content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
expected_output = { "slot": { "rp0": { "cpu": { "0": { "idle": 99.1, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.2, "user": 0.7, "waiting": 0.0 }, "1": { "idle": 98.69, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.3, "user": 1.0, "waiting": 0.0 }, "10": { "idle": 97.3, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.19, "user": 2.49, "waiting": 0.0 }, "11": { "idle": 99.2, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.6, "user": 0.2, "waiting": 0.0 }, "12": { "idle": 99.19, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.4, "user": 0.3, "waiting": 0.1 }, "13": { "idle": 99.7, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.19, "user": 0.09, "waiting": 0.0 }, "14": { "idle": 99.4, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.3, "user": 0.3, "waiting": 0.0 }, "15": { "idle": 99.0, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.3, "user": 0.7, "waiting": 0.0 }, "2": { "idle": 99.7, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.2, "user": 0.1, "waiting": 0.0 }, "3": { "idle": 98.6, "irq": 0.0, "nice_process": 0.0, "sirq": 0.1, "system": 0.1, "user": 1.2, "waiting": 0.0 }, "4": { "idle": 98.39, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.4, "user": 1.2, "waiting": 0.0 }, "5": { "idle": 98.9, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.69, "user": 0.39, "waiting": 0.0 }, "6": { "idle": 99.0, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.5, "user": 0.5, "waiting": 0.0 }, "7": { "idle": 99.3, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.5, "user": 0.2, "waiting": 0.0 }, "8": { "idle": 98.9, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.49, "user": 0.59, "waiting": 0.0 }, "9": { "idle": 98.1, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.4, "user": 1.5, "waiting": 0.0 } }, "load_average": { "15_min": 0.39, "1_min": 0.66, "5_min": 0.6, "status": "unknown" }, "memory": { "committed": 11294396, "committed_percentage": 35, "free": 26573588, "free_percentage": 82, "status": "healthy", "total": 32423072, "used": 5849484, "used_percentage": 18 } } } }
expected_output = {'slot': {'rp0': {'cpu': {'0': {'idle': 99.1, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.2, 'user': 0.7, 'waiting': 0.0}, '1': {'idle': 98.69, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.3, 'user': 1.0, 'waiting': 0.0}, '10': {'idle': 97.3, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.19, 'user': 2.49, 'waiting': 0.0}, '11': {'idle': 99.2, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.6, 'user': 0.2, 'waiting': 0.0}, '12': {'idle': 99.19, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.4, 'user': 0.3, 'waiting': 0.1}, '13': {'idle': 99.7, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.19, 'user': 0.09, 'waiting': 0.0}, '14': {'idle': 99.4, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.3, 'user': 0.3, 'waiting': 0.0}, '15': {'idle': 99.0, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.3, 'user': 0.7, 'waiting': 0.0}, '2': {'idle': 99.7, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.2, 'user': 0.1, 'waiting': 0.0}, '3': {'idle': 98.6, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.1, 'system': 0.1, 'user': 1.2, 'waiting': 0.0}, '4': {'idle': 98.39, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.4, 'user': 1.2, 'waiting': 0.0}, '5': {'idle': 98.9, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.69, 'user': 0.39, 'waiting': 0.0}, '6': {'idle': 99.0, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.5, 'user': 0.5, 'waiting': 0.0}, '7': {'idle': 99.3, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.5, 'user': 0.2, 'waiting': 0.0}, '8': {'idle': 98.9, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.49, 'user': 0.59, 'waiting': 0.0}, '9': {'idle': 98.1, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.4, 'user': 1.5, 'waiting': 0.0}}, 'load_average': {'15_min': 0.39, '1_min': 0.66, '5_min': 0.6, 'status': 'unknown'}, 'memory': {'committed': 11294396, 'committed_percentage': 35, 'free': 26573588, 'free_percentage': 82, 'status': 'healthy', 'total': 32423072, 'used': 5849484, 'used_percentage': 18}}}}
# Create a program that receives two strings on a single line separated by a single space. # Then, it prints the sum of their multiplied character codes as follows: # multiply str1[0] with str2[0] and add the result to the total sum, then continue with the next two characters. # If one of the strings is longer than the other, add the remaining character codes to the total sum without multiplication. sum_of_multiplication = lambda x, y: sum([ord(x[i]) * ord(y[i]) for i in range(min(len(x),len(y)))]) def addition_of_remainder(x, y): diff = abs(len(x) - len(y)) if len(x) > len(y): return sum([ord(ch) for ch in x[-diff:]]) elif len (y) > len(x): return sum([ord(ch) for ch in y[-diff:]]) else: return 0 strings = input().split(' ') output = sum_of_multiplication(strings[0], strings[1]) + addition_of_remainder(strings[0],strings[1]) print (output)
sum_of_multiplication = lambda x, y: sum([ord(x[i]) * ord(y[i]) for i in range(min(len(x), len(y)))]) def addition_of_remainder(x, y): diff = abs(len(x) - len(y)) if len(x) > len(y): return sum([ord(ch) for ch in x[-diff:]]) elif len(y) > len(x): return sum([ord(ch) for ch in y[-diff:]]) else: return 0 strings = input().split(' ') output = sum_of_multiplication(strings[0], strings[1]) + addition_of_remainder(strings[0], strings[1]) print(output)
OPENERS = {'(', '{', '['} CLOSER_MAP = {')': '(', '}': '{', ']': '['} def solve(s: str) -> bool: stack = [] for c in s: if c in OPENERS: stack.append(c) elif len(stack) == 0 or stack.pop() != CLOSER_MAP[c]: return False return True if len(stack) == 0 else False def main() -> None: cases = [('()', True), ('([{}])', True), ('((([[)]))', False), ("([)]", False)] for case in cases: print("{} resulted in {}. Expected: {}".format(case, solve(case[0]), case[1])) if __name__ == '__main__': main()
openers = {'(', '{', '['} closer_map = {')': '(', '}': '{', ']': '['} def solve(s: str) -> bool: stack = [] for c in s: if c in OPENERS: stack.append(c) elif len(stack) == 0 or stack.pop() != CLOSER_MAP[c]: return False return True if len(stack) == 0 else False def main() -> None: cases = [('()', True), ('([{}])', True), ('((([[)]))', False), ('([)]', False)] for case in cases: print('{} resulted in {}. Expected: {}'.format(case, solve(case[0]), case[1])) if __name__ == '__main__': main()
""" Given the triangle of consecutive odd numbers: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 ... Calculate the row sums of this triangle from the row index (starting at index 1) """ def row_sum_odd_numbers(number: int) -> int: """Returns the row sums. Args: number (int): input number to evaluate Examples: >>> assert row_sum_odd_numbers(1) == 1 >>> assert row_sum_odd_numbers(2) == 8 >>> assert row_sum_odd_numbers(13) == 2197 >>> assert row_sum_odd_numbers(19) == 6859 >>> assert row_sum_odd_numbers(41) == 68921 """ return number ** 3 if __name__ == "__main__": print(row_sum_odd_numbers(19))
""" Given the triangle of consecutive odd numbers: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 ... Calculate the row sums of this triangle from the row index (starting at index 1) """ def row_sum_odd_numbers(number: int) -> int: """Returns the row sums. Args: number (int): input number to evaluate Examples: >>> assert row_sum_odd_numbers(1) == 1 >>> assert row_sum_odd_numbers(2) == 8 >>> assert row_sum_odd_numbers(13) == 2197 >>> assert row_sum_odd_numbers(19) == 6859 >>> assert row_sum_odd_numbers(41) == 68921 """ return number ** 3 if __name__ == '__main__': print(row_sum_odd_numbers(19))
''' Task: Your task is to write a function which returns the sum of following series upto nth term(parameter). Series: 1 + 1/4 + 1/7 + 1/10 + 1/13 + 1/16 +... Rules: You need to round the answer to 2 decimal places and return it as String. If the given value is 0 then it should return 0.00 You will only be given Natural Numbers as arguments. Examples: SeriesSum(1) => 1 = "1.00" SeriesSum(2) => 1 + 1/4 = "1.25" SeriesSum(5) => 1 + 1/4 + 1/7 + 1/10 + 1/13 = "1.57" ''' def series_sum(n): summation = 0; denominator = 1 for _ in range(n): summation += 1 / denominator denominator += 3 return str('{:.2f}'.format(summation))
""" Task: Your task is to write a function which returns the sum of following series upto nth term(parameter). Series: 1 + 1/4 + 1/7 + 1/10 + 1/13 + 1/16 +... Rules: You need to round the answer to 2 decimal places and return it as String. If the given value is 0 then it should return 0.00 You will only be given Natural Numbers as arguments. Examples: SeriesSum(1) => 1 = "1.00" SeriesSum(2) => 1 + 1/4 = "1.25" SeriesSum(5) => 1 + 1/4 + 1/7 + 1/10 + 1/13 = "1.57" """ def series_sum(n): summation = 0 denominator = 1 for _ in range(n): summation += 1 / denominator denominator += 3 return str('{:.2f}'.format(summation))
"""AyudaEnPython: https://www.facebook.com/groups/ayudapython Even though the group is only for spanish speakers, english speakers are welcome. """ numbers = [50, 30, 20, 50, 50, 62, 70, 50] # just the first match print("Index ->", numbers.index(50)) # output: Index -> 0 # all matches print("Indexes ->", list((i for i, el in enumerate(numbers) if el == 50))) # output: Indexes -> [0, 3, 4, 7]
"""AyudaEnPython: https://www.facebook.com/groups/ayudapython Even though the group is only for spanish speakers, english speakers are welcome. """ numbers = [50, 30, 20, 50, 50, 62, 70, 50] print('Index ->', numbers.index(50)) print('Indexes ->', list((i for (i, el) in enumerate(numbers) if el == 50)))
# -*- coding: utf-8 -*- """ 1963. Minimum Number of Swaps to Make the String Balanced https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-string-balanced/ Example 1: Input: s = "][][" Output: 1 Explanation: You can make the string balanced by swapping index 0 with index 3. The resulting string is "[[]]". Example 2: Input: s = "]]][[[" Output: 2 Explanation: You can do the following to make the string balanced: - Swap index 0 with index 4. s = "[]][][". - Swap index 1 with index 5. s = "[[][]]". The resulting string is "[[][]]". Example 3: Input: s = "[]" Output: 0 Explanation: The string is already balanced. Reference: https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-string-balanced/discuss/1401218/Very-simple-Python-solution """ class Solution: def minSwaps(self, s: str) -> int: """ TC: O(N) / SC: O(1) """ balance, ans = 0, 0 for i in range(len(s)): if s[i] == "[": balance -= 1 else: balance += 1 if balance > 0: ans += 1 balance = -1 return ans
""" 1963. Minimum Number of Swaps to Make the String Balanced https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-string-balanced/ Example 1: Input: s = "][][" Output: 1 Explanation: You can make the string balanced by swapping index 0 with index 3. The resulting string is "[[]]". Example 2: Input: s = "]]][[[" Output: 2 Explanation: You can do the following to make the string balanced: - Swap index 0 with index 4. s = "[]][][". - Swap index 1 with index 5. s = "[[][]]". The resulting string is "[[][]]". Example 3: Input: s = "[]" Output: 0 Explanation: The string is already balanced. Reference: https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-string-balanced/discuss/1401218/Very-simple-Python-solution """ class Solution: def min_swaps(self, s: str) -> int: """ TC: O(N) / SC: O(1) """ (balance, ans) = (0, 0) for i in range(len(s)): if s[i] == '[': balance -= 1 else: balance += 1 if balance > 0: ans += 1 balance = -1 return ans
def count_unique_values(arr): # return 0 of the length of array is 0 # loop the array by the second element at index j # compare the previous element at index i arr_len = len(arr) if arr_len == 0: return 0 pre_index = 0 unique_arr = [arr[pre_index]] for j in range(1, arr_len): if arr[pre_index] != arr[j]: unique_arr.append(arr[j]) pre_index = j print(unique_arr) return len(unique_arr) print(count_unique_values([1, 1, 1, 1, 1, 2])) print(count_unique_values([1, 2, 3, 4, 4, 4, 7, 7, 12, 12, 13])) print(count_unique_values([])) print(count_unique_values([-2, -1, -1, 0, 1]))
def count_unique_values(arr): arr_len = len(arr) if arr_len == 0: return 0 pre_index = 0 unique_arr = [arr[pre_index]] for j in range(1, arr_len): if arr[pre_index] != arr[j]: unique_arr.append(arr[j]) pre_index = j print(unique_arr) return len(unique_arr) print(count_unique_values([1, 1, 1, 1, 1, 2])) print(count_unique_values([1, 2, 3, 4, 4, 4, 7, 7, 12, 12, 13])) print(count_unique_values([])) print(count_unique_values([-2, -1, -1, 0, 1]))
#05_01_converter class ScaleConverter: def __init__(self, units_from, units_to, factor): self.units_from = units_from self.units_to = units_to self.factor = factor def description(self): return 'Convert ' + self.units_from + ' to ' + self.units_to def convert(self, value): return value * self.factor c1 = ScaleConverter('inches', 'mm', 25) print(c1.description()) print('converting 2 inches') print(str(c1.convert(2)) + c1.units_to)
class Scaleconverter: def __init__(self, units_from, units_to, factor): self.units_from = units_from self.units_to = units_to self.factor = factor def description(self): return 'Convert ' + self.units_from + ' to ' + self.units_to def convert(self, value): return value * self.factor c1 = scale_converter('inches', 'mm', 25) print(c1.description()) print('converting 2 inches') print(str(c1.convert(2)) + c1.units_to)
#local storage LOCAL="/home/pi/MTU-Timelapse-Pi" #in minutes. 60 % interval must be 0 INTERVAL=5 #time between failed uploads FAILTIME=5 #retry count RETRYCOUNT=3 CMD="raspistill -o '/home/pi/MTU-Timelapse-Pi/cam/%s/%s-%s.jpg' -h 1080 -w 1920 --nopreview --timeout 1"
local = '/home/pi/MTU-Timelapse-Pi' interval = 5 failtime = 5 retrycount = 3 cmd = "raspistill -o '/home/pi/MTU-Timelapse-Pi/cam/%s/%s-%s.jpg' -h 1080 -w 1920 --nopreview --timeout 1"
"""Zero_Width table. Created by setup.py.""" # Generated: 2020-03-23T04:40:34.685051 # Source: DerivedGeneralCategory-13.0.0.txt # Date: 2019-10-21, 14:30:32 GMT ZERO_WIDTH = ( (0x0300, 0x036F,), # Combining Grave Accent ..Combining Latin Small Le (0x0483, 0x0489,), # Combining Cyrillic Titlo..Combining Cyrillic Milli (0x0591, 0x05BD,), # Hebrew Accent Etnahta ..Hebrew Point Meteg (0x05BF, 0x05BF,), # Hebrew Point Rafe ..Hebrew Point Rafe (0x05C1, 0x05C2,), # Hebrew Point Shin Dot ..Hebrew Point Sin Dot (0x05C4, 0x05C5,), # Hebrew Mark Upper Dot ..Hebrew Mark Lower Dot (0x05C7, 0x05C7,), # Hebrew Point Qamats Qata..Hebrew Point Qamats Qata (0x0610, 0x061A,), # Arabic Sign Sallallahou ..Arabic Small Kasra (0x064B, 0x065F,), # Arabic Fathatan ..Arabic Wavy Hamza Below (0x0670, 0x0670,), # Arabic Letter Superscrip..Arabic Letter Superscrip (0x06D6, 0x06DC,), # Arabic Small High Ligatu..Arabic Small High Seen (0x06DF, 0x06E4,), # Arabic Small High Rounde..Arabic Small High Madda (0x06E7, 0x06E8,), # Arabic Small High Yeh ..Arabic Small High Noon (0x06EA, 0x06ED,), # Arabic Empty Centre Low ..Arabic Small Low Meem (0x0711, 0x0711,), # Syriac Letter Superscrip..Syriac Letter Superscrip (0x0730, 0x074A,), # Syriac Pthaha Above ..Syriac Barrekh (0x07A6, 0x07B0,), # Thaana Abafili ..Thaana Sukun (0x07EB, 0x07F3,), # Nko Combining Short High..Nko Combining Double Dot (0x07FD, 0x07FD,), # Nko Dantayalan ..Nko Dantayalan (0x0816, 0x0819,), # Samaritan Mark In ..Samaritan Mark Dagesh (0x081B, 0x0823,), # Samaritan Mark Epentheti..Samaritan Vowel Sign A (0x0825, 0x0827,), # Samaritan Vowel Sign Sho..Samaritan Vowel Sign U (0x0829, 0x082D,), # Samaritan Vowel Sign Lon..Samaritan Mark Nequdaa (0x0859, 0x085B,), # Mandaic Affrication Mark..Mandaic Gemination Mark (0x08D3, 0x08E1,), # Arabic Small Low Waw ..Arabic Small High Sign S (0x08E3, 0x0902,), # Arabic Turned Damma Belo..Devanagari Sign Anusvara (0x093A, 0x093A,), # Devanagari Vowel Sign Oe..Devanagari Vowel Sign Oe (0x093C, 0x093C,), # Devanagari Sign Nukta ..Devanagari Sign Nukta (0x0941, 0x0948,), # Devanagari Vowel Sign U ..Devanagari Vowel Sign Ai (0x094D, 0x094D,), # Devanagari Sign Virama ..Devanagari Sign Virama (0x0951, 0x0957,), # Devanagari Stress Sign U..Devanagari Vowel Sign Uu (0x0962, 0x0963,), # Devanagari Vowel Sign Vo..Devanagari Vowel Sign Vo (0x0981, 0x0981,), # Bengali Sign Candrabindu..Bengali Sign Candrabindu (0x09BC, 0x09BC,), # Bengali Sign Nukta ..Bengali Sign Nukta (0x09C1, 0x09C4,), # Bengali Vowel Sign U ..Bengali Vowel Sign Vocal (0x09CD, 0x09CD,), # Bengali Sign Virama ..Bengali Sign Virama (0x09E2, 0x09E3,), # Bengali Vowel Sign Vocal..Bengali Vowel Sign Vocal (0x09FE, 0x09FE,), # Bengali Sandhi Mark ..Bengali Sandhi Mark (0x0A01, 0x0A02,), # Gurmukhi Sign Adak Bindi..Gurmukhi Sign Bindi (0x0A3C, 0x0A3C,), # Gurmukhi Sign Nukta ..Gurmukhi Sign Nukta (0x0A41, 0x0A42,), # Gurmukhi Vowel Sign U ..Gurmukhi Vowel Sign Uu (0x0A47, 0x0A48,), # Gurmukhi Vowel Sign Ee ..Gurmukhi Vowel Sign Ai (0x0A4B, 0x0A4D,), # Gurmukhi Vowel Sign Oo ..Gurmukhi Sign Virama (0x0A51, 0x0A51,), # Gurmukhi Sign Udaat ..Gurmukhi Sign Udaat (0x0A70, 0x0A71,), # Gurmukhi Tippi ..Gurmukhi Addak (0x0A75, 0x0A75,), # Gurmukhi Sign Yakash ..Gurmukhi Sign Yakash (0x0A81, 0x0A82,), # Gujarati Sign Candrabind..Gujarati Sign Anusvara (0x0ABC, 0x0ABC,), # Gujarati Sign Nukta ..Gujarati Sign Nukta (0x0AC1, 0x0AC5,), # Gujarati Vowel Sign U ..Gujarati Vowel Sign Cand (0x0AC7, 0x0AC8,), # Gujarati Vowel Sign E ..Gujarati Vowel Sign Ai (0x0ACD, 0x0ACD,), # Gujarati Sign Virama ..Gujarati Sign Virama (0x0AE2, 0x0AE3,), # Gujarati Vowel Sign Voca..Gujarati Vowel Sign Voca (0x0AFA, 0x0AFF,), # Gujarati Sign Sukun ..Gujarati Sign Two-circle (0x0B01, 0x0B01,), # Oriya Sign Candrabindu ..Oriya Sign Candrabindu (0x0B3C, 0x0B3C,), # Oriya Sign Nukta ..Oriya Sign Nukta (0x0B3F, 0x0B3F,), # Oriya Vowel Sign I ..Oriya Vowel Sign I (0x0B41, 0x0B44,), # Oriya Vowel Sign U ..Oriya Vowel Sign Vocalic (0x0B4D, 0x0B4D,), # Oriya Sign Virama ..Oriya Sign Virama (0x0B55, 0x0B56,), # (nil) ..Oriya Ai Length Mark (0x0B62, 0x0B63,), # Oriya Vowel Sign Vocalic..Oriya Vowel Sign Vocalic (0x0B82, 0x0B82,), # Tamil Sign Anusvara ..Tamil Sign Anusvara (0x0BC0, 0x0BC0,), # Tamil Vowel Sign Ii ..Tamil Vowel Sign Ii (0x0BCD, 0x0BCD,), # Tamil Sign Virama ..Tamil Sign Virama (0x0C00, 0x0C00,), # Telugu Sign Combining Ca..Telugu Sign Combining Ca (0x0C04, 0x0C04,), # Telugu Sign Combining An..Telugu Sign Combining An (0x0C3E, 0x0C40,), # Telugu Vowel Sign Aa ..Telugu Vowel Sign Ii (0x0C46, 0x0C48,), # Telugu Vowel Sign E ..Telugu Vowel Sign Ai (0x0C4A, 0x0C4D,), # Telugu Vowel Sign O ..Telugu Sign Virama (0x0C55, 0x0C56,), # Telugu Length Mark ..Telugu Ai Length Mark (0x0C62, 0x0C63,), # Telugu Vowel Sign Vocali..Telugu Vowel Sign Vocali (0x0C81, 0x0C81,), # Kannada Sign Candrabindu..Kannada Sign Candrabindu (0x0CBC, 0x0CBC,), # Kannada Sign Nukta ..Kannada Sign Nukta (0x0CBF, 0x0CBF,), # Kannada Vowel Sign I ..Kannada Vowel Sign I (0x0CC6, 0x0CC6,), # Kannada Vowel Sign E ..Kannada Vowel Sign E (0x0CCC, 0x0CCD,), # Kannada Vowel Sign Au ..Kannada Sign Virama (0x0CE2, 0x0CE3,), # Kannada Vowel Sign Vocal..Kannada Vowel Sign Vocal (0x0D00, 0x0D01,), # Malayalam Sign Combining..Malayalam Sign Candrabin (0x0D3B, 0x0D3C,), # Malayalam Sign Vertical ..Malayalam Sign Circular (0x0D41, 0x0D44,), # Malayalam Vowel Sign U ..Malayalam Vowel Sign Voc (0x0D4D, 0x0D4D,), # Malayalam Sign Virama ..Malayalam Sign Virama (0x0D62, 0x0D63,), # Malayalam Vowel Sign Voc..Malayalam Vowel Sign Voc (0x0D81, 0x0D81,), # (nil) .. (0x0DCA, 0x0DCA,), # Sinhala Sign Al-lakuna ..Sinhala Sign Al-lakuna (0x0DD2, 0x0DD4,), # Sinhala Vowel Sign Ketti..Sinhala Vowel Sign Ketti (0x0DD6, 0x0DD6,), # Sinhala Vowel Sign Diga ..Sinhala Vowel Sign Diga (0x0E31, 0x0E31,), # Thai Character Mai Han-a..Thai Character Mai Han-a (0x0E34, 0x0E3A,), # Thai Character Sara I ..Thai Character Phinthu (0x0E47, 0x0E4E,), # Thai Character Maitaikhu..Thai Character Yamakkan (0x0EB1, 0x0EB1,), # Lao Vowel Sign Mai Kan ..Lao Vowel Sign Mai Kan (0x0EB4, 0x0EBC,), # Lao Vowel Sign I ..Lao Semivowel Sign Lo (0x0EC8, 0x0ECD,), # Lao Tone Mai Ek ..Lao Niggahita (0x0F18, 0x0F19,), # Tibetan Astrological Sig..Tibetan Astrological Sig (0x0F35, 0x0F35,), # Tibetan Mark Ngas Bzung ..Tibetan Mark Ngas Bzung (0x0F37, 0x0F37,), # Tibetan Mark Ngas Bzung ..Tibetan Mark Ngas Bzung (0x0F39, 0x0F39,), # Tibetan Mark Tsa -phru ..Tibetan Mark Tsa -phru (0x0F71, 0x0F7E,), # Tibetan Vowel Sign Aa ..Tibetan Sign Rjes Su Nga (0x0F80, 0x0F84,), # Tibetan Vowel Sign Rever..Tibetan Mark Halanta (0x0F86, 0x0F87,), # Tibetan Sign Lci Rtags ..Tibetan Sign Yang Rtags (0x0F8D, 0x0F97,), # Tibetan Subjoined Sign L..Tibetan Subjoined Letter (0x0F99, 0x0FBC,), # Tibetan Subjoined Letter..Tibetan Subjoined Letter (0x0FC6, 0x0FC6,), # Tibetan Symbol Padma Gda..Tibetan Symbol Padma Gda (0x102D, 0x1030,), # Myanmar Vowel Sign I ..Myanmar Vowel Sign Uu (0x1032, 0x1037,), # Myanmar Vowel Sign Ai ..Myanmar Sign Dot Below (0x1039, 0x103A,), # Myanmar Sign Virama ..Myanmar Sign Asat (0x103D, 0x103E,), # Myanmar Consonant Sign M..Myanmar Consonant Sign M (0x1058, 0x1059,), # Myanmar Vowel Sign Vocal..Myanmar Vowel Sign Vocal (0x105E, 0x1060,), # Myanmar Consonant Sign M..Myanmar Consonant Sign M (0x1071, 0x1074,), # Myanmar Vowel Sign Geba ..Myanmar Vowel Sign Kayah (0x1082, 0x1082,), # Myanmar Consonant Sign S..Myanmar Consonant Sign S (0x1085, 0x1086,), # Myanmar Vowel Sign Shan ..Myanmar Vowel Sign Shan (0x108D, 0x108D,), # Myanmar Sign Shan Counci..Myanmar Sign Shan Counci (0x109D, 0x109D,), # Myanmar Vowel Sign Aiton..Myanmar Vowel Sign Aiton (0x135D, 0x135F,), # Ethiopic Combining Gemin..Ethiopic Combining Gemin (0x1712, 0x1714,), # Tagalog Vowel Sign I ..Tagalog Sign Virama (0x1732, 0x1734,), # Hanunoo Vowel Sign I ..Hanunoo Sign Pamudpod (0x1752, 0x1753,), # Buhid Vowel Sign I ..Buhid Vowel Sign U (0x1772, 0x1773,), # Tagbanwa Vowel Sign I ..Tagbanwa Vowel Sign U (0x17B4, 0x17B5,), # Khmer Vowel Inherent Aq ..Khmer Vowel Inherent Aa (0x17B7, 0x17BD,), # Khmer Vowel Sign I ..Khmer Vowel Sign Ua (0x17C6, 0x17C6,), # Khmer Sign Nikahit ..Khmer Sign Nikahit (0x17C9, 0x17D3,), # Khmer Sign Muusikatoan ..Khmer Sign Bathamasat (0x17DD, 0x17DD,), # Khmer Sign Atthacan ..Khmer Sign Atthacan (0x180B, 0x180D,), # Mongolian Free Variation..Mongolian Free Variation (0x1885, 0x1886,), # Mongolian Letter Ali Gal..Mongolian Letter Ali Gal (0x18A9, 0x18A9,), # Mongolian Letter Ali Gal..Mongolian Letter Ali Gal (0x1920, 0x1922,), # Limbu Vowel Sign A ..Limbu Vowel Sign U (0x1927, 0x1928,), # Limbu Vowel Sign E ..Limbu Vowel Sign O (0x1932, 0x1932,), # Limbu Small Letter Anusv..Limbu Small Letter Anusv (0x1939, 0x193B,), # Limbu Sign Mukphreng ..Limbu Sign Sa-i (0x1A17, 0x1A18,), # Buginese Vowel Sign I ..Buginese Vowel Sign U (0x1A1B, 0x1A1B,), # Buginese Vowel Sign Ae ..Buginese Vowel Sign Ae (0x1A56, 0x1A56,), # Tai Tham Consonant Sign ..Tai Tham Consonant Sign (0x1A58, 0x1A5E,), # Tai Tham Sign Mai Kang L..Tai Tham Consonant Sign (0x1A60, 0x1A60,), # Tai Tham Sign Sakot ..Tai Tham Sign Sakot (0x1A62, 0x1A62,), # Tai Tham Vowel Sign Mai ..Tai Tham Vowel Sign Mai (0x1A65, 0x1A6C,), # Tai Tham Vowel Sign I ..Tai Tham Vowel Sign Oa B (0x1A73, 0x1A7C,), # Tai Tham Vowel Sign Oa A..Tai Tham Sign Khuen-lue (0x1A7F, 0x1A7F,), # Tai Tham Combining Crypt..Tai Tham Combining Crypt (0x1AB0, 0x1AC0,), # Combining Doubled Circum.. (0x1B00, 0x1B03,), # Balinese Sign Ulu Ricem ..Balinese Sign Surang (0x1B34, 0x1B34,), # Balinese Sign Rerekan ..Balinese Sign Rerekan (0x1B36, 0x1B3A,), # Balinese Vowel Sign Ulu ..Balinese Vowel Sign Ra R (0x1B3C, 0x1B3C,), # Balinese Vowel Sign La L..Balinese Vowel Sign La L (0x1B42, 0x1B42,), # Balinese Vowel Sign Pepe..Balinese Vowel Sign Pepe (0x1B6B, 0x1B73,), # Balinese Musical Symbol ..Balinese Musical Symbol (0x1B80, 0x1B81,), # Sundanese Sign Panyecek ..Sundanese Sign Panglayar (0x1BA2, 0x1BA5,), # Sundanese Consonant Sign..Sundanese Vowel Sign Pan (0x1BA8, 0x1BA9,), # Sundanese Vowel Sign Pam..Sundanese Vowel Sign Pan (0x1BAB, 0x1BAD,), # Sundanese Sign Virama ..Sundanese Consonant Sign (0x1BE6, 0x1BE6,), # Batak Sign Tompi ..Batak Sign Tompi (0x1BE8, 0x1BE9,), # Batak Vowel Sign Pakpak ..Batak Vowel Sign Ee (0x1BED, 0x1BED,), # Batak Vowel Sign Karo O ..Batak Vowel Sign Karo O (0x1BEF, 0x1BF1,), # Batak Vowel Sign U For S..Batak Consonant Sign H (0x1C2C, 0x1C33,), # Lepcha Vowel Sign E ..Lepcha Consonant Sign T (0x1C36, 0x1C37,), # Lepcha Sign Ran ..Lepcha Sign Nukta (0x1CD0, 0x1CD2,), # Vedic Tone Karshana ..Vedic Tone Prenkha (0x1CD4, 0x1CE0,), # Vedic Sign Yajurvedic Mi..Vedic Tone Rigvedic Kash (0x1CE2, 0x1CE8,), # Vedic Sign Visarga Svari..Vedic Sign Visarga Anuda (0x1CED, 0x1CED,), # Vedic Sign Tiryak ..Vedic Sign Tiryak (0x1CF4, 0x1CF4,), # Vedic Tone Candra Above ..Vedic Tone Candra Above (0x1CF8, 0x1CF9,), # Vedic Tone Ring Above ..Vedic Tone Double Ring A (0x1DC0, 0x1DF9,), # Combining Dotted Grave A..Combining Wide Inverted (0x1DFB, 0x1DFF,), # Combining Deletion Mark ..Combining Right Arrowhea (0x20D0, 0x20F0,), # Combining Left Harpoon A..Combining Asterisk Above (0x2CEF, 0x2CF1,), # Coptic Combining Ni Abov..Coptic Combining Spiritu (0x2D7F, 0x2D7F,), # Tifinagh Consonant Joine..Tifinagh Consonant Joine (0x2DE0, 0x2DFF,), # Combining Cyrillic Lette..Combining Cyrillic Lette (0x302A, 0x302D,), # Ideographic Level Tone M..Ideographic Entering Ton (0x3099, 0x309A,), # Combining Katakana-hirag..Combining Katakana-hirag (0xA66F, 0xA672,), # Combining Cyrillic Vzmet..Combining Cyrillic Thous (0xA674, 0xA67D,), # Combining Cyrillic Lette..Combining Cyrillic Payer (0xA69E, 0xA69F,), # Combining Cyrillic Lette..Combining Cyrillic Lette (0xA6F0, 0xA6F1,), # Bamum Combining Mark Koq..Bamum Combining Mark Tuk (0xA802, 0xA802,), # Syloti Nagri Sign Dvisva..Syloti Nagri Sign Dvisva (0xA806, 0xA806,), # Syloti Nagri Sign Hasant..Syloti Nagri Sign Hasant (0xA80B, 0xA80B,), # Syloti Nagri Sign Anusva..Syloti Nagri Sign Anusva (0xA825, 0xA826,), # Syloti Nagri Vowel Sign ..Syloti Nagri Vowel Sign (0xA82C, 0xA82C,), # (nil) .. (0xA8C4, 0xA8C5,), # Saurashtra Sign Virama ..Saurashtra Sign Candrabi (0xA8E0, 0xA8F1,), # Combining Devanagari Dig..Combining Devanagari Sig (0xA8FF, 0xA8FF,), # Devanagari Vowel Sign Ay..Devanagari Vowel Sign Ay (0xA926, 0xA92D,), # Kayah Li Vowel Ue ..Kayah Li Tone Calya Plop (0xA947, 0xA951,), # Rejang Vowel Sign I ..Rejang Consonant Sign R (0xA980, 0xA982,), # Javanese Sign Panyangga ..Javanese Sign Layar (0xA9B3, 0xA9B3,), # Javanese Sign Cecak Telu..Javanese Sign Cecak Telu (0xA9B6, 0xA9B9,), # Javanese Vowel Sign Wulu..Javanese Vowel Sign Suku (0xA9BC, 0xA9BD,), # Javanese Vowel Sign Pepe..Javanese Consonant Sign (0xA9E5, 0xA9E5,), # Myanmar Sign Shan Saw ..Myanmar Sign Shan Saw (0xAA29, 0xAA2E,), # Cham Vowel Sign Aa ..Cham Vowel Sign Oe (0xAA31, 0xAA32,), # Cham Vowel Sign Au ..Cham Vowel Sign Ue (0xAA35, 0xAA36,), # Cham Consonant Sign La ..Cham Consonant Sign Wa (0xAA43, 0xAA43,), # Cham Consonant Sign Fina..Cham Consonant Sign Fina (0xAA4C, 0xAA4C,), # Cham Consonant Sign Fina..Cham Consonant Sign Fina (0xAA7C, 0xAA7C,), # Myanmar Sign Tai Laing T..Myanmar Sign Tai Laing T (0xAAB0, 0xAAB0,), # Tai Viet Mai Kang ..Tai Viet Mai Kang (0xAAB2, 0xAAB4,), # Tai Viet Vowel I ..Tai Viet Vowel U (0xAAB7, 0xAAB8,), # Tai Viet Mai Khit ..Tai Viet Vowel Ia (0xAABE, 0xAABF,), # Tai Viet Vowel Am ..Tai Viet Tone Mai Ek (0xAAC1, 0xAAC1,), # Tai Viet Tone Mai Tho ..Tai Viet Tone Mai Tho (0xAAEC, 0xAAED,), # Meetei Mayek Vowel Sign ..Meetei Mayek Vowel Sign (0xAAF6, 0xAAF6,), # Meetei Mayek Virama ..Meetei Mayek Virama (0xABE5, 0xABE5,), # Meetei Mayek Vowel Sign ..Meetei Mayek Vowel Sign (0xABE8, 0xABE8,), # Meetei Mayek Vowel Sign ..Meetei Mayek Vowel Sign (0xABED, 0xABED,), # Meetei Mayek Apun Iyek ..Meetei Mayek Apun Iyek (0xFB1E, 0xFB1E,), # Hebrew Point Judeo-spani..Hebrew Point Judeo-spani (0xFE00, 0xFE0F,), # Variation Selector-1 ..Variation Selector-16 (0xFE20, 0xFE2F,), # Combining Ligature Left ..Combining Cyrillic Titlo (0x101FD, 0x101FD,), # Phaistos Disc Sign Combi..Phaistos Disc Sign Combi (0x102E0, 0x102E0,), # Coptic Epact Thousands M..Coptic Epact Thousands M (0x10376, 0x1037A,), # Combining Old Permic Let..Combining Old Permic Let (0x10A01, 0x10A03,), # Kharoshthi Vowel Sign I ..Kharoshthi Vowel Sign Vo (0x10A05, 0x10A06,), # Kharoshthi Vowel Sign E ..Kharoshthi Vowel Sign O (0x10A0C, 0x10A0F,), # Kharoshthi Vowel Length ..Kharoshthi Sign Visarga (0x10A38, 0x10A3A,), # Kharoshthi Sign Bar Abov..Kharoshthi Sign Dot Belo (0x10A3F, 0x10A3F,), # Kharoshthi Virama ..Kharoshthi Virama (0x10AE5, 0x10AE6,), # Manichaean Abbreviation ..Manichaean Abbreviation (0x10D24, 0x10D27,), # Hanifi Rohingya Sign Har..Hanifi Rohingya Sign Tas (0x10EAB, 0x10EAC,), # (nil) .. (0x10F46, 0x10F50,), # Sogdian Combining Dot Be..Sogdian Combining Stroke (0x11001, 0x11001,), # Brahmi Sign Anusvara ..Brahmi Sign Anusvara (0x11038, 0x11046,), # Brahmi Vowel Sign Aa ..Brahmi Virama (0x1107F, 0x11081,), # Brahmi Number Joiner ..Kaithi Sign Anusvara (0x110B3, 0x110B6,), # Kaithi Vowel Sign U ..Kaithi Vowel Sign Ai (0x110B9, 0x110BA,), # Kaithi Sign Virama ..Kaithi Sign Nukta (0x11100, 0x11102,), # Chakma Sign Candrabindu ..Chakma Sign Visarga (0x11127, 0x1112B,), # Chakma Vowel Sign A ..Chakma Vowel Sign Uu (0x1112D, 0x11134,), # Chakma Vowel Sign Ai ..Chakma Maayyaa (0x11173, 0x11173,), # Mahajani Sign Nukta ..Mahajani Sign Nukta (0x11180, 0x11181,), # Sharada Sign Candrabindu..Sharada Sign Anusvara (0x111B6, 0x111BE,), # Sharada Vowel Sign U ..Sharada Vowel Sign O (0x111C9, 0x111CC,), # Sharada Sandhi Mark ..Sharada Extra Short Vowe (0x111CF, 0x111CF,), # (nil) .. (0x1122F, 0x11231,), # Khojki Vowel Sign U ..Khojki Vowel Sign Ai (0x11234, 0x11234,), # Khojki Sign Anusvara ..Khojki Sign Anusvara (0x11236, 0x11237,), # Khojki Sign Nukta ..Khojki Sign Shadda (0x1123E, 0x1123E,), # Khojki Sign Sukun ..Khojki Sign Sukun (0x112DF, 0x112DF,), # Khudawadi Sign Anusvara ..Khudawadi Sign Anusvara (0x112E3, 0x112EA,), # Khudawadi Vowel Sign U ..Khudawadi Sign Virama (0x11300, 0x11301,), # Grantha Sign Combining A..Grantha Sign Candrabindu (0x1133B, 0x1133C,), # Combining Bindu Below ..Grantha Sign Nukta (0x11340, 0x11340,), # Grantha Vowel Sign Ii ..Grantha Vowel Sign Ii (0x11366, 0x1136C,), # Combining Grantha Digit ..Combining Grantha Digit (0x11370, 0x11374,), # Combining Grantha Letter..Combining Grantha Letter (0x11438, 0x1143F,), # Newa Vowel Sign U ..Newa Vowel Sign Ai (0x11442, 0x11444,), # Newa Sign Virama ..Newa Sign Anusvara (0x11446, 0x11446,), # Newa Sign Nukta ..Newa Sign Nukta (0x1145E, 0x1145E,), # Newa Sandhi Mark ..Newa Sandhi Mark (0x114B3, 0x114B8,), # Tirhuta Vowel Sign U ..Tirhuta Vowel Sign Vocal (0x114BA, 0x114BA,), # Tirhuta Vowel Sign Short..Tirhuta Vowel Sign Short (0x114BF, 0x114C0,), # Tirhuta Sign Candrabindu..Tirhuta Sign Anusvara (0x114C2, 0x114C3,), # Tirhuta Sign Virama ..Tirhuta Sign Nukta (0x115B2, 0x115B5,), # Siddham Vowel Sign U ..Siddham Vowel Sign Vocal (0x115BC, 0x115BD,), # Siddham Sign Candrabindu..Siddham Sign Anusvara (0x115BF, 0x115C0,), # Siddham Sign Virama ..Siddham Sign Nukta (0x115DC, 0x115DD,), # Siddham Vowel Sign Alter..Siddham Vowel Sign Alter (0x11633, 0x1163A,), # Modi Vowel Sign U ..Modi Vowel Sign Ai (0x1163D, 0x1163D,), # Modi Sign Anusvara ..Modi Sign Anusvara (0x1163F, 0x11640,), # Modi Sign Virama ..Modi Sign Ardhacandra (0x116AB, 0x116AB,), # Takri Sign Anusvara ..Takri Sign Anusvara (0x116AD, 0x116AD,), # Takri Vowel Sign Aa ..Takri Vowel Sign Aa (0x116B0, 0x116B5,), # Takri Vowel Sign U ..Takri Vowel Sign Au (0x116B7, 0x116B7,), # Takri Sign Nukta ..Takri Sign Nukta (0x1171D, 0x1171F,), # Ahom Consonant Sign Medi..Ahom Consonant Sign Medi (0x11722, 0x11725,), # Ahom Vowel Sign I ..Ahom Vowel Sign Uu (0x11727, 0x1172B,), # Ahom Vowel Sign Aw ..Ahom Sign Killer (0x1182F, 0x11837,), # Dogra Vowel Sign U ..Dogra Sign Anusvara (0x11839, 0x1183A,), # Dogra Sign Virama ..Dogra Sign Nukta (0x1193B, 0x1193C,), # (nil) .. (0x1193E, 0x1193E,), # (nil) .. (0x11943, 0x11943,), # (nil) .. (0x119D4, 0x119D7,), # (nil) .. (0x119DA, 0x119DB,), # (nil) .. (0x119E0, 0x119E0,), # (nil) .. (0x11A01, 0x11A0A,), # Zanabazar Square Vowel S..Zanabazar Square Vowel L (0x11A33, 0x11A38,), # Zanabazar Square Final C..Zanabazar Square Sign An (0x11A3B, 0x11A3E,), # Zanabazar Square Cluster..Zanabazar Square Cluster (0x11A47, 0x11A47,), # Zanabazar Square Subjoin..Zanabazar Square Subjoin (0x11A51, 0x11A56,), # Soyombo Vowel Sign I ..Soyombo Vowel Sign Oe (0x11A59, 0x11A5B,), # Soyombo Vowel Sign Vocal..Soyombo Vowel Length Mar (0x11A8A, 0x11A96,), # Soyombo Final Consonant ..Soyombo Sign Anusvara (0x11A98, 0x11A99,), # Soyombo Gemination Mark ..Soyombo Subjoiner (0x11C30, 0x11C36,), # Bhaiksuki Vowel Sign I ..Bhaiksuki Vowel Sign Voc (0x11C38, 0x11C3D,), # Bhaiksuki Vowel Sign E ..Bhaiksuki Sign Anusvara (0x11C3F, 0x11C3F,), # Bhaiksuki Sign Virama ..Bhaiksuki Sign Virama (0x11C92, 0x11CA7,), # Marchen Subjoined Letter..Marchen Subjoined Letter (0x11CAA, 0x11CB0,), # Marchen Subjoined Letter..Marchen Vowel Sign Aa (0x11CB2, 0x11CB3,), # Marchen Vowel Sign U ..Marchen Vowel Sign E (0x11CB5, 0x11CB6,), # Marchen Sign Anusvara ..Marchen Sign Candrabindu (0x11D31, 0x11D36,), # Masaram Gondi Vowel Sign..Masaram Gondi Vowel Sign (0x11D3A, 0x11D3A,), # Masaram Gondi Vowel Sign..Masaram Gondi Vowel Sign (0x11D3C, 0x11D3D,), # Masaram Gondi Vowel Sign..Masaram Gondi Vowel Sign (0x11D3F, 0x11D45,), # Masaram Gondi Vowel Sign..Masaram Gondi Virama (0x11D47, 0x11D47,), # Masaram Gondi Ra-kara ..Masaram Gondi Ra-kara (0x11D90, 0x11D91,), # Gunjala Gondi Vowel Sign..Gunjala Gondi Vowel Sign (0x11D95, 0x11D95,), # Gunjala Gondi Sign Anusv..Gunjala Gondi Sign Anusv (0x11D97, 0x11D97,), # Gunjala Gondi Virama ..Gunjala Gondi Virama (0x11EF3, 0x11EF4,), # Makasar Vowel Sign I ..Makasar Vowel Sign U (0x16AF0, 0x16AF4,), # Bassa Vah Combining High..Bassa Vah Combining High (0x16B30, 0x16B36,), # Pahawh Hmong Mark Cim Tu..Pahawh Hmong Mark Cim Ta (0x16F4F, 0x16F4F,), # (nil) .. (0x16F8F, 0x16F92,), # Miao Tone Right ..Miao Tone Below (0x16FE4, 0x16FE4,), # (nil) .. (0x1BC9D, 0x1BC9E,), # Duployan Thick Letter Se..Duployan Double Mark (0x1D167, 0x1D169,), # Musical Symbol Combining..Musical Symbol Combining (0x1D17B, 0x1D182,), # Musical Symbol Combining..Musical Symbol Combining (0x1D185, 0x1D18B,), # Musical Symbol Combining..Musical Symbol Combining (0x1D1AA, 0x1D1AD,), # Musical Symbol Combining..Musical Symbol Combining (0x1D242, 0x1D244,), # Combining Greek Musical ..Combining Greek Musical (0x1DA00, 0x1DA36,), # Signwriting Head Rim ..Signwriting Air Sucking (0x1DA3B, 0x1DA6C,), # Signwriting Mouth Closed..Signwriting Excitement (0x1DA75, 0x1DA75,), # Signwriting Upper Body T..Signwriting Upper Body T (0x1DA84, 0x1DA84,), # Signwriting Location Hea..Signwriting Location Hea (0x1DA9B, 0x1DA9F,), # Signwriting Fill Modifie..Signwriting Fill Modifie (0x1DAA1, 0x1DAAF,), # Signwriting Rotation Mod..Signwriting Rotation Mod (0x1E000, 0x1E006,), # Combining Glagolitic Let..Combining Glagolitic Let (0x1E008, 0x1E018,), # Combining Glagolitic Let..Combining Glagolitic Let (0x1E01B, 0x1E021,), # Combining Glagolitic Let..Combining Glagolitic Let (0x1E023, 0x1E024,), # Combining Glagolitic Let..Combining Glagolitic Let (0x1E026, 0x1E02A,), # Combining Glagolitic Let..Combining Glagolitic Let (0x1E130, 0x1E136,), # (nil) .. (0x1E2EC, 0x1E2EF,), # (nil) .. (0x1E8D0, 0x1E8D6,), # Mende Kikakui Combining ..Mende Kikakui Combining (0x1E944, 0x1E94A,), # Adlam Alif Lengthener ..Adlam Nukta (0xE0100, 0xE01EF,), # Variation Selector-17 ..Variation Selector-256 )
"""Zero_Width table. Created by setup.py.""" zero_width = ((768, 879), (1155, 1161), (1425, 1469), (1471, 1471), (1473, 1474), (1476, 1477), (1479, 1479), (1552, 1562), (1611, 1631), (1648, 1648), (1750, 1756), (1759, 1764), (1767, 1768), (1770, 1773), (1809, 1809), (1840, 1866), (1958, 1968), (2027, 2035), (2045, 2045), (2070, 2073), (2075, 2083), (2085, 2087), (2089, 2093), (2137, 2139), (2259, 2273), (2275, 2306), (2362, 2362), (2364, 2364), (2369, 2376), (2381, 2381), (2385, 2391), (2402, 2403), (2433, 2433), (2492, 2492), (2497, 2500), (2509, 2509), (2530, 2531), (2558, 2558), (2561, 2562), (2620, 2620), (2625, 2626), (2631, 2632), (2635, 2637), (2641, 2641), (2672, 2673), (2677, 2677), (2689, 2690), (2748, 2748), (2753, 2757), (2759, 2760), (2765, 2765), (2786, 2787), (2810, 2815), (2817, 2817), (2876, 2876), (2879, 2879), (2881, 2884), (2893, 2893), (2901, 2902), (2914, 2915), (2946, 2946), (3008, 3008), (3021, 3021), (3072, 3072), (3076, 3076), (3134, 3136), (3142, 3144), (3146, 3149), (3157, 3158), (3170, 3171), (3201, 3201), (3260, 3260), (3263, 3263), (3270, 3270), (3276, 3277), (3298, 3299), (3328, 3329), (3387, 3388), (3393, 3396), (3405, 3405), (3426, 3427), (3457, 3457), (3530, 3530), (3538, 3540), (3542, 3542), (3633, 3633), (3636, 3642), (3655, 3662), (3761, 3761), (3764, 3772), (3784, 3789), (3864, 3865), (3893, 3893), (3895, 3895), (3897, 3897), (3953, 3966), (3968, 3972), (3974, 3975), (3981, 3991), (3993, 4028), (4038, 4038), (4141, 4144), (4146, 4151), (4153, 4154), (4157, 4158), (4184, 4185), (4190, 4192), (4209, 4212), (4226, 4226), (4229, 4230), (4237, 4237), (4253, 4253), (4957, 4959), (5906, 5908), (5938, 5940), (5970, 5971), (6002, 6003), (6068, 6069), (6071, 6077), (6086, 6086), (6089, 6099), (6109, 6109), (6155, 6157), (6277, 6278), (6313, 6313), (6432, 6434), (6439, 6440), (6450, 6450), (6457, 6459), (6679, 6680), (6683, 6683), (6742, 6742), (6744, 6750), (6752, 6752), (6754, 6754), (6757, 6764), (6771, 6780), (6783, 6783), (6832, 6848), (6912, 6915), (6964, 6964), (6966, 6970), (6972, 6972), (6978, 6978), (7019, 7027), (7040, 7041), (7074, 7077), (7080, 7081), (7083, 7085), (7142, 7142), (7144, 7145), (7149, 7149), (7151, 7153), (7212, 7219), (7222, 7223), (7376, 7378), (7380, 7392), (7394, 7400), (7405, 7405), (7412, 7412), (7416, 7417), (7616, 7673), (7675, 7679), (8400, 8432), (11503, 11505), (11647, 11647), (11744, 11775), (12330, 12333), (12441, 12442), (42607, 42610), (42612, 42621), (42654, 42655), (42736, 42737), (43010, 43010), (43014, 43014), (43019, 43019), (43045, 43046), (43052, 43052), (43204, 43205), (43232, 43249), (43263, 43263), (43302, 43309), (43335, 43345), (43392, 43394), (43443, 43443), (43446, 43449), (43452, 43453), (43493, 43493), (43561, 43566), (43569, 43570), (43573, 43574), (43587, 43587), (43596, 43596), (43644, 43644), (43696, 43696), (43698, 43700), (43703, 43704), (43710, 43711), (43713, 43713), (43756, 43757), (43766, 43766), (44005, 44005), (44008, 44008), (44013, 44013), (64286, 64286), (65024, 65039), (65056, 65071), (66045, 66045), (66272, 66272), (66422, 66426), (68097, 68099), (68101, 68102), (68108, 68111), (68152, 68154), (68159, 68159), (68325, 68326), (68900, 68903), (69291, 69292), (69446, 69456), (69633, 69633), (69688, 69702), (69759, 69761), (69811, 69814), (69817, 69818), (69888, 69890), (69927, 69931), (69933, 69940), (70003, 70003), (70016, 70017), (70070, 70078), (70089, 70092), (70095, 70095), (70191, 70193), (70196, 70196), (70198, 70199), (70206, 70206), (70367, 70367), (70371, 70378), (70400, 70401), (70459, 70460), (70464, 70464), (70502, 70508), (70512, 70516), (70712, 70719), (70722, 70724), (70726, 70726), (70750, 70750), (70835, 70840), (70842, 70842), (70847, 70848), (70850, 70851), (71090, 71093), (71100, 71101), (71103, 71104), (71132, 71133), (71219, 71226), (71229, 71229), (71231, 71232), (71339, 71339), (71341, 71341), (71344, 71349), (71351, 71351), (71453, 71455), (71458, 71461), (71463, 71467), (71727, 71735), (71737, 71738), (71995, 71996), (71998, 71998), (72003, 72003), (72148, 72151), (72154, 72155), (72160, 72160), (72193, 72202), (72243, 72248), (72251, 72254), (72263, 72263), (72273, 72278), (72281, 72283), (72330, 72342), (72344, 72345), (72752, 72758), (72760, 72765), (72767, 72767), (72850, 72871), (72874, 72880), (72882, 72883), (72885, 72886), (73009, 73014), (73018, 73018), (73020, 73021), (73023, 73029), (73031, 73031), (73104, 73105), (73109, 73109), (73111, 73111), (73459, 73460), (92912, 92916), (92976, 92982), (94031, 94031), (94095, 94098), (94180, 94180), (113821, 113822), (119143, 119145), (119163, 119170), (119173, 119179), (119210, 119213), (119362, 119364), (121344, 121398), (121403, 121452), (121461, 121461), (121476, 121476), (121499, 121503), (121505, 121519), (122880, 122886), (122888, 122904), (122907, 122913), (122915, 122916), (122918, 122922), (123184, 123190), (123628, 123631), (125136, 125142), (125252, 125258), (917760, 917999))
class line(object): def __init__(self, _char, _row, _column, _dir, _length): self.char = _char self.row = _row self.column = _column self.dir = _dir self.length = _length return None
class Line(object): def __init__(self, _char, _row, _column, _dir, _length): self.char = _char self.row = _row self.column = _column self.dir = _dir self.length = _length return None
"""Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assume that the version strings are non-empty and contain only digits and the . character. The . character does not represent a decimal point and is used to separate number sequences. For instance, 2.5 is not "two and a half" or "half way to version three", it is the fifth second-level revision of the second first-level revision. """ class Solution(object): def compareVersion(self, version1, version2): """ :type version1: str :type version2: str :rtype: int """ version1 = [int(v) for v in version1.split('.')] version2 = [int(v) for v in version2.split('.')] for i in range(max(len(version1), len(version2))): v1 = version1[i] if i < len(version1) else 0 v2 = version2[i] if i < len(version2) else 0 if v1 > v2: return 1 elif v1 < v2: return -1 return 0 if __name__ == '__main__': solution = Solution() print(solution.compareVersion("0.1", "1.1"))
"""Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assume that the version strings are non-empty and contain only digits and the . character. The . character does not represent a decimal point and is used to separate number sequences. For instance, 2.5 is not "two and a half" or "half way to version three", it is the fifth second-level revision of the second first-level revision. """ class Solution(object): def compare_version(self, version1, version2): """ :type version1: str :type version2: str :rtype: int """ version1 = [int(v) for v in version1.split('.')] version2 = [int(v) for v in version2.split('.')] for i in range(max(len(version1), len(version2))): v1 = version1[i] if i < len(version1) else 0 v2 = version2[i] if i < len(version2) else 0 if v1 > v2: return 1 elif v1 < v2: return -1 return 0 if __name__ == '__main__': solution = solution() print(solution.compareVersion('0.1', '1.1'))
A, B, C = map(int, input().split()) print((A+B)%C) print((A%C+B%C)%C) print((A*B)%C) print(((A%C)*(B%C))%C)
(a, b, c) = map(int, input().split()) print((A + B) % C) print((A % C + B % C) % C) print(A * B % C) print(A % C * (B % C) % C)
lst_1=[1,2,4,88] lst_2=[1,3,4,95,120] lst_3=[] i=0 j=0 for k in range(len(lst_1)+len(lst_2)): if (lst_1[i]<= (lst_2[j])): lst_3.append(lst_1[i]) if (i>=len(lst_1)-1): if j<=(len(lst_2)-1): lst_3.append(lst_2[j]) if j<len(lst_2)-1: j+=1 else: break else: break else: i+=1 else: if j<len(lst_2)-1: lst_3.append(lst_2[j]) j+=1 else: break print(lst_3) i = j = 0 for index in range(len(lst_1)): if lst_1[i] == lst_2[j]: lst_3.append([lst_1[i],lst_2[j]]) i = i + 1 j = j + 1 elif lst_1[i] > lst_2[j]: lst_3.append(lst_2[j]) j= j + 1 elif lst_2[j] > lst_1[i]: lst_3.append(lst_1[i]) i = i + 1
lst_1 = [1, 2, 4, 88] lst_2 = [1, 3, 4, 95, 120] lst_3 = [] i = 0 j = 0 for k in range(len(lst_1) + len(lst_2)): if lst_1[i] <= lst_2[j]: lst_3.append(lst_1[i]) if i >= len(lst_1) - 1: if j <= len(lst_2) - 1: lst_3.append(lst_2[j]) if j < len(lst_2) - 1: j += 1 else: break else: break else: i += 1 elif j < len(lst_2) - 1: lst_3.append(lst_2[j]) j += 1 else: break print(lst_3) i = j = 0 for index in range(len(lst_1)): if lst_1[i] == lst_2[j]: lst_3.append([lst_1[i], lst_2[j]]) i = i + 1 j = j + 1 elif lst_1[i] > lst_2[j]: lst_3.append(lst_2[j]) j = j + 1 elif lst_2[j] > lst_1[i]: lst_3.append(lst_1[i]) i = i + 1
class JournalBlock: """ Represents a JournalBlock that was recorded after executing a transaction in the ledger. """ def __init__(self, block_address, transaction_id, block_timestamp, block_hash, entries_hash, previous_block_hash, entries_hash_list, transaction_info, revisions): self.block_address = block_address self.transaction_id = transaction_id self.block_timestamp = block_timestamp self.block_hash = block_hash self.entries_hash = entries_hash self.previous_block_hash = previous_block_hash self.entries_hash_list = entries_hash_list self.transaction_info = transaction_info self.revisions = revisions def from_ion(ion_value): """ Construct a new JournalBlock object from an IonStruct. :type ion_value: :py:class:`amazon.ion.simple_types.IonSymbol` :param ion_value: The IonStruct returned by QLDB that represents a journal block. :rtype: :py:class:`hash_chain.ledger.qldb.journal_block.JournalBlock` :return: The constructed JournalBlock object. """ block_address = ion_value.get('blockAddress') transaction_id = ion_value.get('transactionId') block_timestamp = ion_value.get('blockTimestamp') block_hash = ion_value.get('blockHash') entries_hash = ion_value.get('entriesHash') previous_block_hash = ion_value.get('previousBlockHash') entries_hash_list = ion_value.get('entriesHashList') transaction_info = ion_value.get('transactionInfo') revisions = ion_value.get('revisions') journal_block = JournalBlock(block_address, transaction_id, block_timestamp, block_hash, entries_hash, previous_block_hash, entries_hash_list, transaction_info, revisions) return journal_block
class Journalblock: """ Represents a JournalBlock that was recorded after executing a transaction in the ledger. """ def __init__(self, block_address, transaction_id, block_timestamp, block_hash, entries_hash, previous_block_hash, entries_hash_list, transaction_info, revisions): self.block_address = block_address self.transaction_id = transaction_id self.block_timestamp = block_timestamp self.block_hash = block_hash self.entries_hash = entries_hash self.previous_block_hash = previous_block_hash self.entries_hash_list = entries_hash_list self.transaction_info = transaction_info self.revisions = revisions def from_ion(ion_value): """ Construct a new JournalBlock object from an IonStruct. :type ion_value: :py:class:`amazon.ion.simple_types.IonSymbol` :param ion_value: The IonStruct returned by QLDB that represents a journal block. :rtype: :py:class:`hash_chain.ledger.qldb.journal_block.JournalBlock` :return: The constructed JournalBlock object. """ block_address = ion_value.get('blockAddress') transaction_id = ion_value.get('transactionId') block_timestamp = ion_value.get('blockTimestamp') block_hash = ion_value.get('blockHash') entries_hash = ion_value.get('entriesHash') previous_block_hash = ion_value.get('previousBlockHash') entries_hash_list = ion_value.get('entriesHashList') transaction_info = ion_value.get('transactionInfo') revisions = ion_value.get('revisions') journal_block = journal_block(block_address, transaction_id, block_timestamp, block_hash, entries_hash, previous_block_hash, entries_hash_list, transaction_info, revisions) return journal_block
__author__ = 'shukkkur' ''' https://codeforces.com/problemset/problem/1475/B B. New Year's Number ''' t = int(input()) for _ in range(t): n = int(input()) if n < 2020: print('NO') else: if n % 2020 <= n / 2020: print('YES') else: print('NO')
__author__ = 'shukkkur' "\nhttps://codeforces.com/problemset/problem/1475/B\nB. New Year's Number\n" t = int(input()) for _ in range(t): n = int(input()) if n < 2020: print('NO') elif n % 2020 <= n / 2020: print('YES') else: print('NO')
def caller(): a = [] for i in range(33, 49): a.append(chr(i)) b = [] c = [] d = [] for i in range(65, 91): b.append(chr(i)) for i in range(97, 123): c.append(chr(i)) for i in range(48, 58): d.append(chr(i)) return a, b, c, d
def caller(): a = [] for i in range(33, 49): a.append(chr(i)) b = [] c = [] d = [] for i in range(65, 91): b.append(chr(i)) for i in range(97, 123): c.append(chr(i)) for i in range(48, 58): d.append(chr(i)) return (a, b, c, d)
""" A list of CSS properties to expand. Format: (property, [aliases], unit, [values]) - property : (String) the full CSS property name. - aliases : (String list) a list of aliases for this shortcut. - unit : (String) when defined, assumes that the property has a value with a unit. When the value is numberless (eg, `margin:12`), the given unit will be assumed (`12px`). Set this to `_` for unitless numbers (eg, line-height). - values : (String list) possible values for this property. Each property will be accessible through these ways: - fuzzy matches of the aliases defined - fuzzy matches of the property name, no dashes (eg: mi, min, minh, minhe, minhei...) - fuzzy matches with dashes (eg: min-h, min-hei, min-heig...) """ properties = [ ("margin", [], "px", ["auto"]), ("width", [], "px", ["auto"]), ("height", [], "px", ["auto"]), ("padding", [], "px", ["auto"]), ("border", [], None, None), ("outline", [], None, None), ("left", [], "px", None), ("top", [], "px", None), ("bottom", [], "px", None), ("right", [], "px", None), ("background", ["bground"], None, ["transparent"]), ("min-height", ["mheight"], "px", ["auto"]), ("min-width", ["mwidth"], "px", ["auto"]), ("max-height", ["xheight","mxheight"], "px", ["auto"]), ("max-width", ["xwidth","mxheight"], "px", ["auto"]), ("margin-left", ["mleft","marleft"], "px", ["auto"]), ("margin-right", ["mright","marright"], "px", ["auto"]), ("margin-top", ["mtop","martop"], "px", ["auto"]), ("margin-bottom", ["mbottom","marbottom"], "px", ["auto"]), ("padding-left", ["pleft","padleft"], "px", None), ("padding-right", ["pright","padright"], "px", None), ("padding-top", ["ptop","padtop"], "px", None), ("padding-bottom", ["pbottom","padbottom"], "px", None), ("z-index", [], "_", None), ("display", [], None, ["none", "block", "inline", "inline-block", "table", "table-cell", "table-row"]), ("text-align", ["talign"], None, ["left", "right", "justify", "center", "inherit"]), ("overflow", ["oflow"], None, ["visible", "scroll", "hidden", "auto", "inherit"]), ("overflow-x", ["ox"], None, ["visible", "scroll", "hidden", "auto", "inherit"]), ("overflow-y", ["oy"], None, ["visible", "scroll", "hidden", "auto", "inherit"]), ("font", [], None, None), ("font-size", ["fsize", "fosize"], "em", None), ("font-style", ["fstyle", "fostyle"], None, ["italic","normal","inherit"]), ("font-weight", ["fweight", "foweight"], None, ["100","200","300","400","500","600","700","800","900","bold","normal","inherit"]), ("font-variant", ["fvariant", "fovariant"], None, None), ("font-family", ["ffamily", "family"], None, None), ("line-height", ["lheight", "liheight"], "_", None), ("letter-spacing", ["lspacing", "lespacing"], "px", None), ("transition", ["trans", "tn", "tsition"], None, None), ("transform", ["tform", "xform"], None, None), ("text-transform", ["ttransform"], None, ["uppercase", "lowercase", "capitalize", "none", "full-width", "inherit"]), ("text-decoration", ["tdecoration"], None, ["underline", "none", "line-through", "overline", "inherit", "initial"]), ("text-decoration-line", ["tdline"], None, ["underline", "none", "line-through", "overline", "inherit", "initial"]), ("text-indent", ["tindent"], "px", None), ("text-shadow", ["tshadow", "teshadow"], None, ["none"]), ("table-layout", ["tlayout", "talayout"], None, ["fixed", "auto", "inherit"]), ("vertical-align", ["valign"], None, ["middle","top","bottom","baseline","text-top","text-bottom","sub","super"]), ("transition-duration", ["tduration"], "ms", None), ("float", [], None, ["left", "right", "none", "inherit"]), ("color", [], None, None), ("opacity", [], "_", None), ("border-right", ["bright", "borright"], None, None), ("border-left", ["bleft", "borleft"], None, None), ("border-top", ["btop", "bortop"], None, None), ("border-bottom", ["bbottom", "borbottom"], None, None), ("border-width", ["bwidth"], "px", None), ("border-right-width", ["brwidth"], "px", None), ("border-left-width", ["blwidth"], "px", None), ("border-top-width", ["btwidth"], "px", None), ("border-bottom-width", ["bbwidth"], "px", None), ("border-image", ["borimage"], None, None), ("cursor", [], None, ["wait", "pointer", "auto", "default", "help", "progress", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "not-allowed", "no-drop", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "nw-resize", "ne-resize", "sw-resize", "se-resize", "ew-resize", "ns-resize", "zoom-in", "zoom-out", "grab", "grabbing" ]), ("animation", [], None, None), ("background-image", ["bgimage", "backimage", "bimage"], None, None), ("background-color", ["bgcolor", "backcolor", "bcolor"], None, None), ("background-size", ["bgsize", "backsize"], None, None), ("background-position", ["bgposition", "backposition", "bposition"], None, ["center", "top", "left", "middle", "bottom", "right"]), ("background-repeat", ["bgrepeat", "backrepeat", "brepeat"], None, ["repeat-x", "repeat-y", "no-repeat"]), ("border-radius", ["bradius", "boradius"], "px", None), ("border-color", ["bcolor", "bocolor", "borcolor"], "px", None), ("border-collapse", ["bcollapse", "borcollapse", "collapse"], None, ["collapse","auto","inherit"]), ("box-shadow", ["bshadow", "boshadow"], None, ["none"]), ("box-sizing", ["bsizing", "bsize", "boxsize"], None, ["border-box", "content-box", "padding-box"]), ("position", [], None, ["absolute", "relative", "fixed", "static", "inherit"]), ("flex", [], None, None), ("white-space", ["wspace", "whispace", "whspace", "wispace"], None, ["nowrap", "normal", "pre", "pre-wrap", "pre-line", "inherit"]), ("visibility", [], None, ["visible", "hidden", "collapse", "inherit"]), ("flex-grow", ["fgrow", "flgrow", "flegrow"], "_", None), ("flex-shrink", ["fshrink", "flshrink", "fleshrink"], "_", None), ("flex-direction", ["fdirection", "fldirection", "fledirection"], None, None), ("flex-wrap", ["fwrap", "flwrap", "flewrap"], None, None), ("align-items", ["aitems", "alitems"], None, ["flex-start", "flex-end", "center", "baseline", "stretch", "inherit"]), ("justify-content", ["jcontent", "jucontent", "juscontent", "justcontent"], None, ["flex-start", "flex-end", "center", "space-around", "space-between", "inherit"]), ("order", [], "_", None), ("page-break-after", ["pbafter"], None, ["always", "auto", "avoid", "left", "right", "inherit"]), ("page-break-before", ["pbbefore"], None, ["always", "auto", "avoid", "left", "right", "inherit"]), ("perspective", [], None, None), ("perspective-origin", ["porigin"], None, None), ("word-break", ["wbreak"], None, []), ("quotes", [], None, None), ("content", [], None, None), ("clear", [], None, ["left", "right", "both", "inherit"]), ("zoom", [], "_", None), ("direction", [], None, ["ltr", "rtl", "inherit"]), ("list-style", ["lstyle"], None, ["none", "square", "disc", "inside", "outside", "inherit", "initial", "unset", "decimal", "georgian"]), ] """ A list of CSS statements to expand. This differs from `properties` as this defines shortcuts for an entire statement. For instance, `dib<Enter>` will expand to `display: inline-block`. Each line is in this format: (property, value, alias) The following options are available: - alias : (String list) see `property_list` on how aliases work. """ statements = [ ("display", "block", ["dblock"]), ("display", "inline", ["dinline"]), ("display", "inline-block", ["diblock"]), ("display", "inline-flex", ["diflex"]), ("display", "table", ["dtable", "table"]), ("display", "table-cell", ["dtcell","cell","tablecell","table-cell"]), ("display", "table-row", ["dtrow","row","tablerow","table-row"]), ("float", "left", ["fleft", "flleft", "floleft"]), ("float", "right", ["fright", "flright", "floright"]), ("float", "none", ["fnone", "flnone", "flonone"]), ("display", "none", ["dnone"]), ("display", "flex", ["dflex", "flex"]), ("font-weight", "normal", ["fwnormal"]), ("font-weight", "bold", ["fwbold", "bold"]), ("font-style", "italic", ["fsitalic", "italic"]), ("font-style", "normal", ["fnormal"]), ("border", "0", ["b0"]), ("padding", "0", ["p0","po"]), ("margin", "0", ["m0","mo"]), ("margin", "0 auto", ["m0a", "moa"]), ("overflow", "hidden", ["ohidden"]), ("overflow", "scroll", ["oscroll"]), ("overflow", "auto", ["oauto"]), ("overflow", "visible", ["ovisible"]), ("overflow-x", "hidden", ["oxhidden"]), ("overflow-x", "scroll", ["oxscroll"]), ("overflow-x", "auto", ["oxauto"]), ("overflow-x", "visible", ["oxvisible"]), ("overflow-y", "hidden", ["oyhidden"]), ("overflow-y", "scroll", ["oyscroll"]), ("overflow-y", "auto", ["oyauto"]), ("overflow-y", "visible", ["oyvisible"]), ("font-weight", "100", ["f100", "fw100"]), ("font-weight", "200", ["f200", "fw200"]), ("font-weight", "300", ["f300", "fw300"]), ("font-weight", "400", ["f400", "fw400"]), ("font-weight", "500", ["f500", "fw500"]), ("font-weight", "600", ["f600", "fw600"]), ("font-weight", "700", ["f700", "fw700"]), ("font-weight", "800", ["f800", "fw800"]), ("font-weight", "900", ["f900", "fw900"]), ("border", "0", ["b0"]), ("border-collapse", "collapse", ["bccollapse"]), ("border-collapse", "separate", ["bcseparate"]), ("background-repeat", "repeat-x", [ "brx", "rx", "bgrx", "repeatx" ]), ("background-repeat", "repeat-y", [ "bry", "ry", "bgry", "repeaty" ]), ("background-repeat", "no-repeat", [ "brnorepeat", "norepeat"]), ("background-size", "cover", ["cover"]), ("background-size", "contain", ["contain"]), ("cursor", "pointer", ["cupointer", "curpointer"]), ("cursor", "wait", ["cuwait", "curwait"]), ("cursor", "busy", ["cubusy", "curbusy"]), ("cursor", "text", ["cutext", "curtext"]), ("vertical-align", "middle", ["vamiddle"]), ("vertical-align", "top", ["vatop"]), ("vertical-align", "bottom", ["vabottom"]), ("vertical-align", "sub", ["vasub"]), ("vertical-align", "super", ["vasuper"]), ("vertical-align", "baseline", ["vabline", "vabaseline", "baseline"]), ("vertical-align", "text-top", ["vattop"]), ("vertical-align", "text-bottom", ["vattbottom"]), ("visibility", "visible", ["vvisible","visible"]), ("visibility", "hidden", ["vhidden", "vishidden", "vihidden", "hidden", "hide"]), ("visibility", "collapse", ["vcollapse", "viscollapse", "vicollapse"]), ("clear", "both", ["cboth"]), ("clear", "right", ["cright"]), ("clear", "left", ["cleft"]), ("content", "''", ["content"]), ("text-transform", "uppercase", ["ttupper", "uppercase"]), ("text-transform", "lowercase", ["ttlower"]), ("text-transform", "none", ["ttnone"]), ("text-transform", "capitalize", ["ttcap"]), ("text-transform", "full-width", ["ttfull"]), ("text-align", "left", ["taleft"]), ("text-align", "right", ["taright"]), ("text-align", "center", ["tacenter", "center"]), ("text-align", "justify", ["tajustify", "justify"]), ("text-decoration", "underline", ["tdunderline", "underline"]), ("text-decoration", "none", ["tdnone"]), ("box-sizing", "border-box", ["bsbox"]), ("box-sizing", "padding-box", ["bspadding"]), ("box-sizing", "content-box", ["bscontent"]), ("margin", "auto", ["mauto"]), ("margin-left", "auto", ["mlauto"]), ("margin-right", "auto", ["mrauto"]), ("width", "auto", ["wauto"]), ("height", "auto", ["hauto"]), ("position", "relative", ["porelative", "prelative", "relative"]), ("position", "fixed", ["pofixed", "pfixed", "fixed"]), ("position", "static", ["postatic", "pstatic", "static"]), ("position", "absolute", ["poabsolute", "pabsolute", "absolute"]), ("white-space", "nowrap", ["nowrap"]), ("text-overflow", "ellipsis", ["ellipsis"]), ("flex", "auto", ["flauto"]), ("align-items", "flex-start", ["aistart"]), ("align-items", "flex-end", ["aiend"]), ("align-items", "center", ["aicenter"]), ("align-items", "stretch", ["aistretch"]), ("text-overflow", "ellipsis", ["elip", "ellipsis", "toellipsis"]), ("flex-wrap", "wrap", ["fwrap","flexwrap"]), ("flex-wrap", "nowrap", ["fnowrap"]), ("flex-direction", "row", ["fdrow"]), ("flex-direction", "row-reverse", ["fdrreverse"]), ("flex-direction", "column", ["fdcolumn"]), ("flex-direction", "column-reverse", ["fdcreverse"]), ("justify-content", "center", ["jccenter"]), ("justify-content", "flex-start", ["jcstart"]), ("justify-content", "flex-end", ["jcend"]), ("direction", "ltr", ["ltr","dirltr"]), ("direction", "rtl", ["rtl","dirrtl"]), ("text-shadow", "none", ["tsnone", "teshnone"]), ("table-layout", "fixed", ["tlfixed"]), ("table-layout", "auto", ["tlauto"]), ("list-style", "none", ["lsnone"]), ("list-style-type", "none", ["lstnone"]), ] definitions = { "properties": properties, "statements": statements }
""" A list of CSS properties to expand. Format: (property, [aliases], unit, [values]) - property : (String) the full CSS property name. - aliases : (String list) a list of aliases for this shortcut. - unit : (String) when defined, assumes that the property has a value with a unit. When the value is numberless (eg, `margin:12`), the given unit will be assumed (`12px`). Set this to `_` for unitless numbers (eg, line-height). - values : (String list) possible values for this property. Each property will be accessible through these ways: - fuzzy matches of the aliases defined - fuzzy matches of the property name, no dashes (eg: mi, min, minh, minhe, minhei...) - fuzzy matches with dashes (eg: min-h, min-hei, min-heig...) """ properties = [('margin', [], 'px', ['auto']), ('width', [], 'px', ['auto']), ('height', [], 'px', ['auto']), ('padding', [], 'px', ['auto']), ('border', [], None, None), ('outline', [], None, None), ('left', [], 'px', None), ('top', [], 'px', None), ('bottom', [], 'px', None), ('right', [], 'px', None), ('background', ['bground'], None, ['transparent']), ('min-height', ['mheight'], 'px', ['auto']), ('min-width', ['mwidth'], 'px', ['auto']), ('max-height', ['xheight', 'mxheight'], 'px', ['auto']), ('max-width', ['xwidth', 'mxheight'], 'px', ['auto']), ('margin-left', ['mleft', 'marleft'], 'px', ['auto']), ('margin-right', ['mright', 'marright'], 'px', ['auto']), ('margin-top', ['mtop', 'martop'], 'px', ['auto']), ('margin-bottom', ['mbottom', 'marbottom'], 'px', ['auto']), ('padding-left', ['pleft', 'padleft'], 'px', None), ('padding-right', ['pright', 'padright'], 'px', None), ('padding-top', ['ptop', 'padtop'], 'px', None), ('padding-bottom', ['pbottom', 'padbottom'], 'px', None), ('z-index', [], '_', None), ('display', [], None, ['none', 'block', 'inline', 'inline-block', 'table', 'table-cell', 'table-row']), ('text-align', ['talign'], None, ['left', 'right', 'justify', 'center', 'inherit']), ('overflow', ['oflow'], None, ['visible', 'scroll', 'hidden', 'auto', 'inherit']), ('overflow-x', ['ox'], None, ['visible', 'scroll', 'hidden', 'auto', 'inherit']), ('overflow-y', ['oy'], None, ['visible', 'scroll', 'hidden', 'auto', 'inherit']), ('font', [], None, None), ('font-size', ['fsize', 'fosize'], 'em', None), ('font-style', ['fstyle', 'fostyle'], None, ['italic', 'normal', 'inherit']), ('font-weight', ['fweight', 'foweight'], None, ['100', '200', '300', '400', '500', '600', '700', '800', '900', 'bold', 'normal', 'inherit']), ('font-variant', ['fvariant', 'fovariant'], None, None), ('font-family', ['ffamily', 'family'], None, None), ('line-height', ['lheight', 'liheight'], '_', None), ('letter-spacing', ['lspacing', 'lespacing'], 'px', None), ('transition', ['trans', 'tn', 'tsition'], None, None), ('transform', ['tform', 'xform'], None, None), ('text-transform', ['ttransform'], None, ['uppercase', 'lowercase', 'capitalize', 'none', 'full-width', 'inherit']), ('text-decoration', ['tdecoration'], None, ['underline', 'none', 'line-through', 'overline', 'inherit', 'initial']), ('text-decoration-line', ['tdline'], None, ['underline', 'none', 'line-through', 'overline', 'inherit', 'initial']), ('text-indent', ['tindent'], 'px', None), ('text-shadow', ['tshadow', 'teshadow'], None, ['none']), ('table-layout', ['tlayout', 'talayout'], None, ['fixed', 'auto', 'inherit']), ('vertical-align', ['valign'], None, ['middle', 'top', 'bottom', 'baseline', 'text-top', 'text-bottom', 'sub', 'super']), ('transition-duration', ['tduration'], 'ms', None), ('float', [], None, ['left', 'right', 'none', 'inherit']), ('color', [], None, None), ('opacity', [], '_', None), ('border-right', ['bright', 'borright'], None, None), ('border-left', ['bleft', 'borleft'], None, None), ('border-top', ['btop', 'bortop'], None, None), ('border-bottom', ['bbottom', 'borbottom'], None, None), ('border-width', ['bwidth'], 'px', None), ('border-right-width', ['brwidth'], 'px', None), ('border-left-width', ['blwidth'], 'px', None), ('border-top-width', ['btwidth'], 'px', None), ('border-bottom-width', ['bbwidth'], 'px', None), ('border-image', ['borimage'], None, None), ('cursor', [], None, ['wait', 'pointer', 'auto', 'default', 'help', 'progress', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'not-allowed', 'no-drop', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'nw-resize', 'ne-resize', 'sw-resize', 'se-resize', 'ew-resize', 'ns-resize', 'zoom-in', 'zoom-out', 'grab', 'grabbing']), ('animation', [], None, None), ('background-image', ['bgimage', 'backimage', 'bimage'], None, None), ('background-color', ['bgcolor', 'backcolor', 'bcolor'], None, None), ('background-size', ['bgsize', 'backsize'], None, None), ('background-position', ['bgposition', 'backposition', 'bposition'], None, ['center', 'top', 'left', 'middle', 'bottom', 'right']), ('background-repeat', ['bgrepeat', 'backrepeat', 'brepeat'], None, ['repeat-x', 'repeat-y', 'no-repeat']), ('border-radius', ['bradius', 'boradius'], 'px', None), ('border-color', ['bcolor', 'bocolor', 'borcolor'], 'px', None), ('border-collapse', ['bcollapse', 'borcollapse', 'collapse'], None, ['collapse', 'auto', 'inherit']), ('box-shadow', ['bshadow', 'boshadow'], None, ['none']), ('box-sizing', ['bsizing', 'bsize', 'boxsize'], None, ['border-box', 'content-box', 'padding-box']), ('position', [], None, ['absolute', 'relative', 'fixed', 'static', 'inherit']), ('flex', [], None, None), ('white-space', ['wspace', 'whispace', 'whspace', 'wispace'], None, ['nowrap', 'normal', 'pre', 'pre-wrap', 'pre-line', 'inherit']), ('visibility', [], None, ['visible', 'hidden', 'collapse', 'inherit']), ('flex-grow', ['fgrow', 'flgrow', 'flegrow'], '_', None), ('flex-shrink', ['fshrink', 'flshrink', 'fleshrink'], '_', None), ('flex-direction', ['fdirection', 'fldirection', 'fledirection'], None, None), ('flex-wrap', ['fwrap', 'flwrap', 'flewrap'], None, None), ('align-items', ['aitems', 'alitems'], None, ['flex-start', 'flex-end', 'center', 'baseline', 'stretch', 'inherit']), ('justify-content', ['jcontent', 'jucontent', 'juscontent', 'justcontent'], None, ['flex-start', 'flex-end', 'center', 'space-around', 'space-between', 'inherit']), ('order', [], '_', None), ('page-break-after', ['pbafter'], None, ['always', 'auto', 'avoid', 'left', 'right', 'inherit']), ('page-break-before', ['pbbefore'], None, ['always', 'auto', 'avoid', 'left', 'right', 'inherit']), ('perspective', [], None, None), ('perspective-origin', ['porigin'], None, None), ('word-break', ['wbreak'], None, []), ('quotes', [], None, None), ('content', [], None, None), ('clear', [], None, ['left', 'right', 'both', 'inherit']), ('zoom', [], '_', None), ('direction', [], None, ['ltr', 'rtl', 'inherit']), ('list-style', ['lstyle'], None, ['none', 'square', 'disc', 'inside', 'outside', 'inherit', 'initial', 'unset', 'decimal', 'georgian'])] '\nA list of CSS statements to expand.\n\nThis differs from `properties` as this defines shortcuts for an entire statement.\nFor instance, `dib<Enter>` will expand to `display: inline-block`.\n\nEach line is in this format:\n\n (property, value, alias)\n\nThe following options are available:\n\n- alias : (String list) see `property_list` on how aliases work.\n' statements = [('display', 'block', ['dblock']), ('display', 'inline', ['dinline']), ('display', 'inline-block', ['diblock']), ('display', 'inline-flex', ['diflex']), ('display', 'table', ['dtable', 'table']), ('display', 'table-cell', ['dtcell', 'cell', 'tablecell', 'table-cell']), ('display', 'table-row', ['dtrow', 'row', 'tablerow', 'table-row']), ('float', 'left', ['fleft', 'flleft', 'floleft']), ('float', 'right', ['fright', 'flright', 'floright']), ('float', 'none', ['fnone', 'flnone', 'flonone']), ('display', 'none', ['dnone']), ('display', 'flex', ['dflex', 'flex']), ('font-weight', 'normal', ['fwnormal']), ('font-weight', 'bold', ['fwbold', 'bold']), ('font-style', 'italic', ['fsitalic', 'italic']), ('font-style', 'normal', ['fnormal']), ('border', '0', ['b0']), ('padding', '0', ['p0', 'po']), ('margin', '0', ['m0', 'mo']), ('margin', '0 auto', ['m0a', 'moa']), ('overflow', 'hidden', ['ohidden']), ('overflow', 'scroll', ['oscroll']), ('overflow', 'auto', ['oauto']), ('overflow', 'visible', ['ovisible']), ('overflow-x', 'hidden', ['oxhidden']), ('overflow-x', 'scroll', ['oxscroll']), ('overflow-x', 'auto', ['oxauto']), ('overflow-x', 'visible', ['oxvisible']), ('overflow-y', 'hidden', ['oyhidden']), ('overflow-y', 'scroll', ['oyscroll']), ('overflow-y', 'auto', ['oyauto']), ('overflow-y', 'visible', ['oyvisible']), ('font-weight', '100', ['f100', 'fw100']), ('font-weight', '200', ['f200', 'fw200']), ('font-weight', '300', ['f300', 'fw300']), ('font-weight', '400', ['f400', 'fw400']), ('font-weight', '500', ['f500', 'fw500']), ('font-weight', '600', ['f600', 'fw600']), ('font-weight', '700', ['f700', 'fw700']), ('font-weight', '800', ['f800', 'fw800']), ('font-weight', '900', ['f900', 'fw900']), ('border', '0', ['b0']), ('border-collapse', 'collapse', ['bccollapse']), ('border-collapse', 'separate', ['bcseparate']), ('background-repeat', 'repeat-x', ['brx', 'rx', 'bgrx', 'repeatx']), ('background-repeat', 'repeat-y', ['bry', 'ry', 'bgry', 'repeaty']), ('background-repeat', 'no-repeat', ['brnorepeat', 'norepeat']), ('background-size', 'cover', ['cover']), ('background-size', 'contain', ['contain']), ('cursor', 'pointer', ['cupointer', 'curpointer']), ('cursor', 'wait', ['cuwait', 'curwait']), ('cursor', 'busy', ['cubusy', 'curbusy']), ('cursor', 'text', ['cutext', 'curtext']), ('vertical-align', 'middle', ['vamiddle']), ('vertical-align', 'top', ['vatop']), ('vertical-align', 'bottom', ['vabottom']), ('vertical-align', 'sub', ['vasub']), ('vertical-align', 'super', ['vasuper']), ('vertical-align', 'baseline', ['vabline', 'vabaseline', 'baseline']), ('vertical-align', 'text-top', ['vattop']), ('vertical-align', 'text-bottom', ['vattbottom']), ('visibility', 'visible', ['vvisible', 'visible']), ('visibility', 'hidden', ['vhidden', 'vishidden', 'vihidden', 'hidden', 'hide']), ('visibility', 'collapse', ['vcollapse', 'viscollapse', 'vicollapse']), ('clear', 'both', ['cboth']), ('clear', 'right', ['cright']), ('clear', 'left', ['cleft']), ('content', "''", ['content']), ('text-transform', 'uppercase', ['ttupper', 'uppercase']), ('text-transform', 'lowercase', ['ttlower']), ('text-transform', 'none', ['ttnone']), ('text-transform', 'capitalize', ['ttcap']), ('text-transform', 'full-width', ['ttfull']), ('text-align', 'left', ['taleft']), ('text-align', 'right', ['taright']), ('text-align', 'center', ['tacenter', 'center']), ('text-align', 'justify', ['tajustify', 'justify']), ('text-decoration', 'underline', ['tdunderline', 'underline']), ('text-decoration', 'none', ['tdnone']), ('box-sizing', 'border-box', ['bsbox']), ('box-sizing', 'padding-box', ['bspadding']), ('box-sizing', 'content-box', ['bscontent']), ('margin', 'auto', ['mauto']), ('margin-left', 'auto', ['mlauto']), ('margin-right', 'auto', ['mrauto']), ('width', 'auto', ['wauto']), ('height', 'auto', ['hauto']), ('position', 'relative', ['porelative', 'prelative', 'relative']), ('position', 'fixed', ['pofixed', 'pfixed', 'fixed']), ('position', 'static', ['postatic', 'pstatic', 'static']), ('position', 'absolute', ['poabsolute', 'pabsolute', 'absolute']), ('white-space', 'nowrap', ['nowrap']), ('text-overflow', 'ellipsis', ['ellipsis']), ('flex', 'auto', ['flauto']), ('align-items', 'flex-start', ['aistart']), ('align-items', 'flex-end', ['aiend']), ('align-items', 'center', ['aicenter']), ('align-items', 'stretch', ['aistretch']), ('text-overflow', 'ellipsis', ['elip', 'ellipsis', 'toellipsis']), ('flex-wrap', 'wrap', ['fwrap', 'flexwrap']), ('flex-wrap', 'nowrap', ['fnowrap']), ('flex-direction', 'row', ['fdrow']), ('flex-direction', 'row-reverse', ['fdrreverse']), ('flex-direction', 'column', ['fdcolumn']), ('flex-direction', 'column-reverse', ['fdcreverse']), ('justify-content', 'center', ['jccenter']), ('justify-content', 'flex-start', ['jcstart']), ('justify-content', 'flex-end', ['jcend']), ('direction', 'ltr', ['ltr', 'dirltr']), ('direction', 'rtl', ['rtl', 'dirrtl']), ('text-shadow', 'none', ['tsnone', 'teshnone']), ('table-layout', 'fixed', ['tlfixed']), ('table-layout', 'auto', ['tlauto']), ('list-style', 'none', ['lsnone']), ('list-style-type', 'none', ['lstnone'])] definitions = {'properties': properties, 'statements': statements}
class Beacon(): def __init__(self, sprite, type): self.sprite = sprite self.type = type ''' self.x = 0 self.y = 0 def set_pos(self, x, y): self.x = x self.y = y ''' @property def position(self): return self.sprite.position @position.setter def position(self, val): self.sprite.position = val @property def x(self): return self.sprite.position[0] @property def y(self): return self.sprite.position[1]
class Beacon: def __init__(self, sprite, type): self.sprite = sprite self.type = type '\n self.x = 0\n self.y = 0\n def set_pos(self, x, y):\n self.x = x\n self.y = y \n ' @property def position(self): return self.sprite.position @position.setter def position(self, val): self.sprite.position = val @property def x(self): return self.sprite.position[0] @property def y(self): return self.sprite.position[1]
class Attribute: NAME = 'Keyboard' class KeyState: LEFT_ARROW_DOWN = 'leftArrowDown' RIGHT_ARROW_DOWN = 'rightArrowDown' UP_ARROW_DOWN = 'upArrowDown' DOWN_ARROW_DOWN = 'downArrowDown'
class Attribute: name = 'Keyboard' class Keystate: left_arrow_down = 'leftArrowDown' right_arrow_down = 'rightArrowDown' up_arrow_down = 'upArrowDown' down_arrow_down = 'downArrowDown'
#Hierarchical Inheritance class A: #Super Class or Parent Class def feature1(self): print("Feature 1 Working") def feature2(self): print("Feature 2 Working") class B(A): # Subclass or Child Class def feature3(self): print("Feature 3 Working") def feature4(self): print("Feature 4 Working") class C(A): #GrandChild class def feature5(self): print("Feature 5 Working") class D(A): #GrandChild class def feature6(self): print("Feature 6 Working") b = B() c = C() d = D()
class A: def feature1(self): print('Feature 1 Working') def feature2(self): print('Feature 2 Working') class B(A): def feature3(self): print('Feature 3 Working') def feature4(self): print('Feature 4 Working') class C(A): def feature5(self): print('Feature 5 Working') class D(A): def feature6(self): print('Feature 6 Working') b = b() c = c() d = d()
def hurdleRace(k, height): if k >= max(height): return 0 else: return max(height) - k # test case h = [1,3,4,5,2,5] print(hurdleRace(3, h)) # Should be 2 print(hurdleRace(8, h)) # Should be 0
def hurdle_race(k, height): if k >= max(height): return 0 else: return max(height) - k h = [1, 3, 4, 5, 2, 5] print(hurdle_race(3, h)) print(hurdle_race(8, h))
# try: # except KeyError: # return render(request, "circle/error.html", context={"message": "Upload file.!!", "type": "Key Error", "link": "newArticle"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field image.!!", "type": "Value Error", "link": "newArticle"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newArticle"}) # class Meta: # db_table = "person" # verbose_name = "Person" # get_latest_by = "id" # ordering = ['id'] # class Meta: # # db_table = "person" # verbose_name = "Messages" # validators=[MinLengthValidator(1), MaxLengthValidator(255)], # class Meta: # db_table = 'article' # verbose_name = 'circle_article' # def login(request): # return render(request, "circle/home.html", context={}) # def logout(request): # return render(request, "circle/home.html", context={}) MESSAGE_TAGS = { messages.DEBUG: 'alert-secondary', messages.INFO: 'alert-info', messages.SUCCESS: 'alert-success', messages.WARNING: 'alert-warning', messages.ERROR: 'alert-danger', } def verification(request): ph_no = 9316300064 request.session['ph_no'] = ph_no otp = str(random.randint(100000, 999999)) cprint(otp, 'white') connection = http.client.HTTPSConnection("api.msg91.com") authkey = settings.authkey code = 91 sender = "Marketplace Team" # payload = "{\"Value1\":\"Param1\",\"Value2\":\"Param2\",\"Value3\":\"Param3\"}" headers = {'content-type': "application/json"} connection.request("GET", "http://control.msg91.com/api/sendotp.php", params={ "otp": otp, "mobile": ph_no, "sender": sender, "message": message, "country": code, "authkey": authkey, "otp_length": 6}, headers=headers) res = connection.getresponse() data = res.read() print(data) print(data.decode("utf-8")) return render(request, "circle/test.html", context={"message": "OTP sent.!!"}) if request.GET: return HttpResponseRedirect(reverse('newArticle', args=())) else: user_id = request.user.id try: title = str(request.POST.get("title")) except KeyError: return render(request, "circle/error.html", context={"message": "Enter title.!!", "type": "Key Error", "link": "newArticle"}) except ValueError: return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newArticle"}) except TypeError: return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newArticle"}) try: description = str(request.POST.get('description')) except KeyError: return render(request, "circle/error.html", context={"message": "Enter description.!!", "type": "Key Error", "link": "newArticle"}) except ValueError: return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newArticle"}) except TypeError: return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newArticle"}) try: price = float(request.POST.get('price')) except KeyError: return render(request, "circle/error.html", context={"message": "Enter price.!!", "type": "Key Error", "link": "newArticle"}) except ValueError: return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newArticle"}) except TypeError: return render(request, "circle/error.html", context={"message": "Incompatible Tag DataType.!!", "type": "Type Error", "link": "newArticle"}) # try: # tags = request.POST.get('tags') # if tags is not None: # tags = list(tags) # else: # tags = [] # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter title.!!", "type": "Key Error", "link": "newArticle"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newArticle"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newArticle"}) image = request.FILES['image'] article = Article.objects.create(title=title, description=description, image=image, price=price) # cprint(article, 'red') # pub_ts = article.pub_ts # cprint(pub_ts, 'white') # article.image = set_unique_name(article.image.url, pub_ts) # cprint(article.image.url, 'blue') # for tag in tags: # article.tags.add(tag) try: person = Person.objects.filter(user_id=user_id).first() person.display.add(article) person.save() return HttpResponseRedirect(reverse("article", args=(article.id, ))) except Person.DoesNotExist: return render(request, "circle/error.html", context={"message": "No person found.!!", "type": "Data Error", "link": "newArticle"}) # if request.GET: # return HttpResponseRedirect(reverse('newPerson', args=())) # else: # try: # user = User.objects.get(pk=request.user.id) # try: # bio = str(request.POST.get("bio")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter a Bio.!!", "type": "Key Error", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # try: # first = str(request.POST.get("first")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter a First Name.!!", "type": "Key Error", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # try: # last = str(request.POST.get("last")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter a Last Name.!!", "type": "Key Error", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # try: # age = int(request.POST.get("age")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter a Age!", "type": "Key Error.!!", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # try: # sex = str(request.POST.get("sex")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Select gender from the options provided.!!", "type": "KeyError", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # sex = sex[0] # try: # email = str(request.POST.get("email")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter an e-mail address.!!", "type": "KeyError", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # try: # ph_no = str(request.POST.get("ph_no")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter an e-mail address.!!", "type": "KeyError", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # username = email.split('@')[0] # profile = request.FILES['profile'] # try: # Person.objects.create(user=user, profile=profile, username=username, bio=bio, first=first, last=last, age=age, sex=sex, email=email, ph_no=ph_no) # return HttpResponseRedirect(reverse('person', args=(person.id, ))) # except: # return render(request, "circle/error.html", context={"message": "No person found.!!", "type": "Data Error", "link": "newPerson"}) # except User.DoesNotExist: # return render(request, "circle/error.html", context={"message": "No user found.!!", "type": "Data Error", "link": "newPerson"})
message_tags = {messages.DEBUG: 'alert-secondary', messages.INFO: 'alert-info', messages.SUCCESS: 'alert-success', messages.WARNING: 'alert-warning', messages.ERROR: 'alert-danger'} def verification(request): ph_no = 9316300064 request.session['ph_no'] = ph_no otp = str(random.randint(100000, 999999)) cprint(otp, 'white') connection = http.client.HTTPSConnection('api.msg91.com') authkey = settings.authkey code = 91 sender = 'Marketplace Team' headers = {'content-type': 'application/json'} connection.request('GET', 'http://control.msg91.com/api/sendotp.php', params={'otp': otp, 'mobile': ph_no, 'sender': sender, 'message': message, 'country': code, 'authkey': authkey, 'otp_length': 6}, headers=headers) res = connection.getresponse() data = res.read() print(data) print(data.decode('utf-8')) return render(request, 'circle/test.html', context={'message': 'OTP sent.!!'}) if request.GET: return http_response_redirect(reverse('newArticle', args=())) else: user_id = request.user.id try: title = str(request.POST.get('title')) except KeyError: return render(request, 'circle/error.html', context={'message': 'Enter title.!!', 'type': 'Key Error', 'link': 'newArticle'}) except ValueError: return render(request, 'circle/error.html', context={'message': 'Invalid Value to given field.!!', 'type': 'Value Error', 'link': 'newArticle'}) except TypeError: return render(request, 'circle/error.html', context={'message': 'Incompatible DataType.!!', 'type': 'Type Error', 'link': 'newArticle'}) try: description = str(request.POST.get('description')) except KeyError: return render(request, 'circle/error.html', context={'message': 'Enter description.!!', 'type': 'Key Error', 'link': 'newArticle'}) except ValueError: return render(request, 'circle/error.html', context={'message': 'Invalid Value to given field.!!', 'type': 'Value Error', 'link': 'newArticle'}) except TypeError: return render(request, 'circle/error.html', context={'message': 'Incompatible DataType.!!', 'type': 'Type Error', 'link': 'newArticle'}) try: price = float(request.POST.get('price')) except KeyError: return render(request, 'circle/error.html', context={'message': 'Enter price.!!', 'type': 'Key Error', 'link': 'newArticle'}) except ValueError: return render(request, 'circle/error.html', context={'message': 'Invalid Value to given field.!!', 'type': 'Value Error', 'link': 'newArticle'}) except TypeError: return render(request, 'circle/error.html', context={'message': 'Incompatible Tag DataType.!!', 'type': 'Type Error', 'link': 'newArticle'}) image = request.FILES['image'] article = Article.objects.create(title=title, description=description, image=image, price=price) try: person = Person.objects.filter(user_id=user_id).first() person.display.add(article) person.save() return http_response_redirect(reverse('article', args=(article.id,))) except Person.DoesNotExist: return render(request, 'circle/error.html', context={'message': 'No person found.!!', 'type': 'Data Error', 'link': 'newArticle'})
class Solution: def isPalindrome(self, s: str) -> bool: string2 = "" for character in s.lower(): if character.isalnum(): string2 += character if string2 == string2[::-1]: return True return False
class Solution: def is_palindrome(self, s: str) -> bool: string2 = '' for character in s.lower(): if character.isalnum(): string2 += character if string2 == string2[::-1]: return True return False
squares = [value ** 2 for value in range(1, 11)] print(squares) cubes = [value ** 3 for value in range(1, 11)] print(cubes) a_million = list(range(1, 1_000_0001)) print(min(a_million)) print(max(a_million)) print(sum(a_million))
squares = [value ** 2 for value in range(1, 11)] print(squares) cubes = [value ** 3 for value in range(1, 11)] print(cubes) a_million = list(range(1, 10000001)) print(min(a_million)) print(max(a_million)) print(sum(a_million))
class Restaurant: def __init__(self, restaurant_name, cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type self.number_serverd = 0 def describe_restaurant(self): print(f'Welcome to {self.restaurant_name.title()}') print(f'Our cousine type is: {self.cuisine_type.title()}') def open_restaurant(self): print(f'The {self.restaurant_name.title()} is OPEN') def set_number_server(self, number): self.number_serverd = number def increment_number_served(self, number): self.number_serverd += number print(f'Customers: {self.number_serverd}') def show_number_serverd(self): print(f'{self.number_serverd}') restaurant = Restaurant('Don Lucho', 'burguer') restaurant.increment_number_served(100) restaurant.increment_number_served(200) restaurant.increment_number_served(500)
class Restaurant: def __init__(self, restaurant_name, cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type self.number_serverd = 0 def describe_restaurant(self): print(f'Welcome to {self.restaurant_name.title()}') print(f'Our cousine type is: {self.cuisine_type.title()}') def open_restaurant(self): print(f'The {self.restaurant_name.title()} is OPEN') def set_number_server(self, number): self.number_serverd = number def increment_number_served(self, number): self.number_serverd += number print(f'Customers: {self.number_serverd}') def show_number_serverd(self): print(f'{self.number_serverd}') restaurant = restaurant('Don Lucho', 'burguer') restaurant.increment_number_served(100) restaurant.increment_number_served(200) restaurant.increment_number_served(500)
mtx = [] while True: n = str(input()) if n == 'end': break mtx.append([int(s) for s in n.split()]) out_mtx = [[0 for j in range(len(mtx[i]))] for i in range(len(mtx))] for i in range(len(mtx)): for j in range(len(mtx[i])): ylen = len(mtx) xlen = len(mtx[0]) out_mtx[i][j]=int(mtx[i-1][j]) + int(mtx[(i+1)%ylen][j]) + int(mtx[i][j-1]) + int(mtx[i][(j+1)%xlen]) for i in range(ylen): for j in range(xlen): print(out_mtx[i][j], end = ' ') print()
mtx = [] while True: n = str(input()) if n == 'end': break mtx.append([int(s) for s in n.split()]) out_mtx = [[0 for j in range(len(mtx[i]))] for i in range(len(mtx))] for i in range(len(mtx)): for j in range(len(mtx[i])): ylen = len(mtx) xlen = len(mtx[0]) out_mtx[i][j] = int(mtx[i - 1][j]) + int(mtx[(i + 1) % ylen][j]) + int(mtx[i][j - 1]) + int(mtx[i][(j + 1) % xlen]) for i in range(ylen): for j in range(xlen): print(out_mtx[i][j], end=' ') print()
# https://leetcode.com/problems/check-array-formation-through-concatenation/ class Solution: def canFormArray(self, arr: List[int], pieces: List[List[int]]) -> bool: result = [] for j in arr: for i in pieces: if i[0] == j: for m in range(len(i)): result.append(i[m]) if result == arr: return True else: return False
class Solution: def can_form_array(self, arr: List[int], pieces: List[List[int]]) -> bool: result = [] for j in arr: for i in pieces: if i[0] == j: for m in range(len(i)): result.append(i[m]) if result == arr: return True else: return False
a = 10 b = 3 print('Add -', a + b) print('Subtract -', a - b) print('Multiply -', a * b) print('Divide (with floating point) -', a / b) print('Divide (ignoring floats) -', a // b) # With interactive python # >>> 10 / 3 # 3.3333333333333335 # >>> 10.0 / 3 # 3.3333333333333335 # >>> 10 // 3 # 3 # >>> 10 // 3.0 # 3.0 print('Remainder or Modulus -', a % b) print('a raised to power b -', a ** b) # Augmented assignment operator or enhanced assignment operator # Increment a += b # Means, a = a + b print('a incremented by b -', a); # Decrement a -= b print('a decremented by b -', a) # Multiply, Divide (floating point & integer), Modulo a *= b print(a) a /= b print(a) a //= b print(a) a %= b print(a)
a = 10 b = 3 print('Add -', a + b) print('Subtract -', a - b) print('Multiply -', a * b) print('Divide (with floating point) -', a / b) print('Divide (ignoring floats) -', a // b) print('Remainder or Modulus -', a % b) print('a raised to power b -', a ** b) a += b print('a incremented by b -', a) a -= b print('a decremented by b -', a) a *= b print(a) a /= b print(a) a //= b print(a) a %= b print(a)
class IrregualrConfigParser(object): COMMENT_FLAGS = ("#", ";") def __init__(self): super(IrregualrConfigParser, self).__init__() self.__content = [] def read(self, fn_or_fp): content = [] if isinstance(fn_or_fp, file): content = [line.strip() for line in fn_or_fp.xreadlines()] else: with open(fn_or_fp, "r") as fp: content = [line.strip() for line in fp.xreadlines()] self.__content = self.parse_content(content) def write(self, fp): for line in self.__content: if line is None: fp.write("\n") continue section = line.get("section", None) comment = line.get("comment", None) option = line.get("option", None) value = line.get("value", None) if comment: fp.write(comment + "\n") continue elif section and option is None: fp.write("[{0}]\n".format(section)) continue elif option and value is not None: fp.write("{0}={1}\n".format(option, value)) elif not section and not option: continue else: fp.write(option + "\n") def parse_content(self, content): def _is_blank(line): return not line def _is_comment(line): return line[0] in self.COMMENT_FLAGS def _is_section(line): return line[0] == '[' and line[-1] == ']' def _is_option(line): return "=" in line def _parse_content(): section = None for line in content: if _is_blank(line): yield None continue if _is_comment(line): yield {"comment": line} continue if _is_section(line): section = line[1:-1] yield {"section": section} continue if _is_option(line): option, value = [i.strip() for i in line.split("=", 1)] yield {"option": option, "value": value, "section": section} else: yield {"option": line, "section": section} return list(_parse_content()) if content else [] def __get_option(self, section, option): for ln, line in enumerate(self.__content): if not line: continue section_name = line.get("section", None) option_name = line.get("option", None) if section_name == section and option_name == option: return ln, line return -1, None def __get_section(self, section): for ln, line in enumerate(self.__content): if not line: continue section_name = line.get("section", None) if section_name == section: return ln, line return -1, None def has_section(self, section): ln, _ = self.__get_section(section) return ln != -1 def has_option(self, section, option): ln, _ = self.__get_option(section, option) return ln != -1 def __add_section(self, section): line = {"section": section} self.__content.append(line) return len(self.__content) - 1, line def add_section(self, section): ln, _ = self.__add_section(section) return ln != -1 def get(self, section, option): _, option_line = self.__get_option(section, option) if not option_line: return None else: return option_line.get("value", None) def set(self, section, option, value=None): _, option_line = self.__get_option(section, option) if option_line: if value is None: option_line.pop('value', None) else: option_line['value'] = value return True ln, _ = self.__get_section(section) if ln == -1: ln, _ = self.__add_section(section) if value is None: line = {"option": option, "section": section} else: line = {"option": option, "value": value, "section": section} self.__content.insert(ln + 1, line) return True
class Irregualrconfigparser(object): comment_flags = ('#', ';') def __init__(self): super(IrregualrConfigParser, self).__init__() self.__content = [] def read(self, fn_or_fp): content = [] if isinstance(fn_or_fp, file): content = [line.strip() for line in fn_or_fp.xreadlines()] else: with open(fn_or_fp, 'r') as fp: content = [line.strip() for line in fp.xreadlines()] self.__content = self.parse_content(content) def write(self, fp): for line in self.__content: if line is None: fp.write('\n') continue section = line.get('section', None) comment = line.get('comment', None) option = line.get('option', None) value = line.get('value', None) if comment: fp.write(comment + '\n') continue elif section and option is None: fp.write('[{0}]\n'.format(section)) continue elif option and value is not None: fp.write('{0}={1}\n'.format(option, value)) elif not section and (not option): continue else: fp.write(option + '\n') def parse_content(self, content): def _is_blank(line): return not line def _is_comment(line): return line[0] in self.COMMENT_FLAGS def _is_section(line): return line[0] == '[' and line[-1] == ']' def _is_option(line): return '=' in line def _parse_content(): section = None for line in content: if _is_blank(line): yield None continue if _is_comment(line): yield {'comment': line} continue if _is_section(line): section = line[1:-1] yield {'section': section} continue if _is_option(line): (option, value) = [i.strip() for i in line.split('=', 1)] yield {'option': option, 'value': value, 'section': section} else: yield {'option': line, 'section': section} return list(_parse_content()) if content else [] def __get_option(self, section, option): for (ln, line) in enumerate(self.__content): if not line: continue section_name = line.get('section', None) option_name = line.get('option', None) if section_name == section and option_name == option: return (ln, line) return (-1, None) def __get_section(self, section): for (ln, line) in enumerate(self.__content): if not line: continue section_name = line.get('section', None) if section_name == section: return (ln, line) return (-1, None) def has_section(self, section): (ln, _) = self.__get_section(section) return ln != -1 def has_option(self, section, option): (ln, _) = self.__get_option(section, option) return ln != -1 def __add_section(self, section): line = {'section': section} self.__content.append(line) return (len(self.__content) - 1, line) def add_section(self, section): (ln, _) = self.__add_section(section) return ln != -1 def get(self, section, option): (_, option_line) = self.__get_option(section, option) if not option_line: return None else: return option_line.get('value', None) def set(self, section, option, value=None): (_, option_line) = self.__get_option(section, option) if option_line: if value is None: option_line.pop('value', None) else: option_line['value'] = value return True (ln, _) = self.__get_section(section) if ln == -1: (ln, _) = self.__add_section(section) if value is None: line = {'option': option, 'section': section} else: line = {'option': option, 'value': value, 'section': section} self.__content.insert(ln + 1, line) return True
def readConstants(constants_list): constants = [] for attribute, value in constants_list.items(): constants.append({"name": attribute, "cname": "c_" + attribute, "value": value}) return constants def readClocks(clocks_lists): clocks = {"par": [], "seq": []} for attribute, value in clocks_lists["par_time"].items(): clocks["par"].append({ "name": attribute, "cname": "cp_" + attribute, "start_str": value[0], "cname_start_f": "start_cp_" + attribute, "end_str": value[1], "cname_end_f": "end_cp_" + attribute, "cname_size_f": "size_cp_" + attribute, }) for attribute, value in clocks_lists["seq_time"].items(): clocks["seq"].append({ "name": attribute, "cname": "cs_" + attribute, "start_str": value[0], "cname_start_f": "start_cs_" + attribute, "end_str": value[1], "cname_end_f": "end_cs_" + attribute, "cname_size_f": "size_cs_" + attribute, }) return clocks def readCubeNests(cube_nests_json): cube_nests = [] for attribute, value in cube_nests_json.items(): cube_list = [] for clock_attr, clock_val in value.items(): cube_list.append({ "clock_mask": clock_val["clock_mask"], "name": clock_attr, "depth": clock_val["depth"], "x_dim_str": clock_val["x-dim"], # array with [0] = min , [1] = max, [?2] = grid_alignment_clock "y_dim_str": clock_val["y-dim"], # array with [0] = min , [1] = max, [?2] = grid_alignment_clock "z_dim_str": clock_val["z-dim"], # array with [0] = min , [1] = max, [?2] = grid_alignment_clock "cname_x_dim_start_f": "x_dim_start_" + attribute + "_" + clock_attr, "cname_y_dim_start_f": "y_dim_start_" + attribute + "_" + clock_attr, "cname_z_dim_start_f": "z_dim_start_" + attribute + "_" + clock_attr, "cname_x_dim_end_f": "x_dim_end_" + attribute + "_" + clock_attr, "cname_y_dim_end_f": "y_dim_end_" + attribute + "_" + clock_attr, "cname_z_dim_end_f": "z_dim_end_" + attribute + "_" + clock_attr, "cname_x_dim_jump_f": "x_dim_jump_" + attribute + "_" + clock_attr, "cname_y_dim_jump_f": "y_dim_jump_" + attribute + "_" + clock_attr, "cname_z_dim_jump_f": "z_dim_jump_" + attribute + "_" + clock_attr, "cname_x_dim_size_f": "x_dim_size_" + attribute + "_" + clock_attr, "cname_y_dim_size_f": "y_dim_size_" + attribute + "_" + clock_attr, "cname_z_dim_size_f": "z_dim_size_" + attribute + "_" + clock_attr, "cname_x_dim_jump_offset_f": "x_dim_jump_offset_" + attribute + "_" + clock_attr, "cname_y_dim_jump_offset_f": "y_dim_jump_offset_" + attribute + "_" + clock_attr, "cname_z_dim_jump_offset_f": "z_dim_jump_offset_" + attribute + "_" + clock_attr }) cube_nests.append({ "name": attribute, "cubes": cube_list, }) return cube_nests
def read_constants(constants_list): constants = [] for (attribute, value) in constants_list.items(): constants.append({'name': attribute, 'cname': 'c_' + attribute, 'value': value}) return constants def read_clocks(clocks_lists): clocks = {'par': [], 'seq': []} for (attribute, value) in clocks_lists['par_time'].items(): clocks['par'].append({'name': attribute, 'cname': 'cp_' + attribute, 'start_str': value[0], 'cname_start_f': 'start_cp_' + attribute, 'end_str': value[1], 'cname_end_f': 'end_cp_' + attribute, 'cname_size_f': 'size_cp_' + attribute}) for (attribute, value) in clocks_lists['seq_time'].items(): clocks['seq'].append({'name': attribute, 'cname': 'cs_' + attribute, 'start_str': value[0], 'cname_start_f': 'start_cs_' + attribute, 'end_str': value[1], 'cname_end_f': 'end_cs_' + attribute, 'cname_size_f': 'size_cs_' + attribute}) return clocks def read_cube_nests(cube_nests_json): cube_nests = [] for (attribute, value) in cube_nests_json.items(): cube_list = [] for (clock_attr, clock_val) in value.items(): cube_list.append({'clock_mask': clock_val['clock_mask'], 'name': clock_attr, 'depth': clock_val['depth'], 'x_dim_str': clock_val['x-dim'], 'y_dim_str': clock_val['y-dim'], 'z_dim_str': clock_val['z-dim'], 'cname_x_dim_start_f': 'x_dim_start_' + attribute + '_' + clock_attr, 'cname_y_dim_start_f': 'y_dim_start_' + attribute + '_' + clock_attr, 'cname_z_dim_start_f': 'z_dim_start_' + attribute + '_' + clock_attr, 'cname_x_dim_end_f': 'x_dim_end_' + attribute + '_' + clock_attr, 'cname_y_dim_end_f': 'y_dim_end_' + attribute + '_' + clock_attr, 'cname_z_dim_end_f': 'z_dim_end_' + attribute + '_' + clock_attr, 'cname_x_dim_jump_f': 'x_dim_jump_' + attribute + '_' + clock_attr, 'cname_y_dim_jump_f': 'y_dim_jump_' + attribute + '_' + clock_attr, 'cname_z_dim_jump_f': 'z_dim_jump_' + attribute + '_' + clock_attr, 'cname_x_dim_size_f': 'x_dim_size_' + attribute + '_' + clock_attr, 'cname_y_dim_size_f': 'y_dim_size_' + attribute + '_' + clock_attr, 'cname_z_dim_size_f': 'z_dim_size_' + attribute + '_' + clock_attr, 'cname_x_dim_jump_offset_f': 'x_dim_jump_offset_' + attribute + '_' + clock_attr, 'cname_y_dim_jump_offset_f': 'y_dim_jump_offset_' + attribute + '_' + clock_attr, 'cname_z_dim_jump_offset_f': 'z_dim_jump_offset_' + attribute + '_' + clock_attr}) cube_nests.append({'name': attribute, 'cubes': cube_list}) return cube_nests
def main() -> None: N = int(input()) S = [] T = [] for _ in range(N): S.append(input()) for _ in range(N): T.append(input()) assert 1 <= N <= 100 assert all(len(S_i) == N for S_i in S) assert all(len(T_i) == N for T_i in S) assert all(S_ij in ('.', '#') for S_i in S for S_ij in S_i) assert all(T_ij in ('.', '#') for T_i in T for T_ij in T_i) assert any(S_ij == '#' for S_i in S for S_ij in S_i) assert any(T_ij == '#' for T_i in T for T_ij in T_i) if __name__ == '__main__': main()
def main() -> None: n = int(input()) s = [] t = [] for _ in range(N): S.append(input()) for _ in range(N): T.append(input()) assert 1 <= N <= 100 assert all((len(S_i) == N for s_i in S)) assert all((len(T_i) == N for t_i in S)) assert all((S_ij in ('.', '#') for s_i in S for s_ij in S_i)) assert all((T_ij in ('.', '#') for t_i in T for t_ij in T_i)) assert any((S_ij == '#' for s_i in S for s_ij in S_i)) assert any((T_ij == '#' for t_i in T for t_ij in T_i)) if __name__ == '__main__': main()
""" --- Even the last --- Elementary You are given an array of integers. You should find the sum of the elements with even indexes (0th, 2nd, 4th...) then multiply this summed number and the final element of the array together. Don't forget that the first element has an index of 0. For an empty array, the result will always be 0 (zero). Input: A list of integers. Output: The number as an integer. How it is used: Indexes and slices are important elements of coding in python and other languages. This will come in handy down the road! Precondition: 0 <= len(array) <= 20 all(isinstance(x, int) for x in array) all(-100 < x < 100 for x in array) """ def my_solution(array): return sum(array[::2]) * array[-1] if array else 0 aggelgian_solution = lambda x: sum(x[::2]) * x[-1] if x else 0
""" --- Even the last --- Elementary You are given an array of integers. You should find the sum of the elements with even indexes (0th, 2nd, 4th...) then multiply this summed number and the final element of the array together. Don't forget that the first element has an index of 0. For an empty array, the result will always be 0 (zero). Input: A list of integers. Output: The number as an integer. How it is used: Indexes and slices are important elements of coding in python and other languages. This will come in handy down the road! Precondition: 0 <= len(array) <= 20 all(isinstance(x, int) for x in array) all(-100 < x < 100 for x in array) """ def my_solution(array): return sum(array[::2]) * array[-1] if array else 0 aggelgian_solution = lambda x: sum(x[::2]) * x[-1] if x else 0
def fib(n): if n == 1: return 1 return n + fib(n-1) def main(): n = 0 m = 1 result = 0 while n < 4000000: tmp = n n = n + m m = tmp if n % 2 == 0: result += n # print(n, n % 2) # print(n, result) print("Problem 2:", result)
def fib(n): if n == 1: return 1 return n + fib(n - 1) def main(): n = 0 m = 1 result = 0 while n < 4000000: tmp = n n = n + m m = tmp if n % 2 == 0: result += n print('Problem 2:', result)
# file path (load_data.py, main.py, and compute_relation_vectors.py) _SOURCE_DATA = '../data/source.csv' _TARGET_DATA = '../data/target.csv' _RESULT_FILE = '../results/results.csv' _MEAN_RELATION = '../results/relation_vectors_before.csv' _MODIFIED_MEAN_RELATINON = '../results/relation_vectors_after.csv' _COUNT_RELATINON = '../results/count_ver_relation_vectors.csv' # the number of labels _SOURCE_DIM_NUM=9 _TARGET_DIM_NUM=2 # for learning _FOLD_NUM = 10 _SORUCE_LATENT_TRAIN = True _TARGET_LATENT_TRAIN = True _DROPOUT_RATE = 0.01 _L2_REGULARIZE_RATE = 0.00001 # for setting models (models.py and main.py) _BATCH_SIZE=32 _OUT_DIM=188 # epoch (main.py) _SOURCE_EPOCH_NUM=5 _TARGET_EPOCH_NUM=5 # for compute_relation_vectors.py _ITERATION = 1000 _SAMPLING = 100 _EPS=1.0e-10 # method flag (main.py, and compute_relation_vectors.py)) _SCRATCH=0 _CONV_TRANSFER=1 _COUNT_ATDL=2 _MEAN_ATDL=3 _MODIFIED_MEAN_ATDL=4
_source_data = '../data/source.csv' _target_data = '../data/target.csv' _result_file = '../results/results.csv' _mean_relation = '../results/relation_vectors_before.csv' _modified_mean_relatinon = '../results/relation_vectors_after.csv' _count_relatinon = '../results/count_ver_relation_vectors.csv' _source_dim_num = 9 _target_dim_num = 2 _fold_num = 10 _soruce_latent_train = True _target_latent_train = True _dropout_rate = 0.01 _l2_regularize_rate = 1e-05 _batch_size = 32 _out_dim = 188 _source_epoch_num = 5 _target_epoch_num = 5 _iteration = 1000 _sampling = 100 _eps = 1e-10 _scratch = 0 _conv_transfer = 1 _count_atdl = 2 _mean_atdl = 3 _modified_mean_atdl = 4
class Instruction: def __init__(self, name): if not(name in dir(self)): raise Exception("Instruction not exists") self.name = name def execute(self, cpu, a, b, c): func = getattr(self,self.name) func(cpu, a, b, c) def addr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] + cpu[b] def addi(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] + b def mulr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] * cpu[b] def muli(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] * b def banr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] & cpu[b] def bani(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] & b def borr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] | cpu[b] def bori(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] | b def setr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] def seti(self, cpu, a, b, c): if not(self.checkRegister(c)): return False cpu[c] = a def gtir(self, cpu, a, b, c): if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = 1 if a > cpu[b] else 0 def gtri(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = 1 if cpu[a] > b else 0 def gtrr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = 1 if cpu[a] > cpu[b] else 0 def eqir(self, cpu, a, b, c): if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = 1 if a == cpu[b] else 0 def eqri(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = 1 if cpu[a] == b else 0 def eqrr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = 1 if cpu[a] == cpu[b] else 0 def checkRegister(self, x): return x >= 0 and x < 4 instructions = [Instruction(x) for x in dir(Instruction) if x[0]!="_" and not(x in ["checkRegister", "execute"])] print([i.name for i in instructions]) instructionsMap = [set() for x in instructions] counter = 0 program = list() with open("input.txt", "r") as file: line = file.readline() while line != "": if line.startswith("Before"): print(line, end="") registersBefore = list([int(x) for x in line[9:-2].split(",")]) line = file.readline() print(line, end="") op = list([int(x) for x in line.split(" ")]) line = file.readline() print(line, end="") registersAfter = list([int(x) for x in line[9:-2].split(",")]) possibleInstructions = list() for instruction in instructions: cpu = list(registersBefore) if instruction.execute(cpu, op[1], op[2], op[3]) != False and cpu == registersAfter: possibleInstructions.append(instruction) print([i.name for i in possibleInstructions]) if len(possibleInstructions) >= 3: counter+=1 if len(instructionsMap[op[0]]) == 0: instructionsMap[op[0]] = set(possibleInstructions) else: instructionsMap[op[0]] & set(possibleInstructions) elif line.strip() != "": program.append(list([int(x) for x in line.split(" ")])) line = file.readline() print(str(counter)+" behaves like 3 or more") for opCode, possibleInstructions in enumerate(instructionsMap): print("Opcode: "+str(opCode)+" - "+str([i.name for i in possibleInstructions])) finalMap = [None for x in instructions] wasChange = True while wasChange: wasChange = False for opCode, possibleInstructions in enumerate(instructionsMap): if len(possibleInstructions) == 1: wasChange = True toRemove = list(possibleInstructions)[0] finalMap[opCode] = toRemove for iSet in instructionsMap: iSet.discard(toRemove) break; for opCode, instruction in enumerate(finalMap): print("Opcode: "+str(opCode)+" - "+str(instruction.name if instruction != None else "None")) print("Executing program") cpu = [0, 0, 0, 0] for op in program: print(op) finalMap[op[0]].execute(cpu, op[1], op[2], op[3]) print("Cpu state: "+str(cpu))
class Instruction: def __init__(self, name): if not name in dir(self): raise exception('Instruction not exists') self.name = name def execute(self, cpu, a, b, c): func = getattr(self, self.name) func(cpu, a, b, c) def addr(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(b): return False if not self.checkRegister(c): return False cpu[c] = cpu[a] + cpu[b] def addi(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(c): return False cpu[c] = cpu[a] + b def mulr(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(b): return False if not self.checkRegister(c): return False cpu[c] = cpu[a] * cpu[b] def muli(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(c): return False cpu[c] = cpu[a] * b def banr(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(b): return False if not self.checkRegister(c): return False cpu[c] = cpu[a] & cpu[b] def bani(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(c): return False cpu[c] = cpu[a] & b def borr(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(b): return False if not self.checkRegister(c): return False cpu[c] = cpu[a] | cpu[b] def bori(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(c): return False cpu[c] = cpu[a] | b def setr(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(c): return False cpu[c] = cpu[a] def seti(self, cpu, a, b, c): if not self.checkRegister(c): return False cpu[c] = a def gtir(self, cpu, a, b, c): if not self.checkRegister(b): return False if not self.checkRegister(c): return False cpu[c] = 1 if a > cpu[b] else 0 def gtri(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(c): return False cpu[c] = 1 if cpu[a] > b else 0 def gtrr(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(b): return False if not self.checkRegister(c): return False cpu[c] = 1 if cpu[a] > cpu[b] else 0 def eqir(self, cpu, a, b, c): if not self.checkRegister(b): return False if not self.checkRegister(c): return False cpu[c] = 1 if a == cpu[b] else 0 def eqri(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(c): return False cpu[c] = 1 if cpu[a] == b else 0 def eqrr(self, cpu, a, b, c): if not self.checkRegister(a): return False if not self.checkRegister(b): return False if not self.checkRegister(c): return False cpu[c] = 1 if cpu[a] == cpu[b] else 0 def check_register(self, x): return x >= 0 and x < 4 instructions = [instruction(x) for x in dir(Instruction) if x[0] != '_' and (not x in ['checkRegister', 'execute'])] print([i.name for i in instructions]) instructions_map = [set() for x in instructions] counter = 0 program = list() with open('input.txt', 'r') as file: line = file.readline() while line != '': if line.startswith('Before'): print(line, end='') registers_before = list([int(x) for x in line[9:-2].split(',')]) line = file.readline() print(line, end='') op = list([int(x) for x in line.split(' ')]) line = file.readline() print(line, end='') registers_after = list([int(x) for x in line[9:-2].split(',')]) possible_instructions = list() for instruction in instructions: cpu = list(registersBefore) if instruction.execute(cpu, op[1], op[2], op[3]) != False and cpu == registersAfter: possibleInstructions.append(instruction) print([i.name for i in possibleInstructions]) if len(possibleInstructions) >= 3: counter += 1 if len(instructionsMap[op[0]]) == 0: instructionsMap[op[0]] = set(possibleInstructions) else: instructionsMap[op[0]] & set(possibleInstructions) elif line.strip() != '': program.append(list([int(x) for x in line.split(' ')])) line = file.readline() print(str(counter) + ' behaves like 3 or more') for (op_code, possible_instructions) in enumerate(instructionsMap): print('Opcode: ' + str(opCode) + ' - ' + str([i.name for i in possibleInstructions])) final_map = [None for x in instructions] was_change = True while wasChange: was_change = False for (op_code, possible_instructions) in enumerate(instructionsMap): if len(possibleInstructions) == 1: was_change = True to_remove = list(possibleInstructions)[0] finalMap[opCode] = toRemove for i_set in instructionsMap: iSet.discard(toRemove) break for (op_code, instruction) in enumerate(finalMap): print('Opcode: ' + str(opCode) + ' - ' + str(instruction.name if instruction != None else 'None')) print('Executing program') cpu = [0, 0, 0, 0] for op in program: print(op) finalMap[op[0]].execute(cpu, op[1], op[2], op[3]) print('Cpu state: ' + str(cpu))
''' modifier: 02 eqtime: 10 ''' def main(): info("Jan Air Sniff Pipette x1") gosub('jan:WaitForMiniboneAccess') gosub('jan:PrepareForAirShot') gosub('jan:EvacPipette2') gosub('common:FillPipette2') gosub('jan:PrepareForAirShotExpansion') close(name="M", description="Microbone to Getter NP-10H") sleep(duration=2.0) gosub('common:SniffPipette2')
""" modifier: 02 eqtime: 10 """ def main(): info('Jan Air Sniff Pipette x1') gosub('jan:WaitForMiniboneAccess') gosub('jan:PrepareForAirShot') gosub('jan:EvacPipette2') gosub('common:FillPipette2') gosub('jan:PrepareForAirShotExpansion') close(name='M', description='Microbone to Getter NP-10H') sleep(duration=2.0) gosub('common:SniffPipette2')
class Verdict: OK = 'OK' WA = 'WA' RE = 'RE' CE = 'CE' TL = 'TL' ML = 'ML' FAIL = 'FAIL' NR = 'NR'
class Verdict: ok = 'OK' wa = 'WA' re = 'RE' ce = 'CE' tl = 'TL' ml = 'ML' fail = 'FAIL' nr = 'NR'
# 2014.10.20 12:29:04 CEST typew = {'AROMATIC': 3.0, 'DOUBLE': 2.0, 'TRIPLE': 3.0, 'SINGLE': 1.0} heterow = {False: 2, True: 1} missingfragmentpenalty = 10.0 mims = {'H': 1.0078250321, 'He': 3.016029, 'Li': 6.015122, 'Be': 9.012182, 'B': 10.012937, 'C': 12.000000, 'N': 14.0030740052, 'O': 15.9949146221, 'F': 18.9984032, 'Ne': 19.992440, 'Na': 22.9897692809, 'Mg': 23.985042, 'Al': 26.981538, 'Si': 27.976927, 'P': 30.97376151, 'S': 31.97207069, 'Cl': 34.96885271, 'Ar': 35.967546, 'K': 38.96370668, 'Ca': 39.962591, 'Sc': 44.955910, 'Ti': 45.952629, 'V': 49.947163, 'Cr': 49.946050, 'Mn': 54.938050, 'Fe': 53.939615, 'Co': 58.933200, 'Ni': 57.935348, 'Cu': 62.929601, 'Zn': 63.929147, 'Ga': 68.925581, 'Ge': 69.924250, 'As': 74.921596, 'Se': 73.922477, 'Br': 78.9183376, 'Kr': 77.920386, 'Rb': 84.911789, 'Sr': 83.913425, 'Y': 88.905848, 'Zr': 89.904704, 'Nb': 92.906378, 'Mo': 91.906810, 'Tc': 97.907216, 'Ru': 95.907598, 'Rh': 102.905504, 'Pd': 101.905608, 'Ag': 106.905093, 'Cd': 105.906458, 'In': 112.904061, 'Sn': 111.904821, 'Sb': 120.903818, 'Te': 119.904020, 'I': 126.904468, 'Xe': 123.905896, 'Cs': 132.905447, 'Ba': 129.906310, 'La': 137.907107, 'Ce': 135.907144, 'Pr': 140.907648, 'Nd': 141.907719, 'Pm': 144.912744, 'Sm': 143.911995, 'Eu': 150.919846, 'Gd': 151.919788, 'Tb': 158.925343, 'Dy': 155.924278, 'Ho': 164.930319, 'Er': 161.928775, 'Tm': 168.934211, 'Yb': 167.933894, 'Lu': 174.940768, 'Hf': 173.940040, 'Ta': 179.947466, 'W': 179.946706, 'Re': 184.952956, 'Os': 183.952491, 'Ir': 190.960591, 'Pt': 189.959930, 'Au': 196.966552, 'Hg': 195.965815, 'Tl': 202.972329, 'Pb': 203.973029, 'Bi': 208.980383} Hmass = mims['H'] elmass = 0.0005486 ionmasses = {1: {'+H': mims['H'], '+NH4': mims['N'] + 4 * mims['H'], '+Na': mims['Na'], '-OH': -(mims['O'] + mims['H']), '+K': mims['K']}, -1: {'-H': -mims['H'], '+Cl': mims['Cl']}}
typew = {'AROMATIC': 3.0, 'DOUBLE': 2.0, 'TRIPLE': 3.0, 'SINGLE': 1.0} heterow = {False: 2, True: 1} missingfragmentpenalty = 10.0 mims = {'H': 1.0078250321, 'He': 3.016029, 'Li': 6.015122, 'Be': 9.012182, 'B': 10.012937, 'C': 12.0, 'N': 14.0030740052, 'O': 15.9949146221, 'F': 18.9984032, 'Ne': 19.99244, 'Na': 22.9897692809, 'Mg': 23.985042, 'Al': 26.981538, 'Si': 27.976927, 'P': 30.97376151, 'S': 31.97207069, 'Cl': 34.96885271, 'Ar': 35.967546, 'K': 38.96370668, 'Ca': 39.962591, 'Sc': 44.95591, 'Ti': 45.952629, 'V': 49.947163, 'Cr': 49.94605, 'Mn': 54.93805, 'Fe': 53.939615, 'Co': 58.9332, 'Ni': 57.935348, 'Cu': 62.929601, 'Zn': 63.929147, 'Ga': 68.925581, 'Ge': 69.92425, 'As': 74.921596, 'Se': 73.922477, 'Br': 78.9183376, 'Kr': 77.920386, 'Rb': 84.911789, 'Sr': 83.913425, 'Y': 88.905848, 'Zr': 89.904704, 'Nb': 92.906378, 'Mo': 91.90681, 'Tc': 97.907216, 'Ru': 95.907598, 'Rh': 102.905504, 'Pd': 101.905608, 'Ag': 106.905093, 'Cd': 105.906458, 'In': 112.904061, 'Sn': 111.904821, 'Sb': 120.903818, 'Te': 119.90402, 'I': 126.904468, 'Xe': 123.905896, 'Cs': 132.905447, 'Ba': 129.90631, 'La': 137.907107, 'Ce': 135.907144, 'Pr': 140.907648, 'Nd': 141.907719, 'Pm': 144.912744, 'Sm': 143.911995, 'Eu': 150.919846, 'Gd': 151.919788, 'Tb': 158.925343, 'Dy': 155.924278, 'Ho': 164.930319, 'Er': 161.928775, 'Tm': 168.934211, 'Yb': 167.933894, 'Lu': 174.940768, 'Hf': 173.94004, 'Ta': 179.947466, 'W': 179.946706, 'Re': 184.952956, 'Os': 183.952491, 'Ir': 190.960591, 'Pt': 189.95993, 'Au': 196.966552, 'Hg': 195.965815, 'Tl': 202.972329, 'Pb': 203.973029, 'Bi': 208.980383} hmass = mims['H'] elmass = 0.0005486 ionmasses = {1: {'+H': mims['H'], '+NH4': mims['N'] + 4 * mims['H'], '+Na': mims['Na'], '-OH': -(mims['O'] + mims['H']), '+K': mims['K']}, -1: {'-H': -mims['H'], '+Cl': mims['Cl']}}
for i in range(1, 101): name = str(i) name = name + ".txt" print(name) print(type(name)) arq = open(name, "w") arq.close();
for i in range(1, 101): name = str(i) name = name + '.txt' print(name) print(type(name)) arq = open(name, 'w') arq.close()
guild = """CREATE TABLE IF NOT EXISTS guild (guild_id bigint NOT NULL, guild_name varchar(100) NOT NULL, prefix varchar(5), server_log bigint, mod_log bigint, ignored_channel bigint[], lockdown_channel bigint[], filter_ignored_channel bigint[], profanity_check boolean DEFAULT false, invite_link boolean DEFAULT false, PRIMARY KEY(guild_id))""" bonafidecoin = """CREATE TABLE IF NOT EXISTS bonafidecoin (guild_id bigint NOT NULL, user_id bigint NOT NULL, wallet int, bank int, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE)""" cog_check = """CREATE TABLE IF NOT EXISTS cog_check (guild_id bigint NOT NULL, cog_name text, enabled boolean, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE)""" filter = """CREATE TABLE IF NOT EXISTS filter (guild_id bigint NOT NULL, keyword text UNIQUE, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ level = """CREATE TABLE IF NOT EXISTS level(guild_id bigint NOT NULL, user_id bigint NOT NULL, total_xp int, current_xp int, required_xp int, lvl int, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ mod_logs = """CREATE TABLE IF NOT EXISTS mod_logs(guild_id bigint NOT NULL, user_id bigint NOT NULL, moderator bigint NOT NULL, reason text, created_at timestamp, type text, case_no int, message_id bigint, duration timestamp, action boolean DEFAULT true, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild( guild_id) ON DELETE CASCADE) """ roles = """CREATE TABLE IF NOT EXISTS roles (guild_id bigint NOT NULL, user_id bigint NOT NULL, role_id bigint NOT NULL, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ shop = """CREATE TABLE IF NOT EXISTS shop (guild_id bigint NOT NULL, items text UNIQUE, value int, role_id bigint, description text, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ stats = """CREATE TABLE IF NOT EXISTS stats (guild_id bigint NOT NULL, user_id bigint NOT NULL, message_count int, created_at date, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ stats_server = """CREATE TABLE IF NOT EXISTS stats_server(guild_id bigint, member_count int, created_at date, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ tags = """CREATE TABLE IF NOT EXISTS tag(guild_id bigint NOT NULL, creator bigint NOT NULL, name text UNIQUE, description text, created_at timestamp, uses int, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild( guild_id) ON DELETE CASCADE) """ user_inventory = """CREATE TABLE IF NOT EXISTS stats (guild_id bigint NOT NULL, user_id bigint NOT NULL, items text, value int, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ role_check = """CREATE TABLE IF NOT EXISTS role_check (guild_id bigint, cog_name text, role_id bigint, enabled boolean, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE); """
guild = 'CREATE TABLE IF NOT EXISTS guild (guild_id bigint NOT NULL, guild_name varchar(100) NOT NULL,\nprefix varchar(5), server_log bigint, mod_log bigint, ignored_channel bigint[], lockdown_channel bigint[],\nfilter_ignored_channel bigint[], profanity_check boolean DEFAULT false, invite_link boolean DEFAULT false,\nPRIMARY KEY(guild_id))' bonafidecoin = 'CREATE TABLE IF NOT EXISTS bonafidecoin (guild_id bigint NOT NULL, user_id bigint NOT NULL,\nwallet int, bank int, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE)' cog_check = 'CREATE TABLE IF NOT EXISTS cog_check (guild_id bigint NOT NULL, cog_name text, enabled boolean,\n CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE)' filter = 'CREATE TABLE IF NOT EXISTS filter (guild_id bigint NOT NULL, keyword text UNIQUE, CONSTRAINT fk_guild\nFOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) ' level = 'CREATE TABLE IF NOT EXISTS level(guild_id bigint NOT NULL, user_id bigint NOT NULL, total_xp int,\ncurrent_xp int, required_xp int, lvl int, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id)\nON DELETE CASCADE) ' mod_logs = 'CREATE TABLE IF NOT EXISTS mod_logs(guild_id bigint NOT NULL, user_id bigint NOT NULL, moderator\nbigint NOT NULL, reason text, created_at timestamp, type text, case_no int, message_id bigint,\nduration timestamp, action boolean DEFAULT true, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(\nguild_id) ON DELETE CASCADE) ' roles = 'CREATE TABLE IF NOT EXISTS roles (guild_id bigint NOT NULL, user_id bigint NOT NULL, role_id bigint\nNOT NULL, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) ' shop = 'CREATE TABLE IF NOT EXISTS shop (guild_id bigint NOT NULL, items text UNIQUE, value int, role_id bigint,\ndescription text, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) ' stats = 'CREATE TABLE IF NOT EXISTS stats (guild_id bigint NOT NULL, user_id bigint NOT NULL, message_count\nint, created_at date, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE\nCASCADE) ' stats_server = 'CREATE TABLE IF NOT EXISTS stats_server(guild_id bigint, member_count int, created_at date,\nCONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) ' tags = 'CREATE TABLE IF NOT EXISTS tag(guild_id bigint NOT NULL, creator bigint NOT NULL, name text UNIQUE,\ndescription text, created_at timestamp, uses int, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(\nguild_id) ON DELETE CASCADE) ' user_inventory = 'CREATE TABLE IF NOT EXISTS stats (guild_id bigint NOT NULL, user_id bigint NOT NULL,\nitems text, value int, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) ' role_check = 'CREATE TABLE IF NOT EXISTS role_check (guild_id bigint, cog_name text, role_id bigint,\nenabled boolean, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE); '
def post_to_dict(post): data = {} data["owner_username"] = post.owner_username data["owner_id"] = post.owner_id data["post_date"] = post.date_utc data["post_caption"] = post.caption data["tagged_users"] = post.tagged_users data["caption_mentions"] = post.caption_mentions data["is_video"] = post.is_video data["video_view_count"] = post.video_view_count data["video_duration"] = post.video_duration data["likes"] = post.likes data["comments"] = post.comments data["post_url"] = "https://www.instagram.com/p/"+post.shortcode data["hashtags_caption"] = post.caption_hashtags return data
def post_to_dict(post): data = {} data['owner_username'] = post.owner_username data['owner_id'] = post.owner_id data['post_date'] = post.date_utc data['post_caption'] = post.caption data['tagged_users'] = post.tagged_users data['caption_mentions'] = post.caption_mentions data['is_video'] = post.is_video data['video_view_count'] = post.video_view_count data['video_duration'] = post.video_duration data['likes'] = post.likes data['comments'] = post.comments data['post_url'] = 'https://www.instagram.com/p/' + post.shortcode data['hashtags_caption'] = post.caption_hashtags return data
class Solution: def equationsPossible(self, equations: List[str]) -> bool: parent = {} def findParent(x): if x not in parent: parent[x] = x else: while parent[x] != x: parent[x] = parent[parent[x]] x = parent[x] return x for eq in equations: if eq[1] == '=': x, y = eq[0], eq[3] px = findParent(x) py = findParent(y) parent[px] = py for eq in equations: if eq[1] == '!': x, y = eq[0], eq[3] px = findParent(x) py = findParent(y) if px == py: return False return True
class Solution: def equations_possible(self, equations: List[str]) -> bool: parent = {} def find_parent(x): if x not in parent: parent[x] = x else: while parent[x] != x: parent[x] = parent[parent[x]] x = parent[x] return x for eq in equations: if eq[1] == '=': (x, y) = (eq[0], eq[3]) px = find_parent(x) py = find_parent(y) parent[px] = py for eq in equations: if eq[1] == '!': (x, y) = (eq[0], eq[3]) px = find_parent(x) py = find_parent(y) if px == py: return False return True
def new_decorator(func): def wrapper_func(): print('code before executing func') func() print('func() has been called') return wrapper_func @new_decorator def func_needs_decorator(): print('this function is in need of decorator!') # func_needs_decorator() # before adding @new_decorator # decorator = new_decorator(func_needs_decorator) # print(decorator) # decorator() # after adding @new_decorator func_needs_decorator()
def new_decorator(func): def wrapper_func(): print('code before executing func') func() print('func() has been called') return wrapper_func @new_decorator def func_needs_decorator(): print('this function is in need of decorator!') func_needs_decorator()
class Stats: def min(dataset): value = dataset[0] for data in dataset: if data < value: value = data return value def max(dataset): value = dataset[0] for data in dataset: if data > value: value = data return value def range(dataset): return Stats.max(dataset) - Stats.min(dataset) def mean(dataset): total = 0 terms = 0 for value in dataset: total += value terms += 1 return float(total) / float(terms) def variance(dataset): terms = 0 total = 0.0 for value in dataset: total += (value - Stats.mean(dataset))**(2) terms += 1 return float(total) / float(terms) def standard_deviation(dataset): return Stats.variance(dataset)**(1.0/2.0) def median(dataset): dataset.sort() if len(dataset) % 2 == 0: value_1 = dataset[int(len(dataset) / 2)] value_2 = dataset[int(len(dataset) / 2 - 1)] return (float(value_1) + float(value_2)) / 2 else: return dataset[int(len(dataset) / 2)] def mode(dataset): dataset.sort() occurences = {} tracker = 0 while tracker < len(dataset): if f'{dataset[tracker]}' not in occurences.keys(): occurences[f'{dataset[tracker]}'] = 1 else: occurences[f'{dataset[tracker]}'] += 1 tracker += 1 greatest = -100000000000 for key in occurences.keys(): if occurences[key] > greatest: greatest = occurences[key] greatest_list = [] for key in occurences.keys(): if occurences[key] == greatest: greatest_list.append(key) return greatest_list
class Stats: def min(dataset): value = dataset[0] for data in dataset: if data < value: value = data return value def max(dataset): value = dataset[0] for data in dataset: if data > value: value = data return value def range(dataset): return Stats.max(dataset) - Stats.min(dataset) def mean(dataset): total = 0 terms = 0 for value in dataset: total += value terms += 1 return float(total) / float(terms) def variance(dataset): terms = 0 total = 0.0 for value in dataset: total += (value - Stats.mean(dataset)) ** 2 terms += 1 return float(total) / float(terms) def standard_deviation(dataset): return Stats.variance(dataset) ** (1.0 / 2.0) def median(dataset): dataset.sort() if len(dataset) % 2 == 0: value_1 = dataset[int(len(dataset) / 2)] value_2 = dataset[int(len(dataset) / 2 - 1)] return (float(value_1) + float(value_2)) / 2 else: return dataset[int(len(dataset) / 2)] def mode(dataset): dataset.sort() occurences = {} tracker = 0 while tracker < len(dataset): if f'{dataset[tracker]}' not in occurences.keys(): occurences[f'{dataset[tracker]}'] = 1 else: occurences[f'{dataset[tracker]}'] += 1 tracker += 1 greatest = -100000000000 for key in occurences.keys(): if occurences[key] > greatest: greatest = occurences[key] greatest_list = [] for key in occurences.keys(): if occurences[key] == greatest: greatest_list.append(key) return greatest_list
######## # PART 1 # on python 3.7+ can just call pow(base, exp, mod), no need to implement anything! def modexp(base, exp, mod): ''' mod exp by repeated squaring ''' res = 1 cur = base while (exp > 0): if (exp % 2 == 1): res = (res * cur) % mod exp = exp >> 1 cur = (cur * cur) % mod return res # To continue, please consult the code grid in the manual. Enter the code at row 2981, column 3075. row, col = (2981, 3075) firstcode = 20151125 base = 252533 mod = 33554393 diag = row + col - 1 exp = diag * (diag - 1) // 2 + col - 1 answer = modexp(base, exp, mod) * firstcode % mod print("Part 1 =", answer) assert answer == 9132360 # check with accepted answer
def modexp(base, exp, mod): """ mod exp by repeated squaring """ res = 1 cur = base while exp > 0: if exp % 2 == 1: res = res * cur % mod exp = exp >> 1 cur = cur * cur % mod return res (row, col) = (2981, 3075) firstcode = 20151125 base = 252533 mod = 33554393 diag = row + col - 1 exp = diag * (diag - 1) // 2 + col - 1 answer = modexp(base, exp, mod) * firstcode % mod print('Part 1 =', answer) assert answer == 9132360
# swap it to get solution fin = open("pic.png", "rb") fout = open("../public/file.bin", "wb") data = fin.read()[::-1] result = bytearray() for byte in data: high = byte >> 4 low = byte & 0xF rbyte = (low << 4) + high result.append(rbyte) fout.write(result) fout.close()
fin = open('pic.png', 'rb') fout = open('../public/file.bin', 'wb') data = fin.read()[::-1] result = bytearray() for byte in data: high = byte >> 4 low = byte & 15 rbyte = (low << 4) + high result.append(rbyte) fout.write(result) fout.close()
WTF_CSRF_ENABLED = True SECRET_KEY = 'you-will-never-guess' projects = {}
wtf_csrf_enabled = True secret_key = 'you-will-never-guess' projects = {}
# some specific relevant fields timestamp_field = 'requestInTs' service_call_fields = ["clientMemberClass", "clientMemberCode", "clientXRoadInstance", "clientSubsystemCode", "serviceCode", "serviceVersion", "serviceMemberClass", "serviceMemberCode", "serviceXRoadInstance", "serviceSubsystemCode"] # Fields to query from the database # 'relevant_cols_general' are fields that are present on the top level relevant_cols_general = ["_id", 'totalDuration', 'producerDurationProducerView', 'requestNwDuration', 'responseNwDuration', 'correctorStatus'] # 'relevant_cols_nested' are fields that are nested inside 'client' and 'producer'. # If 'client' is present, values for these fields will be taken from there, otherwise from 'producer'. relevant_cols_nested = service_call_fields + ["succeeded", "messageId", timestamp_field] # 'relevant_cols_general_alternative' are fields that are present on the top level, but exist for both client and producer. # The value will be taken from the field assigned in the second position in the triplet if it exists, # otherwise from the third field. The first value in the triplet is the name that will be used. # Example: metric 'requestSize' will be assigned value from database field 'clientRequestSize' if it exists, # otherwise from the database field 'producerRequestSize'. relevant_cols_general_alternative = [('requestSize', 'clientRequestSize', 'producerRequestSize'), ('responseSize', 'clientResponseSize', 'producerResponseSize')] # some possible aggregation windows hour_aggregation_time_window = {'agg_window_name': 'hour', 'agg_minutes': 60, 'pd_timeunit': 'h'} day_aggregation_time_window = {'agg_window_name': 'day', 'agg_minutes': 1440, 'pd_timeunit': 'd'} # for historic averages model, we also need to determine which are the "similar" periods hour_weekday_similarity_time_window = {'timeunit_name': 'hour_weekday', 'agg_window': hour_aggregation_time_window, 'similar_periods': ['hour', 'weekday']} weekday_similarity_time_window = {'timeunit_name': 'weekday', 'agg_window': day_aggregation_time_window, 'similar_periods': ['weekday']} hour_monthday_similarity_time_window = {'timeunit_name': 'hour_monthday', 'agg_window': hour_aggregation_time_window, 'similar_periods': ['hour', 'day']} monthday_similarity_time_window = {'timeunit_name': 'monthday', 'agg_window': day_aggregation_time_window, 'similar_periods': ['day']} # which windows are actually used time_windows = {"failed_request_ratio": hour_aggregation_time_window, "duplicate_message_ids": day_aggregation_time_window, "time_sync_errors": hour_aggregation_time_window} historic_averages_time_windows = [(hour_weekday_similarity_time_window, "update"), (weekday_similarity_time_window, "update")] # set the relevant fields (metrics) that will be monitored, aggregation functions to apply # and their anomaly confidence thresholds for the historic averages model historic_averages_thresholds = {'request_count': 0.95, 'mean_request_size': 0.95, 'mean_response_size': 0.95, 'mean_client_duration': 0.95, 'mean_producer_duration': 0.95} # set the relevant fields for monitoring time sync anomalies, and the respective minimum value threshold time_sync_monitored_lower_thresholds = {'requestNwDuration': -1000, 'responseNwDuration': -1000} # set the ratio of allowed failed requests per time window failed_request_ratio_threshold = 0.9 corrector_buffer_time = 14400 # minutes incident_expiration_time = 14400 # minutes training_period_time = 3 # months
timestamp_field = 'requestInTs' service_call_fields = ['clientMemberClass', 'clientMemberCode', 'clientXRoadInstance', 'clientSubsystemCode', 'serviceCode', 'serviceVersion', 'serviceMemberClass', 'serviceMemberCode', 'serviceXRoadInstance', 'serviceSubsystemCode'] relevant_cols_general = ['_id', 'totalDuration', 'producerDurationProducerView', 'requestNwDuration', 'responseNwDuration', 'correctorStatus'] relevant_cols_nested = service_call_fields + ['succeeded', 'messageId', timestamp_field] relevant_cols_general_alternative = [('requestSize', 'clientRequestSize', 'producerRequestSize'), ('responseSize', 'clientResponseSize', 'producerResponseSize')] hour_aggregation_time_window = {'agg_window_name': 'hour', 'agg_minutes': 60, 'pd_timeunit': 'h'} day_aggregation_time_window = {'agg_window_name': 'day', 'agg_minutes': 1440, 'pd_timeunit': 'd'} hour_weekday_similarity_time_window = {'timeunit_name': 'hour_weekday', 'agg_window': hour_aggregation_time_window, 'similar_periods': ['hour', 'weekday']} weekday_similarity_time_window = {'timeunit_name': 'weekday', 'agg_window': day_aggregation_time_window, 'similar_periods': ['weekday']} hour_monthday_similarity_time_window = {'timeunit_name': 'hour_monthday', 'agg_window': hour_aggregation_time_window, 'similar_periods': ['hour', 'day']} monthday_similarity_time_window = {'timeunit_name': 'monthday', 'agg_window': day_aggregation_time_window, 'similar_periods': ['day']} time_windows = {'failed_request_ratio': hour_aggregation_time_window, 'duplicate_message_ids': day_aggregation_time_window, 'time_sync_errors': hour_aggregation_time_window} historic_averages_time_windows = [(hour_weekday_similarity_time_window, 'update'), (weekday_similarity_time_window, 'update')] historic_averages_thresholds = {'request_count': 0.95, 'mean_request_size': 0.95, 'mean_response_size': 0.95, 'mean_client_duration': 0.95, 'mean_producer_duration': 0.95} time_sync_monitored_lower_thresholds = {'requestNwDuration': -1000, 'responseNwDuration': -1000} failed_request_ratio_threshold = 0.9 corrector_buffer_time = 14400 incident_expiration_time = 14400 training_period_time = 3
class Mesh(GeometryObject,IDisposable): """ A triangular mesh. """ def Dispose(self): """ Dispose(self: Mesh,A_0: bool) """ pass def ReleaseManagedResources(self,*args): """ ReleaseManagedResources(self: APIObject) """ pass def ReleaseUnmanagedResources(self,*args): """ ReleaseUnmanagedResources(self: GeometryObject) """ pass def __enter__(self,*args): """ __enter__(self: IDisposable) -> object """ pass def __exit__(self,*args): """ __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """ pass def __init__(self,*args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass MaterialElementId=property(lambda self: object(),lambda self,v: None,lambda self: None) """Element ID of the material from which this mesh is composed. Get: MaterialElementId(self: Mesh) -> ElementId """ NumTriangles=property(lambda self: object(),lambda self,v: None,lambda self: None) """The number of triangles that the mesh contains. Get: NumTriangles(self: Mesh) -> int """ Vertices=property(lambda self: object(),lambda self,v: None,lambda self: None) """Retrieves all vertices used to define this mesh. Intended for indexed access. Get: Vertices(self: Mesh) -> IList[XYZ] """
class Mesh(GeometryObject, IDisposable): """ A triangular mesh. """ def dispose(self): """ Dispose(self: Mesh,A_0: bool) """ pass def release_managed_resources(self, *args): """ ReleaseManagedResources(self: APIObject) """ pass def release_unmanaged_resources(self, *args): """ ReleaseUnmanagedResources(self: GeometryObject) """ pass def __enter__(self, *args): """ __enter__(self: IDisposable) -> object """ pass def __exit__(self, *args): """ __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """ pass def __init__(self, *args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass material_element_id = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Element ID of the material from which this mesh is composed.\n\n\n\nGet: MaterialElementId(self: Mesh) -> ElementId\n\n\n\n' num_triangles = property(lambda self: object(), lambda self, v: None, lambda self: None) 'The number of triangles that the mesh contains.\n\n\n\nGet: NumTriangles(self: Mesh) -> int\n\n\n\n' vertices = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Retrieves all vertices used to define this mesh. Intended for indexed access.\n\n\n\nGet: Vertices(self: Mesh) -> IList[XYZ]\n\n\n\n'
n, k = map(int, input().split()) graph = [] printInfo = [] for i in range(n): graph.append([]) for i in range(k): oper, u, v = input().split() u = int(u) - 1 v = int(v) - 1 if oper == '+': graph[u] += [v] graph[v] += [u] if oper == '?': if not(graph[u] and graph[v]): printInfo += ['?'] elif set(graph[u]) & set(graph[v]): printInfo += ['+'] else: printInfo += ['-'] for info in printInfo: print(info)
(n, k) = map(int, input().split()) graph = [] print_info = [] for i in range(n): graph.append([]) for i in range(k): (oper, u, v) = input().split() u = int(u) - 1 v = int(v) - 1 if oper == '+': graph[u] += [v] graph[v] += [u] if oper == '?': if not (graph[u] and graph[v]): print_info += ['?'] elif set(graph[u]) & set(graph[v]): print_info += ['+'] else: print_info += ['-'] for info in printInfo: print(info)
# A colection of key value pairs # Keys need to be a string my_dict = {'name':'john', 'age':27, 'gender':'male', 'subs': ['Eng', 'Math', 'Sci'], 'marks':(58, 79,63)} print(my_dict['name']) print(my_dict['age']) my_dict['age'] += 3 print(my_dict['age']) print(my_dict['subs']) print(my_dict['marks']) print(my_dict['subs'][1],end='--') print(my_dict['marks'][1]) # Other ways to make a dictionary d = {} d['key1'] = 'value1' d['key2'] = 'value2' print(d) # Dictionary nested inside a dictionary nested inside a dictionary d = {'key1':{'nestkey':{'subnestkey':'value'}}} print(d['key1']['nestkey']['subnestkey']) # DIctionary methods d = {'key1':1, 'key2':2} print(d.keys()) print(d.values()) print(d.items())
my_dict = {'name': 'john', 'age': 27, 'gender': 'male', 'subs': ['Eng', 'Math', 'Sci'], 'marks': (58, 79, 63)} print(my_dict['name']) print(my_dict['age']) my_dict['age'] += 3 print(my_dict['age']) print(my_dict['subs']) print(my_dict['marks']) print(my_dict['subs'][1], end='--') print(my_dict['marks'][1]) d = {} d['key1'] = 'value1' d['key2'] = 'value2' print(d) d = {'key1': {'nestkey': {'subnestkey': 'value'}}} print(d['key1']['nestkey']['subnestkey']) d = {'key1': 1, 'key2': 2} print(d.keys()) print(d.values()) print(d.items())
simulation_parameters = { 'temperature', 'integrator', 'collisions_rate', 'integration_timestep', 'initial_velocities_to_temperature', 'constraint_tolerance', 'platform', 'cuda_precision' } def is_simulation_dict(dictionary): keys=set(dictionary.keys()) output = (keys <= simulation_parameters) return output
simulation_parameters = {'temperature', 'integrator', 'collisions_rate', 'integration_timestep', 'initial_velocities_to_temperature', 'constraint_tolerance', 'platform', 'cuda_precision'} def is_simulation_dict(dictionary): keys = set(dictionary.keys()) output = keys <= simulation_parameters return output
""" isValidIP("0.0.0.0") ==> true isValidIP("12.255.56.1") ==> true isValidIP("137.255.156.100") ==> true isValidIP('') ==> false isValidIP('abc.def.ghi.jkl') ==> false isValidIP('123.456.789.0') ==> false isValidIP('12.34.56') ==> false isValidIP('01.02.03.04') ==> false """ def isValidIP(string): info = string.split('.') if len(string) < 1: return(False) if len(info) == 4: for x in info: if x.isdigit() == False: return False elif len(x) > 1 and x[0] == "0": return False elif x == "": return False elif x.isdigit() == True and (int(x)>= 0 and int(x)<=255): pass else: return False return True else: return False print(isValidIP("0.0.0.0")) print(isValidIP("12.255.56.1")) print(isValidIP("137.255.156.100")) print(isValidIP('')) # DONE print(isValidIP('abc.def.ghi.jkl')) # DONE print(isValidIP('123.456.789.0')) # DONE print(isValidIP('12.34.56')) # DONE print(isValidIP('01.02.03.04')) print(isValidIP('12.34.56.')) # print(isValidIP('1.34.56.9'))
""" isValidIP("0.0.0.0") ==> true isValidIP("12.255.56.1") ==> true isValidIP("137.255.156.100") ==> true isValidIP('') ==> false isValidIP('abc.def.ghi.jkl') ==> false isValidIP('123.456.789.0') ==> false isValidIP('12.34.56') ==> false isValidIP('01.02.03.04') ==> false """ def is_valid_ip(string): info = string.split('.') if len(string) < 1: return False if len(info) == 4: for x in info: if x.isdigit() == False: return False elif len(x) > 1 and x[0] == '0': return False elif x == '': return False elif x.isdigit() == True and (int(x) >= 0 and int(x) <= 255): pass else: return False return True else: return False print(is_valid_ip('0.0.0.0')) print(is_valid_ip('12.255.56.1')) print(is_valid_ip('137.255.156.100')) print(is_valid_ip('')) print(is_valid_ip('abc.def.ghi.jkl')) print(is_valid_ip('123.456.789.0')) print(is_valid_ip('12.34.56')) print(is_valid_ip('01.02.03.04')) print(is_valid_ip('12.34.56.'))
""" Regression utils """ class Regressor(object): def __init__(self): pass def fit(self): pass
""" Regression utils """ class Regressor(object): def __init__(self): pass def fit(self): pass
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"triee": "00_core.ipynb", "cov": "01_oval_clean.ipynb", "numpts": "01_oval_clean.ipynb", "Points": "01_oval_clean.ipynb", "vlen": "01_oval_clean.ipynb", "major": "01_oval_clean.ipynb", "minor": "01_oval_clean.ipynb", "x_vec": "01_oval_clean.ipynb", "dot": "01_oval_clean.ipynb", "ang": "01_oval_clean.ipynb", "rat": "01_oval_clean.ipynb", "major_length": "01_oval_clean.ipynb", "minor_length": "01_oval_clean.ipynb", "transform_x": "01_oval_clean.ipynb", "transform_y": "01_oval_clean.ipynb", "cos": "01_oval_clean.ipynb", "sin": "01_oval_clean.ipynb", "theta": "01_oval_clean.ipynb", "x": "01_oval_clean.ipynb", "y": "01_oval_clean.ipynb", "x_oval": "01_oval_clean.ipynb", "y_oval": "01_oval_clean.ipynb", "Points_map": "01_oval_clean.ipynb", "boundary": "01_oval_clean.ipynb", "xx": "01_oval_clean.ipynb", "y1": "01_oval_clean.ipynb", "y2": "01_oval_clean.ipynb", "layer_init": "02_NN.ipynb", "linear": "02_NN.ipynb", "fetch": "03_NN_numpy.ipynb", "mnist": "03_NN_numpy.ipynb", "kaiming_uniform": "03_NN_numpy.ipynb", "kaiming_normal": "03_NN_numpy.ipynb", "stat": "03_NN_numpy.ipynb", "Linear": "03_NN_numpy.ipynb", "MSELoss": "03_NN_numpy.ipynb", "NNL": "03_NN_numpy.ipynb", "CELoss": "03_NN_numpy.ipynb", "SGD": "03_NN_numpy.ipynb", "Adam": "03_NN_numpy.ipynb", "Sequential": "03_NN_numpy.ipynb", "Conv": "03_NN_numpy.ipynb", "naive": "03_NN_numpy.ipynb", "Conv_dump": "03_NN_numpy.ipynb", "Flatten": "03_NN_numpy.ipynb", "people": "04_DNAA.ipynb", "data": "04_DNAA.ipynb", "frags": "04_DNAA.ipynb", "checkppl": "04_DNAA.ipynb"} modules = ["core.py", "to_submit.py", "nn.py", "nnsig.py", "dnaa.py"] doc_url = "https://Kelvinthedrugger.github.io/HWs/" git_url = "https://github.com/Kelvinthedrugger/HWs/tree/master/" def custom_doc_links(name): return None
__all__ = ['index', 'modules', 'custom_doc_links', 'git_url'] index = {'triee': '00_core.ipynb', 'cov': '01_oval_clean.ipynb', 'numpts': '01_oval_clean.ipynb', 'Points': '01_oval_clean.ipynb', 'vlen': '01_oval_clean.ipynb', 'major': '01_oval_clean.ipynb', 'minor': '01_oval_clean.ipynb', 'x_vec': '01_oval_clean.ipynb', 'dot': '01_oval_clean.ipynb', 'ang': '01_oval_clean.ipynb', 'rat': '01_oval_clean.ipynb', 'major_length': '01_oval_clean.ipynb', 'minor_length': '01_oval_clean.ipynb', 'transform_x': '01_oval_clean.ipynb', 'transform_y': '01_oval_clean.ipynb', 'cos': '01_oval_clean.ipynb', 'sin': '01_oval_clean.ipynb', 'theta': '01_oval_clean.ipynb', 'x': '01_oval_clean.ipynb', 'y': '01_oval_clean.ipynb', 'x_oval': '01_oval_clean.ipynb', 'y_oval': '01_oval_clean.ipynb', 'Points_map': '01_oval_clean.ipynb', 'boundary': '01_oval_clean.ipynb', 'xx': '01_oval_clean.ipynb', 'y1': '01_oval_clean.ipynb', 'y2': '01_oval_clean.ipynb', 'layer_init': '02_NN.ipynb', 'linear': '02_NN.ipynb', 'fetch': '03_NN_numpy.ipynb', 'mnist': '03_NN_numpy.ipynb', 'kaiming_uniform': '03_NN_numpy.ipynb', 'kaiming_normal': '03_NN_numpy.ipynb', 'stat': '03_NN_numpy.ipynb', 'Linear': '03_NN_numpy.ipynb', 'MSELoss': '03_NN_numpy.ipynb', 'NNL': '03_NN_numpy.ipynb', 'CELoss': '03_NN_numpy.ipynb', 'SGD': '03_NN_numpy.ipynb', 'Adam': '03_NN_numpy.ipynb', 'Sequential': '03_NN_numpy.ipynb', 'Conv': '03_NN_numpy.ipynb', 'naive': '03_NN_numpy.ipynb', 'Conv_dump': '03_NN_numpy.ipynb', 'Flatten': '03_NN_numpy.ipynb', 'people': '04_DNAA.ipynb', 'data': '04_DNAA.ipynb', 'frags': '04_DNAA.ipynb', 'checkppl': '04_DNAA.ipynb'} modules = ['core.py', 'to_submit.py', 'nn.py', 'nnsig.py', 'dnaa.py'] doc_url = 'https://Kelvinthedrugger.github.io/HWs/' git_url = 'https://github.com/Kelvinthedrugger/HWs/tree/master/' def custom_doc_links(name): return None
def findMinHeightTrees(n, edges): ''' :param n: int :param edges: List[List[int]] :return: List[int] ''' # create n empty set object tree = [set() for _ in range(n)] # u as vertex, v denotes neighbor vertices # set add method ensure no repeat neighbor vertices for u, v in edges: tree[u].add(v), tree[v].add(u) # q and nq are list # q save leaf node # nq is empty q, nq = [x for x in range(n) if len(tree[x]) < 2], [] while True: for x in q: # check y in tree[x] for y in tree[x]: # delete x in tree[y] tree[y].remove(x) if len(tree[y]) == 1: nq.append(y) # when nq is empty, quit the loop if not nq: break nq, q = [], nq return q # test n = 6 edges = [[0, 3], [1, 3], [2, 3], [4, 3], [5, 4]] print(findMinHeightTrees(n, edges))
def find_min_height_trees(n, edges): """ :param n: int :param edges: List[List[int]] :return: List[int] """ tree = [set() for _ in range(n)] for (u, v) in edges: (tree[u].add(v), tree[v].add(u)) (q, nq) = ([x for x in range(n) if len(tree[x]) < 2], []) while True: for x in q: for y in tree[x]: tree[y].remove(x) if len(tree[y]) == 1: nq.append(y) if not nq: break (nq, q) = ([], nq) return q n = 6 edges = [[0, 3], [1, 3], [2, 3], [4, 3], [5, 4]] print(find_min_height_trees(n, edges))
def solution(number): sum = 0 for x in range(1,number): if x % 3 == 0: sum +=x elif x % 5 == 0: sum +=x elif x % 3 and x % 5 == 0: continue return sum
def solution(number): sum = 0 for x in range(1, number): if x % 3 == 0: sum += x elif x % 5 == 0: sum += x elif x % 3 and x % 5 == 0: continue return sum
class AbstractCrawler: def __init__(self, num, init): self.num = num self.init = init def crawl(self, es, client, process): raise NotImplementedError("This should be implemented.")
class Abstractcrawler: def __init__(self, num, init): self.num = num self.init = init def crawl(self, es, client, process): raise not_implemented_error('This should be implemented.')
height = int(input()) for i in range(1, height + 1): value = 3 * height - i - 1 for j in range(1,i+1): if(i == height): print(height + j - 1,end=" ") elif(j == 1): print(i,end=" ") elif(j == i): print(value,end=" ") else: print(end=" ") print() # Sample Input :- 5 # Output :- # 1 # 2 12 # 3 11 # 4 10 # 5 6 7 8 9
height = int(input()) for i in range(1, height + 1): value = 3 * height - i - 1 for j in range(1, i + 1): if i == height: print(height + j - 1, end=' ') elif j == 1: print(i, end=' ') elif j == i: print(value, end=' ') else: print(end=' ') print()
x = 5 print(type(x)); x = "6" print(type(x)) x = 5.0 print(type(x)) x = 3.45 print(type(x))
x = 5 print(type(x)) x = '6' print(type(x)) x = 5.0 print(type(x)) x = 3.45 print(type(x))
class Solution: def plusOne(self, digits): """ :type digits: List[int] :rtype: List[int] """ return list(map(int, str(int(''.join(map(str, digits))) + 1)))
class Solution: def plus_one(self, digits): """ :type digits: List[int] :rtype: List[int] """ return list(map(int, str(int(''.join(map(str, digits))) + 1)))
# -*- coding: utf-8 -*- # Contributors : [srinivas.v@toyotaconnected.co.in,srivathsan.govindarajan@toyotaconnected.co.in, # harshavardhan.thirupathi@toyotaconnected.co.in, # ashok.ramadass@toyotaconnected.com ] """Utilities for testing used across Zokyo""" __all__ = ['pytest_err_msg'] def pytest_err_msg(err): """Get the error message from an exception that pytest catches Compatibility function for newer versions of pytest, where ``str(err)`` no longer returns the expected ``__repr__`` of an exception. """ try: return str(err.value) except AttributeError: return str(err)
"""Utilities for testing used across Zokyo""" __all__ = ['pytest_err_msg'] def pytest_err_msg(err): """Get the error message from an exception that pytest catches Compatibility function for newer versions of pytest, where ``str(err)`` no longer returns the expected ``__repr__`` of an exception. """ try: return str(err.value) except AttributeError: return str(err)
"""Knapsack solution using the branch and bound method.""" class Item: """Representation of one item from the total set of objects that can be chosen.""" def __init__(self, weight: int, value: int): # Todo: Make this a dataclass. self.__weight = weight self.__value = value def __repr__(self): return f"weight: {self.weight}, value:{self.value}, ratio:{self.ratio}" @property def value(self): return self.__value @property def weight(self): return self.__weight @property def ratio(self): return self.value / self.weight def __ge__(self, other): if self.ratio >= other.ratio: return True if self.ratio < other.ratio: return False class Node: """Node of the branch and bound tree.""" def __init__(self, level: int = None, profit: int = None, bound: float = None, weight: float = None): # TODO: make this a Dataclass. self.level = level self.profit = profit self.bound = bound self.weight = weight def bound(node_u: Node, total_knapsack_weight: int, item_value_pairs: list) -> int: # If the node's weight exceeds the capacity, return a zero value as (an early exit) solution. if node_u.weight >= total_knapsack_weight: return 0 profit_bound = node_u.profit total_weight = node_u.weight item_number = node_u.level + 1 while item_number < len(item_value_pairs) and total_weight + item_value_pairs[item_number].weight <= total_knapsack_weight: total_weight += item_value_pairs[item_number].weight profit_bound += item_value_pairs[item_number].value item_number += 1 if item_number < len(item_value_pairs): profit_bound += (total_knapsack_weight - total_weight) * item_value_pairs[item_number].ratio return profit_bound def knapsack_bb(total_knapsack_weight: int, item_value_pairs: list): """Knapsack using greedy branch and bound.""" def _item_ratio(item): return item.ratio item_value_pairs.sort(key=_item_ratio, reverse=True) current_queue = [] u, v = Node(level=-1, profit=0, weight=0), Node(level=-1, profit=0, weight=0) current_queue.append(u) max_profit = 0 while len(current_queue) > 0: u = current_queue.pop(-1) if u.level == -1: v.level = 0 # This condition? if u.level == len(item_value_pairs) - 1: continue v.level = u.level + 1 v.weight = u.weight + item_value_pairs[v.level].weight; v.profit = u.profit + item_value_pairs[v.level].value; # If cumulated weight is less than W and profit is greater than previous profit, update max_profit. if v.weight <= total_knapsack_weight and v.profit > max_profit: max_profit = v.profit v.bound = bound(v, total_knapsack_weight, item_value_pairs) if v.bound > max_profit: current_queue.append(v) # Do the same thing, but without taking the item in knapsack. v.weight = u.weight; v.profit = u.profit; v.bound = bound(v, total_knapsack_weight, item_value_pairs); if v.bound > max_profit: current_queue.append(v) return max_profit if __name__ == "__main__": W = 95 item_value_pairs = [(2, 40), (3.14, 50), (1.98, 100), (5, 95), (3, 30)] item_value_pairs = [Item(weight=weight, value=value) for value, weight in item_value_pairs] print( knapsack_bb( total_knapsack_weight=W, item_value_pairs=item_value_pairs, ) )
"""Knapsack solution using the branch and bound method.""" class Item: """Representation of one item from the total set of objects that can be chosen.""" def __init__(self, weight: int, value: int): self.__weight = weight self.__value = value def __repr__(self): return f'weight: {self.weight}, value:{self.value}, ratio:{self.ratio}' @property def value(self): return self.__value @property def weight(self): return self.__weight @property def ratio(self): return self.value / self.weight def __ge__(self, other): if self.ratio >= other.ratio: return True if self.ratio < other.ratio: return False class Node: """Node of the branch and bound tree.""" def __init__(self, level: int=None, profit: int=None, bound: float=None, weight: float=None): self.level = level self.profit = profit self.bound = bound self.weight = weight def bound(node_u: Node, total_knapsack_weight: int, item_value_pairs: list) -> int: if node_u.weight >= total_knapsack_weight: return 0 profit_bound = node_u.profit total_weight = node_u.weight item_number = node_u.level + 1 while item_number < len(item_value_pairs) and total_weight + item_value_pairs[item_number].weight <= total_knapsack_weight: total_weight += item_value_pairs[item_number].weight profit_bound += item_value_pairs[item_number].value item_number += 1 if item_number < len(item_value_pairs): profit_bound += (total_knapsack_weight - total_weight) * item_value_pairs[item_number].ratio return profit_bound def knapsack_bb(total_knapsack_weight: int, item_value_pairs: list): """Knapsack using greedy branch and bound.""" def _item_ratio(item): return item.ratio item_value_pairs.sort(key=_item_ratio, reverse=True) current_queue = [] (u, v) = (node(level=-1, profit=0, weight=0), node(level=-1, profit=0, weight=0)) current_queue.append(u) max_profit = 0 while len(current_queue) > 0: u = current_queue.pop(-1) if u.level == -1: v.level = 0 if u.level == len(item_value_pairs) - 1: continue v.level = u.level + 1 v.weight = u.weight + item_value_pairs[v.level].weight v.profit = u.profit + item_value_pairs[v.level].value if v.weight <= total_knapsack_weight and v.profit > max_profit: max_profit = v.profit v.bound = bound(v, total_knapsack_weight, item_value_pairs) if v.bound > max_profit: current_queue.append(v) v.weight = u.weight v.profit = u.profit v.bound = bound(v, total_knapsack_weight, item_value_pairs) if v.bound > max_profit: current_queue.append(v) return max_profit if __name__ == '__main__': w = 95 item_value_pairs = [(2, 40), (3.14, 50), (1.98, 100), (5, 95), (3, 30)] item_value_pairs = [item(weight=weight, value=value) for (value, weight) in item_value_pairs] print(knapsack_bb(total_knapsack_weight=W, item_value_pairs=item_value_pairs))
class PythonApiException(Exception): pass class RepositoryException(PythonApiException): pass
class Pythonapiexception(Exception): pass class Repositoryexception(PythonApiException): pass
e = 10e-6 for b in range(10, 100): for a in range(10, b): r = a / b a1 = a % 10 a10 = (a // 10) % 10 b1 = b % 10 b10 = (b // 10) % 10 if a1 == b1 and a1 != 0 and b1 != 0: c = a10 d = b10 elif a1 == b10: c = a10 d = b1 elif a10 == b1: c = a1 d = b10 elif a10 == b10: c = a1 d = b1 else: continue if c != 0 and d != 0: s = c / d if abs(s - r) < e: print(a, "/", b, "->", c, "/", d)
e = 1e-05 for b in range(10, 100): for a in range(10, b): r = a / b a1 = a % 10 a10 = a // 10 % 10 b1 = b % 10 b10 = b // 10 % 10 if a1 == b1 and a1 != 0 and (b1 != 0): c = a10 d = b10 elif a1 == b10: c = a10 d = b1 elif a10 == b1: c = a1 d = b10 elif a10 == b10: c = a1 d = b1 else: continue if c != 0 and d != 0: s = c / d if abs(s - r) < e: print(a, '/', b, '->', c, '/', d)
# https://codeforces.com/contest/520/problem/A def check_freq(x): freq = {} for c in set(x): freq[c] = x.count(c) return freq _ = input() word = input().lower() if len(check_freq(word)) == 26: print("YES") else: print("NO")
def check_freq(x): freq = {} for c in set(x): freq[c] = x.count(c) return freq _ = input() word = input().lower() if len(check_freq(word)) == 26: print('YES') else: print('NO')
"""Exceptions module.""" class A10SAError(Exception): """Base A10SA Script exception.""" class ParseError(A10SAError): """A script parsing error occured."""
"""Exceptions module.""" class A10Saerror(Exception): """Base A10SA Script exception.""" class Parseerror(A10SAError): """A script parsing error occured."""
s=0 for i in range(0,3): for j in range(0,3): for k in range(0,3): s+=1 print(s)
s = 0 for i in range(0, 3): for j in range(0, 3): for k in range(0, 3): s += 1 print(s)
bags = {} def get_bags(): with open("7/input.txt", "r") as file: data = file.read().split('\n') for line in data: parts = line.split(" contain ") color = parts[0].replace(" bags", "") contains = [] if parts[1] != "no other bags.": contains_bags = parts[1].split(", ") for c in contains_bags: parts = c.split(" ") num = int(parts[0]) color_name = f"{parts[1]} {parts[2]}" contains.append((num, color_name)) bags[color] = contains return bags
bags = {} def get_bags(): with open('7/input.txt', 'r') as file: data = file.read().split('\n') for line in data: parts = line.split(' contain ') color = parts[0].replace(' bags', '') contains = [] if parts[1] != 'no other bags.': contains_bags = parts[1].split(', ') for c in contains_bags: parts = c.split(' ') num = int(parts[0]) color_name = f'{parts[1]} {parts[2]}' contains.append((num, color_name)) bags[color] = contains return bags
load(":common.bzl", "get_nuget_files") load("//dotnet/private:context.bzl", "make_builder_cmd") load("//dotnet/private/actions:common.bzl", "cache_set", "declare_caches", "write_cache_manifest") load("//dotnet/private:providers.bzl", "DotnetRestoreInfo", "MSBuildDirectoryInfo", "NuGetPackageInfo") def restore(ctx, dotnet): # we don't really need this since we're declaring the directory, but this way, if the restore # fails, bazel will fail the build because this file wasn't created outputs, assets_json = _declare_restore_outputs(ctx) cache = declare_caches(ctx, "restore") files, caches = _process_deps(dotnet, ctx) cache_manifest = write_cache_manifest(ctx, cache, cache_set(transitive = caches)) directory_info = ctx.attr.msbuild_directory[MSBuildDirectoryInfo] inputs = depset( direct = [ctx.file.project_file, cache_manifest], transitive = files + [directory_info.files], ) outputs.extend([cache.result, cache.project]) assembly_name = _get_assembly_name(ctx, directory_info) args, cmd_outputs = make_builder_cmd(ctx, dotnet, "restore", directory_info, assembly_name) outputs.extend(cmd_outputs) args.add_all([ "--version", ctx.attr.version, "--package_version", ctx.attr.package_version, ]) ctx.actions.run( mnemonic = "NuGetRestore", inputs = inputs, outputs = outputs, executable = dotnet.sdk.dotnet, arguments = [args], env = dotnet.env, tools = dotnet.builder.files, ) return DotnetRestoreInfo( target_framework = ctx.attr.target_framework, assets_json = assets_json, outputs = outputs, files = depset(outputs, transitive = [inputs]), caches = cache_set([cache], transitive = caches), directory_info = directory_info, assembly_name = assembly_name, ), outputs def _process_deps(dotnet, ctx): tfm = dotnet.config.tfm deps = ctx.attr.deps files = [] caches = [] for dep in getattr(dotnet.config, "tfm_deps", []): get_nuget_files(dep, tfm, files) for dep in getattr(dotnet.config, "implicit_deps", []): get_nuget_files(dep, tfm, files) for dep in deps: if DotnetRestoreInfo in dep: info = dep[DotnetRestoreInfo] files.append(info.files) caches.append(info.caches) elif NuGetPackageInfo in dep: get_nuget_files(dep, tfm, files) else: fail("Unkown dependency type: {}".format(dep)) return files, caches def _get_assembly_name(ctx, directory_info): if directory_info == None: return "" override = getattr(ctx.attr, "assembly_name", None) if override != None and override != "": return override parts = [] prefix = getattr(directory_info, "assembly_name_prefix", "") if prefix != "": parts.append(prefix) name = ctx.attr.name[:(-1 * len("_restore"))] root_package = getattr(directory_info, "assembly_name_root_package", None) if root_package: root_package = root_package[2:] # skip the // package = ctx.label.package if package != "": if package.startswith(root_package): package = package[len(root_package) + 1:] parts.extend(package.split("/")) if name != parts[-1]: parts.append(name) else: parts.append(name) return ".".join(parts) def _declare_restore_outputs(ctx): outputs = [] for d in ["restore/_/", "restore/"]: for x in [".assets.json", ".nuget.cache"]: outputs.append(ctx.actions.declare_file(d + "project" + x)) for x in [".bazel.props", ".bazel.targets", ".nuget.g.props", ".nuget.g.targets", ".nuget.dgspec.json"]: outputs.append(ctx.actions.declare_file(d + ctx.attr.project_file.label.name + x)) return outputs, outputs[0]
load(':common.bzl', 'get_nuget_files') load('//dotnet/private:context.bzl', 'make_builder_cmd') load('//dotnet/private/actions:common.bzl', 'cache_set', 'declare_caches', 'write_cache_manifest') load('//dotnet/private:providers.bzl', 'DotnetRestoreInfo', 'MSBuildDirectoryInfo', 'NuGetPackageInfo') def restore(ctx, dotnet): (outputs, assets_json) = _declare_restore_outputs(ctx) cache = declare_caches(ctx, 'restore') (files, caches) = _process_deps(dotnet, ctx) cache_manifest = write_cache_manifest(ctx, cache, cache_set(transitive=caches)) directory_info = ctx.attr.msbuild_directory[MSBuildDirectoryInfo] inputs = depset(direct=[ctx.file.project_file, cache_manifest], transitive=files + [directory_info.files]) outputs.extend([cache.result, cache.project]) assembly_name = _get_assembly_name(ctx, directory_info) (args, cmd_outputs) = make_builder_cmd(ctx, dotnet, 'restore', directory_info, assembly_name) outputs.extend(cmd_outputs) args.add_all(['--version', ctx.attr.version, '--package_version', ctx.attr.package_version]) ctx.actions.run(mnemonic='NuGetRestore', inputs=inputs, outputs=outputs, executable=dotnet.sdk.dotnet, arguments=[args], env=dotnet.env, tools=dotnet.builder.files) return (dotnet_restore_info(target_framework=ctx.attr.target_framework, assets_json=assets_json, outputs=outputs, files=depset(outputs, transitive=[inputs]), caches=cache_set([cache], transitive=caches), directory_info=directory_info, assembly_name=assembly_name), outputs) def _process_deps(dotnet, ctx): tfm = dotnet.config.tfm deps = ctx.attr.deps files = [] caches = [] for dep in getattr(dotnet.config, 'tfm_deps', []): get_nuget_files(dep, tfm, files) for dep in getattr(dotnet.config, 'implicit_deps', []): get_nuget_files(dep, tfm, files) for dep in deps: if DotnetRestoreInfo in dep: info = dep[DotnetRestoreInfo] files.append(info.files) caches.append(info.caches) elif NuGetPackageInfo in dep: get_nuget_files(dep, tfm, files) else: fail('Unkown dependency type: {}'.format(dep)) return (files, caches) def _get_assembly_name(ctx, directory_info): if directory_info == None: return '' override = getattr(ctx.attr, 'assembly_name', None) if override != None and override != '': return override parts = [] prefix = getattr(directory_info, 'assembly_name_prefix', '') if prefix != '': parts.append(prefix) name = ctx.attr.name[:-1 * len('_restore')] root_package = getattr(directory_info, 'assembly_name_root_package', None) if root_package: root_package = root_package[2:] package = ctx.label.package if package != '': if package.startswith(root_package): package = package[len(root_package) + 1:] parts.extend(package.split('/')) if name != parts[-1]: parts.append(name) else: parts.append(name) return '.'.join(parts) def _declare_restore_outputs(ctx): outputs = [] for d in ['restore/_/', 'restore/']: for x in ['.assets.json', '.nuget.cache']: outputs.append(ctx.actions.declare_file(d + 'project' + x)) for x in ['.bazel.props', '.bazel.targets', '.nuget.g.props', '.nuget.g.targets', '.nuget.dgspec.json']: outputs.append(ctx.actions.declare_file(d + ctx.attr.project_file.label.name + x)) return (outputs, outputs[0])
def sum_digits(digit): return sum(int(x) for x in digit if x.isdigit()) print(sum_digits('texto123numero456x7')) #https://pt.stackoverflow.com/q/42280/101
def sum_digits(digit): return sum((int(x) for x in digit if x.isdigit())) print(sum_digits('texto123numero456x7'))
"""Top-level package for Butane.""" __author__ = """Travis F. Collins""" __email__ = 'travis.collins@analog.com' __version__ = '0.0.1'
"""Top-level package for Butane.""" __author__ = 'Travis F. Collins' __email__ = 'travis.collins@analog.com' __version__ = '0.0.1'
def update_c_deprecated_attributes(main, file): """ This updates deprecated attributes in the conanfile Only add attributes here which do have a 1:1 replacement If there is no direct replacement then extend/write a check script for it and let the developer decide manually Automatic replacements should be a safe bet :param file: Conan file path """ conanfile = open(file, 'r') recipe = conanfile.read() conanfile.close() # We need to go regularly though the changelog to catch new deprecations # Last checked for Conan versions up to 1.14.1 deprecations = { # Official Conan attributes "self.cpp_info.cppflags": "self.cpp_info.cxxflags", # 1.13.0 # Custom attributes " install_subfolder =": " _install_subfolder =", "self.install_subfolder": "self._install_subfolder", " build_subfolder =": " _build_subfolder =", "self.build_subfolder": "self._build_subfolder", " source_subfolder =": " _source_subfolder =", "self.source_subfolder": "self._source_subfolder", "def configure_cmake": "def _configure_cmake", "self.configure_cmake": "self._configure_cmake", "self.requires.add": "self.requires", "self.build_requires.add": "self.build_requires", } updated = False for deprecated, replacement in deprecations.items(): if deprecated in recipe: if main.replace_in_file(file, deprecated, replacement): main.output_result_update(title="Replace deprecated {} with {}".format(deprecated, replacement)) updated = True if updated: return True return False
def update_c_deprecated_attributes(main, file): """ This updates deprecated attributes in the conanfile Only add attributes here which do have a 1:1 replacement If there is no direct replacement then extend/write a check script for it and let the developer decide manually Automatic replacements should be a safe bet :param file: Conan file path """ conanfile = open(file, 'r') recipe = conanfile.read() conanfile.close() deprecations = {'self.cpp_info.cppflags': 'self.cpp_info.cxxflags', ' install_subfolder =': ' _install_subfolder =', 'self.install_subfolder': 'self._install_subfolder', ' build_subfolder =': ' _build_subfolder =', 'self.build_subfolder': 'self._build_subfolder', ' source_subfolder =': ' _source_subfolder =', 'self.source_subfolder': 'self._source_subfolder', 'def configure_cmake': 'def _configure_cmake', 'self.configure_cmake': 'self._configure_cmake', 'self.requires.add': 'self.requires', 'self.build_requires.add': 'self.build_requires'} updated = False for (deprecated, replacement) in deprecations.items(): if deprecated in recipe: if main.replace_in_file(file, deprecated, replacement): main.output_result_update(title='Replace deprecated {} with {}'.format(deprecated, replacement)) updated = True if updated: return True return False
# # PySNMP MIB module NTNTECH-CHASSIS-CONFIGURATION-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NTNTECH-CHASSIS-CONFIGURATION-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:25:24 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") SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion") NtnDisplayString, NtnTimeTicks, NtnDefaultGateway, ntntechChassis, NtnSubnetMask = mibBuilder.importSymbols("NTNTECH-ROOT-MIB", "NtnDisplayString", "NtnTimeTicks", "NtnDefaultGateway", "ntntechChassis", "NtnSubnetMask") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") iso, Counter64, ObjectIdentity, ModuleIdentity, IpAddress, Bits, TimeTicks, Integer32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32, Gauge32, NotificationType, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "Counter64", "ObjectIdentity", "ModuleIdentity", "IpAddress", "Bits", "TimeTicks", "Integer32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32", "Gauge32", "NotificationType", "Unsigned32") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") ntntechChassisConfigurationMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1)) ntntechChassisConfigurationMIB.setRevisions(('1902-08-13 11:12', '1902-08-28 09:12', '1902-10-11 09:13', '1902-10-22 02:00', '1902-11-04 12:58', '1904-03-15 10:15', '1904-04-27 11:16', '1904-10-11 09:09', '1904-11-17 09:58',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ntntechChassisConfigurationMIB.setRevisionsDescriptions(('Added the mumCfgAdvanced OID. Added the mumCfgManagementPort OID.', 'New Release - v1.01.00', 'Added OID mgmtPortCfgType to the mgmtPortCfgTable.', 'New Release - v1.01.01', 'Added the values uplink3(4), uplink4(5), and mgmt(6) to the mumCfgInterConnection OID.', 'Added OID mumCfgCommitChange to the mumCfgTable.', 'Updated the description associated with the mumCfgCommitChange OID.', 'Updated the description associated with the mumCfgCommitChange OID again. Adjusted the copyright date and references to Paradyne.', 'New Release -- version 1.02.01',)) if mibBuilder.loadTexts: ntntechChassisConfigurationMIB.setLastUpdated('0411170200Z') if mibBuilder.loadTexts: ntntechChassisConfigurationMIB.setOrganization('Paradyne Corporation') if mibBuilder.loadTexts: ntntechChassisConfigurationMIB.setContactInfo('Paradyne Corporation 8545 126th Avenue North Largo, FL 33773 phone: +1 (727) 530 2000 email: support@paradyne.com www: http://www.nettonet.com/support/') if mibBuilder.loadTexts: ntntechChassisConfigurationMIB.setDescription("This mib module defines an SNMP API to manage the Paradyne Corporation's DSLAM chassis parameters. These parameter settings are specifically associated with the the MUM200-2 and MUM2000-2 modules and the Mini and Micro DSLAMs. The interface types are described below, AMD8000-12 12-Port ADSL Mini DSLAMs With Full Rate and G.lite Operational Modes SMD2000-12, SMD2000Q-12, SMD2000G-12 12-Port SDSL Mini DSLAMs: AC and DC Versions with Cap, 2B1Q and G.SHDSL line encoding SuD2011_12T, SuD2011_12E, SuD2003_12T, SuD2003_12E 12-Port SDSL Micro DSLAMs: Cap, 2B1Q and G.SHDSL line encoding SuD2011_6T, SuD2011_6E, SuD2002_6T, SuD2002_6E 6-Port SDSL Micro DSLAMs: Cap, 2B1Q and G.SHDSL line encoding MUM200-2, MUM2000-2 Multiplexer Uplink Module with Dual Uplink Interface Module Capacity UIM-10/100 Uplink Interface Module UIM-DS3 DS3 Uplink Interface Module UIM-E1 E1 Uplink Interface Module UIM-E3 E3 Uplink Interface Module UIM-T1 T1 Uplink Interface Module ") chsCfgMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1)) chsCfgParameterConfiguration = MibIdentifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1)) prmCfgMultiplexerUplinkModule = MibIdentifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1)) mumCfgNotes = MibScalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 1), NtnDisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mumCfgNotes.setStatus('current') if mibBuilder.loadTexts: mumCfgNotes.setDescription("The chassis system 'Notes' field is to be used as a scratchpad (i.e. chassis id or name) by the administrator. The default value is blank. The length of string must not exceed 128 alpha-numeric characters.") mumCfgTable = MibTable((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2), ) if mibBuilder.loadTexts: mumCfgTable.setStatus('current') if mibBuilder.loadTexts: mumCfgTable.setDescription('A list of MUM200-2/2000-2 module or Mini/Micro DSLAM entries.') mumCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1), ).setIndexNames((0, "NTNTECH-CHASSIS-CONFIGURATION-MIB", "mumCfgIndex")) if mibBuilder.loadTexts: mumCfgEntry.setStatus('current') if mibBuilder.loadTexts: mumCfgEntry.setDescription('An entry containing management information applicable to a MUM200-2/MUM2000-2 module or Mini/Micro DSLAM.') mumCfgIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readonly") if mibBuilder.loadTexts: mumCfgIndex.setStatus('current') if mibBuilder.loadTexts: mumCfgIndex.setDescription("Translates to the physical slot number that a MUM200-2/2000-2 module exists within a chassis. The Mini/Micro DSLAMs' physical location is set to 1 by default. See below, chassis type physical location(s) translation ------------ -------------------------------- IPD12000 MUM in slots 13,14 = mumCfgIndex 1,2 respecitively IPD4000 MUM in slot 5 = mumCfgIndex 1 Mini DSLAM NA = mumCfgIndex 1 Micro DSLAM NA = mumCfgIndex 1") mumCfgIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mumCfgIpAddress.setStatus('current') if mibBuilder.loadTexts: mumCfgIpAddress.setDescription('IP Address assigned to a MUM200-2/2000-2 module or Mini/Micro DSLAM. This parameter is initially set to a default value, i.e 192.168.254.252 for a MUM200-2/2000-2 module located in slot 13 of an IPD12000, slot 5 of an IPD4000 DSLAM and a Mini/Micro DSLAM. The default value of 192.168.254.253 will be for a MUM200-2/2000-2 module located in slot 14 of an IPD12000 (duplicate IP addresses are not allowed). These default values can be modified by the user.') mumCfgSubnetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mumCfgSubnetMask.setStatus('current') if mibBuilder.loadTexts: mumCfgSubnetMask.setDescription('The Subnet Mask assigned to a MUM200-2/2000-2 module or Mini/Micro DSLAM. This parameter is assiged by the user, the default value is 255.255.255.0.') mumCfgDefaultGateway = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 4), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mumCfgDefaultGateway.setStatus('current') if mibBuilder.loadTexts: mumCfgDefaultGateway.setDescription('The Default Gateway assigned to a MUM200-2/2000-2 module or Mini/Micro DSLAM. This value is assiged by the user, the default value is 0.0.0.0.') mumCfgInbandMgmt = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mumCfgInbandMgmt.setStatus('current') if mibBuilder.loadTexts: mumCfgInbandMgmt.setDescription('Inband management feature, when enabled [ON(1)], allows access to the DSLAM via the network against an assigned IP address, subnet mask, and default gateway.') mumCfgInbandMGMTVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4085))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mumCfgInbandMGMTVlanID.setStatus('current') if mibBuilder.loadTexts: mumCfgInbandMGMTVlanID.setDescription('The IP DSLAM supports 802.1Q Virtual LANs (VLANs). This parameter configuration applies to the inband management traffic only. It does not apply to out of band traffic received from the MGMT port. Note: for the case where the chassis type is an IPD12000 loaded with two MUMs, the setting of this parameter will affect both.') mumCfgInterConnection = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("neither", 1), ("uplink1", 2), ("uplink2", 3), ("uplink3", 4), ("uplink4", 5), ("mgmt", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mumCfgInterConnection.setStatus('current') if mibBuilder.loadTexts: mumCfgInterConnection.setDescription('IPD12000 or IPD4000 DSLAM interconnect configuration provides the system manager the ability to daisy-chain one IP DSLAM to another so that a single router may be used for all DSLAMs in the chain.') mumCfgCommitChange = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mumCfgCommitChange.setStatus('current') if mibBuilder.loadTexts: mumCfgCommitChange.setDescription('Set to enabled(1) in order to commit the latest changes to the IP address, subnetmask, default gateway chassis parameters. This is only applicable to the SNE2040G-P and the SNE2040G-S.') mumCfgUplinkInterfaceModule = MibIdentifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3)) uimCfgEthTable = MibTable((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 1), ) if mibBuilder.loadTexts: uimCfgEthTable.setStatus('current') if mibBuilder.loadTexts: uimCfgEthTable.setDescription('A list of ethernet Uplink Interface Module (UIM) entries.') uimCfgEthEntry = MibTableRow((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 1, 1), ).setIndexNames((0, "NTNTECH-CHASSIS-CONFIGURATION-MIB", "uimCfgEthMumIndex"), (0, "NTNTECH-CHASSIS-CONFIGURATION-MIB", "uimCfgEthIndex")) if mibBuilder.loadTexts: uimCfgEthEntry.setStatus('current') if mibBuilder.loadTexts: uimCfgEthEntry.setDescription('An entry containing information applicable to an ethernet Uplink Interface Module (UIM).') uimCfgEthMumIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readonly") if mibBuilder.loadTexts: uimCfgEthMumIndex.setStatus('current') if mibBuilder.loadTexts: uimCfgEthMumIndex.setDescription("Translates to the physical slot number that a MUM200-2/2000-2 module exists within a chassis. The Mini/Micro DSLAMs' physical location is set to 1 by default. See below, chassis type physical location(s) translation ------------ -------------------------------- IPD12000 MUM in slots 13,14 = uimCfgEthMumIndex 1,2 respecitively IPD4000 MUM in slot 5 = uimCfgEthMumIndex 1 Mini DSLAM NA = uimCfgEthMumIndex 1 Micro DSLAM NA = uimCfgEthMumIndex 1 Note: when configuring an ethernet UIM, the user must enter the index of the MUM, see above table, that corresponds with the IP address of the remote SNMP agent.") uimCfgEthIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: uimCfgEthIndex.setStatus('current') if mibBuilder.loadTexts: uimCfgEthIndex.setDescription('The physical slot used to access the UIM in the MUM200-2/2000-2 module or Mini/Micro DSLAM.') uimCfgEthRxTxRate = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("uimEthAutoNegotiate", 0), ("uimEth10", 1), ("uimEth100", 2), ("uimEthGig", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: uimCfgEthRxTxRate.setStatus('current') if mibBuilder.loadTexts: uimCfgEthRxTxRate.setDescription('The RxTx rate for an ethernet UIM.') uimCfgEthDuplex = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("uimEthAutoNegotiate", 0), ("uimEthHalf", 1), ("uimEthFull", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: uimCfgEthDuplex.setStatus('current') if mibBuilder.loadTexts: uimCfgEthDuplex.setDescription('The current duplex setting for an ethernet UIM.') uimCfgT1Table = MibTable((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2), ) if mibBuilder.loadTexts: uimCfgT1Table.setStatus('current') if mibBuilder.loadTexts: uimCfgT1Table.setDescription('A list of T1 Uplink Interface Module (UIM) entries.') uimCfgT1Entry = MibTableRow((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2, 1), ).setIndexNames((0, "NTNTECH-CHASSIS-CONFIGURATION-MIB", "uimCfgT1MumIndex"), (0, "NTNTECH-CHASSIS-CONFIGURATION-MIB", "uimCfgT1Index")) if mibBuilder.loadTexts: uimCfgT1Entry.setStatus('current') if mibBuilder.loadTexts: uimCfgT1Entry.setDescription('An entry containing information applicable to a T1 Uplink Interface Module (UIM).') uimCfgT1MumIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readonly") if mibBuilder.loadTexts: uimCfgT1MumIndex.setStatus('current') if mibBuilder.loadTexts: uimCfgT1MumIndex.setDescription("Translates to the physical slot number that a MUM200-2/2000-2 module exists within a chassis. The Mini/Micro DSLAMs' physical location is set to 1 by default. See below, chassis type physical location(s) translation ------------ -------------------------------- IPD12000 MUM in slots 13,14 = uimCfgT1MumIndex 1,2 respecitively IPD4000 MUM in slot 5 = uimCfgT1MumIndex 1 Mini DSLAM NA = uimCfgT1MumIndex 1 Micro DSLAM NA = uimCfgT1MumIndex 1 Note: when configuring a T1 UIM, the user must enter the index of the MUM, see above table, that corresponds with the IP address of the remote SNMP agent.") uimCfgT1Index = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: uimCfgT1Index.setStatus('current') if mibBuilder.loadTexts: uimCfgT1Index.setDescription('The physical slot used to access the UIM in the MUM200-2/2000-2 module or Mini/Micro DSLAM.') uimCfgT1Frame = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("uimT1ESF", 1), ("uimT1SFD4", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: uimCfgT1Frame.setStatus('current') if mibBuilder.loadTexts: uimCfgT1Frame.setDescription('The frame type parameter for a T1 UIM.') uimCfgT1LineCode = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("uimT1B8ZS", 1), ("uimT1AMI", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: uimCfgT1LineCode.setStatus('current') if mibBuilder.loadTexts: uimCfgT1LineCode.setDescription('The line code parameter for a T1 UIM.') uimCfgT1LineBuildout = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("uimT10db", 1), ("uimT1N7p5db", 2), ("uimT1N15db", 3), ("uimT1N22p5db", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: uimCfgT1LineBuildout.setStatus('current') if mibBuilder.loadTexts: uimCfgT1LineBuildout.setDescription('The line buildout parameter for a T1 UIM.') uimCfgE1Table = MibTable((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 3), ) if mibBuilder.loadTexts: uimCfgE1Table.setStatus('current') if mibBuilder.loadTexts: uimCfgE1Table.setDescription('A list of E1 Uplink Interface Module (UIM) entries.') uimCfgE1Entry = MibTableRow((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 3, 1), ).setIndexNames((0, "NTNTECH-CHASSIS-CONFIGURATION-MIB", "uimCfgE1MumIndex"), (0, "NTNTECH-CHASSIS-CONFIGURATION-MIB", "uimCfgE1Index")) if mibBuilder.loadTexts: uimCfgE1Entry.setStatus('current') if mibBuilder.loadTexts: uimCfgE1Entry.setDescription('An entry containing information applicable to an E1 Uplink Interface Module (UIM).') uimCfgE1MumIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readonly") if mibBuilder.loadTexts: uimCfgE1MumIndex.setStatus('current') if mibBuilder.loadTexts: uimCfgE1MumIndex.setDescription("Translates to the physical slot number that a MUM200-2/2000-2 module exists within a chassis. The Mini/Micro DSLAMs' physical location is set to 1 by default. See below, chassis type physical location(s) translation ------------ -------------------------------- IPD12000 MUM in slots 13,14 = uimCfgE1MumIndex 1,2 respecitively IPD4000 MUM in slot 5 = uimCfgE1MumIndex 1 Mini DSLAM NA = uimCfgE1MumIndex 1 Micro DSLAM NA = uimCfgE1MumIndex 1 Note: when configuring an E1 UIM, the user must enter the index of the MUM, see above table, that corresponds with the IP address of the remote SNMP agent.") uimCfgE1Index = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: uimCfgE1Index.setStatus('current') if mibBuilder.loadTexts: uimCfgE1Index.setDescription('The physical slot used to access the UIM in the MUM200-2/2000-2 module or Mini/Micro DSLAM.') uimCfgE1Frame = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("uimE1CRC", 1), ("uimE1NoCRC", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: uimCfgE1Frame.setStatus('current') if mibBuilder.loadTexts: uimCfgE1Frame.setDescription('The frame type parameter for an E1 UIM.') uimCfgE1LineCode = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("uimE1HDB3", 1), ("uimE1AMI", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: uimCfgE1LineCode.setStatus('current') if mibBuilder.loadTexts: uimCfgE1LineCode.setDescription('The line code parameter for an E1 UIM.') mumSNMPConfiguration = MibIdentifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4)) snmpCfgNoticeIpTable = MibTable((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 1), ) if mibBuilder.loadTexts: snmpCfgNoticeIpTable.setStatus('current') if mibBuilder.loadTexts: snmpCfgNoticeIpTable.setDescription('A list of SNMP trap notification Ip Addresses.') snmpCfgNoticeIpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 1, 1), ).setIndexNames((0, "NTNTECH-CHASSIS-CONFIGURATION-MIB", "snmpCfgNoticeIndex")) if mibBuilder.loadTexts: snmpCfgNoticeIpEntry.setStatus('current') if mibBuilder.loadTexts: snmpCfgNoticeIpEntry.setDescription('An entry containing SNMP information applicable to a MUM200-2/MUM2000-2 module or Mini/Micro DSLAM.') snmpCfgNoticeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: snmpCfgNoticeIndex.setStatus('current') if mibBuilder.loadTexts: snmpCfgNoticeIndex.setDescription('An integer value that points to one of four trap notification IP addresses.') snmpCfgNoticeIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 1, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: snmpCfgNoticeIpAddress.setStatus('current') if mibBuilder.loadTexts: snmpCfgNoticeIpAddress.setDescription('IP Address of the location or computer to which you would like trap notifications sent. The default value is 0.0.0.0 and it can be modified by the user.') snmpCfgAuthenticationTrapState = MibScalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: snmpCfgAuthenticationTrapState.setStatus('current') if mibBuilder.loadTexts: snmpCfgAuthenticationTrapState.setDescription('Indicates whether Authentication traps should be generated. By default, this object should have the value enabled(1).') snmpCfgEnvironmentTrapState = MibScalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: snmpCfgEnvironmentTrapState.setStatus('current') if mibBuilder.loadTexts: snmpCfgEnvironmentTrapState.setDescription('Indicates whether the fan and temperature traps should be generated. By default, this object should have the value enabled(1).') snmpCfgColdstartTrapState = MibScalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: snmpCfgColdstartTrapState.setStatus('current') if mibBuilder.loadTexts: snmpCfgColdstartTrapState.setDescription('Indicates whether Cold Start traps should be generated. By default, this object should have the value disabled(2).') snmpCfgModulePortTrapState = MibScalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: snmpCfgModulePortTrapState.setStatus('current') if mibBuilder.loadTexts: snmpCfgModulePortTrapState.setDescription('Indicates whether the module present/removed and link up/down traps should be generated. By default, this object should have the value disabled(2).') snmpCfgCommunity = MibIdentifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 6)) comReadWriteAccess = MibScalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 6, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: comReadWriteAccess.setStatus('current') if mibBuilder.loadTexts: comReadWriteAccess.setDescription('The community string that will allow the user read/write access to the agent. In otherwords, the user will be allowed to view and set parameter attributes. Note: since this is a hidden attribute, for security purposes, when performing a get on this OID the string that is returned will be represented by asterisk(s).') comReadOnlyAccess = MibScalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 6, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: comReadOnlyAccess.setStatus('current') if mibBuilder.loadTexts: comReadOnlyAccess.setDescription('The community string that will allow the user read access to the agent. In otherwords, the user will be allowed to view parameter attributes. Note: since this is a hidden attribute, for security purposes, when performing a get on this OID the string that is returned will be represented by asterisk(s).') mumCfgUniques = MibIdentifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 5)) unqEmbHttpWebsrvrState = MibScalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 5, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: unqEmbHttpWebsrvrState.setStatus('current') if mibBuilder.loadTexts: unqEmbHttpWebsrvrState.setDescription('This configuration parameter allows the user the ability to disable, or enable, the embedded webserver. By default, this object should have the value enabled(1).') mumCfgAdvanced = MibIdentifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6)) advCfgTable = MibTable((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1), ) if mibBuilder.loadTexts: advCfgTable.setStatus('current') if mibBuilder.loadTexts: advCfgTable.setDescription('A list of the Advanced Configuration entries.') advCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1), ).setIndexNames((0, "NTNTECH-CHASSIS-CONFIGURATION-MIB", "advCfgMumIndex")) if mibBuilder.loadTexts: advCfgEntry.setStatus('current') if mibBuilder.loadTexts: advCfgEntry.setDescription('An entry containing information applicable to an Advanced Configuration parameter.') advCfgMumIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readonly") if mibBuilder.loadTexts: advCfgMumIndex.setStatus('current') if mibBuilder.loadTexts: advCfgMumIndex.setDescription("Translates to the physical slot number that a MUM200-2/2000-2 module exists within a chassis. The Mini/Micro DSLAMs' physical location is set to 1 by default. See below, chassis type physical location(s) translation ------------ -------------------------------- IPD12000 MUM in slots 13,14 = uimCfgE1MumIndex 1,2 respecitively IPD4000 MUM in slot 5 = uimCfgE1MumIndex 1 Mini DSLAM NA = uimCfgE1MumIndex 1 Micro DSLAM NA = uimCfgE1MumIndex 1 Note: when configuring an Advanced Configuration parameter, the user must enter the index of the MUM, see above table, that corresponds with the IP address of the remote SNMP agent.") advCfgTFTPState = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: advCfgTFTPState.setStatus('current') if mibBuilder.loadTexts: advCfgTFTPState.setDescription('This configuration parameter allows the user the ability to disable, or enable, the TFTP server. By default, this object should have the value enabled(1).') advCfgTelnetState = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: advCfgTelnetState.setStatus('current') if mibBuilder.loadTexts: advCfgTelnetState.setDescription('This configuration parameter allows the user the ability to disable, or enable, telnet. By default, this object should have the value enabled(1).') advCfgMgmtFltrIpStart = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1, 4), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: advCfgMgmtFltrIpStart.setStatus('current') if mibBuilder.loadTexts: advCfgMgmtFltrIpStart.setDescription("The start value for the management IP filter range. This parameter is initially set to a default filter range of 0.0.0.0 - 255.255.255.255. Connection to the management system will be allowed only if the user's Ip address value falls within the defined mumCfgMgmtIpStart and mumCfgMgmtIpEnd range.") advCfgMgmtFltrIpEnd = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1, 5), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: advCfgMgmtFltrIpEnd.setStatus('current') if mibBuilder.loadTexts: advCfgMgmtFltrIpEnd.setDescription("The end value for the management IP filter range. This parameter is initially set to a default filter range of 0.0.0.0 - 255.255.255.255. Connection to the management system will be allowed only if the user's Ip address value falls within the defined mumCfgMgmtIpStart and mumCfgMgmtIpEnd range.") advCfgMgmtSessionTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1, 6), NtnTimeTicks()).setMaxAccess("readwrite") if mibBuilder.loadTexts: advCfgMgmtSessionTimeout.setStatus('current') if mibBuilder.loadTexts: advCfgMgmtSessionTimeout.setDescription('This value defines the length of a password session in seconds. If the session has been idle for a time greater than this value, the browser will be challenged again, even if it has provided authentication credentials with the request.') mumCfgManagementPort = MibIdentifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7)) mgmtPortCfgTable = MibTable((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7, 1), ) if mibBuilder.loadTexts: mgmtPortCfgTable.setStatus('current') if mibBuilder.loadTexts: mgmtPortCfgTable.setDescription('A list of the hardware platform management port entries.') mgmtPortCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7, 1, 1), ).setIndexNames((0, "NTNTECH-CHASSIS-CONFIGURATION-MIB", "mgmtPortCfgMumIndex")) if mibBuilder.loadTexts: mgmtPortCfgEntry.setStatus('current') if mibBuilder.loadTexts: mgmtPortCfgEntry.setDescription('An entry containing information applicable to the managment (ethernet type) port.') mgmtPortCfgMumIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readonly") if mibBuilder.loadTexts: mgmtPortCfgMumIndex.setStatus('current') if mibBuilder.loadTexts: mgmtPortCfgMumIndex.setDescription("Translates to the physical slot number that a MUM200-2/2000-2 module exists within a chassis. The Mini/Micro DSLAMs' physical location is set to 1 by default. See below, chassis type physical location(s) translation ------------ -------------------------------- IPD12000 MUM in slots 13,14 = uimCfgEthMumIndex 1,2 respecitively IPD4000 MUM in slot 5 = uimCfgEthMumIndex 1 Mini DSLAM NA = uimCfgEthMumIndex 1 Micro DSLAM NA = uimCfgEthMumIndex 1 Note: when configuring a management port, the user must enter the index of the MUM, see above table, that corresponds with the IP address of the remote SNMP agent.") mgmtPortCfgRxTxRate = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("uimEthAutoNegotiate", 0), ("uimEth10", 1), ("uimEth100", 2), ("uimEthGig", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mgmtPortCfgRxTxRate.setStatus('current') if mibBuilder.loadTexts: mgmtPortCfgRxTxRate.setDescription('Set the RxTx rate for an ethernet management port.') mgmtPortCfgDuplex = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("uimEthAutoNegotiate", 0), ("uimEthHalf", 1), ("uimEthFull", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mgmtPortCfgDuplex.setStatus('current') if mibBuilder.loadTexts: mgmtPortCfgDuplex.setDescription('Set the duplex setting for an ethernet management port.') mgmtPortCfgType = MibTableColumn((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("mgmt", 1), ("uplink", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mgmtPortCfgType.setStatus('current') if mibBuilder.loadTexts: mgmtPortCfgType.setDescription('Set the management port type as follows. By setting this port to mgmt(1), it will operate as a non-bridge mode connection. Setting it to uplink(2), this port will operate like an uplink interface module, i.e. a bridge mode connection. Note: this applies to the AuD8000-12 micro DSLAM only.') mibBuilder.exportSymbols("NTNTECH-CHASSIS-CONFIGURATION-MIB", uimCfgE1Index=uimCfgE1Index, uimCfgT1Frame=uimCfgT1Frame, snmpCfgNoticeIpAddress=snmpCfgNoticeIpAddress, mgmtPortCfgEntry=mgmtPortCfgEntry, snmpCfgNoticeIndex=snmpCfgNoticeIndex, chsCfgMIBObjects=chsCfgMIBObjects, advCfgTelnetState=advCfgTelnetState, mgmtPortCfgDuplex=mgmtPortCfgDuplex, mumCfgUplinkInterfaceModule=mumCfgUplinkInterfaceModule, mgmtPortCfgType=mgmtPortCfgType, advCfgTFTPState=advCfgTFTPState, mumCfgNotes=mumCfgNotes, uimCfgEthIndex=uimCfgEthIndex, snmpCfgAuthenticationTrapState=snmpCfgAuthenticationTrapState, mgmtPortCfgRxTxRate=mgmtPortCfgRxTxRate, mumCfgIpAddress=mumCfgIpAddress, uimCfgE1LineCode=uimCfgE1LineCode, snmpCfgNoticeIpEntry=snmpCfgNoticeIpEntry, PYSNMP_MODULE_ID=ntntechChassisConfigurationMIB, uimCfgEthTable=uimCfgEthTable, uimCfgE1Table=uimCfgE1Table, uimCfgT1Index=uimCfgT1Index, snmpCfgNoticeIpTable=snmpCfgNoticeIpTable, snmpCfgCommunity=snmpCfgCommunity, mumCfgSubnetMask=mumCfgSubnetMask, uimCfgT1Entry=uimCfgT1Entry, mgmtPortCfgTable=mgmtPortCfgTable, mgmtPortCfgMumIndex=mgmtPortCfgMumIndex, mumCfgTable=mumCfgTable, mumCfgAdvanced=mumCfgAdvanced, uimCfgE1MumIndex=uimCfgE1MumIndex, uimCfgE1Entry=uimCfgE1Entry, unqEmbHttpWebsrvrState=unqEmbHttpWebsrvrState, mumCfgEntry=mumCfgEntry, uimCfgEthMumIndex=uimCfgEthMumIndex, mumCfgCommitChange=mumCfgCommitChange, snmpCfgModulePortTrapState=snmpCfgModulePortTrapState, advCfgTable=advCfgTable, mumCfgInterConnection=mumCfgInterConnection, uimCfgEthEntry=uimCfgEthEntry, comReadWriteAccess=comReadWriteAccess, uimCfgEthDuplex=uimCfgEthDuplex, snmpCfgEnvironmentTrapState=snmpCfgEnvironmentTrapState, snmpCfgColdstartTrapState=snmpCfgColdstartTrapState, mumSNMPConfiguration=mumSNMPConfiguration, ntntechChassisConfigurationMIB=ntntechChassisConfigurationMIB, uimCfgT1LineBuildout=uimCfgT1LineBuildout, uimCfgT1Table=uimCfgT1Table, chsCfgParameterConfiguration=chsCfgParameterConfiguration, comReadOnlyAccess=comReadOnlyAccess, mumCfgIndex=mumCfgIndex, uimCfgT1LineCode=uimCfgT1LineCode, advCfgEntry=advCfgEntry, advCfgMumIndex=advCfgMumIndex, advCfgMgmtSessionTimeout=advCfgMgmtSessionTimeout, mumCfgDefaultGateway=mumCfgDefaultGateway, mumCfgInbandMgmt=mumCfgInbandMgmt, mumCfgUniques=mumCfgUniques, mumCfgManagementPort=mumCfgManagementPort, uimCfgT1MumIndex=uimCfgT1MumIndex, uimCfgE1Frame=uimCfgE1Frame, mumCfgInbandMGMTVlanID=mumCfgInbandMGMTVlanID, advCfgMgmtFltrIpEnd=advCfgMgmtFltrIpEnd, prmCfgMultiplexerUplinkModule=prmCfgMultiplexerUplinkModule, advCfgMgmtFltrIpStart=advCfgMgmtFltrIpStart, uimCfgEthRxTxRate=uimCfgEthRxTxRate)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_range_constraint, constraints_intersection, value_size_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint', 'ConstraintsUnion') (ntn_display_string, ntn_time_ticks, ntn_default_gateway, ntntech_chassis, ntn_subnet_mask) = mibBuilder.importSymbols('NTNTECH-ROOT-MIB', 'NtnDisplayString', 'NtnTimeTicks', 'NtnDefaultGateway', 'ntntechChassis', 'NtnSubnetMask') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (iso, counter64, object_identity, module_identity, ip_address, bits, time_ticks, integer32, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, counter32, gauge32, notification_type, unsigned32) = mibBuilder.importSymbols('SNMPv2-SMI', 'iso', 'Counter64', 'ObjectIdentity', 'ModuleIdentity', 'IpAddress', 'Bits', 'TimeTicks', 'Integer32', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter32', 'Gauge32', 'NotificationType', 'Unsigned32') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') ntntech_chassis_configuration_mib = module_identity((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1)) ntntechChassisConfigurationMIB.setRevisions(('1902-08-13 11:12', '1902-08-28 09:12', '1902-10-11 09:13', '1902-10-22 02:00', '1902-11-04 12:58', '1904-03-15 10:15', '1904-04-27 11:16', '1904-10-11 09:09', '1904-11-17 09:58')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ntntechChassisConfigurationMIB.setRevisionsDescriptions(('Added the mumCfgAdvanced OID. Added the mumCfgManagementPort OID.', 'New Release - v1.01.00', 'Added OID mgmtPortCfgType to the mgmtPortCfgTable.', 'New Release - v1.01.01', 'Added the values uplink3(4), uplink4(5), and mgmt(6) to the mumCfgInterConnection OID.', 'Added OID mumCfgCommitChange to the mumCfgTable.', 'Updated the description associated with the mumCfgCommitChange OID.', 'Updated the description associated with the mumCfgCommitChange OID again. Adjusted the copyright date and references to Paradyne.', 'New Release -- version 1.02.01')) if mibBuilder.loadTexts: ntntechChassisConfigurationMIB.setLastUpdated('0411170200Z') if mibBuilder.loadTexts: ntntechChassisConfigurationMIB.setOrganization('Paradyne Corporation') if mibBuilder.loadTexts: ntntechChassisConfigurationMIB.setContactInfo('Paradyne Corporation 8545 126th Avenue North Largo, FL 33773 phone: +1 (727) 530 2000 email: support@paradyne.com www: http://www.nettonet.com/support/') if mibBuilder.loadTexts: ntntechChassisConfigurationMIB.setDescription("This mib module defines an SNMP API to manage the Paradyne Corporation's DSLAM chassis parameters. These parameter settings are specifically associated with the the MUM200-2 and MUM2000-2 modules and the Mini and Micro DSLAMs. The interface types are described below, AMD8000-12 12-Port ADSL Mini DSLAMs With Full Rate and G.lite Operational Modes SMD2000-12, SMD2000Q-12, SMD2000G-12 12-Port SDSL Mini DSLAMs: AC and DC Versions with Cap, 2B1Q and G.SHDSL line encoding SuD2011_12T, SuD2011_12E, SuD2003_12T, SuD2003_12E 12-Port SDSL Micro DSLAMs: Cap, 2B1Q and G.SHDSL line encoding SuD2011_6T, SuD2011_6E, SuD2002_6T, SuD2002_6E 6-Port SDSL Micro DSLAMs: Cap, 2B1Q and G.SHDSL line encoding MUM200-2, MUM2000-2 Multiplexer Uplink Module with Dual Uplink Interface Module Capacity UIM-10/100 Uplink Interface Module UIM-DS3 DS3 Uplink Interface Module UIM-E1 E1 Uplink Interface Module UIM-E3 E3 Uplink Interface Module UIM-T1 T1 Uplink Interface Module ") chs_cfg_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1)) chs_cfg_parameter_configuration = mib_identifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1)) prm_cfg_multiplexer_uplink_module = mib_identifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1)) mum_cfg_notes = mib_scalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 1), ntn_display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: mumCfgNotes.setStatus('current') if mibBuilder.loadTexts: mumCfgNotes.setDescription("The chassis system 'Notes' field is to be used as a scratchpad (i.e. chassis id or name) by the administrator. The default value is blank. The length of string must not exceed 128 alpha-numeric characters.") mum_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2)) if mibBuilder.loadTexts: mumCfgTable.setStatus('current') if mibBuilder.loadTexts: mumCfgTable.setDescription('A list of MUM200-2/2000-2 module or Mini/Micro DSLAM entries.') mum_cfg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1)).setIndexNames((0, 'NTNTECH-CHASSIS-CONFIGURATION-MIB', 'mumCfgIndex')) if mibBuilder.loadTexts: mumCfgEntry.setStatus('current') if mibBuilder.loadTexts: mumCfgEntry.setDescription('An entry containing management information applicable to a MUM200-2/MUM2000-2 module or Mini/Micro DSLAM.') mum_cfg_index = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2))).setMaxAccess('readonly') if mibBuilder.loadTexts: mumCfgIndex.setStatus('current') if mibBuilder.loadTexts: mumCfgIndex.setDescription("Translates to the physical slot number that a MUM200-2/2000-2 module exists within a chassis. The Mini/Micro DSLAMs' physical location is set to 1 by default. See below, chassis type physical location(s) translation ------------ -------------------------------- IPD12000 MUM in slots 13,14 = mumCfgIndex 1,2 respecitively IPD4000 MUM in slot 5 = mumCfgIndex 1 Mini DSLAM NA = mumCfgIndex 1 Micro DSLAM NA = mumCfgIndex 1") mum_cfg_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: mumCfgIpAddress.setStatus('current') if mibBuilder.loadTexts: mumCfgIpAddress.setDescription('IP Address assigned to a MUM200-2/2000-2 module or Mini/Micro DSLAM. This parameter is initially set to a default value, i.e 192.168.254.252 for a MUM200-2/2000-2 module located in slot 13 of an IPD12000, slot 5 of an IPD4000 DSLAM and a Mini/Micro DSLAM. The default value of 192.168.254.253 will be for a MUM200-2/2000-2 module located in slot 14 of an IPD12000 (duplicate IP addresses are not allowed). These default values can be modified by the user.') mum_cfg_subnet_mask = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: mumCfgSubnetMask.setStatus('current') if mibBuilder.loadTexts: mumCfgSubnetMask.setDescription('The Subnet Mask assigned to a MUM200-2/2000-2 module or Mini/Micro DSLAM. This parameter is assiged by the user, the default value is 255.255.255.0.') mum_cfg_default_gateway = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 4), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: mumCfgDefaultGateway.setStatus('current') if mibBuilder.loadTexts: mumCfgDefaultGateway.setDescription('The Default Gateway assigned to a MUM200-2/2000-2 module or Mini/Micro DSLAM. This value is assiged by the user, the default value is 0.0.0.0.') mum_cfg_inband_mgmt = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('on', 1), ('off', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mumCfgInbandMgmt.setStatus('current') if mibBuilder.loadTexts: mumCfgInbandMgmt.setDescription('Inband management feature, when enabled [ON(1)], allows access to the DSLAM via the network against an assigned IP address, subnet mask, and default gateway.') mum_cfg_inband_mgmt_vlan_id = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 4085))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mumCfgInbandMGMTVlanID.setStatus('current') if mibBuilder.loadTexts: mumCfgInbandMGMTVlanID.setDescription('The IP DSLAM supports 802.1Q Virtual LANs (VLANs). This parameter configuration applies to the inband management traffic only. It does not apply to out of band traffic received from the MGMT port. Note: for the case where the chassis type is an IPD12000 loaded with two MUMs, the setting of this parameter will affect both.') mum_cfg_inter_connection = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('neither', 1), ('uplink1', 2), ('uplink2', 3), ('uplink3', 4), ('uplink4', 5), ('mgmt', 6)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mumCfgInterConnection.setStatus('current') if mibBuilder.loadTexts: mumCfgInterConnection.setDescription('IPD12000 or IPD4000 DSLAM interconnect configuration provides the system manager the ability to daisy-chain one IP DSLAM to another so that a single router may be used for all DSLAMs in the chain.') mum_cfg_commit_change = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1))).clone(namedValues=named_values(('disabled', 0), ('enabled', 1)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mumCfgCommitChange.setStatus('current') if mibBuilder.loadTexts: mumCfgCommitChange.setDescription('Set to enabled(1) in order to commit the latest changes to the IP address, subnetmask, default gateway chassis parameters. This is only applicable to the SNE2040G-P and the SNE2040G-S.') mum_cfg_uplink_interface_module = mib_identifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3)) uim_cfg_eth_table = mib_table((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 1)) if mibBuilder.loadTexts: uimCfgEthTable.setStatus('current') if mibBuilder.loadTexts: uimCfgEthTable.setDescription('A list of ethernet Uplink Interface Module (UIM) entries.') uim_cfg_eth_entry = mib_table_row((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 1, 1)).setIndexNames((0, 'NTNTECH-CHASSIS-CONFIGURATION-MIB', 'uimCfgEthMumIndex'), (0, 'NTNTECH-CHASSIS-CONFIGURATION-MIB', 'uimCfgEthIndex')) if mibBuilder.loadTexts: uimCfgEthEntry.setStatus('current') if mibBuilder.loadTexts: uimCfgEthEntry.setDescription('An entry containing information applicable to an ethernet Uplink Interface Module (UIM).') uim_cfg_eth_mum_index = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2))).setMaxAccess('readonly') if mibBuilder.loadTexts: uimCfgEthMumIndex.setStatus('current') if mibBuilder.loadTexts: uimCfgEthMumIndex.setDescription("Translates to the physical slot number that a MUM200-2/2000-2 module exists within a chassis. The Mini/Micro DSLAMs' physical location is set to 1 by default. See below, chassis type physical location(s) translation ------------ -------------------------------- IPD12000 MUM in slots 13,14 = uimCfgEthMumIndex 1,2 respecitively IPD4000 MUM in slot 5 = uimCfgEthMumIndex 1 Mini DSLAM NA = uimCfgEthMumIndex 1 Micro DSLAM NA = uimCfgEthMumIndex 1 Note: when configuring an ethernet UIM, the user must enter the index of the MUM, see above table, that corresponds with the IP address of the remote SNMP agent.") uim_cfg_eth_index = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 4))).setMaxAccess('readonly') if mibBuilder.loadTexts: uimCfgEthIndex.setStatus('current') if mibBuilder.loadTexts: uimCfgEthIndex.setDescription('The physical slot used to access the UIM in the MUM200-2/2000-2 module or Mini/Micro DSLAM.') uim_cfg_eth_rx_tx_rate = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('uimEthAutoNegotiate', 0), ('uimEth10', 1), ('uimEth100', 2), ('uimEthGig', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: uimCfgEthRxTxRate.setStatus('current') if mibBuilder.loadTexts: uimCfgEthRxTxRate.setDescription('The RxTx rate for an ethernet UIM.') uim_cfg_eth_duplex = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('uimEthAutoNegotiate', 0), ('uimEthHalf', 1), ('uimEthFull', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: uimCfgEthDuplex.setStatus('current') if mibBuilder.loadTexts: uimCfgEthDuplex.setDescription('The current duplex setting for an ethernet UIM.') uim_cfg_t1_table = mib_table((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2)) if mibBuilder.loadTexts: uimCfgT1Table.setStatus('current') if mibBuilder.loadTexts: uimCfgT1Table.setDescription('A list of T1 Uplink Interface Module (UIM) entries.') uim_cfg_t1_entry = mib_table_row((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2, 1)).setIndexNames((0, 'NTNTECH-CHASSIS-CONFIGURATION-MIB', 'uimCfgT1MumIndex'), (0, 'NTNTECH-CHASSIS-CONFIGURATION-MIB', 'uimCfgT1Index')) if mibBuilder.loadTexts: uimCfgT1Entry.setStatus('current') if mibBuilder.loadTexts: uimCfgT1Entry.setDescription('An entry containing information applicable to a T1 Uplink Interface Module (UIM).') uim_cfg_t1_mum_index = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2))).setMaxAccess('readonly') if mibBuilder.loadTexts: uimCfgT1MumIndex.setStatus('current') if mibBuilder.loadTexts: uimCfgT1MumIndex.setDescription("Translates to the physical slot number that a MUM200-2/2000-2 module exists within a chassis. The Mini/Micro DSLAMs' physical location is set to 1 by default. See below, chassis type physical location(s) translation ------------ -------------------------------- IPD12000 MUM in slots 13,14 = uimCfgT1MumIndex 1,2 respecitively IPD4000 MUM in slot 5 = uimCfgT1MumIndex 1 Mini DSLAM NA = uimCfgT1MumIndex 1 Micro DSLAM NA = uimCfgT1MumIndex 1 Note: when configuring a T1 UIM, the user must enter the index of the MUM, see above table, that corresponds with the IP address of the remote SNMP agent.") uim_cfg_t1_index = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 4))).setMaxAccess('readonly') if mibBuilder.loadTexts: uimCfgT1Index.setStatus('current') if mibBuilder.loadTexts: uimCfgT1Index.setDescription('The physical slot used to access the UIM in the MUM200-2/2000-2 module or Mini/Micro DSLAM.') uim_cfg_t1_frame = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('uimT1ESF', 1), ('uimT1SFD4', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: uimCfgT1Frame.setStatus('current') if mibBuilder.loadTexts: uimCfgT1Frame.setDescription('The frame type parameter for a T1 UIM.') uim_cfg_t1_line_code = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('uimT1B8ZS', 1), ('uimT1AMI', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: uimCfgT1LineCode.setStatus('current') if mibBuilder.loadTexts: uimCfgT1LineCode.setDescription('The line code parameter for a T1 UIM.') uim_cfg_t1_line_buildout = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('uimT10db', 1), ('uimT1N7p5db', 2), ('uimT1N15db', 3), ('uimT1N22p5db', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: uimCfgT1LineBuildout.setStatus('current') if mibBuilder.loadTexts: uimCfgT1LineBuildout.setDescription('The line buildout parameter for a T1 UIM.') uim_cfg_e1_table = mib_table((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 3)) if mibBuilder.loadTexts: uimCfgE1Table.setStatus('current') if mibBuilder.loadTexts: uimCfgE1Table.setDescription('A list of E1 Uplink Interface Module (UIM) entries.') uim_cfg_e1_entry = mib_table_row((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 3, 1)).setIndexNames((0, 'NTNTECH-CHASSIS-CONFIGURATION-MIB', 'uimCfgE1MumIndex'), (0, 'NTNTECH-CHASSIS-CONFIGURATION-MIB', 'uimCfgE1Index')) if mibBuilder.loadTexts: uimCfgE1Entry.setStatus('current') if mibBuilder.loadTexts: uimCfgE1Entry.setDescription('An entry containing information applicable to an E1 Uplink Interface Module (UIM).') uim_cfg_e1_mum_index = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2))).setMaxAccess('readonly') if mibBuilder.loadTexts: uimCfgE1MumIndex.setStatus('current') if mibBuilder.loadTexts: uimCfgE1MumIndex.setDescription("Translates to the physical slot number that a MUM200-2/2000-2 module exists within a chassis. The Mini/Micro DSLAMs' physical location is set to 1 by default. See below, chassis type physical location(s) translation ------------ -------------------------------- IPD12000 MUM in slots 13,14 = uimCfgE1MumIndex 1,2 respecitively IPD4000 MUM in slot 5 = uimCfgE1MumIndex 1 Mini DSLAM NA = uimCfgE1MumIndex 1 Micro DSLAM NA = uimCfgE1MumIndex 1 Note: when configuring an E1 UIM, the user must enter the index of the MUM, see above table, that corresponds with the IP address of the remote SNMP agent.") uim_cfg_e1_index = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 4))).setMaxAccess('readonly') if mibBuilder.loadTexts: uimCfgE1Index.setStatus('current') if mibBuilder.loadTexts: uimCfgE1Index.setDescription('The physical slot used to access the UIM in the MUM200-2/2000-2 module or Mini/Micro DSLAM.') uim_cfg_e1_frame = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 3, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('uimE1CRC', 1), ('uimE1NoCRC', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: uimCfgE1Frame.setStatus('current') if mibBuilder.loadTexts: uimCfgE1Frame.setDescription('The frame type parameter for an E1 UIM.') uim_cfg_e1_line_code = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 3, 3, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('uimE1HDB3', 1), ('uimE1AMI', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: uimCfgE1LineCode.setStatus('current') if mibBuilder.loadTexts: uimCfgE1LineCode.setDescription('The line code parameter for an E1 UIM.') mum_snmp_configuration = mib_identifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4)) snmp_cfg_notice_ip_table = mib_table((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 1)) if mibBuilder.loadTexts: snmpCfgNoticeIpTable.setStatus('current') if mibBuilder.loadTexts: snmpCfgNoticeIpTable.setDescription('A list of SNMP trap notification Ip Addresses.') snmp_cfg_notice_ip_entry = mib_table_row((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 1, 1)).setIndexNames((0, 'NTNTECH-CHASSIS-CONFIGURATION-MIB', 'snmpCfgNoticeIndex')) if mibBuilder.loadTexts: snmpCfgNoticeIpEntry.setStatus('current') if mibBuilder.loadTexts: snmpCfgNoticeIpEntry.setDescription('An entry containing SNMP information applicable to a MUM200-2/MUM2000-2 module or Mini/Micro DSLAM.') snmp_cfg_notice_index = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4))).setMaxAccess('readonly') if mibBuilder.loadTexts: snmpCfgNoticeIndex.setStatus('current') if mibBuilder.loadTexts: snmpCfgNoticeIndex.setDescription('An integer value that points to one of four trap notification IP addresses.') snmp_cfg_notice_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 1, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: snmpCfgNoticeIpAddress.setStatus('current') if mibBuilder.loadTexts: snmpCfgNoticeIpAddress.setDescription('IP Address of the location or computer to which you would like trap notifications sent. The default value is 0.0.0.0 and it can be modified by the user.') snmp_cfg_authentication_trap_state = mib_scalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: snmpCfgAuthenticationTrapState.setStatus('current') if mibBuilder.loadTexts: snmpCfgAuthenticationTrapState.setDescription('Indicates whether Authentication traps should be generated. By default, this object should have the value enabled(1).') snmp_cfg_environment_trap_state = mib_scalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: snmpCfgEnvironmentTrapState.setStatus('current') if mibBuilder.loadTexts: snmpCfgEnvironmentTrapState.setDescription('Indicates whether the fan and temperature traps should be generated. By default, this object should have the value enabled(1).') snmp_cfg_coldstart_trap_state = mib_scalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: snmpCfgColdstartTrapState.setStatus('current') if mibBuilder.loadTexts: snmpCfgColdstartTrapState.setDescription('Indicates whether Cold Start traps should be generated. By default, this object should have the value disabled(2).') snmp_cfg_module_port_trap_state = mib_scalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: snmpCfgModulePortTrapState.setStatus('current') if mibBuilder.loadTexts: snmpCfgModulePortTrapState.setDescription('Indicates whether the module present/removed and link up/down traps should be generated. By default, this object should have the value disabled(2).') snmp_cfg_community = mib_identifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 6)) com_read_write_access = mib_scalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 6, 1), octet_string().subtype(subtypeSpec=value_size_constraint(0, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: comReadWriteAccess.setStatus('current') if mibBuilder.loadTexts: comReadWriteAccess.setDescription('The community string that will allow the user read/write access to the agent. In otherwords, the user will be allowed to view and set parameter attributes. Note: since this is a hidden attribute, for security purposes, when performing a get on this OID the string that is returned will be represented by asterisk(s).') com_read_only_access = mib_scalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 4, 6, 2), octet_string().subtype(subtypeSpec=value_size_constraint(0, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: comReadOnlyAccess.setStatus('current') if mibBuilder.loadTexts: comReadOnlyAccess.setDescription('The community string that will allow the user read access to the agent. In otherwords, the user will be allowed to view parameter attributes. Note: since this is a hidden attribute, for security purposes, when performing a get on this OID the string that is returned will be represented by asterisk(s).') mum_cfg_uniques = mib_identifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 5)) unq_emb_http_websrvr_state = mib_scalar((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 5, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: unqEmbHttpWebsrvrState.setStatus('current') if mibBuilder.loadTexts: unqEmbHttpWebsrvrState.setDescription('This configuration parameter allows the user the ability to disable, or enable, the embedded webserver. By default, this object should have the value enabled(1).') mum_cfg_advanced = mib_identifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6)) adv_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1)) if mibBuilder.loadTexts: advCfgTable.setStatus('current') if mibBuilder.loadTexts: advCfgTable.setDescription('A list of the Advanced Configuration entries.') adv_cfg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1)).setIndexNames((0, 'NTNTECH-CHASSIS-CONFIGURATION-MIB', 'advCfgMumIndex')) if mibBuilder.loadTexts: advCfgEntry.setStatus('current') if mibBuilder.loadTexts: advCfgEntry.setDescription('An entry containing information applicable to an Advanced Configuration parameter.') adv_cfg_mum_index = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2))).setMaxAccess('readonly') if mibBuilder.loadTexts: advCfgMumIndex.setStatus('current') if mibBuilder.loadTexts: advCfgMumIndex.setDescription("Translates to the physical slot number that a MUM200-2/2000-2 module exists within a chassis. The Mini/Micro DSLAMs' physical location is set to 1 by default. See below, chassis type physical location(s) translation ------------ -------------------------------- IPD12000 MUM in slots 13,14 = uimCfgE1MumIndex 1,2 respecitively IPD4000 MUM in slot 5 = uimCfgE1MumIndex 1 Mini DSLAM NA = uimCfgE1MumIndex 1 Micro DSLAM NA = uimCfgE1MumIndex 1 Note: when configuring an Advanced Configuration parameter, the user must enter the index of the MUM, see above table, that corresponds with the IP address of the remote SNMP agent.") adv_cfg_tftp_state = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: advCfgTFTPState.setStatus('current') if mibBuilder.loadTexts: advCfgTFTPState.setDescription('This configuration parameter allows the user the ability to disable, or enable, the TFTP server. By default, this object should have the value enabled(1).') adv_cfg_telnet_state = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: advCfgTelnetState.setStatus('current') if mibBuilder.loadTexts: advCfgTelnetState.setDescription('This configuration parameter allows the user the ability to disable, or enable, telnet. By default, this object should have the value enabled(1).') adv_cfg_mgmt_fltr_ip_start = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1, 4), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: advCfgMgmtFltrIpStart.setStatus('current') if mibBuilder.loadTexts: advCfgMgmtFltrIpStart.setDescription("The start value for the management IP filter range. This parameter is initially set to a default filter range of 0.0.0.0 - 255.255.255.255. Connection to the management system will be allowed only if the user's Ip address value falls within the defined mumCfgMgmtIpStart and mumCfgMgmtIpEnd range.") adv_cfg_mgmt_fltr_ip_end = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1, 5), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: advCfgMgmtFltrIpEnd.setStatus('current') if mibBuilder.loadTexts: advCfgMgmtFltrIpEnd.setDescription("The end value for the management IP filter range. This parameter is initially set to a default filter range of 0.0.0.0 - 255.255.255.255. Connection to the management system will be allowed only if the user's Ip address value falls within the defined mumCfgMgmtIpStart and mumCfgMgmtIpEnd range.") adv_cfg_mgmt_session_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 6, 1, 1, 6), ntn_time_ticks()).setMaxAccess('readwrite') if mibBuilder.loadTexts: advCfgMgmtSessionTimeout.setStatus('current') if mibBuilder.loadTexts: advCfgMgmtSessionTimeout.setDescription('This value defines the length of a password session in seconds. If the session has been idle for a time greater than this value, the browser will be challenged again, even if it has provided authentication credentials with the request.') mum_cfg_management_port = mib_identifier((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7)) mgmt_port_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7, 1)) if mibBuilder.loadTexts: mgmtPortCfgTable.setStatus('current') if mibBuilder.loadTexts: mgmtPortCfgTable.setDescription('A list of the hardware platform management port entries.') mgmt_port_cfg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7, 1, 1)).setIndexNames((0, 'NTNTECH-CHASSIS-CONFIGURATION-MIB', 'mgmtPortCfgMumIndex')) if mibBuilder.loadTexts: mgmtPortCfgEntry.setStatus('current') if mibBuilder.loadTexts: mgmtPortCfgEntry.setDescription('An entry containing information applicable to the managment (ethernet type) port.') mgmt_port_cfg_mum_index = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2))).setMaxAccess('readonly') if mibBuilder.loadTexts: mgmtPortCfgMumIndex.setStatus('current') if mibBuilder.loadTexts: mgmtPortCfgMumIndex.setDescription("Translates to the physical slot number that a MUM200-2/2000-2 module exists within a chassis. The Mini/Micro DSLAMs' physical location is set to 1 by default. See below, chassis type physical location(s) translation ------------ -------------------------------- IPD12000 MUM in slots 13,14 = uimCfgEthMumIndex 1,2 respecitively IPD4000 MUM in slot 5 = uimCfgEthMumIndex 1 Mini DSLAM NA = uimCfgEthMumIndex 1 Micro DSLAM NA = uimCfgEthMumIndex 1 Note: when configuring a management port, the user must enter the index of the MUM, see above table, that corresponds with the IP address of the remote SNMP agent.") mgmt_port_cfg_rx_tx_rate = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('uimEthAutoNegotiate', 0), ('uimEth10', 1), ('uimEth100', 2), ('uimEthGig', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mgmtPortCfgRxTxRate.setStatus('current') if mibBuilder.loadTexts: mgmtPortCfgRxTxRate.setDescription('Set the RxTx rate for an ethernet management port.') mgmt_port_cfg_duplex = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('uimEthAutoNegotiate', 0), ('uimEthHalf', 1), ('uimEthFull', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mgmtPortCfgDuplex.setStatus('current') if mibBuilder.loadTexts: mgmtPortCfgDuplex.setDescription('Set the duplex setting for an ethernet management port.') mgmt_port_cfg_type = mib_table_column((1, 3, 6, 1, 4, 1, 8059, 1, 1, 1, 1, 1, 1, 7, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('mgmt', 1), ('uplink', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mgmtPortCfgType.setStatus('current') if mibBuilder.loadTexts: mgmtPortCfgType.setDescription('Set the management port type as follows. By setting this port to mgmt(1), it will operate as a non-bridge mode connection. Setting it to uplink(2), this port will operate like an uplink interface module, i.e. a bridge mode connection. Note: this applies to the AuD8000-12 micro DSLAM only.') mibBuilder.exportSymbols('NTNTECH-CHASSIS-CONFIGURATION-MIB', uimCfgE1Index=uimCfgE1Index, uimCfgT1Frame=uimCfgT1Frame, snmpCfgNoticeIpAddress=snmpCfgNoticeIpAddress, mgmtPortCfgEntry=mgmtPortCfgEntry, snmpCfgNoticeIndex=snmpCfgNoticeIndex, chsCfgMIBObjects=chsCfgMIBObjects, advCfgTelnetState=advCfgTelnetState, mgmtPortCfgDuplex=mgmtPortCfgDuplex, mumCfgUplinkInterfaceModule=mumCfgUplinkInterfaceModule, mgmtPortCfgType=mgmtPortCfgType, advCfgTFTPState=advCfgTFTPState, mumCfgNotes=mumCfgNotes, uimCfgEthIndex=uimCfgEthIndex, snmpCfgAuthenticationTrapState=snmpCfgAuthenticationTrapState, mgmtPortCfgRxTxRate=mgmtPortCfgRxTxRate, mumCfgIpAddress=mumCfgIpAddress, uimCfgE1LineCode=uimCfgE1LineCode, snmpCfgNoticeIpEntry=snmpCfgNoticeIpEntry, PYSNMP_MODULE_ID=ntntechChassisConfigurationMIB, uimCfgEthTable=uimCfgEthTable, uimCfgE1Table=uimCfgE1Table, uimCfgT1Index=uimCfgT1Index, snmpCfgNoticeIpTable=snmpCfgNoticeIpTable, snmpCfgCommunity=snmpCfgCommunity, mumCfgSubnetMask=mumCfgSubnetMask, uimCfgT1Entry=uimCfgT1Entry, mgmtPortCfgTable=mgmtPortCfgTable, mgmtPortCfgMumIndex=mgmtPortCfgMumIndex, mumCfgTable=mumCfgTable, mumCfgAdvanced=mumCfgAdvanced, uimCfgE1MumIndex=uimCfgE1MumIndex, uimCfgE1Entry=uimCfgE1Entry, unqEmbHttpWebsrvrState=unqEmbHttpWebsrvrState, mumCfgEntry=mumCfgEntry, uimCfgEthMumIndex=uimCfgEthMumIndex, mumCfgCommitChange=mumCfgCommitChange, snmpCfgModulePortTrapState=snmpCfgModulePortTrapState, advCfgTable=advCfgTable, mumCfgInterConnection=mumCfgInterConnection, uimCfgEthEntry=uimCfgEthEntry, comReadWriteAccess=comReadWriteAccess, uimCfgEthDuplex=uimCfgEthDuplex, snmpCfgEnvironmentTrapState=snmpCfgEnvironmentTrapState, snmpCfgColdstartTrapState=snmpCfgColdstartTrapState, mumSNMPConfiguration=mumSNMPConfiguration, ntntechChassisConfigurationMIB=ntntechChassisConfigurationMIB, uimCfgT1LineBuildout=uimCfgT1LineBuildout, uimCfgT1Table=uimCfgT1Table, chsCfgParameterConfiguration=chsCfgParameterConfiguration, comReadOnlyAccess=comReadOnlyAccess, mumCfgIndex=mumCfgIndex, uimCfgT1LineCode=uimCfgT1LineCode, advCfgEntry=advCfgEntry, advCfgMumIndex=advCfgMumIndex, advCfgMgmtSessionTimeout=advCfgMgmtSessionTimeout, mumCfgDefaultGateway=mumCfgDefaultGateway, mumCfgInbandMgmt=mumCfgInbandMgmt, mumCfgUniques=mumCfgUniques, mumCfgManagementPort=mumCfgManagementPort, uimCfgT1MumIndex=uimCfgT1MumIndex, uimCfgE1Frame=uimCfgE1Frame, mumCfgInbandMGMTVlanID=mumCfgInbandMGMTVlanID, advCfgMgmtFltrIpEnd=advCfgMgmtFltrIpEnd, prmCfgMultiplexerUplinkModule=prmCfgMultiplexerUplinkModule, advCfgMgmtFltrIpStart=advCfgMgmtFltrIpStart, uimCfgEthRxTxRate=uimCfgEthRxTxRate)
load("@bazel_gazelle//:deps.bzl", "go_repository") def go_repositories(): go_repository( name = "com_github_deepmap_oapi_codegen", importpath = "github.com/deepmap/oapi-codegen", sum = "h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU=", version = "v1.8.2", ) go_repository( name = "com_github_cyberdelia_templates", importpath = "github.com/cyberdelia/templates", sum = "h1:/ovYnF02fwL0kvspmy9AuyKg1JhdTRUgPw4nUxd9oZM=", version = "v0.0.0-20141128023046-ca7fffd4298c", ) go_repository( name = "com_github_davecgh_go_spew", importpath = "github.com/davecgh/go-spew", sum = "h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=", version = "v1.1.1", ) go_repository( name = "com_github_dgrijalva_jwt_go", importpath = "github.com/dgrijalva/jwt-go", sum = "h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=", version = "v3.2.0+incompatible", ) go_repository( name = "com_github_getkin_kin_openapi", importpath = "github.com/getkin/kin-openapi", sum = "h1:6awGqF5nG5zkVpMsAih1QH4VgzS8phTxECUWIFo7zko=", version = "v0.61.0", ) go_repository( name = "com_github_ghodss_yaml", importpath = "github.com/ghodss/yaml", sum = "h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=", version = "v1.0.0", ) go_repository( name = "com_github_go_chi_chi_v5", importpath = "github.com/go-chi/chi/v5", sum = "h1:DBPx88FjZJH3FsICfDAfIfnb7XxKIYVGG6lOPlhENAg=", version = "v5.0.0", ) go_repository( name = "com_github_go_openapi_jsonpointer", importpath = "github.com/go-openapi/jsonpointer", sum = "h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=", version = "v0.19.5", ) go_repository( name = "com_github_go_openapi_swag", importpath = "github.com/go-openapi/swag", sum = "h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=", version = "v0.19.5", ) go_repository( name = "com_github_golangci_lint_1", importpath = "github.com/golangci/lint-1", sum = "h1:utua3L2IbQJmauC5IXdEA547bcoU5dozgQAfc8Onsg4=", version = "v0.0.0-20181222135242-d2cdd8c08219", ) go_repository( name = "com_github_gorilla_mux", importpath = "github.com/gorilla/mux", sum = "h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=", version = "v1.8.0", ) go_repository( name = "com_github_kr_pretty", importpath = "github.com/kr/pretty", sum = "h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=", version = "v0.1.0", ) go_repository( name = "com_github_kr_pty", importpath = "github.com/kr/pty", sum = "h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=", version = "v1.1.1", ) go_repository( name = "com_github_kr_text", importpath = "github.com/kr/text", sum = "h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=", version = "v0.1.0", ) go_repository( name = "com_github_labstack_echo_v4", importpath = "github.com/labstack/echo/v4", sum = "h1:LF5Iq7t/jrtUuSutNuiEWtB5eiHfZ5gSe2pcu5exjQw=", version = "v4.2.1", ) go_repository( name = "com_github_labstack_gommon", importpath = "github.com/labstack/gommon", sum = "h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=", version = "v0.3.0", ) go_repository( name = "com_github_mailru_easyjson", importpath = "github.com/mailru/easyjson", sum = "h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8=", version = "v0.0.0-20190626092158-b2ccc519800e", ) go_repository( name = "com_github_matryer_moq", importpath = "github.com/matryer/moq", sum = "h1:HvFwW+cm9bCbZ/+vuGNq7CRWXql8c0y8nGeYpqmpvmk=", version = "v0.0.0-20190312154309-6cfb0558e1bd", ) go_repository( name = "com_github_mattn_go_colorable", importpath = "github.com/mattn/go-colorable", sum = "h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=", version = "v0.1.8", ) go_repository( name = "com_github_mattn_go_isatty", importpath = "github.com/mattn/go-isatty", sum = "h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=", version = "v0.0.12", ) go_repository( name = "com_github_pkg_errors", importpath = "github.com/pkg/errors", sum = "h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=", version = "v0.8.1", ) go_repository( name = "com_github_pmezard_go_difflib", importpath = "github.com/pmezard/go-difflib", sum = "h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=", version = "v1.0.0", ) go_repository( name = "com_github_stretchr_objx", importpath = "github.com/stretchr/objx", sum = "h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=", version = "v0.1.0", ) go_repository( name = "com_github_stretchr_testify", importpath = "github.com/stretchr/testify", sum = "h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=", version = "v1.5.1", ) go_repository( name = "com_github_valyala_bytebufferpool", importpath = "github.com/valyala/bytebufferpool", sum = "h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=", version = "v1.0.0", ) go_repository( name = "com_github_valyala_fasttemplate", importpath = "github.com/valyala/fasttemplate", sum = "h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4=", version = "v1.2.1", ) go_repository( name = "in_gopkg_check_v1", importpath = "gopkg.in/check.v1", sum = "h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=", version = "v1.0.0-20180628173108-788fd7840127", ) go_repository( name = "in_gopkg_yaml_v2", importpath = "gopkg.in/yaml.v2", sum = "h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=", version = "v2.3.0", ) go_repository( name = "org_golang_x_crypto", importpath = "golang.org/x/crypto", sum = "h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY=", version = "v0.0.0-20201221181555-eec23a3978ad", ) go_repository( name = "org_golang_x_net", importpath = "golang.org/x/net", sum = "h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew=", version = "v0.0.0-20210119194325-5f4716e94777", ) go_repository( name = "org_golang_x_sync", importpath = "golang.org/x/sync", sum = "h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=", version = "v0.0.0-20190423024810-112230192c58", ) go_repository( name = "org_golang_x_sys", importpath = "golang.org/x/sys", sum = "h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=", version = "v0.0.0-20210124154548-22da62e12c0c", ) go_repository( name = "org_golang_x_term", importpath = "golang.org/x/term", sum = "h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=", version = "v0.0.0-20201126162022-7de9c90e9dd1", ) go_repository( name = "org_golang_x_text", importpath = "golang.org/x/text", sum = "h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=", version = "v0.3.5", ) go_repository( name = "org_golang_x_time", importpath = "golang.org/x/time", sum = "h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE=", version = "v0.0.0-20210220033141-f8bda1e9f3ba", ) go_repository( name = "org_golang_x_tools", importpath = "golang.org/x/tools", sum = "h1:kDxGY2VmgABOe55qheT/TFqUMtcTHnomIPS1iv3G4Ms=", version = "v0.0.0-20191125144606-a911d9008d1f", ) go_repository( name = "org_golang_x_xerrors", importpath = "golang.org/x/xerrors", sum = "h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=", version = "v0.0.0-20190717185122-a985d3407aa7", )
load('@bazel_gazelle//:deps.bzl', 'go_repository') def go_repositories(): go_repository(name='com_github_deepmap_oapi_codegen', importpath='github.com/deepmap/oapi-codegen', sum='h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU=', version='v1.8.2') go_repository(name='com_github_cyberdelia_templates', importpath='github.com/cyberdelia/templates', sum='h1:/ovYnF02fwL0kvspmy9AuyKg1JhdTRUgPw4nUxd9oZM=', version='v0.0.0-20141128023046-ca7fffd4298c') go_repository(name='com_github_davecgh_go_spew', importpath='github.com/davecgh/go-spew', sum='h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=', version='v1.1.1') go_repository(name='com_github_dgrijalva_jwt_go', importpath='github.com/dgrijalva/jwt-go', sum='h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=', version='v3.2.0+incompatible') go_repository(name='com_github_getkin_kin_openapi', importpath='github.com/getkin/kin-openapi', sum='h1:6awGqF5nG5zkVpMsAih1QH4VgzS8phTxECUWIFo7zko=', version='v0.61.0') go_repository(name='com_github_ghodss_yaml', importpath='github.com/ghodss/yaml', sum='h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=', version='v1.0.0') go_repository(name='com_github_go_chi_chi_v5', importpath='github.com/go-chi/chi/v5', sum='h1:DBPx88FjZJH3FsICfDAfIfnb7XxKIYVGG6lOPlhENAg=', version='v5.0.0') go_repository(name='com_github_go_openapi_jsonpointer', importpath='github.com/go-openapi/jsonpointer', sum='h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=', version='v0.19.5') go_repository(name='com_github_go_openapi_swag', importpath='github.com/go-openapi/swag', sum='h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=', version='v0.19.5') go_repository(name='com_github_golangci_lint_1', importpath='github.com/golangci/lint-1', sum='h1:utua3L2IbQJmauC5IXdEA547bcoU5dozgQAfc8Onsg4=', version='v0.0.0-20181222135242-d2cdd8c08219') go_repository(name='com_github_gorilla_mux', importpath='github.com/gorilla/mux', sum='h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=', version='v1.8.0') go_repository(name='com_github_kr_pretty', importpath='github.com/kr/pretty', sum='h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=', version='v0.1.0') go_repository(name='com_github_kr_pty', importpath='github.com/kr/pty', sum='h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=', version='v1.1.1') go_repository(name='com_github_kr_text', importpath='github.com/kr/text', sum='h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=', version='v0.1.0') go_repository(name='com_github_labstack_echo_v4', importpath='github.com/labstack/echo/v4', sum='h1:LF5Iq7t/jrtUuSutNuiEWtB5eiHfZ5gSe2pcu5exjQw=', version='v4.2.1') go_repository(name='com_github_labstack_gommon', importpath='github.com/labstack/gommon', sum='h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=', version='v0.3.0') go_repository(name='com_github_mailru_easyjson', importpath='github.com/mailru/easyjson', sum='h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8=', version='v0.0.0-20190626092158-b2ccc519800e') go_repository(name='com_github_matryer_moq', importpath='github.com/matryer/moq', sum='h1:HvFwW+cm9bCbZ/+vuGNq7CRWXql8c0y8nGeYpqmpvmk=', version='v0.0.0-20190312154309-6cfb0558e1bd') go_repository(name='com_github_mattn_go_colorable', importpath='github.com/mattn/go-colorable', sum='h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=', version='v0.1.8') go_repository(name='com_github_mattn_go_isatty', importpath='github.com/mattn/go-isatty', sum='h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=', version='v0.0.12') go_repository(name='com_github_pkg_errors', importpath='github.com/pkg/errors', sum='h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=', version='v0.8.1') go_repository(name='com_github_pmezard_go_difflib', importpath='github.com/pmezard/go-difflib', sum='h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=', version='v1.0.0') go_repository(name='com_github_stretchr_objx', importpath='github.com/stretchr/objx', sum='h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=', version='v0.1.0') go_repository(name='com_github_stretchr_testify', importpath='github.com/stretchr/testify', sum='h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=', version='v1.5.1') go_repository(name='com_github_valyala_bytebufferpool', importpath='github.com/valyala/bytebufferpool', sum='h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=', version='v1.0.0') go_repository(name='com_github_valyala_fasttemplate', importpath='github.com/valyala/fasttemplate', sum='h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4=', version='v1.2.1') go_repository(name='in_gopkg_check_v1', importpath='gopkg.in/check.v1', sum='h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=', version='v1.0.0-20180628173108-788fd7840127') go_repository(name='in_gopkg_yaml_v2', importpath='gopkg.in/yaml.v2', sum='h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=', version='v2.3.0') go_repository(name='org_golang_x_crypto', importpath='golang.org/x/crypto', sum='h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY=', version='v0.0.0-20201221181555-eec23a3978ad') go_repository(name='org_golang_x_net', importpath='golang.org/x/net', sum='h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew=', version='v0.0.0-20210119194325-5f4716e94777') go_repository(name='org_golang_x_sync', importpath='golang.org/x/sync', sum='h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=', version='v0.0.0-20190423024810-112230192c58') go_repository(name='org_golang_x_sys', importpath='golang.org/x/sys', sum='h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=', version='v0.0.0-20210124154548-22da62e12c0c') go_repository(name='org_golang_x_term', importpath='golang.org/x/term', sum='h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=', version='v0.0.0-20201126162022-7de9c90e9dd1') go_repository(name='org_golang_x_text', importpath='golang.org/x/text', sum='h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=', version='v0.3.5') go_repository(name='org_golang_x_time', importpath='golang.org/x/time', sum='h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE=', version='v0.0.0-20210220033141-f8bda1e9f3ba') go_repository(name='org_golang_x_tools', importpath='golang.org/x/tools', sum='h1:kDxGY2VmgABOe55qheT/TFqUMtcTHnomIPS1iv3G4Ms=', version='v0.0.0-20191125144606-a911d9008d1f') go_repository(name='org_golang_x_xerrors', importpath='golang.org/x/xerrors', sum='h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=', version='v0.0.0-20190717185122-a985d3407aa7')
def get_days(datetime_1,datetime_2,work_timing,weekends,holidays_list): # Here a datetime without full work time still is count as a day first_day = datetime_1 days = 1 while(first_day.day < datetime_2.day): if((first_day.isoweekday() not in weekends) and (first_day.strftime("%Y-%m-%d") not in holidays_list)): days += 1 first_day += datetime.timedelta(days=1) return days def get_hours(datetime_1,datetime_2,work_timing,weekends,holidays_list): #Round up if(datetime_1 > datetime_2): hours = 0 else: days = get_days(datetime_1,datetime_2,work_timing,weekends,holidays_list) if(days > 1): days = days - 2 #The day function is rounded up, so this ignore the last and first day hours_day = work_timing[1] - work_timing[0] hours = days * hours_day if(datetime_1.hour < work_timing[0]): #This calculate working hours in the first day hours_first_day = hours_day; elif(datetime_1.hour > work_timing[1]): hours_first_day = 0 else: hours_first_day = work_timing[1] - datetime_1.hour if(datetime_2.hour > work_timing[1]): #This calculate working hours in the last day hours_last_day = hours_day; elif(datetime_2.hour < work_timing[0]): hours_last_day = 0 else: hours_last_day = datetime_2.hour - work_timing[0] hours = hours + hours_first_day + hours_last_day else: hours = datetime_1.hour - datetime_2.hour #days minimum value is suposed to be 1 return hours def get_hours_and_minutes(datetime_1,datetime_2,work_timing,weekends,holidays_list): if(datetime_1 > datetime_2): minutes = 0 hours = 0 else: if((datetime_1.hour < work_timing[0]) or (datetime_1.hour > work_timing[1])): minute_1 = 0 else: minute_1 = datetime_1.minute if((datetime_2.hour < work_timing[0]) or (datetime_2.hour > work_timing[1])): minute_2 = 0 else: minute_2 = datetime_2.minute if(minute_1 < minute_2): minutes = minute_2 - minute_1 elif(minute_1 > minute_2): minutes = 60 + minute_2 - minute_1 else: minutes = 0 if((datetime_1.hour < work_timing[0]) or (datetime_1.hour > work_timing[1])): hours_1 = 0 else: hours_1 = datetime_1.hour if((datetime_2.hour < work_timing[0]) or (datetime_2.hour > work_timing[1])): hours_2 = 0 else: hours_2 = datetime_2.hour #Generate hours days = get_days(datetime_1,datetime_2,work_timing,weekends,holidays_list) if(days > 1): days = days - 2 hours_day = work_timing[1] - work_timing[0] hours = days * hours_day + hours_2 + (8 - hours_1) else: if(hours_1 < hours_2): hours = hours_2 - hours_1 elif(hours_1 > hours_2): hours = 8 + hours_2 - hours_1 else: hours = 0 return str(hours) + ':' + str(minutes)
def get_days(datetime_1, datetime_2, work_timing, weekends, holidays_list): first_day = datetime_1 days = 1 while first_day.day < datetime_2.day: if first_day.isoweekday() not in weekends and first_day.strftime('%Y-%m-%d') not in holidays_list: days += 1 first_day += datetime.timedelta(days=1) return days def get_hours(datetime_1, datetime_2, work_timing, weekends, holidays_list): if datetime_1 > datetime_2: hours = 0 else: days = get_days(datetime_1, datetime_2, work_timing, weekends, holidays_list) if days > 1: days = days - 2 hours_day = work_timing[1] - work_timing[0] hours = days * hours_day if datetime_1.hour < work_timing[0]: hours_first_day = hours_day elif datetime_1.hour > work_timing[1]: hours_first_day = 0 else: hours_first_day = work_timing[1] - datetime_1.hour if datetime_2.hour > work_timing[1]: hours_last_day = hours_day elif datetime_2.hour < work_timing[0]: hours_last_day = 0 else: hours_last_day = datetime_2.hour - work_timing[0] hours = hours + hours_first_day + hours_last_day else: hours = datetime_1.hour - datetime_2.hour return hours def get_hours_and_minutes(datetime_1, datetime_2, work_timing, weekends, holidays_list): if datetime_1 > datetime_2: minutes = 0 hours = 0 else: if datetime_1.hour < work_timing[0] or datetime_1.hour > work_timing[1]: minute_1 = 0 else: minute_1 = datetime_1.minute if datetime_2.hour < work_timing[0] or datetime_2.hour > work_timing[1]: minute_2 = 0 else: minute_2 = datetime_2.minute if minute_1 < minute_2: minutes = minute_2 - minute_1 elif minute_1 > minute_2: minutes = 60 + minute_2 - minute_1 else: minutes = 0 if datetime_1.hour < work_timing[0] or datetime_1.hour > work_timing[1]: hours_1 = 0 else: hours_1 = datetime_1.hour if datetime_2.hour < work_timing[0] or datetime_2.hour > work_timing[1]: hours_2 = 0 else: hours_2 = datetime_2.hour days = get_days(datetime_1, datetime_2, work_timing, weekends, holidays_list) if days > 1: days = days - 2 hours_day = work_timing[1] - work_timing[0] hours = days * hours_day + hours_2 + (8 - hours_1) elif hours_1 < hours_2: hours = hours_2 - hours_1 elif hours_1 > hours_2: hours = 8 + hours_2 - hours_1 else: hours = 0 return str(hours) + ':' + str(minutes)
class DBController(): def insert(): pass def connect(): pass
class Dbcontroller: def insert(): pass def connect(): pass
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 12 empirical models of protein evolution adopted from `PAML 4.9e <http://abacus.gene.ucl.ac.uk/software/paml.html>`_: """ cprev10 = """ 105 227 357 175 43 4435 669 823 538 10 157 1745 768 400 10 499 152 1055 3691 10 3122 665 243 653 431 303 133 379 66 715 1405 331 441 1269 162 19 145 136 168 10 280 92 148 40 29 197 203 113 10 396 286 82 20 66 1745 236 4482 2430 412 48 3313 2629 263 305 345 218 185 125 61 47 159 202 113 21 10 1772 1351 193 68 53 97 22 726 10 145 25 127 454 1268 72 327 490 87 173 170 285 323 185 28 152 117 219 302 100 43 2440 385 2085 590 2331 396 568 691 303 216 516 868 93 487 1202 1340 314 1393 266 576 241 369 92 32 1040 156 918 645 148 260 2151 14 230 40 18 435 53 63 82 69 42 159 10 86 468 49 73 29 56 323 754 281 1466 391 142 10 1971 89 189 247 215 2370 97 522 71 346 968 92 83 75 592 54 200 91 25 4797 865 249 475 317 122 167 760 10 119 0.0755 0.0621 0.0410 0.0371 0.0091 0.0382 0.0495 0.0838 0.0246 0.0806 0.1011 0.0504 0.0220 0.0506 0.0431 0.0622 0.0543 0.0181 0.0307 0.0660 A R N D C Q E G H I L K M F P S T W Y V Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val """ cprev64 = """ 6.5 4.5 10.6 84.3 9.5 643.2 19.5 353.7 10.9 10.7 6.1 486.3 18.0 11.6 0.1 74.5 21.5 13.0 437.4 0.1 342.6 118.1 183.9 17.4 150.3 86.8 7.1 161.9 2.8 346.6 345.3 202.4 111.8 450.1 6.2 2.2 1.5 50.6 25.6 5.6 3.4 3.6 4.3 2.5 8.4 3.9 36.9 2.4 5.9 20.3 26.1 5.1 3.4 17.3 205.0 4.2 712.1 639.2 10.1 0.1 500.5 426.6 29.3 9.2 37.9 10.8 13.4 53.5 9.9 3.8 10.5 9.5 9.6 3.8 3.6 534.9 142.8 83.6 4.3 5.0 8.7 7.5 238.0 2.4 7.7 3.1 11.0 61.0 542.3 9.4 3.8 91.2 69.0 3.5 13.4 6.5 145.6 8.1 2.6 133.9 2.1 155.8 21.2 10.5 12.6 251.1 82.9 271.4 34.8 471.9 10.7 16.4 136.7 19.2 36.2 160.3 23.9 6.2 249.4 348.6 467.5 82.5 215.5 8.0 7.4 5.4 11.6 6.3 3.8 266.2 10.7 140.2 295.2 3.6 181.2 144.8 3.4 171.8 6.1 3.5 518.6 17.0 9.1 49.0 5.7 3.3 98.8 2.3 11.1 34.1 1.1 56.3 1.5 2.2 4.3 69.9 202.9 579.1 9.4 9.1 2.1 889.2 10.8 9.6 20.1 3.4 255.9 5.6 264.3 3.3 21.7 363.2 8.4 1.6 10.3 37.8 5.1 21.6 76.0 1.1 595.0 155.8 9.2 191.9 102.2 7.7 10.1 36.8 5.0 7.2 0.061007 0.060799 0.043028 0.038515 0.011297 0.035406 0.050764 0.073749 0.024609 0.085629 0.106930 0.046704 0.023382 0.056136 0.043289 0.073994 0.052078 0.018023 0.036043 0.058620 A R N D C Q E G H I L K M F P S T W Y V Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val """ dayhoff = """ 27 98 32 120 0 905 36 23 0 0 89 246 103 134 0 198 1 148 1153 0 716 240 9 139 125 11 28 81 23 240 535 86 28 606 43 10 65 64 77 24 44 18 61 0 7 41 15 34 0 0 73 11 7 44 257 26 464 318 71 0 153 83 27 26 46 18 72 90 1 0 0 114 30 17 0 336 527 243 18 14 14 0 0 0 0 15 48 196 157 0 92 250 103 42 13 19 153 51 34 94 12 32 33 17 11 409 154 495 95 161 56 79 234 35 24 17 96 62 46 245 371 26 229 66 16 53 34 30 22 192 33 136 104 13 78 550 0 201 23 0 0 0 0 0 27 0 46 0 0 76 0 75 0 24 8 95 0 96 0 22 0 127 37 28 13 0 698 0 34 42 61 208 24 15 18 49 35 37 54 44 889 175 10 258 12 48 30 157 0 28 0.087127 0.040904 0.040432 0.046872 0.033474 0.038255 0.049530 0.088612 0.033618 0.036886 0.085357 0.080482 0.014753 0.039772 0.050680 0.069577 0.058542 0.010494 0.029916 0.064718 A R N D C Q E G H I L K M F P S T W Y V Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val """ dayhoff_dcmut = """ """ jones_dcmut = """ 0.531678 0.557967 0.451095 0.827445 0.154899 5.549530 0.574478 1.019843 0.313311 0.105625 0.556725 3.021995 0.768834 0.521646 0.091304 1.066681 0.318483 0.578115 7.766557 0.053907 3.417706 1.740159 1.359652 0.773313 1.272434 0.546389 0.231294 1.115632 0.219970 3.210671 4.025778 1.032342 0.724998 5.684080 0.243768 0.201696 0.361684 0.239195 0.491003 0.115968 0.150559 0.078270 0.111773 0.053769 0.181788 0.310007 0.372261 0.137289 0.061486 0.164593 0.709004 0.097485 0.069492 0.540571 2.335139 0.369437 6.529255 2.529517 0.282466 0.049009 2.966732 1.731684 0.269840 0.525096 0.202562 0.146481 0.469395 0.431045 0.330720 0.190001 0.409202 0.456901 0.175084 0.130379 0.329660 4.831666 3.856906 0.624581 0.138293 0.065314 0.073481 0.032522 0.678335 0.045683 0.043829 0.050212 0.453428 0.777090 2.500294 0.024521 0.436181 1.959599 0.710489 0.121804 0.127164 0.123653 1.608126 0.191994 0.208081 1.141961 0.098580 1.060504 0.216345 0.164215 0.148483 3.887095 1.001551 5.057964 0.589268 2.155331 0.548807 0.312449 1.874296 0.743458 0.405119 0.592511 0.474478 0.285564 0.943971 2.788406 4.582565 0.650282 2.351311 0.425159 0.469823 0.523825 0.331584 0.316862 0.477355 2.553806 0.272514 0.965641 2.114728 0.138904 1.176961 4.777647 0.084329 1.257961 0.027700 0.057466 1.104181 0.172206 0.114381 0.544180 0.128193 0.134510 0.530324 0.089134 0.201334 0.537922 0.069965 0.310927 0.080556 0.139492 0.235601 0.700693 0.453952 2.114852 0.254745 0.063452 0.052500 5.848400 0.303445 0.241094 0.087904 0.189870 5.484236 0.113850 0.628608 0.201094 0.747889 2.924161 0.171995 0.164525 0.315261 0.621323 0.179771 0.465271 0.470140 0.121827 9.533943 1.761439 0.124066 3.038533 0.593478 0.211561 0.408532 1.143980 0.239697 0.165473 0.076862 0.051057 0.042546 0.051269 0.020279 0.041061 0.061820 0.074714 0.022983 0.052569 0.091111 0.059498 0.023414 0.040530 0.050532 0.068225 0.058518 0.014336 0.032303 0.066374 A R N D C Q E G H I L K M F P S T W Y V Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val """ jones = """ 58 54 45 81 16 528 56 113 34 10 57 310 86 49 9 105 29 58 767 5 323 179 137 81 130 59 26 119 27 328 391 112 69 597 26 23 36 22 47 11 17 9 12 6 16 30 38 12 7 23 72 9 6 56 229 35 646 263 26 7 292 181 27 45 21 14 54 44 30 15 31 43 18 14 33 479 388 65 15 5 10 4 78 4 5 5 40 89 248 4 43 194 74 15 15 14 164 18 24 115 10 102 21 16 17 378 101 503 59 223 53 30 201 73 40 59 47 29 92 285 475 64 232 38 42 51 32 33 46 245 25 103 226 12 118 477 9 126 8 4 115 18 10 55 8 9 52 10 24 53 6 35 12 11 20 70 46 209 24 7 8 573 32 24 8 18 536 10 63 21 71 298 17 16 31 62 20 45 47 11 961 180 14 323 62 23 38 112 25 16 0.076748 0.051691 0.042645 0.051544 0.019803 0.040752 0.061830 0.073152 0.022944 0.053761 0.091904 0.058676 0.023826 0.040126 0.050901 0.068765 0.058565 0.014261 0.032102 0.066005 A R N D C Q E G H I L K M F P S T W Y V Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val 0.98754 0.00030 0.00023 0.00042 0.00011 0.00023 0.00065 0.00130 0.00006 0.00020 0.00028 0.00021 0.00013 0.00006 0.00098 0.00257 0.00275 0.00001 0.00003 0.00194 0.00044 0.98974 0.00019 0.00008 0.00022 0.00125 0.00018 0.00099 0.00075 0.00012 0.00035 0.00376 0.00010 0.00002 0.00037 0.00069 0.00037 0.00018 0.00006 0.00012 0.00042 0.00023 0.98720 0.00269 0.00007 0.00035 0.00036 0.00059 0.00089 0.00025 0.00011 0.00153 0.00007 0.00004 0.00008 0.00342 0.00135 0.00001 0.00022 0.00011 0.00062 0.00008 0.00223 0.98954 0.00002 0.00020 0.00470 0.00095 0.00025 0.00006 0.00006 0.00015 0.00004 0.00002 0.00008 0.00041 0.00023 0.00001 0.00015 0.00020 0.00043 0.00058 0.00015 0.00005 0.99432 0.00004 0.00003 0.00043 0.00016 0.00009 0.00021 0.00004 0.00007 0.00031 0.00007 0.00152 0.00025 0.00016 0.00067 0.00041 0.00044 0.00159 0.00037 0.00025 0.00002 0.98955 0.00198 0.00019 0.00136 0.00005 0.00066 0.00170 0.00010 0.00002 0.00083 0.00037 0.00030 0.00003 0.00008 0.00013 0.00080 0.00015 0.00025 0.00392 0.00001 0.00130 0.99055 0.00087 0.00006 0.00006 0.00009 0.00105 0.00004 0.00002 0.00009 0.00021 0.00019 0.00001 0.00002 0.00029 0.00136 0.00070 0.00035 0.00067 0.00012 0.00011 0.00074 0.99350 0.00005 0.00003 0.00006 0.00016 0.00003 0.00002 0.00013 0.00137 0.00020 0.00008 0.00003 0.00031 0.00021 0.00168 0.00165 0.00057 0.00014 0.00241 0.00016 0.00017 0.98864 0.00009 0.00051 0.00027 0.00008 0.00016 0.00058 0.00050 0.00027 0.00001 0.00182 0.00008 0.00029 0.00011 0.00020 0.00006 0.00003 0.00004 0.00007 0.00004 0.00004 0.98729 0.00209 0.00012 0.00113 0.00035 0.00005 0.00027 0.00142 0.00001 0.00010 0.00627 0.00023 0.00019 0.00005 0.00004 0.00005 0.00029 0.00006 0.00005 0.00013 0.00122 0.99330 0.00008 0.00092 0.00099 0.00052 0.00040 0.00015 0.00007 0.00008 0.00118 0.00027 0.00331 0.00111 0.00014 0.00001 0.00118 0.00111 0.00020 0.00011 0.00011 0.00013 0.99100 0.00015 0.00002 0.00011 0.00032 0.00060 0.00001 0.00003 0.00009 0.00042 0.00023 0.00013 0.00008 0.00006 0.00018 0.00011 0.00011 0.00007 0.00255 0.00354 0.00038 0.98818 0.00017 0.00008 0.00020 0.00131 0.00003 0.00006 0.00212 0.00011 0.00003 0.00004 0.00002 0.00015 0.00002 0.00003 0.00004 0.00009 0.00047 0.00227 0.00002 0.00010 0.99360 0.00009 0.00063 0.00007 0.00008 0.00171 0.00041 0.00148 0.00038 0.00007 0.00008 0.00003 0.00067 0.00011 0.00018 0.00026 0.00006 0.00093 0.00012 0.00004 0.00007 0.99270 0.00194 0.00069 0.00001 0.00003 0.00015 0.00287 0.00052 0.00212 0.00031 0.00044 0.00022 0.00018 0.00146 0.00017 0.00021 0.00054 0.00027 0.00007 0.00037 0.00144 0.98556 0.00276 0.00005 0.00020 0.00025 0.00360 0.00033 0.00098 0.00020 0.00008 0.00021 0.00020 0.00024 0.00011 0.00131 0.00024 0.00060 0.00053 0.00005 0.00060 0.00324 0.98665 0.00002 0.00007 0.00074 0.00007 0.00065 0.00003 0.00002 0.00023 0.00008 0.00006 0.00040 0.00002 0.00005 0.00048 0.00006 0.00006 0.00021 0.00003 0.00024 0.00007 0.99686 0.00023 0.00017 0.00008 0.00010 0.00030 0.00024 0.00041 0.00010 0.00004 0.00006 0.00130 0.00017 0.00022 0.00005 0.00004 0.00214 0.00005 0.00043 0.00012 0.00010 0.99392 0.00011 0.00226 0.00009 0.00007 0.00016 0.00012 0.00008 0.00027 0.00034 0.00003 0.00511 0.00165 0.00008 0.00076 0.00025 0.00012 0.00026 0.00066 0.00004 0.00005 0.98761 """ lg = """ 0.425093 0.276818 0.751878 0.395144 0.123954 5.076149 2.489084 0.534551 0.528768 0.062556 0.969894 2.807908 1.695752 0.523386 0.084808 1.038545 0.363970 0.541712 5.243870 0.003499 4.128591 2.066040 0.390192 1.437645 0.844926 0.569265 0.267959 0.348847 0.358858 2.426601 4.509238 0.927114 0.640543 4.813505 0.423881 0.311484 0.149830 0.126991 0.191503 0.010690 0.320627 0.072854 0.044265 0.008705 0.108882 0.395337 0.301848 0.068427 0.015076 0.594007 0.582457 0.069673 0.044261 0.366317 4.145067 0.536518 6.326067 2.145078 0.282959 0.013266 3.234294 1.807177 0.296636 0.697264 0.159069 0.137500 1.124035 0.484133 0.371004 0.025548 0.893680 1.672569 0.173735 0.139538 0.442472 4.273607 6.312358 0.656604 0.253701 0.052722 0.089525 0.017416 1.105251 0.035855 0.018811 0.089586 0.682139 1.112727 2.592692 0.023918 1.798853 1.177651 0.332533 0.161787 0.394456 0.075382 0.624294 0.419409 0.196961 0.508851 0.078281 0.249060 0.390322 0.099849 0.094464 4.727182 0.858151 4.008358 1.240275 2.784478 1.223828 0.611973 1.739990 0.990012 0.064105 0.182287 0.748683 0.346960 0.361819 1.338132 2.139501 0.578987 2.000679 0.425860 1.143480 1.080136 0.604545 0.129836 0.584262 1.033739 0.302936 1.136863 2.020366 0.165001 0.571468 6.472279 0.180717 0.593607 0.045376 0.029890 0.670128 0.236199 0.077852 0.268491 0.597054 0.111660 0.619632 0.049906 0.696175 2.457121 0.095131 0.248862 0.140825 0.218959 0.314440 0.612025 0.135107 1.165532 0.257336 0.120037 0.054679 5.306834 0.232523 0.299648 0.131932 0.481306 7.803902 0.089613 0.400547 0.245841 3.151815 2.547870 0.170887 0.083688 0.037967 1.959291 0.210332 0.245034 0.076701 0.119013 10.649107 1.702745 0.185202 1.898718 0.654683 0.296501 0.098369 2.188158 0.189510 0.249313 0.079066 0.055941 0.041977 0.053052 0.012937 0.040767 0.071586 0.057337 0.022355 0.062157 0.099081 0.064600 0.022951 0.042302 0.044040 0.061197 0.053287 0.012066 0.034155 0.069147 A R N D C Q E G H I L K M F P S T W Y V Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val """ mtart = """ 0.2 0.2 0.2 1 4 500 254 36 98 11 0.2 154 262 0.2 0.2 0.2 0.2 183 862 0.2 262 200 0.2 121 12 81 3 44 0.2 41 180 0.2 12 314 15 0.2 26 2 21 7 63 11 7 3 0.2 4 2 13 1 79 16 2 1 6 515 0.2 209 467 2 0.2 349 106 0.2 0.2 3 4 121 5 79 0.2 312 67 0.2 56 0.2 515 885 106 13 5 20 0.2 184 0.2 0.2 1 14 118 263 11 322 49 0.2 17 0.2 0.2 39 8 0.2 1 0.2 12 17 5 15 673 3 398 44 664 52 31 226 11 7 8 144 112 36 87 244 0.2 166 0.2 183 44 43 0.2 19 204 48 70 289 14 47 660 0.2 0.2 8 0.2 22 7 11 2 0.2 0.2 21 16 71 54 0.2 2 0.2 1 4 251 0.2 72 87 8 9 191 12 20 117 71 792 18 30 46 38 340 0.2 23 0.2 350 0.2 14 3 0.2 1855 85 26 281 52 32 61 544 0.2 2 0.054116 0.018227 0.039903 0.020160 0.009709 0.018781 0.024289 0.068183 0.024518 0.092638 0.148658 0.021718 0.061453 0.088668 0.041826 0.091030 0.049194 0.029786 0.039443 0.057700 A R N D C Q E G H I L K M F P S T W Y V Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val """ mtmam = """ 32 2 4 11 0 864 0 186 0 0 0 246 8 49 0 0 0 0 569 0 274 78 18 47 79 0 0 22 8 232 458 11 305 550 22 0 75 0 19 0 41 0 0 0 0 21 6 0 0 27 20 0 0 26 232 0 50 408 0 0 242 215 0 0 6 4 76 0 21 0 0 22 0 0 0 378 609 59 0 0 6 5 7 0 0 0 0 57 246 0 11 53 9 33 2 0 51 0 0 53 5 43 18 0 17 342 3 446 16 347 30 21 112 20 0 74 65 47 90 202 681 0 110 0 114 0 4 0 1 360 34 50 691 8 78 614 5 16 6 0 65 0 0 0 0 0 12 0 13 0 7 17 0 0 0 156 0 530 54 0 1 1525 16 25 67 0 682 8 107 0 14 398 0 0 10 0 33 20 5 0 2220 100 0 832 6 0 0 237 0 0 0.0692 0.0184 0.0400 0.0186 0.0065 0.0238 0.0236 0.0557 0.0277 0.0905 0.1675 0.0221 0.0561 0.0611 0.0536 0.0725 0.0870 0.0293 0.0340 0.0428 A R N D C Q E G H I L K M F P S T W Y V Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val """ mtrev24 = """ 23.18 26.95 13.24 17.67 1.90 794.38 59.93 103.33 58.94 1.90 1.90 220.99 173.56 55.28 75.24 9.77 1.90 63.05 583.55 1.90 313.56 120.71 23.03 53.30 56.77 30.71 6.75 28.28 13.90 165.23 496.13 113.99 141.49 582.40 49.12 1.90 96.49 1.90 27.10 4.34 62.73 8.34 3.31 5.98 12.26 25.46 15.58 15.16 1.90 25.65 39.70 1.90 2.41 11.49 329.09 8.36 141.40 608.70 2.31 1.90 465.58 313.86 22.73 127.67 19.57 14.88 141.88 1.90 65.41 1.90 6.18 47.37 1.90 1.90 11.97 517.98 537.53 91.37 6.37 4.69 15.20 4.98 70.80 19.11 2.67 1.90 48.16 84.67 216.06 6.44 90.82 54.31 23.64 73.31 13.43 31.26 137.29 12.83 1.90 60.97 20.63 40.10 50.10 18.84 17.31 387.86 6.04 494.39 69.02 277.05 54.11 54.71 125.93 77.46 47.70 73.61 105.79 111.16 64.29 169.90 480.72 2.08 238.46 28.01 179.97 94.93 14.82 11.17 44.78 368.43 126.40 136.33 528.17 33.85 128.22 597.21 1.90 21.95 10.68 19.86 33.60 1.90 1.90 10.92 7.08 1.90 32.44 24.00 21.71 7.84 4.21 38.58 9.99 6.48 1.90 191.36 21.21 254.77 38.82 13.12 3.21 670.14 25.01 44.15 51.17 39.96 465.58 16.21 64.92 38.73 26.25 195.06 7.64 1.90 1.90 1.90 19.00 21.14 2.53 1.90 1222.94 91.67 1.90 387.54 6.35 8.23 1.90 204.54 5.37 1.90 0.072 0.019 0.039 0.019 0.006 0.025 0.024 0.056 0.028 0.088 0.169 0.023 0.054 0.061 0.054 0.072 0.086 0.029 0.033 0.043 A R N D C Q E G H I L K M F P S T W Y V Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val """ mtzoa = """ 3.3 1.7 33.6 16.1 3.2 617.0 272.5 61.1 94.6 9.5 7.3 231.0 190.3 19.3 49.1 17.1 6.4 174.0 883.6 3.4 349.4 289.3 7.2 99.3 26.0 82.4 8.9 43.1 2.3 61.7 228.9 55.6 37.5 421.8 14.9 7.4 33.2 0.2 24.3 1.5 48.8 0.2 7.3 3.4 1.6 15.6 4.1 7.9 0.5 59.7 23.0 1.0 3.5 6.6 425.2 0.2 292.3 413.4 0.2 0.2 334.0 163.2 10.1 23.9 8.4 6.7 136.5 3.8 73.7 0.2 264.8 83.9 0.2 52.2 7.1 449.7 636.3 83.0 26.5 0.2 12.9 2.0 167.8 9.5 0.2 5.8 13.1 90.3 234.2 16.3 215.6 61.8 7.5 22.6 0.2 8.1 52.2 20.6 1.3 15.6 2.6 11.4 24.3 5.4 10.5 644.9 11.8 420.2 51.4 656.3 96.4 38.4 257.1 23.1 7.2 15.2 144.9 95.3 32.2 79.7 378.1 3.2 184.6 2.3 199.0 39.4 34.5 5.2 19.4 222.3 50.0 75.5 305.1 19.3 56.9 666.3 3.1 16.9 6.4 0.2 36.1 6.1 3.5 12.3 4.5 9.7 27.2 6.6 48.7 58.2 1.3 10.3 3.6 2.1 13.8 141.6 13.9 76.7 52.3 10.0 4.3 266.5 13.1 5.7 45.0 41.4 590.5 4.2 29.7 29.0 79.8 321.9 5.1 7.1 3.7 243.8 9.0 16.3 23.7 0.3 1710.6 126.1 11.1 279.6 59.6 17.9 49.5 396.4 13.7 15.6 0.068880 0.021037 0.030390 0.020696 0.009966 0.018623 0.024989 0.071968 0.026814 0.085072 0.156717 0.019276 0.050652 0.081712 0.044803 0.080535 0.056386 0.027998 0.037404 0.066083 A R N D C Q E G H I L K M F P S T W Y V Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val """ wag = """ 0.551571 0.509848 0.635346 0.738998 0.147304 5.429420 1.027040 0.528191 0.265256 0.0302949 0.908598 3.035500 1.543640 0.616783 0.0988179 1.582850 0.439157 0.947198 6.174160 0.021352 5.469470 1.416720 0.584665 1.125560 0.865584 0.306674 0.330052 0.567717 0.316954 2.137150 3.956290 0.930676 0.248972 4.294110 0.570025 0.249410 0.193335 0.186979 0.554236 0.039437 0.170135 0.113917 0.127395 0.0304501 0.138190 0.397915 0.497671 0.131528 0.0848047 0.384287 0.869489 0.154263 0.0613037 0.499462 3.170970 0.906265 5.351420 3.012010 0.479855 0.0740339 3.894900 2.584430 0.373558 0.890432 0.323832 0.257555 0.893496 0.683162 0.198221 0.103754 0.390482 1.545260 0.315124 0.174100 0.404141 4.257460 4.854020 0.934276 0.210494 0.102711 0.0961621 0.0467304 0.398020 0.0999208 0.0811339 0.049931 0.679371 1.059470 2.115170 0.088836 1.190630 1.438550 0.679489 0.195081 0.423984 0.109404 0.933372 0.682355 0.243570 0.696198 0.0999288 0.415844 0.556896 0.171329 0.161444 3.370790 1.224190 3.974230 1.071760 1.407660 1.028870 0.704939 1.341820 0.740169 0.319440 0.344739 0.967130 0.493905 0.545931 1.613280 2.121110 0.554413 2.030060 0.374866 0.512984 0.857928 0.822765 0.225833 0.473307 1.458160 0.326622 1.386980 1.516120 0.171903 0.795384 4.378020 0.113133 1.163920 0.0719167 0.129767 0.717070 0.215737 0.156557 0.336983 0.262569 0.212483 0.665309 0.137505 0.515706 1.529640 0.139405 0.523742 0.110864 0.240735 0.381533 1.086000 0.325711 0.543833 0.227710 0.196303 0.103604 3.873440 0.420170 0.398618 0.133264 0.428437 6.454280 0.216046 0.786993 0.291148 2.485390 2.006010 0.251849 0.196246 0.152335 1.002140 0.301281 0.588731 0.187247 0.118358 7.821300 1.800340 0.305434 2.058450 0.649892 0.314887 0.232739 1.388230 0.365369 0.314730 0.0866279 0.043972 0.0390894 0.0570451 0.0193078 0.0367281 0.0580589 0.0832518 0.0244313 0.048466 0.086209 0.0620286 0.0195027 0.0384319 0.0457631 0.0695179 0.0610127 0.0143859 0.0352742 0.0708956 A R N D C Q E G H I L K M F P S T W Y V Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val """ models = {'cprev10': cprev10, 'cprev64': cprev64, 'dayhoff': dayhoff, 'dayhoff-dcmut': dayhoff_dcmut, 'jones-dcmut': jones_dcmut, 'jtt': jones, 'jones': jones, 'lg': lg, 'mtart': mtart, 'mtmam': mtmam, 'mtrev24': mtrev24, 'mtzoa': mtzoa, 'wag': wag}
""" 12 empirical models of protein evolution adopted from `PAML 4.9e <http://abacus.gene.ucl.ac.uk/software/paml.html>`_: """ cprev10 = '\n\n 105\n 227 357\n 175 43 4435\n 669 823 538 10\n 157 1745 768 400 10\n 499 152 1055 3691 10 3122\n 665 243 653 431 303 133 379\n 66 715 1405 331 441 1269 162 19\n 145 136 168 10 280 92 148 40 29\n 197 203 113 10 396 286 82 20 66 1745\n 236 4482 2430 412 48 3313 2629 263 305 345 218\n 185 125 61 47 159 202 113 21 10 1772 1351 193\n 68 53 97 22 726 10 145 25 127 454 1268 72 327\n 490 87 173 170 285 323 185 28 152 117 219 302 100 43\n 2440 385 2085 590 2331 396 568 691 303 216 516 868 93 487 1202\n 1340 314 1393 266 576 241 369 92 32 1040 156 918 645 148 260 2151\n 14 230 40 18 435 53 63 82 69 42 159 10 86 468 49 73 29\n 56 323 754 281 1466 391 142 10 1971 89 189 247 215 2370 97 522 71 346\n 968 92 83 75 592 54 200 91 25 4797 865 249 475 317 122 167 760 10 119\n\n0.0755 0.0621 0.0410 0.0371 0.0091 0.0382 0.0495 0.0838 0.0246 0.0806 0.1011 0.0504 0.0220 0.0506 0.0431 0.0622 0.0543 0.0181 0.0307 0.0660\n\n A R N D C Q E G H I L K M F P S T W Y V\nAla Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val\n\n' cprev64 = '\n\n 6.5\n 4.5 10.6\n 84.3 9.5 643.2\n 19.5 353.7 10.9 10.7\n 6.1 486.3 18.0 11.6 0.1\n 74.5 21.5 13.0 437.4 0.1 342.6\n 118.1 183.9 17.4 150.3 86.8 7.1 161.9\n 2.8 346.6 345.3 202.4 111.8 450.1 6.2 2.2\n 1.5 50.6 25.6 5.6 3.4 3.6 4.3 2.5 8.4\n 3.9 36.9 2.4 5.9 20.3 26.1 5.1 3.4 17.3 205.0\n 4.2 712.1 639.2 10.1 0.1 500.5 426.6 29.3 9.2 37.9 10.8\n 13.4 53.5 9.9 3.8 10.5 9.5 9.6 3.8 3.6 534.9 142.8 83.6\n 4.3 5.0 8.7 7.5 238.0 2.4 7.7 3.1 11.0 61.0 542.3 9.4 3.8\n 91.2 69.0 3.5 13.4 6.5 145.6 8.1 2.6 133.9 2.1 155.8 21.2 10.5 12.6\n 251.1 82.9 271.4 34.8 471.9 10.7 16.4 136.7 19.2 36.2 160.3 23.9 6.2 249.4 348.6\n 467.5 82.5 215.5 8.0 7.4 5.4 11.6 6.3 3.8 266.2 10.7 140.2 295.2 3.6 181.2 144.8\n 3.4 171.8 6.1 3.5 518.6 17.0 9.1 49.0 5.7 3.3 98.8 2.3 11.1 34.1 1.1 56.3 1.5\n 2.2 4.3 69.9 202.9 579.1 9.4 9.1 2.1 889.2 10.8 9.6 20.1 3.4 255.9 5.6 264.3 3.3 21.7\n 363.2 8.4 1.6 10.3 37.8 5.1 21.6 76.0 1.1 595.0 155.8 9.2 191.9 102.2 7.7 10.1 36.8 5.0 7.2\n\n0.061007 0.060799 0.043028 0.038515 0.011297 0.035406 0.050764 0.073749 0.024609 0.085629 0.106930 0.046704 0.023382 0.056136 0.043289 0.073994 0.052078 0.018023 0.036043 0.058620\n\n A R N D C Q E G H I L K M F P S T W Y V\nAla Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val\n\n' dayhoff = '\n \n 27\n 98 32\n120 0 905\n 36 23 0 0\n 89 246 103 134 0\n198 1 148 1153 0 716\n240 9 139 125 11 28 81\n 23 240 535 86 28 606 43 10\n 65 64 77 24 44 18 61 0 7\n 41 15 34 0 0 73 11 7 44 257\n 26 464 318 71 0 153 83 27 26 46 18\n 72 90 1 0 0 114 30 17 0 336 527 243\n 18 14 14 0 0 0 0 15 48 196 157 0 92\n250 103 42 13 19 153 51 34 94 12 32 33 17 11\n409 154 495 95 161 56 79 234 35 24 17 96 62 46 245\n371 26 229 66 16 53 34 30 22 192 33 136 104 13 78 550\n 0 201 23 0 0 0 0 0 27 0 46 0 0 76 0 75 0\n 24 8 95 0 96 0 22 0 127 37 28 13 0 698 0 34 42 61\n208 24 15 18 49 35 37 54 44 889 175 10 258 12 48 30 157 0 28\n\n0.087127 0.040904 0.040432 0.046872 0.033474 0.038255 0.049530 0.088612 0.033618 0.036886 0.085357 0.080482 0.014753 0.039772 0.050680 0.069577 0.058542 0.010494 0.029916 0.064718\n\n A R N D C Q E G H I L K M F P S T W Y V\nAla Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val\n\n' dayhoff_dcmut = '\n' jones_dcmut = '\n\n0.531678\n0.557967 0.451095\n0.827445 0.154899 5.549530\n0.574478 1.019843 0.313311 0.105625\n0.556725 3.021995 0.768834 0.521646 0.091304\n1.066681 0.318483 0.578115 7.766557 0.053907 3.417706\n1.740159 1.359652 0.773313 1.272434 0.546389 0.231294 1.115632\n0.219970 3.210671 4.025778 1.032342 0.724998 5.684080 0.243768 0.201696\n0.361684 0.239195 0.491003 0.115968 0.150559 0.078270 0.111773 0.053769 0.181788\n0.310007 0.372261 0.137289 0.061486 0.164593 0.709004 0.097485 0.069492 0.540571 2.335139\n0.369437 6.529255 2.529517 0.282466 0.049009 2.966732 1.731684 0.269840 0.525096 0.202562 0.146481\n0.469395 0.431045 0.330720 0.190001 0.409202 0.456901 0.175084 0.130379 0.329660 4.831666 3.856906 0.624581\n0.138293 0.065314 0.073481 0.032522 0.678335 0.045683 0.043829 0.050212 0.453428 0.777090 2.500294 0.024521 0.436181\n1.959599 0.710489 0.121804 0.127164 0.123653 1.608126 0.191994 0.208081 1.141961 0.098580 1.060504 0.216345 0.164215 0.148483\n3.887095 1.001551 5.057964 0.589268 2.155331 0.548807 0.312449 1.874296 0.743458 0.405119 0.592511 0.474478 0.285564 0.943971 2.788406\n4.582565 0.650282 2.351311 0.425159 0.469823 0.523825 0.331584 0.316862 0.477355 2.553806 0.272514 0.965641 2.114728 0.138904 1.176961 4.777647\n0.084329 1.257961 0.027700 0.057466 1.104181 0.172206 0.114381 0.544180 0.128193 0.134510 0.530324 0.089134 0.201334 0.537922 0.069965 0.310927 0.080556\n0.139492 0.235601 0.700693 0.453952 2.114852 0.254745 0.063452 0.052500 5.848400 0.303445 0.241094 0.087904 0.189870 5.484236 0.113850 0.628608 0.201094 0.747889\n2.924161 0.171995 0.164525 0.315261 0.621323 0.179771 0.465271 0.470140 0.121827 9.533943 1.761439 0.124066 3.038533 0.593478 0.211561 0.408532 1.143980 0.239697 0.165473\n\n0.076862 0.051057 0.042546 0.051269 0.020279 0.041061 0.061820 0.074714 0.022983 0.052569 0.091111 0.059498 0.023414 0.040530 0.050532 0.068225 0.058518 0.014336 0.032303 0.066374\n\n A R N D C Q E G H I L K M F P S T W Y V\nAla Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val\n\n' jones = '\n \n 58\n 54 45\n 81 16 528\n 56 113 34 10\n 57 310 86 49 9\n105 29 58 767 5 323\n179 137 81 130 59 26 119\n 27 328 391 112 69 597 26 23\n 36 22 47 11 17 9 12 6 16\n 30 38 12 7 23 72 9 6 56 229\n 35 646 263 26 7 292 181 27 45 21 14\n 54 44 30 15 31 43 18 14 33 479 388 65\n 15 5 10 4 78 4 5 5 40 89 248 4 43\n194 74 15 15 14 164 18 24 115 10 102 21 16 17\n378 101 503 59 223 53 30 201 73 40 59 47 29 92 285\n475 64 232 38 42 51 32 33 46 245 25 103 226 12 118 477\n 9 126 8 4 115 18 10 55 8 9 52 10 24 53 6 35 12\n 11 20 70 46 209 24 7 8 573 32 24 8 18 536 10 63 21 71\n298 17 16 31 62 20 45 47 11 961 180 14 323 62 23 38 112 25 16\n\n0.076748 0.051691 0.042645 0.051544 0.019803 0.040752 0.061830 0.073152 0.022944 0.053761 0.091904 0.058676 0.023826 0.040126 0.050901 0.068765 0.058565 0.014261 0.032102 0.066005\n\n A R N D C Q E G H I L K M F P S T W Y V\nAla Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val\n\n0.98754 0.00030 0.00023 0.00042 0.00011 0.00023 0.00065 0.00130 0.00006 0.00020 0.00028 0.00021 0.00013 0.00006 0.00098 0.00257 0.00275 0.00001 0.00003 0.00194\n0.00044 0.98974 0.00019 0.00008 0.00022 0.00125 0.00018 0.00099 0.00075 0.00012 0.00035 0.00376 0.00010 0.00002 0.00037 0.00069 0.00037 0.00018 0.00006 0.00012\n0.00042 0.00023 0.98720 0.00269 0.00007 0.00035 0.00036 0.00059 0.00089 0.00025 0.00011 0.00153 0.00007 0.00004 0.00008 0.00342 0.00135 0.00001 0.00022 0.00011\n0.00062 0.00008 0.00223 0.98954 0.00002 0.00020 0.00470 0.00095 0.00025 0.00006 0.00006 0.00015 0.00004 0.00002 0.00008 0.00041 0.00023 0.00001 0.00015 0.00020\n0.00043 0.00058 0.00015 0.00005 0.99432 0.00004 0.00003 0.00043 0.00016 0.00009 0.00021 0.00004 0.00007 0.00031 0.00007 0.00152 0.00025 0.00016 0.00067 0.00041\n0.00044 0.00159 0.00037 0.00025 0.00002 0.98955 0.00198 0.00019 0.00136 0.00005 0.00066 0.00170 0.00010 0.00002 0.00083 0.00037 0.00030 0.00003 0.00008 0.00013\n0.00080 0.00015 0.00025 0.00392 0.00001 0.00130 0.99055 0.00087 0.00006 0.00006 0.00009 0.00105 0.00004 0.00002 0.00009 0.00021 0.00019 0.00001 0.00002 0.00029\n0.00136 0.00070 0.00035 0.00067 0.00012 0.00011 0.00074 0.99350 0.00005 0.00003 0.00006 0.00016 0.00003 0.00002 0.00013 0.00137 0.00020 0.00008 0.00003 0.00031\n0.00021 0.00168 0.00165 0.00057 0.00014 0.00241 0.00016 0.00017 0.98864 0.00009 0.00051 0.00027 0.00008 0.00016 0.00058 0.00050 0.00027 0.00001 0.00182 0.00008\n0.00029 0.00011 0.00020 0.00006 0.00003 0.00004 0.00007 0.00004 0.00004 0.98729 0.00209 0.00012 0.00113 0.00035 0.00005 0.00027 0.00142 0.00001 0.00010 0.00627\n0.00023 0.00019 0.00005 0.00004 0.00005 0.00029 0.00006 0.00005 0.00013 0.00122 0.99330 0.00008 0.00092 0.00099 0.00052 0.00040 0.00015 0.00007 0.00008 0.00118\n0.00027 0.00331 0.00111 0.00014 0.00001 0.00118 0.00111 0.00020 0.00011 0.00011 0.00013 0.99100 0.00015 0.00002 0.00011 0.00032 0.00060 0.00001 0.00003 0.00009\n0.00042 0.00023 0.00013 0.00008 0.00006 0.00018 0.00011 0.00011 0.00007 0.00255 0.00354 0.00038 0.98818 0.00017 0.00008 0.00020 0.00131 0.00003 0.00006 0.00212\n0.00011 0.00003 0.00004 0.00002 0.00015 0.00002 0.00003 0.00004 0.00009 0.00047 0.00227 0.00002 0.00010 0.99360 0.00009 0.00063 0.00007 0.00008 0.00171 0.00041\n0.00148 0.00038 0.00007 0.00008 0.00003 0.00067 0.00011 0.00018 0.00026 0.00006 0.00093 0.00012 0.00004 0.00007 0.99270 0.00194 0.00069 0.00001 0.00003 0.00015\n0.00287 0.00052 0.00212 0.00031 0.00044 0.00022 0.00018 0.00146 0.00017 0.00021 0.00054 0.00027 0.00007 0.00037 0.00144 0.98556 0.00276 0.00005 0.00020 0.00025\n0.00360 0.00033 0.00098 0.00020 0.00008 0.00021 0.00020 0.00024 0.00011 0.00131 0.00024 0.00060 0.00053 0.00005 0.00060 0.00324 0.98665 0.00002 0.00007 0.00074\n0.00007 0.00065 0.00003 0.00002 0.00023 0.00008 0.00006 0.00040 0.00002 0.00005 0.00048 0.00006 0.00006 0.00021 0.00003 0.00024 0.00007 0.99686 0.00023 0.00017\n0.00008 0.00010 0.00030 0.00024 0.00041 0.00010 0.00004 0.00006 0.00130 0.00017 0.00022 0.00005 0.00004 0.00214 0.00005 0.00043 0.00012 0.00010 0.99392 0.00011\n0.00226 0.00009 0.00007 0.00016 0.00012 0.00008 0.00027 0.00034 0.00003 0.00511 0.00165 0.00008 0.00076 0.00025 0.00012 0.00026 0.00066 0.00004 0.00005 0.98761\n\n' lg = '\n\n0.425093\n0.276818 0.751878\n0.395144 0.123954 5.076149\n2.489084 0.534551 0.528768 0.062556\n0.969894 2.807908 1.695752 0.523386 0.084808\n1.038545 0.363970 0.541712 5.243870 0.003499 4.128591\n2.066040 0.390192 1.437645 0.844926 0.569265 0.267959 0.348847\n0.358858 2.426601 4.509238 0.927114 0.640543 4.813505 0.423881 0.311484\n0.149830 0.126991 0.191503 0.010690 0.320627 0.072854 0.044265 0.008705 0.108882\n0.395337 0.301848 0.068427 0.015076 0.594007 0.582457 0.069673 0.044261 0.366317 4.145067\n0.536518 6.326067 2.145078 0.282959 0.013266 3.234294 1.807177 0.296636 0.697264 0.159069 0.137500\n1.124035 0.484133 0.371004 0.025548 0.893680 1.672569 0.173735 0.139538 0.442472 4.273607 6.312358 0.656604\n0.253701 0.052722 0.089525 0.017416 1.105251 0.035855 0.018811 0.089586 0.682139 1.112727 2.592692 0.023918 1.798853\n1.177651 0.332533 0.161787 0.394456 0.075382 0.624294 0.419409 0.196961 0.508851 0.078281 0.249060 0.390322 0.099849 0.094464\n4.727182 0.858151 4.008358 1.240275 2.784478 1.223828 0.611973 1.739990 0.990012 0.064105 0.182287 0.748683 0.346960 0.361819 1.338132\n2.139501 0.578987 2.000679 0.425860 1.143480 1.080136 0.604545 0.129836 0.584262 1.033739 0.302936 1.136863 2.020366 0.165001 0.571468 6.472279\n0.180717 0.593607 0.045376 0.029890 0.670128 0.236199 0.077852 0.268491 0.597054 0.111660 0.619632 0.049906 0.696175 2.457121 0.095131 0.248862 0.140825\n0.218959 0.314440 0.612025 0.135107 1.165532 0.257336 0.120037 0.054679 5.306834 0.232523 0.299648 0.131932 0.481306 7.803902 0.089613 0.400547 0.245841 3.151815\n2.547870 0.170887 0.083688 0.037967 1.959291 0.210332 0.245034 0.076701 0.119013 10.649107 1.702745 0.185202 1.898718 0.654683 0.296501 0.098369 2.188158 0.189510 0.249313\n\n0.079066 0.055941 0.041977 0.053052 0.012937 0.040767 0.071586 0.057337 0.022355 0.062157 0.099081 0.064600 0.022951 0.042302 0.044040 0.061197 0.053287 0.012066 0.034155 0.069147\n\n A R N D C Q E G H I L K M F P S T W Y V\nAla Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val\n\n' mtart = '\n\n0.2\n0.2 0.2\n1 4 500\n254 36 98 11\n0.2 154 262 0.2 0.2\n0.2 0.2 183 862 0.2 262\n200 0.2 121 12 81 3 44\n0.2 41 180 0.2 12 314 15 0.2\n26 2 21 7 63 11 7 3 0.2\n4 2 13 1 79 16 2 1 6 515\n0.2 209 467 2 0.2 349 106 0.2 0.2 3 4\n121 5 79 0.2 312 67 0.2 56 0.2 515 885 106\n13 5 20 0.2 184 0.2 0.2 1 14 118 263 11 322\n49 0.2 17 0.2 0.2 39 8 0.2 1 0.2 12 17 5 15\n673 3 398 44 664 52 31 226 11 7 8 144 112 36 87\n244 0.2 166 0.2 183 44 43 0.2 19 204 48 70 289 14 47 660\n0.2 0.2 8 0.2 22 7 11 2 0.2 0.2 21 16 71 54 0.2 2 0.2\n1 4 251 0.2 72 87 8 9 191 12 20 117 71 792 18 30 46 38\n340 0.2 23 0.2 350 0.2 14 3 0.2 1855 85 26 281 52 32 61 544 0.2 2\n\n0.054116 0.018227 0.039903 0.020160 0.009709 0.018781 0.024289 0.068183 0.024518 0.092638 0.148658 0.021718 0.061453 0.088668 0.041826 0.091030 0.049194 0.029786 0.039443 0.057700\n\n A R N D C Q E G H I L K M F P S T W Y V\nAla Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val\n\n\n' mtmam = '\n\n 32\n 2 4\n 11 0 864\n 0 186 0 0\n 0 246 8 49 0\n 0 0 0 569 0 274\n 78 18 47 79 0 0 22\n 8 232 458 11 305 550 22 0\n 75 0 19 0 41 0 0 0 0\n 21 6 0 0 27 20 0 0 26 232\n 0 50 408 0 0 242 215 0 0 6 4\n 76 0 21 0 0 22 0 0 0 378 609 59\n 0 0 6 5 7 0 0 0 0 57 246 0 11\n 53 9 33 2 0 51 0 0 53 5 43 18 0 17\n342 3 446 16 347 30 21 112 20 0 74 65 47 90 202\n681 0 110 0 114 0 4 0 1 360 34 50 691 8 78 614\n 5 16 6 0 65 0 0 0 0 0 12 0 13 0 7 17 0\n 0 0 156 0 530 54 0 1 1525 16 25 67 0 682 8 107 0 14\n398 0 0 10 0 33 20 5 0 2220 100 0 832 6 0 0 237 0 0\n\n0.0692 0.0184 0.0400 0.0186 0.0065 0.0238 0.0236 0.0557 0.0277 0.0905 0.1675 0.0221 0.0561 0.0611 0.0536 0.0725 0.0870 0.0293 0.0340 0.0428\n\n A R N D C Q E G H I L K M F P S T W Y V\nAla Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val\n\n' mtrev24 = '\n\n 23.18\n 26.95 13.24\n 17.67 1.90 794.38\n 59.93 103.33 58.94 1.90\n 1.90 220.99 173.56 55.28 75.24\n 9.77 1.90 63.05 583.55 1.90 313.56\n 120.71 23.03 53.30 56.77 30.71 6.75 28.28\n 13.90 165.23 496.13 113.99 141.49 582.40 49.12 1.90\n 96.49 1.90 27.10 4.34 62.73 8.34 3.31 5.98 12.26\n 25.46 15.58 15.16 1.90 25.65 39.70 1.90 2.41 11.49 329.09\n 8.36 141.40 608.70 2.31 1.90 465.58 313.86 22.73 127.67 19.57 14.88\n 141.88 1.90 65.41 1.90 6.18 47.37 1.90 1.90 11.97 517.98 537.53 91.37\n 6.37 4.69 15.20 4.98 70.80 19.11 2.67 1.90 48.16 84.67 216.06 6.44 90.82\n 54.31 23.64 73.31 13.43 31.26 137.29 12.83 1.90 60.97 20.63 40.10 50.10 18.84 17.31\n 387.86 6.04 494.39 69.02 277.05 54.11 54.71 125.93 77.46 47.70 73.61 105.79 111.16 64.29 169.90\n 480.72 2.08 238.46 28.01 179.97 94.93 14.82 11.17 44.78 368.43 126.40 136.33 528.17 33.85 128.22 597.21\n 1.90 21.95 10.68 19.86 33.60 1.90 1.90 10.92 7.08 1.90 32.44 24.00 21.71 7.84 4.21 38.58 9.99\n 6.48 1.90 191.36 21.21 254.77 38.82 13.12 3.21 670.14 25.01 44.15 51.17 39.96 465.58 16.21 64.92 38.73 26.25\n 195.06 7.64 1.90 1.90 1.90 19.00 21.14 2.53 1.90 1222.94 91.67 1.90 387.54 6.35 8.23 1.90 204.54 5.37 1.90\n\n0.072 0.019 0.039 0.019 0.006 0.025 0.024 0.056 0.028 0.088 0.169 0.023 0.054 0.061 0.054 0.072 0.086 0.029 0.033 0.043\n\n A R N D C Q E G H I L K M F P S T W Y V\nAla Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val\n\n' mtzoa = '\n\n 3.3\n 1.7 33.6\n 16.1 3.2 617.0\n 272.5 61.1 94.6 9.5\n 7.3 231.0 190.3 19.3 49.1\n 17.1 6.4 174.0 883.6 3.4 349.4\n 289.3 7.2 99.3 26.0 82.4 8.9 43.1\n 2.3 61.7 228.9 55.6 37.5 421.8 14.9 7.4\n 33.2 0.2 24.3 1.5 48.8 0.2 7.3 3.4 1.6\n 15.6 4.1 7.9 0.5 59.7 23.0 1.0 3.5 6.6 425.2\n 0.2 292.3 413.4 0.2 0.2 334.0 163.2 10.1 23.9 8.4 6.7\n 136.5 3.8 73.7 0.2 264.8 83.9 0.2 52.2 7.1 449.7 636.3 83.0\n 26.5 0.2 12.9 2.0 167.8 9.5 0.2 5.8 13.1 90.3 234.2 16.3 215.6\n 61.8 7.5 22.6 0.2 8.1 52.2 20.6 1.3 15.6 2.6 11.4 24.3 5.4 10.5\n 644.9 11.8 420.2 51.4 656.3 96.4 38.4 257.1 23.1 7.2 15.2 144.9 95.3 32.2 79.7\n 378.1 3.2 184.6 2.3 199.0 39.4 34.5 5.2 19.4 222.3 50.0 75.5 305.1 19.3 56.9 666.3\n 3.1 16.9 6.4 0.2 36.1 6.1 3.5 12.3 4.5 9.7 27.2 6.6 48.7 58.2 1.3 10.3 3.6\n 2.1 13.8 141.6 13.9 76.7 52.3 10.0 4.3 266.5 13.1 5.7 45.0 41.4 590.5 4.2 29.7 29.0 79.8\n 321.9 5.1 7.1 3.7 243.8 9.0 16.3 23.7 0.3 1710.6 126.1 11.1 279.6 59.6 17.9 49.5 396.4 13.7 15.6\n\n0.068880 0.021037 0.030390 0.020696 0.009966 0.018623 0.024989 0.071968 0.026814 0.085072 0.156717 0.019276 0.050652 0.081712 0.044803 0.080535 0.056386 0.027998 0.037404 0.066083\n\n A R N D C Q E G H I L K M F P S T W Y V\nAla Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val\n\n' wag = '\n\n0.551571\n0.509848 0.635346\n0.738998 0.147304 5.429420\n1.027040 0.528191 0.265256 0.0302949\n0.908598 3.035500 1.543640 0.616783 0.0988179\n1.582850 0.439157 0.947198 6.174160 0.021352 5.469470\n1.416720 0.584665 1.125560 0.865584 0.306674 0.330052 0.567717\n0.316954 2.137150 3.956290 0.930676 0.248972 4.294110 0.570025 0.249410\n0.193335 0.186979 0.554236 0.039437 0.170135 0.113917 0.127395 0.0304501 0.138190\n0.397915 0.497671 0.131528 0.0848047 0.384287 0.869489 0.154263 0.0613037 0.499462 3.170970\n0.906265 5.351420 3.012010 0.479855 0.0740339 3.894900 2.584430 0.373558 0.890432 0.323832 0.257555\n0.893496 0.683162 0.198221 0.103754 0.390482 1.545260 0.315124 0.174100 0.404141 4.257460 4.854020 0.934276\n0.210494 0.102711 0.0961621 0.0467304 0.398020 0.0999208 0.0811339 0.049931 0.679371 1.059470 2.115170 0.088836 1.190630\n1.438550 0.679489 0.195081 0.423984 0.109404 0.933372 0.682355 0.243570 0.696198 0.0999288 0.415844 0.556896 0.171329 0.161444\n3.370790 1.224190 3.974230 1.071760 1.407660 1.028870 0.704939 1.341820 0.740169 0.319440 0.344739 0.967130 0.493905 0.545931 1.613280\n2.121110 0.554413 2.030060 0.374866 0.512984 0.857928 0.822765 0.225833 0.473307 1.458160 0.326622 1.386980 1.516120 0.171903 0.795384 4.378020\n0.113133 1.163920 0.0719167 0.129767 0.717070 0.215737 0.156557 0.336983 0.262569 0.212483 0.665309 0.137505 0.515706 1.529640 0.139405 0.523742 0.110864\n0.240735 0.381533 1.086000 0.325711 0.543833 0.227710 0.196303 0.103604 3.873440 0.420170 0.398618 0.133264 0.428437 6.454280 0.216046 0.786993 0.291148 2.485390\n2.006010 0.251849 0.196246 0.152335 1.002140 0.301281 0.588731 0.187247 0.118358 7.821300 1.800340 0.305434 2.058450 0.649892 0.314887 0.232739 1.388230 0.365369 0.314730\n\n0.0866279 0.043972 0.0390894 0.0570451 0.0193078 0.0367281 0.0580589 0.0832518 0.0244313 0.048466 0.086209 0.0620286 0.0195027 0.0384319 0.0457631 0.0695179 0.0610127 0.0143859 0.0352742 0.0708956\n\n A R N D C Q E G H I L K M F P S T W Y V\nAla Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val\n\n' models = {'cprev10': cprev10, 'cprev64': cprev64, 'dayhoff': dayhoff, 'dayhoff-dcmut': dayhoff_dcmut, 'jones-dcmut': jones_dcmut, 'jtt': jones, 'jones': jones, 'lg': lg, 'mtart': mtart, 'mtmam': mtmam, 'mtrev24': mtrev24, 'mtzoa': mtzoa, 'wag': wag}
"""Constants for the Sagemcom integration.""" DOMAIN = "sagemcom_fast" CONF_ENCRYPTION_METHOD = "encryption_method" CONF_TRACK_WIRELESS_CLIENTS = "track_wireless_clients" CONF_TRACK_WIRED_CLIENTS = "track_wired_clients" DEFAULT_TRACK_WIRELESS_CLIENTS = True DEFAULT_TRACK_WIRED_CLIENTS = True ATTR_MANUFACTURER = "Sagemcom" MIN_SCAN_INTERVAL = 10 DEFAULT_SCAN_INTERVAL = 10
"""Constants for the Sagemcom integration.""" domain = 'sagemcom_fast' conf_encryption_method = 'encryption_method' conf_track_wireless_clients = 'track_wireless_clients' conf_track_wired_clients = 'track_wired_clients' default_track_wireless_clients = True default_track_wired_clients = True attr_manufacturer = 'Sagemcom' min_scan_interval = 10 default_scan_interval = 10
def make_move(): board = [input().split() for _ in range(n)] my_ptr = 'R' if player == 'RED' else 'B' my_x = my_y = None for i, row in enumerate(board): for j, val in enumerate(row): if val == my_ptr: my_x = i my_y = j delta = [[0, -1, 'L'], [-1, 0, 'U'], [0, 1, 'R'], [1, 0, 'D']] for move in delta: nx = my_x + move[0] ny = my_y + move[1] if nx in range(n) and ny in range(m): if board[nx][ny] == '.': print(move[2]) return if __name__ == '__main__': player = input() level = int(input()) n, m = map(int, input().split()) while True: make_move()
def make_move(): board = [input().split() for _ in range(n)] my_ptr = 'R' if player == 'RED' else 'B' my_x = my_y = None for (i, row) in enumerate(board): for (j, val) in enumerate(row): if val == my_ptr: my_x = i my_y = j delta = [[0, -1, 'L'], [-1, 0, 'U'], [0, 1, 'R'], [1, 0, 'D']] for move in delta: nx = my_x + move[0] ny = my_y + move[1] if nx in range(n) and ny in range(m): if board[nx][ny] == '.': print(move[2]) return if __name__ == '__main__': player = input() level = int(input()) (n, m) = map(int, input().split()) while True: make_move()
class Solution: def largestRectangleArea(self, heights): """ :type heights: List[int] :rtype: int """ if len(heights) == 1: return heights[0] stack = [] # (index, height) max_area = 0 for i, height in enumerate(heights): if i > 0 and height == heights[i-1]: stack[-1] = (i, height) while stack and height < stack[-1][1]: _, curr_height = stack.pop() right = i left = -1 if stack: left = stack[-1][0] width = right - left - 1 curr_area = curr_height * width max_area = max(max_area, curr_area) stack.append((i, height)) while stack: _, curr_height = stack.pop() right = len(heights) left = -1 if stack: left = stack[-1][0] width = right - left - 1 curr_area = curr_height * width max_area = max(max_area, curr_area) return max_area
class Solution: def largest_rectangle_area(self, heights): """ :type heights: List[int] :rtype: int """ if len(heights) == 1: return heights[0] stack = [] max_area = 0 for (i, height) in enumerate(heights): if i > 0 and height == heights[i - 1]: stack[-1] = (i, height) while stack and height < stack[-1][1]: (_, curr_height) = stack.pop() right = i left = -1 if stack: left = stack[-1][0] width = right - left - 1 curr_area = curr_height * width max_area = max(max_area, curr_area) stack.append((i, height)) while stack: (_, curr_height) = stack.pop() right = len(heights) left = -1 if stack: left = stack[-1][0] width = right - left - 1 curr_area = curr_height * width max_area = max(max_area, curr_area) return max_area
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. class ClientConfig: """ Client side configuration of Zeppelin SDK """ def __init__(self, zeppelin_rest_url, query_interval=1, knox_sso_url=None): self.zeppelin_rest_url = zeppelin_rest_url self.query_interval = query_interval self.knox_sso_url = knox_sso_url def get_zeppelin_rest_url(self): return self.zeppelin_rest_url def get_query_interval(self): return self.query_interval
class Clientconfig: """ Client side configuration of Zeppelin SDK """ def __init__(self, zeppelin_rest_url, query_interval=1, knox_sso_url=None): self.zeppelin_rest_url = zeppelin_rest_url self.query_interval = query_interval self.knox_sso_url = knox_sso_url def get_zeppelin_rest_url(self): return self.zeppelin_rest_url def get_query_interval(self): return self.query_interval
class ImportLine: def __init__(self, fromString: str, importString: str): self.__from = fromString self.__import = importString def getFrom(self) -> str: return self.__from def getImport(self) -> str: return self.__import def isSame(self, line2: 'ImportLine') -> bool: return ( line2.getFrom() == self.__from and line2.getImport() == self.__import ) def getDebugString(self): return 'from ' + self.__from + ' import ' + self.__import
class Importline: def __init__(self, fromString: str, importString: str): self.__from = fromString self.__import = importString def get_from(self) -> str: return self.__from def get_import(self) -> str: return self.__import def is_same(self, line2: 'ImportLine') -> bool: return line2.getFrom() == self.__from and line2.getImport() == self.__import def get_debug_string(self): return 'from ' + self.__from + ' import ' + self.__import
nome = 'Djonatan ' sobrenome = 'Schvambach' print(nome + sobrenome) idade = 25 altura = 1.76 e_maior = idade > 18 print('Nome ' + nome + sobrenome + ' Idade ' + str(idade) + ' maior de Idade ? ' + str(e_maior) ) peso = 58 imc = peso / altura ** 2 print(imc)
nome = 'Djonatan ' sobrenome = 'Schvambach' print(nome + sobrenome) idade = 25 altura = 1.76 e_maior = idade > 18 print('Nome ' + nome + sobrenome + ' Idade ' + str(idade) + ' maior de Idade ? ' + str(e_maior)) peso = 58 imc = peso / altura ** 2 print(imc)
# Source : https://leetcode.com/problems/longest-common-prefix/ # Author : foxfromworld # Date : 04/10/2021 # First attempt class Solution: def longestCommonPrefix(self, strs: List[str]) -> str: strs.sort(key=len) result = "" char = set() for i in range(len(strs[0])): for j in range(len(strs)): char.add(strs[j][i]) if len(char) > 1: return result else: result = result + strs[0][i] char.clear() return result
class Solution: def longest_common_prefix(self, strs: List[str]) -> str: strs.sort(key=len) result = '' char = set() for i in range(len(strs[0])): for j in range(len(strs)): char.add(strs[j][i]) if len(char) > 1: return result else: result = result + strs[0][i] char.clear() return result
{ "targets": [ { "target_name": "memcachedNative", "sources": [ "src/init.cc", "src/client.cpp" ], "include_dirs": [ "<!(node -e \"require('nan')\")" ], 'link_settings': { 'libraries': [ '<!@(pkg-config --libs libmemcached)' ] } } ] }
{'targets': [{'target_name': 'memcachedNative', 'sources': ['src/init.cc', 'src/client.cpp'], 'include_dirs': ['<!(node -e "require(\'nan\')")'], 'link_settings': {'libraries': ['<!@(pkg-config --libs libmemcached)']}}]}
class InventoryFullError(Exception): """Exception raised when player inventory is full""" pass
class Inventoryfullerror(Exception): """Exception raised when player inventory is full""" pass
def sisi(): a = 10.0; b = {}; c = "string" return a, b, c sisi()
def sisi(): a = 10.0 b = {} c = 'string' return (a, b, c) sisi()
s=input().split() graph_path = list() graph_path.append(s) for i in range(len(s)-1): graph_path.append(input().split()) print('path input done.') #print(graph_path) s=input().split() weight_path = list() weight_path.append(s) for i in range(len(s)-1): weight_path.append(input().split()) print('weight input done.') #print(graph_path) # graph_path=[ # ['0', '1', '0', '0', '0', '0', '0', '1', '1'], # ['1', '0', '1', '0', '0', '0', '0', '1', '0'], # ['0', '1', '0', '1', '0', '1', '0', '0', '1'], # ['0', '0','1', '0', '1', '1', '0', '0', '0'], # ['0', '0', '0', '1', '0', '1', '0', '0', '1'], # ['0', '0', '1', '1', '1', '0', '1', '0', '0'], # ['0', '0', '0', '0', '0', '1', '0', '1', '1'], # ['1', '1', '0', '0', '0', '0', '1', '0', '1'], # ['1', '0', '1', '0', '1', '0', '1', '1', '0']] # graph_weight=[ # ['0', '3.6', '0', '0', '0', '0', '0', '3.7', '3.9'], # ['3.6', '0', '3.6', '0', '0', '0', '0', '0', '0'], # ['0', '3.6', '0', '3.3', '0', '2', '0', '0', '1.7'], # ['0', '0', '3.3', '0', '3.3', '0', '0', '0', '0'], # ['0', '0','0', '3.3', '0', '4', '0', '0', '3.9'], # ['0', '0', '2', '0', '4', '0', '2', '0', '0'], # ['0', '0', '0', '0', '0', '2', '0', '2', '0'], # ['3.7', '0', '0', '0', '0', '0', '2', '0', '1.7'], # ['3.9', '0', '1.7', '0', '3.9', '0', '0', '1.7', '0'] # ]
s = input().split() graph_path = list() graph_path.append(s) for i in range(len(s) - 1): graph_path.append(input().split()) print('path input done.') s = input().split() weight_path = list() weight_path.append(s) for i in range(len(s) - 1): weight_path.append(input().split()) print('weight input done.')
def word(): word = "CSPIsCool" x = "" for i in word: x += i print(x) def rows(): rows = 10 for i in range(1, rows + 1): for j in range(1, i + 1): print(i * j, end=' ') print() def pattern(): rows = 6 for i in range(0, rows): for j in range(rows - 1, i, -1): print(j, '', end='') for l in range(i): print(' ', end='') for k in range(i + 1, rows): print(k, '', end='') print('\n')
def word(): word = 'CSPIsCool' x = '' for i in word: x += i print(x) def rows(): rows = 10 for i in range(1, rows + 1): for j in range(1, i + 1): print(i * j, end=' ') print() def pattern(): rows = 6 for i in range(0, rows): for j in range(rows - 1, i, -1): print(j, '', end='') for l in range(i): print(' ', end='') for k in range(i + 1, rows): print(k, '', end='') print('\n')
# by adegunlehinabayomi@gmail.com # ______COVID-19 Impact Estimator_______ reportedCases = data_reported_cases population = data-population timeToElapse = data-time-to-elapse totalHospitalBeds = data-total-hospital-beds c_i = 0 iBRT = 0 #return reportedCases, population, timeToElapse, totalHospitalBeds # Challenge 1 def currentlyInfected(r_c, check): if check == 'impact': impactCurrentlyInfected = reportedCases * 10 c_i = impactCurrentlyInfected return c_i elif check == 'severe': severeImpactCurrentlyInfected = reportedCases * 50 c_i = severeImpactCurrentlyInfected return c_i def infectionByRequiredTime(time, x): if time == 'days': infectionByRequiredTime = ((c_i * 512)/28) * timeToElapse elif time == 'months': infectionByRequiredTime = ((c_i * 512)/28) * 30 * timeToElapse elif time == 'weeks': infectionByRequiredTime = ((c_i * 512)/28) * 7 * timeToElapse return infectionByRequiredTime # elif check == 'severe': # if time = days: # infectionByRequiredTime = ((c_i * 512)/28) * x # elif time = 'months': # infectionByRequiredTime = ((c_i * 512)/28) * 30 * x # elif time = 'weeks': # infectionByRequiredTime = ((c_i * 512)/28) * 7 * x # Challenge 2 def severeCasesByRequiredTime(): iBRT = c_i * 512 * 0.15 return iBRT def hospitalBedSpaceByRequiredTime(): hBS = hospitalBedSpace * 0.35 hBSBRT = hBS - iBRT return print(hBSBRT,' Hospital Bedspaces are available') # Challenge 3 def casesForICUByRequestedTime(): c4ICU = iBRT * 0.05 return c4ICU def casesForVentilatorsByRequestedTime(): c4Vent = iBRT * 0.02 return c4Vent def dollarsInFlight(): dIF = iBRT * 30 return dIF def impactCase(r_c, time): i = 'impact' currentlyInfected(reportedCases, i) infectionByRequiredTime(time, i) def severeImpact(): s = 'severe' currentlyInfected(reportedCases, s) infectionByRequiredTime(time, s) def estimator(data): data_supplied = data impactCase() severeImpact() return data, severeImpact, impactCase estimator()
reported_cases = data_reported_cases population = data - population time_to_elapse = data - time - to - elapse total_hospital_beds = data - total - hospital - beds c_i = 0 i_brt = 0 def currently_infected(r_c, check): if check == 'impact': impact_currently_infected = reportedCases * 10 c_i = impactCurrentlyInfected return c_i elif check == 'severe': severe_impact_currently_infected = reportedCases * 50 c_i = severeImpactCurrentlyInfected return c_i def infection_by_required_time(time, x): if time == 'days': infection_by_required_time = c_i * 512 / 28 * timeToElapse elif time == 'months': infection_by_required_time = c_i * 512 / 28 * 30 * timeToElapse elif time == 'weeks': infection_by_required_time = c_i * 512 / 28 * 7 * timeToElapse return infectionByRequiredTime def severe_cases_by_required_time(): i_brt = c_i * 512 * 0.15 return iBRT def hospital_bed_space_by_required_time(): h_bs = hospitalBedSpace * 0.35 h_bsbrt = hBS - iBRT return print(hBSBRT, ' Hospital Bedspaces are available') def cases_for_icu_by_requested_time(): c4_icu = iBRT * 0.05 return c4ICU def cases_for_ventilators_by_requested_time(): c4_vent = iBRT * 0.02 return c4Vent def dollars_in_flight(): d_if = iBRT * 30 return dIF def impact_case(r_c, time): i = 'impact' currently_infected(reportedCases, i) infection_by_required_time(time, i) def severe_impact(): s = 'severe' currently_infected(reportedCases, s) infection_by_required_time(time, s) def estimator(data): data_supplied = data impact_case() severe_impact() return (data, severeImpact, impactCase) estimator()
class Solution(object): def singleNumber(self, nums): """ :type nums: List[int] :rtype: int """ counts = {} for x in nums: if counts.get(x) is None: counts[x] = 1 else: counts[x] += 1 for x in counts: if counts[x] == 1: return x
class Solution(object): def single_number(self, nums): """ :type nums: List[int] :rtype: int """ counts = {} for x in nums: if counts.get(x) is None: counts[x] = 1 else: counts[x] += 1 for x in counts: if counts[x] == 1: return x
possibleprograms = ["Example.exe", "ExampleNr2.exe", "Pavlov-Win64-Shipping.exe"] programdisplaynames = { "Example.exe": "Example", "ExampleNr2.exe": "Whatever name should be displayed", "Pavlov-Win64-Shipping.exe": "Pavlov" } presets = [ [["Spotify.exe", 0.00], ["firefox.exe", 0.50]], [["Spotify.exe", 0.50], ["firefox.exe", 0.00]] ]
possibleprograms = ['Example.exe', 'ExampleNr2.exe', 'Pavlov-Win64-Shipping.exe'] programdisplaynames = {'Example.exe': 'Example', 'ExampleNr2.exe': 'Whatever name should be displayed', 'Pavlov-Win64-Shipping.exe': 'Pavlov'} presets = [[['Spotify.exe', 0.0], ['firefox.exe', 0.5]], [['Spotify.exe', 0.5], ['firefox.exe', 0.0]]]
class _BotCommands: def __init__(self): self.StartCommand = 'start' self.MirrorCommand = 'mirror' self.UnzipMirrorCommand = 'unzipmirror' self.TarMirrorCommand = 'tarmirror' self.CancelMirror = 'cancel' self.CancelAllCommand = 'cancelall' self.ListCommand = 'list' self.StatusCommand = 'status' self.AuthorizedUsersCommand = 'users' self.AuthorizeCommand = 'authorize' self.UnAuthorizeCommand = 'unauthorize' self.AddSudoCommand = 'addsudo' self.RmSudoCommand = 'rmsudo' self.PingCommand = 'ping' self.RestartCommand = 'restart' self.StatsCommand = 'stats' self.HelpCommand = 'help' self.LogCommand = 'log' self.SpeedCommand = 'speedtest' self.CloneCommand = 'clone' self.CountCommand = 'count' self.WatchCommand = 'watch' self.TarWatchCommand = 'tarwatch' self.DeleteCommand = 'del' self.ConfigMenuCommand = 'config' self.ShellCommand = 'shell' self.UpdateCommand = 'update' self.ExecHelpCommand = 'exechelp' self.TsHelpCommand = 'tshelp' BotCommands = _BotCommands()
class _Botcommands: def __init__(self): self.StartCommand = 'start' self.MirrorCommand = 'mirror' self.UnzipMirrorCommand = 'unzipmirror' self.TarMirrorCommand = 'tarmirror' self.CancelMirror = 'cancel' self.CancelAllCommand = 'cancelall' self.ListCommand = 'list' self.StatusCommand = 'status' self.AuthorizedUsersCommand = 'users' self.AuthorizeCommand = 'authorize' self.UnAuthorizeCommand = 'unauthorize' self.AddSudoCommand = 'addsudo' self.RmSudoCommand = 'rmsudo' self.PingCommand = 'ping' self.RestartCommand = 'restart' self.StatsCommand = 'stats' self.HelpCommand = 'help' self.LogCommand = 'log' self.SpeedCommand = 'speedtest' self.CloneCommand = 'clone' self.CountCommand = 'count' self.WatchCommand = 'watch' self.TarWatchCommand = 'tarwatch' self.DeleteCommand = 'del' self.ConfigMenuCommand = 'config' self.ShellCommand = 'shell' self.UpdateCommand = 'update' self.ExecHelpCommand = 'exechelp' self.TsHelpCommand = 'tshelp' bot_commands = __bot_commands()
############################################################################### # Name: make.py # # Purpose: Define Makefile syntax for highlighting and other features # # Author: Cody Precord <cprecord@editra.org> # # Copyright: (c) 2007 Cody Precord <staff@editra.org> # # License: wxWindows License # ############################################################################### """ FILE: make.py AUTHOR: Cody Precord @summary: Lexer configuration module for Makefiles. """ __author__ = "Cody Precord <cprecord@editra.org>" __svnid__ = "$Id: make.py 52852 2008-03-27 13:45:40Z CJP $" __revision__ = "$Revision: 52852 $" #-----------------------------------------------------------------------------# #---- Keyword Specifications ----# # No keywords #---- Syntax Style Specs ----# SYNTAX_ITEMS = [ ('STC_MAKE_DEFAULT', 'default_style'), ('STC_MAKE_COMMENT', 'comment_style'), ('STC_MAKE_IDENTIFIER', "scalar_style"), ('STC_MAKE_IDEOL', 'ideol_style'), ('STC_MAKE_OPERATOR', 'operator_style'), ('STC_MAKE_PREPROCESSOR', "pre2_style"), ('STC_MAKE_TARGET', 'keyword_style') ] #--- Extra Properties ----# # None #-----------------------------------------------------------------------------# #---- Required Module Functions ----# def Keywords(lang_id=0): """Returns Specified Keywords List @param lang_id: used to select specific subset of keywords """ return list() def SyntaxSpec(lang_id=0): """Syntax Specifications @param lang_id: used for selecting a specific subset of syntax specs """ return SYNTAX_ITEMS def Properties(lang_id=0): """Returns a list of Extra Properties to set @param lang_id: used to select a specific set of properties """ return list() def CommentPattern(lang_id=0): """Returns a list of characters used to comment a block of code @param lang_id: used to select a specific subset of comment pattern(s) """ return [u'#'] #---- End Required Module Functions ----# #---- Syntax Modules Internal Functions ----# def KeywordString(option=0): """Returns the specified Keyword String @note: not used by most modules """ return None #---- End Syntax Modules Internal Functions ----# #-----------------------------------------------------------------------------#
""" FILE: make.py AUTHOR: Cody Precord @summary: Lexer configuration module for Makefiles. """ __author__ = 'Cody Precord <cprecord@editra.org>' __svnid__ = '$Id: make.py 52852 2008-03-27 13:45:40Z CJP $' __revision__ = '$Revision: 52852 $' syntax_items = [('STC_MAKE_DEFAULT', 'default_style'), ('STC_MAKE_COMMENT', 'comment_style'), ('STC_MAKE_IDENTIFIER', 'scalar_style'), ('STC_MAKE_IDEOL', 'ideol_style'), ('STC_MAKE_OPERATOR', 'operator_style'), ('STC_MAKE_PREPROCESSOR', 'pre2_style'), ('STC_MAKE_TARGET', 'keyword_style')] def keywords(lang_id=0): """Returns Specified Keywords List @param lang_id: used to select specific subset of keywords """ return list() def syntax_spec(lang_id=0): """Syntax Specifications @param lang_id: used for selecting a specific subset of syntax specs """ return SYNTAX_ITEMS def properties(lang_id=0): """Returns a list of Extra Properties to set @param lang_id: used to select a specific set of properties """ return list() def comment_pattern(lang_id=0): """Returns a list of characters used to comment a block of code @param lang_id: used to select a specific subset of comment pattern(s) """ return [u'#'] def keyword_string(option=0): """Returns the specified Keyword String @note: not used by most modules """ return None
def CorsMiddleware(app): def _set_headers(headers): headers.append(('Access-Control-Allow-Origin', '*')) headers.append(('Access-Control-Allow-Methods', '*')) headers.append(('Access-Control-Allow-Headers', 'origin, content-type, accept')) return headers def middleware(environ, start_response): if environ.get('REQUEST_METHOD') == 'OPTIONS': headers = [] headers = _set_headers(headers) start_response('200 OK', headers) return [] def headers_start_response(status, headers, *args, **kwargs): all_headers = [key.lower() for key, val in headers] if 'access-control-allow-origin' not in all_headers: headers = _set_headers(headers) return start_response(status, headers, *args, **kwargs) return app(environ, headers_start_response) return middleware
def cors_middleware(app): def _set_headers(headers): headers.append(('Access-Control-Allow-Origin', '*')) headers.append(('Access-Control-Allow-Methods', '*')) headers.append(('Access-Control-Allow-Headers', 'origin, content-type, accept')) return headers def middleware(environ, start_response): if environ.get('REQUEST_METHOD') == 'OPTIONS': headers = [] headers = _set_headers(headers) start_response('200 OK', headers) return [] def headers_start_response(status, headers, *args, **kwargs): all_headers = [key.lower() for (key, val) in headers] if 'access-control-allow-origin' not in all_headers: headers = _set_headers(headers) return start_response(status, headers, *args, **kwargs) return app(environ, headers_start_response) return middleware
#IMPRIMIR UMA PALAVRA INSERIDA INVERTIDAMENTE if __name__ == "__main__": palavra = input() for index in range(len(palavra) - 1, -1, -1): print(palavra[index], end='')
if __name__ == '__main__': palavra = input() for index in range(len(palavra) - 1, -1, -1): print(palavra[index], end='')
class Solution: def minMalwareSpread(self, graph: List[List[int]], initial: List[int]) -> int: if not graph: return -1 N = len(graph) clean = set(range(N)) - set(initial) parents = list(range(N)) size = [1] * N def find(x): if parents[x] != x: parents[x] = find(parents[x]) return parents[x] def union(x, y): rx, ry = find(x), find(y) if rx != ry: if size[rx] < size[ry]: parents[rx] = ry size[ry] += size[rx] else: parents[ry] = rx size[rx] += size[ry] for u, v in itertools.combinations(clean, 2): if graph[u][v]: union(u, v) d = collections.defaultdict(set) infectedTimes = collections.Counter() for u in initial: for v in clean: if graph[u][v]: d[u].add(find(v)) for comm in d[u]: infectedTimes[comm] += 1 count = [0] * N for u, comms in d.items(): for comm in comms: if infectedTimes[comm] == 1: count[u] += size[comm] maxi = max(count) return count.index(maxi) if maxi != 0 else min(initial)
class Solution: def min_malware_spread(self, graph: List[List[int]], initial: List[int]) -> int: if not graph: return -1 n = len(graph) clean = set(range(N)) - set(initial) parents = list(range(N)) size = [1] * N def find(x): if parents[x] != x: parents[x] = find(parents[x]) return parents[x] def union(x, y): (rx, ry) = (find(x), find(y)) if rx != ry: if size[rx] < size[ry]: parents[rx] = ry size[ry] += size[rx] else: parents[ry] = rx size[rx] += size[ry] for (u, v) in itertools.combinations(clean, 2): if graph[u][v]: union(u, v) d = collections.defaultdict(set) infected_times = collections.Counter() for u in initial: for v in clean: if graph[u][v]: d[u].add(find(v)) for comm in d[u]: infectedTimes[comm] += 1 count = [0] * N for (u, comms) in d.items(): for comm in comms: if infectedTimes[comm] == 1: count[u] += size[comm] maxi = max(count) return count.index(maxi) if maxi != 0 else min(initial)