content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
frogs = input().split(' ') while True: token = input().split(' ') length = len(frogs) - 1 command = token[0] if command == 'Join': name = token[1] frogs.append(name) elif command == 'Jump': name = token[1] index = int(token[2]) if length >= index: if index >= 0: frogs.insert(index, name) elif command == 'Dive': index = int(token[1]) if length >= index: if index >= 0: frogs.pop(index) elif command == 'First': count = int(token[1]) if length <= count: print(' '.join(frogs)) else: print(' '.join(frogs[0:count])) elif command == 'Last': count = int(token[1]) if length <= count: print(' '.join(frogs)) else: print(' '.join(frogs[-count:])) elif command == 'Print': operator = token[1] if operator == 'Normal': print(f"Frogs: {' '.join(frogs)}") break if operator == 'Reversed': print(f"Frogs: {' '.join(reversed(frogs))}") break
frogs = input().split(' ') while True: token = input().split(' ') length = len(frogs) - 1 command = token[0] if command == 'Join': name = token[1] frogs.append(name) elif command == 'Jump': name = token[1] index = int(token[2]) if length >= index: if index >= 0: frogs.insert(index, name) elif command == 'Dive': index = int(token[1]) if length >= index: if index >= 0: frogs.pop(index) elif command == 'First': count = int(token[1]) if length <= count: print(' '.join(frogs)) else: print(' '.join(frogs[0:count])) elif command == 'Last': count = int(token[1]) if length <= count: print(' '.join(frogs)) else: print(' '.join(frogs[-count:])) elif command == 'Print': operator = token[1] if operator == 'Normal': print(f"Frogs: {' '.join(frogs)}") break if operator == 'Reversed': print(f"Frogs: {' '.join(reversed(frogs))}") break
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '', # Or path to database file if using sqlite3. 'USER': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. } } MEDIASYNC = { 'BACKEND': 'mediasync.backends.s3', 'AWS_KEY': '', 'AWS_SECRET': '', 'AWS_BUCKET': '', 'JOINED': { 'style/production.css': ( 'yui/reset-fonts-grids.css', 'yui/yahoo-min.js', 'yui/dom-min.js', 'yui/event-min.js', 'style/public_markup.css', ), }, } RECAPTCHA_PUBLIC_KEY = '' RECAPTCHA_PRIVATE_KEY = '' POSTMARK_API_KEY = 'your-key' POSTMARK_SENDER = 'sender@signature.com'
databases = {'default': {'ENGINE': 'django.db.backends.', 'NAME': '', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': ''}} mediasync = {'BACKEND': 'mediasync.backends.s3', 'AWS_KEY': '', 'AWS_SECRET': '', 'AWS_BUCKET': '', 'JOINED': {'style/production.css': ('yui/reset-fonts-grids.css', 'yui/yahoo-min.js', 'yui/dom-min.js', 'yui/event-min.js', 'style/public_markup.css')}} recaptcha_public_key = '' recaptcha_private_key = '' postmark_api_key = 'your-key' postmark_sender = 'sender@signature.com'
# 02. Count substring occurrences text, key = input(), input() counter = 0 for index in range(0, len(text) - len(key) + 1): if key.lower() == text[index:index + len(key)].lower(): counter += 1 print(counter)
(text, key) = (input(), input()) counter = 0 for index in range(0, len(text) - len(key) + 1): if key.lower() == text[index:index + len(key)].lower(): counter += 1 print(counter)
# def func(a): # return a + 5 func = lambda a: a+5 square = lambda s: s*s sum = lambda x,y,z: x+y+z x = 10 print (func(x)) print (square(x)) print (sum(x,4,5))
func = lambda a: a + 5 square = lambda s: s * s sum = lambda x, y, z: x + y + z x = 10 print(func(x)) print(square(x)) print(sum(x, 4, 5))
class ServiceTypes(): MachineLearning = "ml" Vision = "vision" ChatBot = "bot" Speech = "speech" LangIntent = "intent" LangEntity = "entity"
class Servicetypes: machine_learning = 'ml' vision = 'vision' chat_bot = 'bot' speech = 'speech' lang_intent = 'intent' lang_entity = 'entity'
class Solution(object): def maxSubArray(self, nums): idx, sumVal = 0, 0 ans = -float('INF') while idx < len(nums): sumVal += nums[idx] ans = max(ans, sumVal) if sumVal < 0: sumVal = 0 idx += 1 return ans
class Solution(object): def max_sub_array(self, nums): (idx, sum_val) = (0, 0) ans = -float('INF') while idx < len(nums): sum_val += nums[idx] ans = max(ans, sumVal) if sumVal < 0: sum_val = 0 idx += 1 return ans
class Document: def __init__(self, docID, docTitle, docContent, docAll): self.docID = docID self.docTitle = docTitle self.docContent = docContent self.docAll = docAll def get_docID(self): return self.docID def get_docTitle(self): return self.docTitle def get_docContent(self): return self.docContent def get_docAll(self): return self.docAll def set_docAll(self, newAll): self.docAll = newAll
class Document: def __init__(self, docID, docTitle, docContent, docAll): self.docID = docID self.docTitle = docTitle self.docContent = docContent self.docAll = docAll def get_doc_id(self): return self.docID def get_doc_title(self): return self.docTitle def get_doc_content(self): return self.docContent def get_doc_all(self): return self.docAll def set_doc_all(self, newAll): self.docAll = newAll
class Solution: def findTilt(self, root: TreeNode) -> int: def traverse(node, res): if not node: return 0 left_sum = traverse(node.left, res) right_sum = traverse(node.right, res) res[0] += abs(left_sum-right_sum) return left_sum + right_sum + node.val res = [0] traverse(root, res) return res[0]
class Solution: def find_tilt(self, root: TreeNode) -> int: def traverse(node, res): if not node: return 0 left_sum = traverse(node.left, res) right_sum = traverse(node.right, res) res[0] += abs(left_sum - right_sum) return left_sum + right_sum + node.val res = [0] traverse(root, res) return res[0]
x = 9 y = 3 #integers #arithmetic operators print(x+y) #addition print(x-y) #subtraction print(x*y) #multiplication print(x/y) #division print(x%y) #modulus print(x**y) #exponentiation x = 9.1918123 print(x//y) #floor division # Assignment operators x = 9 #sets x to equal 9 x += 3 # x = x +3 print(x) x = 9 x -= 3 print(x) x *= 3 print(x) x /= 3 print(x) x **= 3 print(x) #comparison operators x = 9 y = 3 print(x==y) #True if x=y, false otherwise print(x!=y) #True is x does not =y. false otherwise print(x>y) #True if x>y, flase otherwise print(x<y) #true if x<y, false other print(x>=y) #true if x>=y, false other print(x<=y) #true if x<=y, false other
x = 9 y = 3 print(x + y) print(x - y) print(x * y) print(x / y) print(x % y) print(x ** y) x = 9.1918123 print(x // y) x = 9 x += 3 print(x) x = 9 x -= 3 print(x) x *= 3 print(x) x /= 3 print(x) x **= 3 print(x) x = 9 y = 3 print(x == y) print(x != y) print(x > y) print(x < y) print(x >= y) print(x <= y)
class Terminal(object): check = u'\u2714' error = u'\u2715' broken = u'\u2718' arrow = u'\u21D2' broken_arrow = u'\u21CF' under_arrow = u'\u21AA' class tcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' class Outputs(Terminal): def __init__(self, symlinks): self.symlinks = symlinks super().__init__() def symlink_output(self): for symlink in self.symlinks: arrow = self.arrow if symlink.status == symlink.CREATED: color = tcolors.OKGREEN status = self.check elif symlink.status == symlink.BROKEN: color = tcolors.WARNING status = self.broken arrow = self.broken_arrow elif symlink.status == symlink.FAILED: color = tcolors.FAIL status = self.error print( "[" + color + f"{status}" + tcolors.ENDC + "]", f"{symlink.src} " + arrow + f" {symlink.dest}") if symlink.status == symlink.BROKEN: print(f" {self.under_arrow} Warning: Symlink created, but source file does not exist") elif symlink.status == symlink.FAILED: print(f" - {symlink.error_message}")
class Terminal(object): check = u'✔' error = u'✕' broken = u'✘' arrow = u'⇒' broken_arrow = u'⇏' under_arrow = u'↪' class Tcolors: header = '\x1b[95m' okblue = '\x1b[94m' okgreen = '\x1b[92m' warning = '\x1b[93m' fail = '\x1b[91m' endc = '\x1b[0m' bold = '\x1b[1m' underline = '\x1b[4m' class Outputs(Terminal): def __init__(self, symlinks): self.symlinks = symlinks super().__init__() def symlink_output(self): for symlink in self.symlinks: arrow = self.arrow if symlink.status == symlink.CREATED: color = tcolors.OKGREEN status = self.check elif symlink.status == symlink.BROKEN: color = tcolors.WARNING status = self.broken arrow = self.broken_arrow elif symlink.status == symlink.FAILED: color = tcolors.FAIL status = self.error print('[' + color + f'{status}' + tcolors.ENDC + ']', f'{symlink.src} ' + arrow + f' {symlink.dest}') if symlink.status == symlink.BROKEN: print(f' {self.under_arrow} Warning: Symlink created, but source file does not exist') elif symlink.status == symlink.FAILED: print(f' - {symlink.error_message}')
expected_output = { "instance": { "master": { "areas": { "0.0.0.1": { "interfaces": { "ge-0/0/2.0": { "state": "BDR", "dr_id": "10.16.2.2", "bdr_id": "10.64.4.4", "nbrs_count": 5, } } } } } } }
expected_output = {'instance': {'master': {'areas': {'0.0.0.1': {'interfaces': {'ge-0/0/2.0': {'state': 'BDR', 'dr_id': '10.16.2.2', 'bdr_id': '10.64.4.4', 'nbrs_count': 5}}}}}}}
full_dataset = [ {'name': 'Peach', 'items': ['green shell', 'banana', 'green shell',], 'finish': 3}, {'name': 'Peach', 'items': ['green shell', 'banana', 'green shell',], 'finish': 1}, {'name': 'Bowser', 'items': ['green shell',], 'finish': 1}, {'name': None, 'items': ['green shell',], 'finish': 2}, {'name': 'Bowser', 'items': ['green shell',], 'finish': 1}, {'name': None, 'items': ['red shell',], 'finish': 1}, {'name': 'Yoshi', 'items': ['banana', 'blue shell', 'banana'], 'finish': 7}, {'name': 'DK', 'items': ['blue shell', 'star',], 'finish': 1}, ]
full_dataset = [{'name': 'Peach', 'items': ['green shell', 'banana', 'green shell'], 'finish': 3}, {'name': 'Peach', 'items': ['green shell', 'banana', 'green shell'], 'finish': 1}, {'name': 'Bowser', 'items': ['green shell'], 'finish': 1}, {'name': None, 'items': ['green shell'], 'finish': 2}, {'name': 'Bowser', 'items': ['green shell'], 'finish': 1}, {'name': None, 'items': ['red shell'], 'finish': 1}, {'name': 'Yoshi', 'items': ['banana', 'blue shell', 'banana'], 'finish': 7}, {'name': 'DK', 'items': ['blue shell', 'star'], 'finish': 1}]
def Contract_scalar_1x5(\ t0_6,t1_6,t2_6,\ t0_5,t1_5,t2_5,\ t0_4,t1_4,t2_4,\ t0_3,t1_3,t2_3,\ t0_2,t1_2,t2_2,\ t0_1,t1_1,t2_1,\ t0_0,t1_0,t2_0,\ o1_5,\ o1_4,\ o1_3,\ o1_2,\ o1_1\ ): ############################## # ./input/input_Lx1Ly5.dat ############################## # (o1_2*(t1_2.conj()*((t0_2*(t0_1*(t1_1.conj()*((o1_1*t1_1)*(t2_1*(t0_0*(t2_0*t1_0)))))))*(t1_2*(t2_2*(t0_3*(t1_3.conj()*((t1_3*o1_3)*(t2_3*(t0_4*(t1_4.conj()*((o1_4*t1_4)*(t2_4*(t0_5*(t1_5.conj()*((o1_5*t1_5)*(t2_5*(t0_6*(t2_6*t1_6))))))))))))))))))) # cpu_cost= 3.004e+11 memory= 5.0206e+08 # final_bond_order () ############################## return np.tensordot( o1_2, np.tensordot( t1_2.conj(), np.tensordot( np.tensordot( t0_2, np.tensordot( t0_1, np.tensordot( t1_1.conj(), np.tensordot( np.tensordot( o1_1, t1_1, ([0], [4]) ), np.tensordot( t2_1, np.tensordot( t0_0, np.tensordot( t2_0, t1_0, ([1], [0]) ), ([0], [1]) ), ([1], [1]) ), ([3, 4], [1, 4]) ), ([2, 3, 4], [4, 6, 0]) ), ([0, 2, 3], [5, 2, 0]) ), ([0], [0]) ), np.tensordot( t1_2, np.tensordot( t2_2, np.tensordot( t0_3, np.tensordot( t1_3.conj(), np.tensordot( np.tensordot( t1_3, o1_3, ([4], [0]) ), np.tensordot( t2_3, np.tensordot( t0_4, np.tensordot( t1_4.conj(), np.tensordot( np.tensordot( o1_4, t1_4, ([0], [4]) ), np.tensordot( t2_4, np.tensordot( t0_5, np.tensordot( t1_5.conj(), np.tensordot( np.tensordot( o1_5, t1_5, ([0], [4]) ), np.tensordot( t2_5, np.tensordot( t0_6, np.tensordot( t2_6, t1_6, ([0], [1]) ), ([1], [1]) ), ([0], [1]) ), ([2, 3], [4, 1]) ), ([1, 2, 4], [6, 4, 0]) ), ([1, 2, 3], [5, 2, 0]) ), ([0], [3]) ), ([2, 3], [5, 1]) ), ([1, 2, 4], [6, 4, 0]) ), ([1, 2, 3], [5, 2, 0]) ), ([0], [3]) ), ([1, 2], [5, 1]) ), ([1, 2, 4], [6, 4, 2]) ), ([1, 2, 3], [5, 2, 0]) ), ([0], [3]) ), ([1, 2], [5, 1]) ), ([0, 1, 4, 5], [5, 0, 1, 3]) ), ([0, 1, 2, 3], [0, 4, 3, 1]) ), ([0, 1], [1, 0]) )
def contract_scalar_1x5(t0_6, t1_6, t2_6, t0_5, t1_5, t2_5, t0_4, t1_4, t2_4, t0_3, t1_3, t2_3, t0_2, t1_2, t2_2, t0_1, t1_1, t2_1, t0_0, t1_0, t2_0, o1_5, o1_4, o1_3, o1_2, o1_1): return np.tensordot(o1_2, np.tensordot(t1_2.conj(), np.tensordot(np.tensordot(t0_2, np.tensordot(t0_1, np.tensordot(t1_1.conj(), np.tensordot(np.tensordot(o1_1, t1_1, ([0], [4])), np.tensordot(t2_1, np.tensordot(t0_0, np.tensordot(t2_0, t1_0, ([1], [0])), ([0], [1])), ([1], [1])), ([3, 4], [1, 4])), ([2, 3, 4], [4, 6, 0])), ([0, 2, 3], [5, 2, 0])), ([0], [0])), np.tensordot(t1_2, np.tensordot(t2_2, np.tensordot(t0_3, np.tensordot(t1_3.conj(), np.tensordot(np.tensordot(t1_3, o1_3, ([4], [0])), np.tensordot(t2_3, np.tensordot(t0_4, np.tensordot(t1_4.conj(), np.tensordot(np.tensordot(o1_4, t1_4, ([0], [4])), np.tensordot(t2_4, np.tensordot(t0_5, np.tensordot(t1_5.conj(), np.tensordot(np.tensordot(o1_5, t1_5, ([0], [4])), np.tensordot(t2_5, np.tensordot(t0_6, np.tensordot(t2_6, t1_6, ([0], [1])), ([1], [1])), ([0], [1])), ([2, 3], [4, 1])), ([1, 2, 4], [6, 4, 0])), ([1, 2, 3], [5, 2, 0])), ([0], [3])), ([2, 3], [5, 1])), ([1, 2, 4], [6, 4, 0])), ([1, 2, 3], [5, 2, 0])), ([0], [3])), ([1, 2], [5, 1])), ([1, 2, 4], [6, 4, 2])), ([1, 2, 3], [5, 2, 0])), ([0], [3])), ([1, 2], [5, 1])), ([0, 1, 4, 5], [5, 0, 1, 3])), ([0, 1, 2, 3], [0, 4, 3, 1])), ([0, 1], [1, 0]))
def read_matrix_lines(): return [int(x) for x in input().split(", ")] def create_matrix(size): result = [read_matrix_lines() for _ in range(size)] return result def get_first_diagonal(matrix, size): return [matrix[i][i]for i in range(size)] def get_second_diagonal(matrix, size): result = [] for r in range(size): result.append(matrix[r][size - r - 1]) return result def turn_diagonal_to_str(diagonal): result = ", ".join(map(str,diagonal)) return result size = int(input()) matrix = create_matrix(size) first_diagonal = get_first_diagonal(matrix, size) second_diagonal = get_second_diagonal(matrix, size) print(f"First diagonal: {turn_diagonal_to_str(first_diagonal)}. Sum: {sum(first_diagonal)}") print(f"Second diagonal: {turn_diagonal_to_str(second_diagonal)}. Sum: {sum(second_diagonal)}")
def read_matrix_lines(): return [int(x) for x in input().split(', ')] def create_matrix(size): result = [read_matrix_lines() for _ in range(size)] return result def get_first_diagonal(matrix, size): return [matrix[i][i] for i in range(size)] def get_second_diagonal(matrix, size): result = [] for r in range(size): result.append(matrix[r][size - r - 1]) return result def turn_diagonal_to_str(diagonal): result = ', '.join(map(str, diagonal)) return result size = int(input()) matrix = create_matrix(size) first_diagonal = get_first_diagonal(matrix, size) second_diagonal = get_second_diagonal(matrix, size) print(f'First diagonal: {turn_diagonal_to_str(first_diagonal)}. Sum: {sum(first_diagonal)}') print(f'Second diagonal: {turn_diagonal_to_str(second_diagonal)}. Sum: {sum(second_diagonal)}')
#!/usr/bin/python def param_gui(self): param_gui = [ self.K1, self.P1, self.e1, self.om1, self.ma1, self.incl1, self.Omega1, self.K2, self.P2, self.e2, self.om2, self.ma2, self.incl2, self.Omega2, self.K3, self.P3, self.e3, self.om3, self.ma3, self.incl3, self.Omega3, self.K4, self.P4, self.e4, self.om4, self.ma4, self.incl4, self.Omega4, self.K5, self.P5, self.e5, self.om5, self.ma5, self.incl5, self.Omega5, self.K6, self.P6, self.e6, self.om6, self.ma6, self.incl6, self.Omega6, self.K7, self.P7, self.e7, self.om7, self.ma7, self.incl7, self.Omega7, self.K8, self.P8, self.e8, self.om8, self.ma8, self.incl8, self.Omega8, self.K9, self.P9, self.e9, self.om9, self.ma9, self.incl9, self.Omega9, ] return param_gui def param_errors_gui(self): param_errors_gui = [self.err_K1,self.err_P1,self.err_e1,self.err_om1,self.err_ma1, self.err_i1, self.err_Om1, self.err_K2,self.err_P2,self.err_e2,self.err_om2,self.err_ma2, self.err_i2, self.err_Om2, self.err_K3,self.err_P3,self.err_e3,self.err_om3,self.err_ma3, self.err_i3, self.err_Om3, self.err_K4,self.err_P4,self.err_e4,self.err_om4,self.err_ma4, self.err_i4, self.err_Om4, self.err_K5,self.err_P5,self.err_e5,self.err_om5,self.err_ma5, self.err_i5, self.err_Om5, self.err_K6,self.err_P6,self.err_e6,self.err_om6,self.err_ma6, self.err_i6, self.err_Om6, self.err_K7,self.err_P7,self.err_e7,self.err_om7,self.err_ma7, self.err_i7, self.err_Om7, self.err_K8,self.err_P8,self.err_e8,self.err_om8,self.err_ma8, self.err_i8, self.err_Om8, self.err_K9,self.err_P9,self.err_e9,self.err_om9,self.err_ma9, self.err_i9, self.err_Om9, ] return param_errors_gui def use_param_gui(self): use_param_gui = [self.use_K1, self.use_P1, self.use_e1, self.use_om1, self.use_ma1, self.use_incl1, self.use_Omega1, self.use_K2, self.use_P2, self.use_e2, self.use_om2, self.use_ma2, self.use_incl2, self.use_Omega2, self.use_K3, self.use_P3, self.use_e3, self.use_om3, self.use_ma3, self.use_incl3, self.use_Omega3, self.use_K4, self.use_P4, self.use_e4, self.use_om4, self.use_ma4, self.use_incl4, self.use_Omega4, self.use_K5, self.use_P5, self.use_e5, self.use_om5, self.use_ma5, self.use_incl5, self.use_Omega5, self.use_K6, self.use_P6, self.use_e6, self.use_om6, self.use_ma6, self.use_incl6, self.use_Omega6, self.use_K7, self.use_P7, self.use_e7, self.use_om7, self.use_ma7, self.use_incl7, self.use_Omega7, self.use_K8, self.use_P8, self.use_e8, self.use_om8, self.use_ma8, self.use_incl8, self.use_Omega8, self.use_K9, self.use_P9, self.use_e9, self.use_om9, self.use_ma9, self.use_incl9, self.use_Omega9, ] return use_param_gui ########################################################################### def param_gui_wd(self): param_gui_wd = [ self.om_dot_1, self.om_dot_2, self.om_dot_3, self.om_dot_4, self.om_dot_5, self.om_dot_6, self.om_dot_7, self.om_dot_8, self.om_dot_9 ] return param_gui_wd def use_param_gui_wd(self): use_param_gui_wd = [ self.use_om_dot_1, self.use_om_dot_2, self.use_om_dot_3, self.use_om_dot_4, self.use_om_dot_5, self.use_om_dot_6, self.use_om_dot_7, self.use_om_dot_8, self.use_om_dot_9 ] return use_param_gui_wd def param_errors_gui_wd(self): param_errors_gui_wd = [ self.err_om_dot_1,self.err_om_dot_2,self.err_om_dot_3, self.err_om_dot_4,self.err_om_dot_5,self.err_om_dot_6, self.err_om_dot_7,self.err_om_dot_8,self.err_om_dot_9, ] return param_errors_gui_wd ########################################################################### def param_gui_tr(self): param_gui_tr = [ self.t0_1, self.pl_rad_1, self.a_sol_1, self.t0_2, self.pl_rad_2, self.a_sol_2, self.t0_3, self.pl_rad_3, self.a_sol_3, self.t0_4, self.pl_rad_4, self.a_sol_4, self.t0_5, self.pl_rad_5, self.a_sol_5, self.t0_6, self.pl_rad_6, self.a_sol_6, self.t0_7, self.pl_rad_7, self.a_sol_7, self.t0_8, self.pl_rad_8, self.a_sol_8, self.t0_9, self.pl_rad_9, self.a_sol_9, ] return param_gui_tr def use_param_gui_tr(self): use_param_gui_tr = [self.use_t0_1, self.use_pl_rad_1, self.use_a_sol_1, self.use_t0_2, self.use_pl_rad_2, self.use_a_sol_2, self.use_t0_3, self.use_pl_rad_3, self.use_a_sol_3, self.use_t0_4, self.use_pl_rad_4, self.use_a_sol_4, self.use_t0_5, self.use_pl_rad_5, self.use_a_sol_5, self.use_t0_6, self.use_pl_rad_6, self.use_a_sol_6, self.use_t0_7, self.use_pl_rad_7, self.use_a_sol_7, self.use_t0_8, self.use_pl_rad_8, self.use_a_sol_8, self.use_t0_9, self.use_pl_rad_9, self.use_a_sol_9, ] return use_param_gui_tr def err_t0(self): err_t0 = [self.err_t0_1,self.err_t0_2,self.err_t0_3, self.err_t0_4,self.err_t0_5,self.err_t0_6, self.err_t0_7,self.err_t0_8,self.err_t0_9, ] return err_t0 def err_pl_rad(self): err_pl_rad = [self.err_pl_rad_1,self.err_pl_rad_2,self.err_pl_rad_3, self.err_pl_rad_4,self.err_pl_rad_5,self.err_pl_rad_6, self.err_pl_rad_7,self.err_pl_rad_8,self.err_pl_rad_9, ] return err_pl_rad def err_a_sol(self): err_a_sol = [self.err_a_sol_1,self.err_a_sol_2,self.err_a_sol_3, self.err_a_sol_4,self.err_a_sol_5,self.err_a_sol_6, self.err_a_sol_7,self.err_a_sol_8,self.err_a_sol_9, ] return err_a_sol ########################################################################### def rvs_data_gui(self): rvs_data_gui = [ self.Data1,self.Data2,self.Data3,self.Data4,self.Data5, self.Data6,self.Data7,self.Data8,self.Data9,self.Data10 ] return rvs_data_gui def rvs_data_jitter_gui(self): rvs_data_jitter_gui = [ self.jitter_Data1,self.jitter_Data2,self.jitter_Data3,self.jitter_Data4,self.jitter_Data5, self.jitter_Data6,self.jitter_Data7,self.jitter_Data8,self.jitter_Data9,self.jitter_Data10 ] return rvs_data_jitter_gui def use_data_offset_gui(self): use_data_offset_gui = [self.use_offset_Data1,self.use_offset_Data2,self.use_offset_Data3,self.use_offset_Data4, self.use_offset_Data5,self.use_offset_Data6,self.use_offset_Data7,self.use_offset_Data8, self.use_offset_Data9,self.use_offset_Data10] return use_data_offset_gui def use_data_jitter_gui(self): use_data_jitter_gui = [self.use_jitter_Data1,self.use_jitter_Data2,self.use_jitter_Data3,self.use_jitter_Data4,self.use_jitter_Data5, self.use_jitter_Data6,self.use_jitter_Data7,self.use_jitter_Data8,self.use_jitter_Data9,self.use_jitter_Data10] return use_data_jitter_gui def data_errors_gui(self): data_errors_gui = [ self.err_Data1,self.err_Data2,self.err_Data3,self.err_Data4,self.err_Data5, self.err_Data6,self.err_Data7,self.err_Data8,self.err_Data9,self.err_Data10 ] return data_errors_gui def data_errors_jitter_gui(self): data_errors_jitter_gui = [ self.err_jitter_Data1,self.err_jitter_Data2,self.err_jitter_Data3,self.err_jitter_Data4,self.err_jitter_Data5, self.err_jitter_Data6,self.err_jitter_Data7,self.err_jitter_Data8,self.err_jitter_Data9,self.err_jitter_Data10 ] return data_errors_jitter_gui def tra_data_gui(self): tra_data_gui = [ self.trans_Data1,self.trans_Data2,self.trans_Data3,self.trans_Data4,self.trans_Data5, self.trans_Data6,self.trans_Data7,self.trans_Data8,self.trans_Data9,self.trans_Data10 ] return tra_data_gui def tra_data_jitter_gui(self): tra_data_jitter_gui = [ self.jitter_trans_Data1,self.jitter_trans_Data2,self.jitter_trans_Data3,self.jitter_trans_Data4,self.jitter_trans_Data5, self.jitter_trans_Data6,self.jitter_trans_Data7,self.jitter_trans_Data8,self.jitter_trans_Data9,self.jitter_trans_Data10 ] return tra_data_jitter_gui def use_tra_data_offset_gui(self): use_tra_data_offset_gui = [ self.use_offset_trans_Data1,self.use_offset_trans_Data2,self.use_offset_trans_Data3,self.use_offset_trans_Data4, self.use_offset_trans_Data5,self.use_offset_trans_Data6,self.use_offset_trans_Data7,self.use_offset_trans_Data8, self.use_offset_trans_Data9,self.use_offset_trans_Data10 ] return use_tra_data_offset_gui def use_tra_data_jitter_gui(self): use_tra_data_jitter_gui = [ self.use_jitter_trans_Data1,self.use_jitter_trans_Data2,self.use_jitter_trans_Data3,self.use_jitter_trans_Data4, self.use_jitter_trans_Data5,self.use_jitter_trans_Data6,self.use_jitter_trans_Data7,self.use_jitter_trans_Data8, self.use_jitter_trans_Data9,self.use_jitter_trans_Data10 ] return use_tra_data_jitter_gui def tra_data_errors_gui(self): tra_data_errors_gui = [ self.err_trans_Data1,self.err_trans_Data2,self.err_trans_Data3,self.err_trans_Data4,self.err_trans_Data5, self.err_trans_Data6,self.err_trans_Data7,self.err_trans_Data8,self.err_trans_Data9,self.err_trans_Data10 ] return tra_data_errors_gui def tra_data_errors_jitter_gui(self): tra_data_errors_jitter_gui = [ self.err_jitter_trans_Data1,self.err_jitter_trans_Data2,self.err_jitter_trans_Data3,self.err_jitter_trans_Data4, self.err_jitter_trans_Data5,self.err_jitter_trans_Data6,self.err_jitter_trans_Data7,self.err_jitter_trans_Data8, self.err_jitter_trans_Data9,self.err_jitter_trans_Data10 ] return tra_data_errors_jitter_gui def param_bounds_gui(self): param_bounds_gui = [ [self.K_min_1,self.K_max_1],[self.P_min_1,self.P_max_1], [self.e_min_1,self.e_max_1],[self.om_min_1,self.om_max_1], [self.ma_min_1,self.ma_max_1],[self.incl_min_1,self.incl_max_1], [self.Omega_min_1,self.Omega_max_1],[self.t0_min_1,self.t0_max_1],[self.pl_rad_min_1,self.pl_rad_max_1],[self.a_sol_min_1,self.a_sol_max_1], [self.K_min_2,self.K_max_2],[self.P_min_2,self.P_max_2], [self.e_min_2,self.e_max_2],[self.om_min_2,self.om_max_2], [self.ma_min_2,self.ma_max_2],[self.incl_min_2,self.incl_max_2], [self.Omega_min_2,self.Omega_max_2],[self.t0_min_2,self.t0_max_2],[self.pl_rad_min_2,self.pl_rad_max_2],[self.a_sol_min_2,self.a_sol_max_2], [self.K_min_3,self.K_max_3],[self.P_min_3,self.P_max_3], [self.e_min_3,self.e_max_3],[self.om_min_3,self.om_max_3], [self.ma_min_3,self.ma_max_3],[self.incl_min_3,self.incl_max_3], [self.Omega_min_3,self.Omega_max_3],[self.t0_min_3,self.t0_max_3],[self.pl_rad_min_3,self.pl_rad_max_3],[self.a_sol_min_3,self.a_sol_max_3], [self.K_min_4,self.K_max_4],[self.P_min_4,self.P_max_4], [self.e_min_4,self.e_max_4],[self.om_min_4,self.om_max_4], [self.ma_min_4,self.ma_max_4],[self.incl_min_4,self.incl_max_4], [self.Omega_min_4,self.Omega_max_4],[self.t0_min_4,self.t0_max_4],[self.pl_rad_min_4,self.pl_rad_max_4],[self.a_sol_min_4,self.a_sol_max_4], [self.K_min_5,self.K_max_5],[self.P_min_5,self.P_max_5], [self.e_min_5,self.e_max_5],[self.om_min_5,self.om_max_5], [self.ma_min_5,self.ma_max_5],[self.incl_min_5,self.incl_max_5], [self.Omega_min_5,self.Omega_max_5],[self.t0_min_5,self.t0_max_5],[self.pl_rad_min_5,self.pl_rad_max_5],[self.a_sol_min_5,self.a_sol_max_5], [self.K_min_6,self.K_max_6],[self.P_min_6,self.P_max_6], [self.e_min_6,self.e_max_6],[self.om_min_6,self.om_max_6], [self.ma_min_6,self.ma_max_6],[self.incl_min_6,self.incl_max_6], [self.Omega_min_6,self.Omega_max_6],[self.t0_min_6,self.t0_max_6],[self.pl_rad_min_6,self.pl_rad_max_6],[self.a_sol_min_6,self.a_sol_max_6], [self.K_min_7,self.K_max_7],[self.P_min_7,self.P_max_7], [self.e_min_7,self.e_max_7],[self.om_min_7,self.om_max_7], [self.ma_min_7,self.ma_max_7],[self.incl_min_7,self.incl_max_7], [self.Omega_min_7,self.Omega_max_7],[self.t0_min_7,self.t0_max_7],[self.pl_rad_min_7,self.pl_rad_max_7],[self.a_sol_min_7,self.a_sol_max_7], [self.K_min_8,self.K_max_8],[self.P_min_8,self.P_max_8], [self.e_min_8,self.e_max_8],[self.om_min_8,self.om_max_8], [self.ma_min_8,self.ma_max_8],[self.incl_min_8,self.incl_max_8], [self.Omega_min_8,self.Omega_max_8],[self.t0_min_8,self.t0_max_8],[self.pl_rad_min_8,self.pl_rad_max_8],[self.a_sol_min_8,self.a_sol_max_8], [self.K_min_9,self.K_max_9],[self.P_min_9,self.P_max_9], [self.e_min_9,self.e_max_9],[self.om_min_9,self.om_max_9], [self.ma_min_9,self.ma_max_9],[self.incl_min_9,self.incl_max_9], [self.Omega_min_9,self.Omega_max_9],[self.t0_min_9,self.t0_max_9],[self.pl_rad_min_9,self.pl_rad_max_9],[self.a_sol_min_9,self.a_sol_max_9] ] return param_bounds_gui def offset_bounds_gui(self): offset_bounds_gui = [ [self.Data1_min,self.Data1_max], [self.Data2_min,self.Data2_max], [self.Data3_min,self.Data3_max], [self.Data4_min,self.Data4_max], [self.Data5_min,self.Data5_max], [self.Data6_min,self.Data6_max], [self.Data7_min,self.Data7_max], [self.Data8_min,self.Data8_max], [self.Data9_min,self.Data9_max], [self.Data10_min,self.Data10_max] ] return offset_bounds_gui def jitter_bounds_gui(self): jitter_bounds_gui = [ [self.jitter1_min,self.jitter1_max], [self.jitter2_min,self.jitter2_max], [self.jitter3_min,self.jitter3_max], [self.jitter4_min,self.jitter4_max], [self.jitter5_min,self.jitter5_max], [self.jitter6_min,self.jitter6_max], [self.jitter7_min,self.jitter7_max], [self.jitter8_min,self.jitter8_max], [self.jitter9_min,self.jitter9_max], [self.jitter10_min,self.Data10_max] ] return jitter_bounds_gui ################### OmDot ######################## def om_dot_bounds_gui(self): om_dot_bounds_gui = [ [self.omega_dot_min_1,self.omega_dot_max_1], [self.omega_dot_min_2,self.omega_dot_max_2], [self.omega_dot_min_3,self.omega_dot_max_3], [self.omega_dot_min_4,self.omega_dot_max_4], [self.omega_dot_min_5,self.omega_dot_max_5], [self.omega_dot_min_6,self.omega_dot_max_6], [self.omega_dot_min_7,self.omega_dot_max_7], [self.omega_dot_min_8,self.omega_dot_max_8], [self.omega_dot_min_9,self.omega_dot_max_9] ] return om_dot_bounds_gui ################### LD ######################## def use_uni_ld_models(self): use_uni_ld_models = [ self.use_uniform_ld_1,self.use_uniform_ld_2,self.use_uniform_ld_3,self.use_uniform_ld_4,self.use_uniform_ld_5, self.use_uniform_ld_6,self.use_uniform_ld_7,self.use_uniform_ld_8,self.use_uniform_ld_9,self.use_uniform_ld_10 ] return use_uni_ld_models def use_lin_ld_models(self): use_lin_ld_models = [ self.use_linear_ld_1,self.use_linear_ld_2,self.use_linear_ld_3,self.use_linear_ld_4,self.use_linear_ld_5, self.use_linear_ld_6,self.use_linear_ld_7,self.use_linear_ld_8,self.use_linear_ld_9,self.use_linear_ld_10 ] return use_lin_ld_models def use_quad_ld_models(self): use_quad_ld_models =[ self.use_quadratic_ld_1,self.use_quadratic_ld_2,self.use_quadratic_ld_3,self.use_quadratic_ld_4,self.use_quadratic_ld_5, self.use_quadratic_ld_6,self.use_quadratic_ld_7,self.use_quadratic_ld_8,self.use_quadratic_ld_9,self.use_quadratic_ld_10 ] return use_quad_ld_models def use_nonlin_ld_models(self): use_nonlin_ld_models = [ self.use_nonlinear_ld_1,self.use_nonlinear_ld_2,self.use_nonlinear_ld_3,self.use_nonlinear_ld_4,self.use_nonlinear_ld_5, self.use_nonlinear_ld_6,self.use_nonlinear_ld_7,self.use_nonlinear_ld_8,self.use_nonlinear_ld_9,self.use_nonlinear_ld_10 ] return use_nonlin_ld_models def lin_u(self): lin_u = [self.u1_linear_1,self.u1_linear_2,self.u1_linear_3,self.u1_linear_4,self.u1_linear_5, self.u1_linear_6,self.u1_linear_7,self.u1_linear_8,self.u1_linear_9,self.u1_linear_10 ] return lin_u def use_lin_u(self): use_lin_u = [ self.use_u1_linear_1,self.use_u1_linear_2,self.use_u1_linear_3,self.use_u1_linear_4,self.use_u1_linear_5, self.use_u1_linear_6,self.use_u1_linear_7,self.use_u1_linear_8,self.use_u1_linear_9,self.use_u1_linear_10 ] return use_lin_u def err_lin_u(self): err_lin_u = [self.err_u1_linear_1,self.err_u1_linear_2,self.err_u1_linear_3,self.err_u1_linear_4,self.err_u1_linear_5, self.err_u1_linear_6,self.err_u1_linear_7,self.err_u1_linear_8,self.err_u1_linear_9,self.err_u1_linear_10 ] return err_lin_u def quad_u1(self): quad_u1 = [ self.u1_quadratic_1,self.u1_quadratic_2,self.u1_quadratic_3,self.u1_quadratic_4,self.u1_quadratic_5, self.u1_quadratic_6,self.u1_quadratic_7,self.u1_quadratic_8,self.u1_quadratic_9,self.u1_quadratic_10 ] return quad_u1 def use_quad_u1(self): use_quad_u1 = [ self.use_u1_quadratic_1,self.use_u1_quadratic_2,self.use_u1_quadratic_3,self.use_u1_quadratic_4,self.use_u1_quadratic_5, self.use_u1_quadratic_6,self.use_u1_quadratic_7,self.use_u1_quadratic_8,self.use_u1_quadratic_9,self.use_u1_quadratic_10 ] return use_quad_u1 def err_quad_u1(self): err_quad_u1 = [ self.err_u1_quadratic_1,self.err_u1_quadratic_2,self.err_u1_quadratic_3,self.err_u1_quadratic_4,self.err_u1_quadratic_5, self.err_u1_quadratic_6,self.err_u1_quadratic_7,self.err_u1_quadratic_8,self.err_u1_quadratic_9,self.err_u1_quadratic_10 ] return err_quad_u1 def quad_u2(self): quad_u2 = [ self.u2_quadratic_1,self.u2_quadratic_2,self.u2_quadratic_3,self.u2_quadratic_4,self.u2_quadratic_5, self.u2_quadratic_6,self.u2_quadratic_7,self.u2_quadratic_8,self.u2_quadratic_9,self.u2_quadratic_10 ] return quad_u2 def use_quad_u2(self): use_quad_u2 = [ self.use_u2_quadratic_1,self.use_u2_quadratic_2,self.use_u2_quadratic_3,self.use_u2_quadratic_4,self.use_u2_quadratic_5, self.use_u2_quadratic_6,self.use_u2_quadratic_7,self.use_u2_quadratic_8,self.use_u2_quadratic_9,self.use_u2_quadratic_10 ] return use_quad_u2 def err_quad_u2(self): err_quad_u2 = [ self.err_u2_quadratic_1,self.err_u2_quadratic_2,self.err_u2_quadratic_3,self.err_u2_quadratic_4,self.err_u2_quadratic_5, self.err_u2_quadratic_6,self.err_u2_quadratic_7,self.err_u2_quadratic_8,self.err_u2_quadratic_9,self.err_u2_quadratic_10 ] return err_quad_u2 def nonlin_u1(self): nonlin_u1 = [ self.u1_nonlin_1,self.u1_nonlin_2,self.u1_nonlin_3,self.u1_nonlin_4,self.u1_nonlin_5, self.u1_nonlin_6,self.u1_nonlin_7,self.u1_nonlin_8,self.u1_nonlin_9,self.u1_nonlin_10 ] return nonlin_u1 def use_nonlin_u1(self): use_nonlin_u1 = [ self.use_u1_nonlin_1,self.use_u1_nonlin_2,self.use_u1_nonlin_3,self.use_u1_nonlin_4,self.use_u1_nonlin_5, self.use_u1_nonlin_6,self.use_u1_nonlin_7,self.use_u1_nonlin_8,self.use_u1_nonlin_9,self.use_u1_nonlin_10 ] return use_nonlin_u1 def err_nonlin_u1(self): err_nonlin_u1 = [ self.err_u1_nonlin_1,self.err_u1_nonlin_2,self.err_u1_nonlin_3,self.err_u1_nonlin_4,self.err_u1_nonlin_5, self.err_u1_nonlin_6,self.err_u1_nonlin_7,self.err_u1_nonlin_8,self.err_u1_nonlin_9,self.err_u1_nonlin_10 ] return err_nonlin_u1 def nonlin_u2(self): nonlin_u2 = [ self.u2_nonlin_1,self.u2_nonlin_2,self.u2_nonlin_3,self.u2_nonlin_4,self.u2_nonlin_5, self.u2_nonlin_6,self.u2_nonlin_7,self.u2_nonlin_8,self.u2_nonlin_9,self.u2_nonlin_10 ] return nonlin_u2 def use_nonlin_u2(self): use_nonlin_u2 = [ self.use_u2_nonlin_1,self.use_u2_nonlin_2,self.use_u2_nonlin_3,self.use_u2_nonlin_4,self.use_u2_nonlin_5, self.use_u2_nonlin_6,self.use_u2_nonlin_7,self.use_u2_nonlin_8,self.use_u2_nonlin_9,self.use_u2_nonlin_10 ] return use_nonlin_u2 def err_nonlin_u2(self): err_nonlin_u2 = [ self.err_u2_nonlin_1,self.err_u2_nonlin_2,self.err_u2_nonlin_3,self.err_u2_nonlin_4,self.err_u2_nonlin_5, self.err_u2_nonlin_6,self.err_u2_nonlin_7,self.err_u2_nonlin_8,self.err_u2_nonlin_9,self.err_u2_nonlin_10 ] return err_nonlin_u2 def nonlin_u3(self): nonlin_u3 = [ self.u3_nonlin_1,self.u3_nonlin_2,self.u3_nonlin_3,self.u3_nonlin_4,self.u3_nonlin_5, self.u3_nonlin_6,self.u3_nonlin_7,self.u3_nonlin_8,self.u3_nonlin_9,self.u3_nonlin_10 ] return nonlin_u3 def use_nonlin_u3(self): use_nonlin_u3 = [ self.use_u3_nonlin_1,self.use_u3_nonlin_2,self.use_u3_nonlin_3,self.use_u3_nonlin_4,self.use_u3_nonlin_5, self.use_u3_nonlin_6,self.use_u3_nonlin_7,self.use_u3_nonlin_8,self.use_u3_nonlin_9,self.use_u3_nonlin_10 ] return use_nonlin_u3 def err_nonlin_u3(self): err_nonlin_u3 = [ self.err_u3_nonlin_1,self.err_u3_nonlin_2,self.err_u3_nonlin_3,self.err_u3_nonlin_4,self.err_u3_nonlin_5, self.err_u3_nonlin_6,self.err_u3_nonlin_7,self.err_u3_nonlin_8,self.err_u3_nonlin_9,self.err_u3_nonlin_10 ] return err_nonlin_u3 def nonlin_u4(self): nonlin_u4 = [ self.u4_nonlin_1,self.u4_nonlin_2,self.u4_nonlin_3,self.u4_nonlin_4,self.u4_nonlin_5, self.u4_nonlin_6,self.u4_nonlin_7,self.u4_nonlin_8,self.u4_nonlin_9,self.u4_nonlin_10 ] return nonlin_u4 def use_nonlin_u4(self): use_nonlin_u4 = [ self.use_u4_nonlin_1,self.use_u4_nonlin_2,self.use_u4_nonlin_3,self.use_u4_nonlin_4,self.use_u4_nonlin_5, self.use_u4_nonlin_6,self.use_u4_nonlin_7,self.use_u4_nonlin_8,self.use_u4_nonlin_9,self.use_u4_nonlin_10 ] return use_nonlin_u4 def err_nonlin_u4(self): err_nonlin_u4 = [ self.err_u4_nonlin_1,self.err_u4_nonlin_2,self.err_u4_nonlin_3,self.err_u4_nonlin_4,self.err_u4_nonlin_5, self.err_u4_nonlin_6,self.err_u4_nonlin_7,self.err_u4_nonlin_8,self.err_u4_nonlin_9,self.err_u4_nonlin_10 ] return err_nonlin_u4 def ld_u1_bounds_gui(self): ld_u1_bounds_gui = [ [self.u1_min_1,self.u1_max_1],[self.u1_min_2,self.u1_max_2],[self.u1_min_3,self.u1_max_3], [self.u1_min_4,self.u1_max_4],[self.u1_min_5,self.u1_max_5],[self.u1_min_6,self.u1_max_6], [self.u1_min_7,self.u1_max_7],[self.u1_min_8,self.u1_max_8],[self.u1_min_9,self.u1_max_9], [self.u1_min_10,self.u1_max_10] ] return ld_u1_bounds_gui def ld_u2_bounds_gui(self): ld_u2_bounds_gui = [ [self.u2_min_1,self.u2_max_1],[self.u2_min_2,self.u2_max_2],[self.u2_min_3,self.u2_max_3], [self.u2_min_4,self.u2_max_4],[self.u2_min_5,self.u2_max_5],[self.u2_min_6,self.u2_max_6], [self.u2_min_7,self.u2_max_7],[self.u2_min_8,self.u2_max_8],[self.u2_min_9,self.u2_max_9], [self.u2_min_10,self.u2_max_10] ] return ld_u2_bounds_gui def ld_u3_bounds_gui(self): ld_u3_bounds_gui = [ [self.u3_min_1,self.u3_max_1],[self.u3_min_2,self.u3_max_2],[self.u3_min_3,self.u3_max_3], [self.u3_min_4,self.u3_max_4],[self.u3_min_5,self.u3_max_5],[self.u3_min_6,self.u3_max_6], [self.u3_min_7,self.u3_max_7],[self.u3_min_8,self.u3_max_8],[self.u3_min_9,self.u3_max_9], [self.u3_min_10,self.u3_max_10] ] return ld_u3_bounds_gui def ld_u4_bounds_gui(self): ld_u4_bounds_gui = [ [self.u4_min_1,self.u4_max_1],[self.u4_min_2,self.u4_max_2],[self.u4_min_3,self.u4_max_3], [self.u4_min_4,self.u4_max_4],[self.u4_min_5,self.u4_max_5],[self.u4_min_6,self.u4_max_6], [self.u4_min_7,self.u4_max_7],[self.u4_min_8,self.u4_max_8],[self.u4_min_9,self.u4_max_9], [self.u4_min_10,self.u4_max_10] ] return ld_u4_bounds_gui ################# Normal Prior ################ def param_nr_priors_gui(self): param_nr_priors_gui = [ [self.K_mean_1,self.K_sigma_1,self.use_K_norm_pr_1],[self.P_mean_1,self.P_sigma_1,self.use_P_norm_pr_1], [self.e_mean_1,self.e_sigma_1,self.use_e_norm_pr_1],[self.om_mean_1,self.om_sigma_1,self.use_om_norm_pr_1], [self.ma_mean_1,self.ma_sigma_1,self.use_ma_norm_pr_1],[self.incl_mean_1,self.incl_sigma_1,self.use_incl_norm_pr_1], [self.Omega_mean_1,self.Omega_sigma_1, self.use_Omega_norm_pr_1],[self.t0_mean_1,self.t0_sigma_1, self.use_t0_norm_pr_1],[self.pl_rad_mean_1,self.pl_rad_sigma_1,self.use_pl_rad_norm_pr_1],[self.a_sol_mean_1,self.a_sol_sigma_1,self.use_a_sol_norm_pr_1], [self.K_mean_2,self.K_sigma_2,self.use_K_norm_pr_2],[self.P_mean_2,self.P_sigma_2,self.use_P_norm_pr_2], [self.e_mean_2,self.e_sigma_2,self.use_e_norm_pr_2],[self.om_mean_2,self.om_sigma_2,self.use_om_norm_pr_2], [self.ma_mean_2,self.ma_sigma_2,self.use_ma_norm_pr_2],[self.incl_mean_2,self.incl_sigma_2,self.use_incl_norm_pr_2], [self.Omega_mean_2,self.Omega_sigma_2, self.use_Omega_norm_pr_2],[self.t0_mean_2,self.t0_sigma_2, self.use_t0_norm_pr_2],[self.pl_rad_mean_2,self.pl_rad_sigma_2,self.use_pl_rad_norm_pr_2],[self.a_sol_mean_2,self.a_sol_sigma_2,self.use_a_sol_norm_pr_2], [self.K_mean_3,self.K_sigma_3,self.use_K_norm_pr_3],[self.P_mean_3,self.P_sigma_3,self.use_P_norm_pr_3], [self.e_mean_3,self.e_sigma_3,self.use_e_norm_pr_3],[self.om_mean_3,self.om_sigma_3,self.use_om_norm_pr_3], [self.ma_mean_3,self.ma_sigma_3,self.use_ma_norm_pr_3],[self.incl_mean_3,self.incl_sigma_3,self.use_incl_norm_pr_3], [self.Omega_mean_3,self.Omega_sigma_3, self.use_Omega_norm_pr_3],[self.t0_mean_3,self.t0_sigma_3, self.use_t0_norm_pr_3],[self.pl_rad_mean_3,self.pl_rad_sigma_3,self.use_pl_rad_norm_pr_3],[self.a_sol_mean_3,self.a_sol_sigma_3,self.use_a_sol_norm_pr_3], [self.K_mean_4,self.K_sigma_4,self.use_K_norm_pr_4],[self.P_mean_4,self.P_sigma_4,self.use_P_norm_pr_4], [self.e_mean_4,self.e_sigma_4,self.use_e_norm_pr_4],[self.om_mean_4,self.om_sigma_4,self.use_om_norm_pr_4], [self.ma_mean_4,self.ma_sigma_4,self.use_ma_norm_pr_4],[self.incl_mean_4,self.incl_sigma_4,self.use_incl_norm_pr_4], [self.Omega_mean_4,self.Omega_sigma_4, self.use_Omega_norm_pr_4],[self.t0_mean_4,self.t0_sigma_4, self.use_t0_norm_pr_4],[self.pl_rad_mean_4,self.pl_rad_sigma_4,self.use_pl_rad_norm_pr_4],[self.a_sol_mean_4,self.a_sol_sigma_4,self.use_a_sol_norm_pr_4], [self.K_mean_5,self.K_sigma_5,self.use_K_norm_pr_5],[self.P_mean_5,self.P_sigma_5,self.use_P_norm_pr_5], [self.e_mean_5,self.e_sigma_5,self.use_e_norm_pr_5],[self.om_mean_5,self.om_sigma_5,self.use_om_norm_pr_5], [self.ma_mean_5,self.ma_sigma_5,self.use_ma_norm_pr_5],[self.incl_mean_5,self.incl_sigma_5,self.use_incl_norm_pr_5], [self.Omega_mean_5,self.Omega_sigma_5, self.use_Omega_norm_pr_5],[self.t0_mean_5,self.t0_sigma_5, self.use_t0_norm_pr_5],[self.pl_rad_mean_5,self.pl_rad_sigma_5,self.use_pl_rad_norm_pr_5],[self.a_sol_mean_5,self.a_sol_sigma_5,self.use_a_sol_norm_pr_5], [self.K_mean_6,self.K_sigma_6,self.use_K_norm_pr_6],[self.P_mean_6,self.P_sigma_6,self.use_P_norm_pr_6], [self.e_mean_6,self.e_sigma_6,self.use_e_norm_pr_6],[self.om_mean_6,self.om_sigma_6,self.use_om_norm_pr_6], [self.ma_mean_6,self.ma_sigma_6,self.use_ma_norm_pr_6],[self.incl_mean_6,self.incl_sigma_6,self.use_incl_norm_pr_6], [self.Omega_mean_6,self.Omega_sigma_6, self.use_Omega_norm_pr_6],[self.t0_mean_6,self.t0_sigma_6, self.use_t0_norm_pr_6],[self.pl_rad_mean_6,self.pl_rad_sigma_6,self.use_pl_rad_norm_pr_6],[self.a_sol_mean_6,self.a_sol_sigma_6,self.use_a_sol_norm_pr_6], [self.K_mean_7,self.K_sigma_7,self.use_K_norm_pr_7],[self.P_mean_7,self.P_sigma_7,self.use_P_norm_pr_7], [self.e_mean_7,self.e_sigma_7,self.use_e_norm_pr_7],[self.om_mean_7,self.om_sigma_7,self.use_om_norm_pr_7], [self.ma_mean_7,self.ma_sigma_7,self.use_ma_norm_pr_7],[self.incl_mean_7,self.incl_sigma_7,self.use_incl_norm_pr_7], [self.Omega_mean_7,self.Omega_sigma_7, self.use_Omega_norm_pr_7],[self.t0_mean_7,self.t0_sigma_7, self.use_t0_norm_pr_7],[self.pl_rad_mean_7,self.pl_rad_sigma_7,self.use_pl_rad_norm_pr_7],[self.a_sol_mean_7,self.a_sol_sigma_7,self.use_a_sol_norm_pr_7], [self.K_mean_8,self.K_sigma_8,self.use_K_norm_pr_8],[self.P_mean_8,self.P_sigma_8,self.use_P_norm_pr_8], [self.e_mean_8,self.e_sigma_8,self.use_e_norm_pr_8],[self.om_mean_8,self.om_sigma_8,self.use_om_norm_pr_8], [self.ma_mean_8,self.ma_sigma_8,self.use_ma_norm_pr_8],[self.incl_mean_8,self.incl_sigma_8,self.use_incl_norm_pr_8], [self.Omega_mean_8,self.Omega_sigma_8, self.use_Omega_norm_pr_8],[self.t0_mean_8,self.t0_sigma_8, self.use_t0_norm_pr_8],[self.pl_rad_mean_8,self.pl_rad_sigma_8,self.use_pl_rad_norm_pr_8],[self.a_sol_mean_8,self.a_sol_sigma_8,self.use_a_sol_norm_pr_8], [self.K_mean_9,self.K_sigma_9,self.use_K_norm_pr_9],[self.P_mean_9,self.P_sigma_9,self.use_P_norm_pr_9], [self.e_mean_9,self.e_sigma_9,self.use_e_norm_pr_9],[self.om_mean_9,self.om_sigma_9,self.use_om_norm_pr_9], [self.ma_mean_9,self.ma_sigma_9,self.use_ma_norm_pr_9],[self.incl_mean_9,self.incl_sigma_9,self.use_incl_norm_pr_9], [self.Omega_mean_9,self.Omega_sigma_9, self.use_Omega_norm_pr_9],[self.t0_mean_9,self.t0_sigma_9, self.use_t0_norm_pr_9],[self.pl_rad_mean_9,self.pl_rad_sigma_9,self.use_pl_rad_norm_pr_9],[self.a_sol_mean_9,self.a_sol_sigma_9,self.use_a_sol_norm_pr_9], ] return param_nr_priors_gui ################# Jeff Prior ################ def param_jeff_priors_gui(self): param_jeff_priors_gui = [ [self.K_jeff_alpha_1,self.K_jeff_beta_1,self.use_K_jeff_pr_1],[self.P_jeff_alpha_1,self.P_jeff_beta_1,self.use_P_jeff_pr_1], [self.e_jeff_alpha_1,self.e_jeff_beta_1,self.use_e_jeff_pr_1],[self.om_jeff_alpha_1,self.om_jeff_beta_1,self.use_om_jeff_pr_1], [self.ma_jeff_alpha_1,self.ma_jeff_beta_1,self.use_ma_jeff_pr_1],[self.incl_jeff_alpha_1,self.incl_jeff_beta_1,self.use_incl_jeff_pr_1], [self.Omega_jeff_alpha_1,self.Omega_jeff_beta_1, self.use_Omega_jeff_pr_1],[self.t0_jeff_alpha_1,self.t0_jeff_beta_1, self.use_t0_jeff_pr_1],[self.pl_rad_jeff_alpha_1,self.pl_rad_jeff_beta_1,self.use_pl_rad_jeff_pr_1],[self.a_sol_jeff_alpha_1,self.a_sol_jeff_beta_1,self.use_a_sol_jeff_pr_1], [self.K_jeff_alpha_2,self.K_jeff_beta_2,self.use_K_jeff_pr_2],[self.P_jeff_alpha_2,self.P_jeff_beta_2,self.use_P_jeff_pr_2], [self.e_jeff_alpha_2,self.e_jeff_beta_2,self.use_e_jeff_pr_2],[self.om_jeff_alpha_2,self.om_jeff_beta_2,self.use_om_jeff_pr_2], [self.ma_jeff_alpha_2,self.ma_jeff_beta_2,self.use_ma_jeff_pr_2],[self.incl_jeff_alpha_2,self.incl_jeff_beta_2,self.use_incl_jeff_pr_2], [self.Omega_jeff_alpha_2,self.Omega_jeff_beta_2, self.use_Omega_jeff_pr_2],[self.t0_jeff_alpha_2,self.t0_jeff_beta_2, self.use_t0_jeff_pr_2],[self.pl_rad_jeff_alpha_2,self.pl_rad_jeff_beta_2,self.use_pl_rad_jeff_pr_2],[self.a_sol_jeff_alpha_2,self.a_sol_jeff_beta_2,self.use_a_sol_jeff_pr_2], [self.K_jeff_alpha_3,self.K_jeff_beta_3,self.use_K_jeff_pr_3],[self.P_jeff_alpha_3,self.P_jeff_beta_3,self.use_P_jeff_pr_3], [self.e_jeff_alpha_3,self.e_jeff_beta_3,self.use_e_jeff_pr_3],[self.om_jeff_alpha_3,self.om_jeff_beta_3,self.use_om_jeff_pr_3], [self.ma_jeff_alpha_3,self.ma_jeff_beta_3,self.use_ma_jeff_pr_3],[self.incl_jeff_alpha_3,self.incl_jeff_beta_3,self.use_incl_jeff_pr_3], [self.Omega_jeff_alpha_3,self.Omega_jeff_beta_3, self.use_Omega_jeff_pr_3],[self.t0_jeff_alpha_3,self.t0_jeff_beta_3, self.use_t0_jeff_pr_3],[self.pl_rad_jeff_alpha_3,self.pl_rad_jeff_beta_3,self.use_pl_rad_jeff_pr_3],[self.a_sol_jeff_alpha_3,self.a_sol_jeff_beta_3,self.use_a_sol_jeff_pr_3], [self.K_jeff_alpha_4,self.K_jeff_beta_4,self.use_K_jeff_pr_4],[self.P_jeff_alpha_4,self.P_jeff_beta_4,self.use_P_jeff_pr_4], [self.e_jeff_alpha_4,self.e_jeff_beta_4,self.use_e_jeff_pr_4],[self.om_jeff_alpha_4,self.om_jeff_beta_4,self.use_om_jeff_pr_4], [self.ma_jeff_alpha_4,self.ma_jeff_beta_4,self.use_ma_jeff_pr_4],[self.incl_jeff_alpha_4,self.incl_jeff_beta_4,self.use_incl_jeff_pr_4], [self.Omega_jeff_alpha_4,self.Omega_jeff_beta_4, self.use_Omega_jeff_pr_4],[self.t0_jeff_alpha_4,self.t0_jeff_beta_4, self.use_t0_jeff_pr_4],[self.pl_rad_jeff_alpha_4,self.pl_rad_jeff_beta_4,self.use_pl_rad_jeff_pr_4],[self.a_sol_jeff_alpha_4,self.a_sol_jeff_beta_4,self.use_a_sol_jeff_pr_4], [self.K_jeff_alpha_5,self.K_jeff_beta_5,self.use_K_jeff_pr_5],[self.P_jeff_alpha_5,self.P_jeff_beta_5,self.use_P_jeff_pr_5], [self.e_jeff_alpha_5,self.e_jeff_beta_5,self.use_e_jeff_pr_5],[self.om_jeff_alpha_5,self.om_jeff_beta_5,self.use_om_jeff_pr_5], [self.ma_jeff_alpha_5,self.ma_jeff_beta_5,self.use_ma_jeff_pr_5],[self.incl_jeff_alpha_5,self.incl_jeff_beta_5,self.use_incl_jeff_pr_5], [self.Omega_jeff_alpha_5,self.Omega_jeff_beta_5, self.use_Omega_jeff_pr_5],[self.t0_jeff_alpha_5,self.t0_jeff_beta_5, self.use_t0_jeff_pr_5],[self.pl_rad_jeff_alpha_5,self.pl_rad_jeff_beta_5,self.use_pl_rad_jeff_pr_5],[self.a_sol_jeff_alpha_5,self.a_sol_jeff_beta_5,self.use_a_sol_jeff_pr_5], [self.K_jeff_alpha_6,self.K_jeff_beta_6,self.use_K_jeff_pr_6],[self.P_jeff_alpha_6,self.P_jeff_beta_6,self.use_P_jeff_pr_6], [self.e_jeff_alpha_6,self.e_jeff_beta_6,self.use_e_jeff_pr_6],[self.om_jeff_alpha_6,self.om_jeff_beta_6,self.use_om_jeff_pr_6], [self.ma_jeff_alpha_6,self.ma_jeff_beta_6,self.use_ma_jeff_pr_6],[self.incl_jeff_alpha_6,self.incl_jeff_beta_6,self.use_incl_jeff_pr_6], [self.Omega_jeff_alpha_6,self.Omega_jeff_beta_6, self.use_Omega_jeff_pr_6],[self.t0_jeff_alpha_6,self.t0_jeff_beta_6, self.use_t0_jeff_pr_6],[self.pl_rad_jeff_alpha_6,self.pl_rad_jeff_beta_6,self.use_pl_rad_jeff_pr_6],[self.a_sol_jeff_alpha_6,self.a_sol_jeff_beta_6,self.use_a_sol_jeff_pr_6], [self.K_jeff_alpha_7,self.K_jeff_beta_7,self.use_K_jeff_pr_7],[self.P_jeff_alpha_7,self.P_jeff_beta_7,self.use_P_jeff_pr_7], [self.e_jeff_alpha_7,self.e_jeff_beta_7,self.use_e_jeff_pr_7],[self.om_jeff_alpha_7,self.om_jeff_beta_7,self.use_om_jeff_pr_7], [self.ma_jeff_alpha_7,self.ma_jeff_beta_7,self.use_ma_jeff_pr_7],[self.incl_jeff_alpha_7,self.incl_jeff_beta_7,self.use_incl_jeff_pr_7], [self.Omega_jeff_alpha_7,self.Omega_jeff_beta_7, self.use_Omega_jeff_pr_7],[self.t0_jeff_alpha_7,self.t0_jeff_beta_7, self.use_t0_jeff_pr_7],[self.pl_rad_jeff_alpha_7,self.pl_rad_jeff_beta_7,self.use_pl_rad_jeff_pr_7],[self.a_sol_jeff_alpha_7,self.a_sol_jeff_beta_7,self.use_a_sol_jeff_pr_7], [self.K_jeff_alpha_8,self.K_jeff_beta_8,self.use_K_jeff_pr_8],[self.P_jeff_alpha_8,self.P_jeff_beta_8,self.use_P_jeff_pr_8], [self.e_jeff_alpha_8,self.e_jeff_beta_8,self.use_e_jeff_pr_8],[self.om_jeff_alpha_8,self.om_jeff_beta_8,self.use_om_jeff_pr_8], [self.ma_jeff_alpha_8,self.ma_jeff_beta_8,self.use_ma_jeff_pr_8],[self.incl_jeff_alpha_8,self.incl_jeff_beta_8,self.use_incl_jeff_pr_8], [self.Omega_jeff_alpha_8,self.Omega_jeff_beta_8, self.use_Omega_jeff_pr_8],[self.t0_jeff_alpha_8,self.t0_jeff_beta_8, self.use_t0_jeff_pr_8],[self.pl_rad_jeff_alpha_8,self.pl_rad_jeff_beta_8,self.use_pl_rad_jeff_pr_8],[self.a_sol_jeff_alpha_8,self.a_sol_jeff_beta_8,self.use_a_sol_jeff_pr_8], [self.K_jeff_alpha_9,self.K_jeff_beta_9,self.use_K_jeff_pr_9],[self.P_jeff_alpha_9,self.P_jeff_beta_9,self.use_P_jeff_pr_9], [self.e_jeff_alpha_9,self.e_jeff_beta_9,self.use_e_jeff_pr_9],[self.om_jeff_alpha_9,self.om_jeff_beta_9,self.use_om_jeff_pr_9], [self.ma_jeff_alpha_9,self.ma_jeff_beta_9,self.use_ma_jeff_pr_9],[self.incl_jeff_alpha_9,self.incl_jeff_beta_9,self.use_incl_jeff_pr_9], [self.Omega_jeff_alpha_9,self.Omega_jeff_beta_9, self.use_Omega_jeff_pr_9],[self.t0_jeff_alpha_9,self.t0_jeff_beta_9, self.use_t0_jeff_pr_9],[self.pl_rad_jeff_alpha_9,self.pl_rad_jeff_beta_9,self.use_pl_rad_jeff_pr_9],[self.a_sol_jeff_alpha_9,self.a_sol_jeff_beta_9,self.use_a_sol_jeff_pr_9], ] return param_jeff_priors_gui ################### GP ######################## def gp_rot_params(self): gp_rot_params = [ self.GP_rot_kernel_Amp, self.GP_rot_kernel_time_sc, self.GP_rot_kernel_Per, self.GP_rot_kernel_fact ] return gp_rot_params def gp_rot_errors_gui(self): gp_rot_errors_gui = [ self.err_rot_kernel_Amp, self.err_rot_kernel_time_sc, self.err_rot_kernel_Per, self.err_rot_kernel_fact ] return gp_rot_errors_gui def use_gp_rot_params(self): use_gp_rot_params = [ self.use_GP_rot_kernel_Amp, self.use_GP_rot_kernel_time_sc, self.use_GP_rot_kernel_Per, self.use_GP_rot_kernel_fact ] return use_gp_rot_params def gp_sho_params(self): gp_sho_params = [ self.GP_sho_kernel_S, self.GP_sho_kernel_Q, self.GP_sho_kernel_omega ] return gp_sho_params def use_gp_sho_params(self): use_gp_sho_params = [ self.use_GP_sho_kernel_S, self.use_GP_sho_kernel_Q, self.use_GP_sho_kernel_omega ] return use_gp_sho_params def gp_sho_errors_gui(self): gp_sho_errors_gui = [ self.err_sho_kernel_S, self.err_sho_kernel_Q, self.err_sho_kernel_omega ] return gp_sho_errors_gui def tra_gp_rot_params(self): tra_gp_rot_params = [ self.tra_GP_rot_kernel_Amp, self.tra_GP_rot_kernel_time_sc, self.tra_GP_rot_kernel_Per, self.tra_GP_rot_kernel_fact] return tra_gp_rot_params def use_tra_gp_rot_params(self): use_tra_gp_rot_params = [ self.use_tra_GP_rot_kernel_Amp, self.use_tra_GP_rot_kernel_time_sc, self.use_tra_GP_rot_kernel_Per, self.use_tra_GP_rot_kernel_fact ] return use_tra_gp_rot_params def tra_gp_sho_params(self): tra_gp_sho_params = [ self.tra_GP_sho_kernel_S, self.tra_GP_sho_kernel_Q, self.tra_GP_sho_kernel_omega] return tra_gp_sho_params def use_tra_gp_sho_params(self): use_tra_gp_sho_params = [ self.use_tra_GP_sho_kernel_S, self.use_tra_GP_sho_kernel_Q, self.use_tra_GP_sho_kernel_omega] return use_tra_gp_sho_params ################ labels ########################## def param_a_gui(self): param_a_gui = [ self.label_a1, self.label_a2, self.label_a3, self.label_a4, self.label_a5, self.label_a6, self.label_a7, self.label_a8, self.label_a9 ] return param_a_gui def param_mass_gui(self): param_mass_gui = [ self.label_mass1, self.label_mass2, self.label_mass3, self.label_mass4, self.label_mass5, self.label_mass6, self.label_mass7, self.label_mass8, self.label_mass9 ] return param_mass_gui def param_t_peri_gui(self): param_t_peri_gui = [ self.label_t_peri1, self.label_t_peri2, self.label_t_peri3, self.label_t_peri4, self.label_t_peri5, self.label_t_peri6, self.label_t_peri7, self.label_t_peri8, self.label_t_peri9 ] return param_t_peri_gui def planet_checked_gui(self): planet_checked_gui = [ self.use_Planet1,self.use_Planet2,self.use_Planet3, self.use_Planet4,self.use_Planet5,self.use_Planet6, self.use_Planet7,self.use_Planet8,self.use_Planet9 ] return planet_checked_gui def bin_rv_data(self): bin_rv_data = [ [self.RV_bin_data_1,self.use_RV_bin_data_1],[self.RV_bin_data_2,self.use_RV_bin_data_2], [self.RV_bin_data_3,self.use_RV_bin_data_3],[self.RV_bin_data_4,self.use_RV_bin_data_4], [self.RV_bin_data_5,self.use_RV_bin_data_5],[self.RV_bin_data_6,self.use_RV_bin_data_6], [self.RV_bin_data_7,self.use_RV_bin_data_7],[self.RV_bin_data_8,self.use_RV_bin_data_8], [self.RV_bin_data_9,self.use_RV_bin_data_9],[self.RV_bin_data_10,self.use_RV_bin_data_10] ] return bin_rv_data def add_rv_error(self): add_rv_error = [ [self.inflate_RV_sigma_1,self.use_inflate_RV_sigma_1],[self.inflate_RV_sigma_2,self.use_inflate_RV_sigma_2], [self.inflate_RV_sigma_3,self.use_inflate_RV_sigma_3],[self.inflate_RV_sigma_4,self.use_inflate_RV_sigma_4], [self.inflate_RV_sigma_5,self.use_inflate_RV_sigma_5],[self.inflate_RV_sigma_6,self.use_inflate_RV_sigma_6], [self.inflate_RV_sigma_7,self.use_inflate_RV_sigma_7],[self.inflate_RV_sigma_8,self.use_inflate_RV_sigma_8], [self.inflate_RV_sigma_9,self.use_inflate_RV_sigma_9],[self.inflate_RV_sigma_10,self.use_inflate_RV_sigma_10] ] return add_rv_error def rv_sigma_clip(self): rv_sigma_clip = [ [self.RV_sigma_clip_1,self.use_RV_sigma_clip_1],[self.RV_sigma_clip_2,self.use_RV_sigma_clip_2], [self.RV_sigma_clip_3,self.use_RV_sigma_clip_3],[self.RV_sigma_clip_4,self.use_RV_sigma_clip_4], [self.RV_sigma_clip_5,self.use_RV_sigma_clip_5],[self.RV_sigma_clip_6,self.use_RV_sigma_clip_6], [self.RV_sigma_clip_7,self.use_RV_sigma_clip_7],[self.RV_sigma_clip_8,self.use_RV_sigma_clip_8], [self.RV_sigma_clip_9,self.use_RV_sigma_clip_9],[self.RV_sigma_clip_10,self.use_RV_sigma_clip_10] ] return rv_sigma_clip def act_sigma_clip(self): act_sigma_clip = [ [self.act_sigma_clip_1,self.use_act_sigma_clip_1],[self.act_sigma_clip_2,self.use_act_sigma_clip_2], [self.act_sigma_clip_3,self.use_act_sigma_clip_3],[self.act_sigma_clip_4,self.use_act_sigma_clip_4], [self.act_sigma_clip_5,self.use_act_sigma_clip_5],[self.act_sigma_clip_6,self.use_act_sigma_clip_6], [self.act_sigma_clip_7,self.use_act_sigma_clip_7],[self.act_sigma_clip_8,self.use_act_sigma_clip_8], [self.act_sigma_clip_9,self.use_act_sigma_clip_9],[self.act_sigma_clip_10,self.use_act_sigma_clip_10] ] return act_sigma_clip def act_remove_mean(self): act_remove_mean = [ self.act_remove_mean_1,self.act_remove_mean_2,self.act_remove_mean_3, self.act_remove_mean_4,self.act_remove_mean_5,self.act_remove_mean_6, self.act_remove_mean_7,self.act_remove_mean_8,self.act_remove_mean_9, self.act_remove_mean_10 ] return act_remove_mean #def tra_sigma_clip(self): # tra_sigma_clip = [ # [self.tra_sigma_clip_1,self.use_tra_sigma_clip_1],[self.tra_sigma_clip_2,self.use_tra_sigma_clip_2], # [self.tra_sigma_clip_3,self.use_tra_sigma_clip_3],[self.tra_sigma_clip_4,self.use_tra_sigma_clip_4], # [self.tra_sigma_clip_5,self.use_tra_sigma_clip_5],[self.tra_sigma_clip_6,self.use_tra_sigma_clip_6], # [self.tra_sigma_clip_7,self.use_tra_sigma_clip_7],[self.tra_sigma_clip_8,self.use_tra_sigma_clip_8], # [self.tra_sigma_clip_9,self.use_tra_sigma_clip_9],[self.tra_sigma_clip_10,self.use_tra_sigma_clip_10] # ] # return tra_sigma_clip def tra_norm(self): tra_norm = [ self.tra_norm_1,self.tra_norm_2,self.tra_norm_3,self.tra_norm_4,self.tra_norm_5, self.tra_norm_6,self.tra_norm_7,self.tra_norm_8,self.tra_norm_9,self.tra_norm_10 ] return tra_norm def tra_dilution(self): tra_dilution = [ [self.tra_dilution_1,self.use_tra_dilution_1], [self.tra_dilution_2,self.use_tra_dilution_2], [self.tra_dilution_3,self.use_tra_dilution_3], [self.tra_dilution_4,self.use_tra_dilution_4], [self.tra_dilution_5,self.use_tra_dilution_5], [self.tra_dilution_6,self.use_tra_dilution_6], [self.tra_dilution_7,self.use_tra_dilution_7], [self.tra_dilution_8,self.use_tra_dilution_8], [self.tra_dilution_9,self.use_tra_dilution_9], [self.tra_dilution_10,self.use_tra_dilution_10] ] return tra_dilution ######################### Arb N-body ################################# def arb_param_gui(self): arb_param_gui = [ self.arb_K_1, self.arb_P_1, self.arb_e_1, self.arb_om_1, self.arb_ma_1, self.arb_incl_1, self.arb_Om_1, self.arb_K_2, self.arb_P_2, self.arb_e_2, self.arb_om_2, self.arb_ma_2, self.arb_incl_2, self.arb_Om_2, self.arb_K_3, self.arb_P_3, self.arb_e_3, self.arb_om_3, self.arb_ma_3, self.arb_incl_3, self.arb_Om_3, self.arb_K_4, self.arb_P_4, self.arb_e_4, self.arb_om_4, self.arb_ma_4, self.arb_incl_4, self.arb_Om_4, self.arb_K_5, self.arb_P_5, self.arb_e_5, self.arb_om_5, self.arb_ma_5, self.arb_incl_5, self.arb_Om_5, self.arb_K_6, self.arb_P_6, self.arb_e_6, self.arb_om_6, self.arb_ma_6, self.arb_incl_6, self.arb_Om_6, self.arb_K_7, self.arb_P_7, self.arb_e_7, self.arb_om_7, self.arb_ma_7, self.arb_incl_7, self.arb_Om_7, self.arb_K_8, self.arb_P_8, self.arb_e_8, self.arb_om_8, self.arb_ma_8, self.arb_incl_8, self.arb_Om_8, self.arb_K_9, self.arb_P_9, self.arb_e_9, self.arb_om_9, self.arb_ma_9, self.arb_incl_9, self.arb_Om_9, ] return arb_param_gui def arb_param_gui_use(self): arb_param_gui_use = [ self.use_arb_Planet_1,self.use_arb_Planet_2,self.use_arb_Planet_3, self.use_arb_Planet_4,self.use_arb_Planet_5,self.use_arb_Planet_6, self.use_arb_Planet_7,self.use_arb_Planet_8,self.use_arb_Planet_9 ] return arb_param_gui_use def ttv_data_to_planet(self): ttv_data_to_planet = [ self.ttv_data_planet_1,self.ttv_data_planet_2,self.ttv_data_planet_3,self.ttv_data_planet_4,self.ttv_data_planet_5, self.ttv_data_planet_6,self.ttv_data_planet_7,self.ttv_data_planet_8,self.ttv_data_planet_9,self.ttv_data_planet_10, ] return ttv_data_to_planet def use_ttv_data_to_planet(self): use_ttv_data_to_planet = [ self.use_ttv_data_1,self.use_ttv_data_2,self.use_ttv_data_3,self.use_ttv_data_4,self.use_ttv_data_5, self.use_ttv_data_6,self.use_ttv_data_7,self.use_ttv_data_8,self.use_ttv_data_9,self.use_ttv_data_10, ] return use_ttv_data_to_planet
def param_gui(self): param_gui = [self.K1, self.P1, self.e1, self.om1, self.ma1, self.incl1, self.Omega1, self.K2, self.P2, self.e2, self.om2, self.ma2, self.incl2, self.Omega2, self.K3, self.P3, self.e3, self.om3, self.ma3, self.incl3, self.Omega3, self.K4, self.P4, self.e4, self.om4, self.ma4, self.incl4, self.Omega4, self.K5, self.P5, self.e5, self.om5, self.ma5, self.incl5, self.Omega5, self.K6, self.P6, self.e6, self.om6, self.ma6, self.incl6, self.Omega6, self.K7, self.P7, self.e7, self.om7, self.ma7, self.incl7, self.Omega7, self.K8, self.P8, self.e8, self.om8, self.ma8, self.incl8, self.Omega8, self.K9, self.P9, self.e9, self.om9, self.ma9, self.incl9, self.Omega9] return param_gui def param_errors_gui(self): param_errors_gui = [self.err_K1, self.err_P1, self.err_e1, self.err_om1, self.err_ma1, self.err_i1, self.err_Om1, self.err_K2, self.err_P2, self.err_e2, self.err_om2, self.err_ma2, self.err_i2, self.err_Om2, self.err_K3, self.err_P3, self.err_e3, self.err_om3, self.err_ma3, self.err_i3, self.err_Om3, self.err_K4, self.err_P4, self.err_e4, self.err_om4, self.err_ma4, self.err_i4, self.err_Om4, self.err_K5, self.err_P5, self.err_e5, self.err_om5, self.err_ma5, self.err_i5, self.err_Om5, self.err_K6, self.err_P6, self.err_e6, self.err_om6, self.err_ma6, self.err_i6, self.err_Om6, self.err_K7, self.err_P7, self.err_e7, self.err_om7, self.err_ma7, self.err_i7, self.err_Om7, self.err_K8, self.err_P8, self.err_e8, self.err_om8, self.err_ma8, self.err_i8, self.err_Om8, self.err_K9, self.err_P9, self.err_e9, self.err_om9, self.err_ma9, self.err_i9, self.err_Om9] return param_errors_gui def use_param_gui(self): use_param_gui = [self.use_K1, self.use_P1, self.use_e1, self.use_om1, self.use_ma1, self.use_incl1, self.use_Omega1, self.use_K2, self.use_P2, self.use_e2, self.use_om2, self.use_ma2, self.use_incl2, self.use_Omega2, self.use_K3, self.use_P3, self.use_e3, self.use_om3, self.use_ma3, self.use_incl3, self.use_Omega3, self.use_K4, self.use_P4, self.use_e4, self.use_om4, self.use_ma4, self.use_incl4, self.use_Omega4, self.use_K5, self.use_P5, self.use_e5, self.use_om5, self.use_ma5, self.use_incl5, self.use_Omega5, self.use_K6, self.use_P6, self.use_e6, self.use_om6, self.use_ma6, self.use_incl6, self.use_Omega6, self.use_K7, self.use_P7, self.use_e7, self.use_om7, self.use_ma7, self.use_incl7, self.use_Omega7, self.use_K8, self.use_P8, self.use_e8, self.use_om8, self.use_ma8, self.use_incl8, self.use_Omega8, self.use_K9, self.use_P9, self.use_e9, self.use_om9, self.use_ma9, self.use_incl9, self.use_Omega9] return use_param_gui def param_gui_wd(self): param_gui_wd = [self.om_dot_1, self.om_dot_2, self.om_dot_3, self.om_dot_4, self.om_dot_5, self.om_dot_6, self.om_dot_7, self.om_dot_8, self.om_dot_9] return param_gui_wd def use_param_gui_wd(self): use_param_gui_wd = [self.use_om_dot_1, self.use_om_dot_2, self.use_om_dot_3, self.use_om_dot_4, self.use_om_dot_5, self.use_om_dot_6, self.use_om_dot_7, self.use_om_dot_8, self.use_om_dot_9] return use_param_gui_wd def param_errors_gui_wd(self): param_errors_gui_wd = [self.err_om_dot_1, self.err_om_dot_2, self.err_om_dot_3, self.err_om_dot_4, self.err_om_dot_5, self.err_om_dot_6, self.err_om_dot_7, self.err_om_dot_8, self.err_om_dot_9] return param_errors_gui_wd def param_gui_tr(self): param_gui_tr = [self.t0_1, self.pl_rad_1, self.a_sol_1, self.t0_2, self.pl_rad_2, self.a_sol_2, self.t0_3, self.pl_rad_3, self.a_sol_3, self.t0_4, self.pl_rad_4, self.a_sol_4, self.t0_5, self.pl_rad_5, self.a_sol_5, self.t0_6, self.pl_rad_6, self.a_sol_6, self.t0_7, self.pl_rad_7, self.a_sol_7, self.t0_8, self.pl_rad_8, self.a_sol_8, self.t0_9, self.pl_rad_9, self.a_sol_9] return param_gui_tr def use_param_gui_tr(self): use_param_gui_tr = [self.use_t0_1, self.use_pl_rad_1, self.use_a_sol_1, self.use_t0_2, self.use_pl_rad_2, self.use_a_sol_2, self.use_t0_3, self.use_pl_rad_3, self.use_a_sol_3, self.use_t0_4, self.use_pl_rad_4, self.use_a_sol_4, self.use_t0_5, self.use_pl_rad_5, self.use_a_sol_5, self.use_t0_6, self.use_pl_rad_6, self.use_a_sol_6, self.use_t0_7, self.use_pl_rad_7, self.use_a_sol_7, self.use_t0_8, self.use_pl_rad_8, self.use_a_sol_8, self.use_t0_9, self.use_pl_rad_9, self.use_a_sol_9] return use_param_gui_tr def err_t0(self): err_t0 = [self.err_t0_1, self.err_t0_2, self.err_t0_3, self.err_t0_4, self.err_t0_5, self.err_t0_6, self.err_t0_7, self.err_t0_8, self.err_t0_9] return err_t0 def err_pl_rad(self): err_pl_rad = [self.err_pl_rad_1, self.err_pl_rad_2, self.err_pl_rad_3, self.err_pl_rad_4, self.err_pl_rad_5, self.err_pl_rad_6, self.err_pl_rad_7, self.err_pl_rad_8, self.err_pl_rad_9] return err_pl_rad def err_a_sol(self): err_a_sol = [self.err_a_sol_1, self.err_a_sol_2, self.err_a_sol_3, self.err_a_sol_4, self.err_a_sol_5, self.err_a_sol_6, self.err_a_sol_7, self.err_a_sol_8, self.err_a_sol_9] return err_a_sol def rvs_data_gui(self): rvs_data_gui = [self.Data1, self.Data2, self.Data3, self.Data4, self.Data5, self.Data6, self.Data7, self.Data8, self.Data9, self.Data10] return rvs_data_gui def rvs_data_jitter_gui(self): rvs_data_jitter_gui = [self.jitter_Data1, self.jitter_Data2, self.jitter_Data3, self.jitter_Data4, self.jitter_Data5, self.jitter_Data6, self.jitter_Data7, self.jitter_Data8, self.jitter_Data9, self.jitter_Data10] return rvs_data_jitter_gui def use_data_offset_gui(self): use_data_offset_gui = [self.use_offset_Data1, self.use_offset_Data2, self.use_offset_Data3, self.use_offset_Data4, self.use_offset_Data5, self.use_offset_Data6, self.use_offset_Data7, self.use_offset_Data8, self.use_offset_Data9, self.use_offset_Data10] return use_data_offset_gui def use_data_jitter_gui(self): use_data_jitter_gui = [self.use_jitter_Data1, self.use_jitter_Data2, self.use_jitter_Data3, self.use_jitter_Data4, self.use_jitter_Data5, self.use_jitter_Data6, self.use_jitter_Data7, self.use_jitter_Data8, self.use_jitter_Data9, self.use_jitter_Data10] return use_data_jitter_gui def data_errors_gui(self): data_errors_gui = [self.err_Data1, self.err_Data2, self.err_Data3, self.err_Data4, self.err_Data5, self.err_Data6, self.err_Data7, self.err_Data8, self.err_Data9, self.err_Data10] return data_errors_gui def data_errors_jitter_gui(self): data_errors_jitter_gui = [self.err_jitter_Data1, self.err_jitter_Data2, self.err_jitter_Data3, self.err_jitter_Data4, self.err_jitter_Data5, self.err_jitter_Data6, self.err_jitter_Data7, self.err_jitter_Data8, self.err_jitter_Data9, self.err_jitter_Data10] return data_errors_jitter_gui def tra_data_gui(self): tra_data_gui = [self.trans_Data1, self.trans_Data2, self.trans_Data3, self.trans_Data4, self.trans_Data5, self.trans_Data6, self.trans_Data7, self.trans_Data8, self.trans_Data9, self.trans_Data10] return tra_data_gui def tra_data_jitter_gui(self): tra_data_jitter_gui = [self.jitter_trans_Data1, self.jitter_trans_Data2, self.jitter_trans_Data3, self.jitter_trans_Data4, self.jitter_trans_Data5, self.jitter_trans_Data6, self.jitter_trans_Data7, self.jitter_trans_Data8, self.jitter_trans_Data9, self.jitter_trans_Data10] return tra_data_jitter_gui def use_tra_data_offset_gui(self): use_tra_data_offset_gui = [self.use_offset_trans_Data1, self.use_offset_trans_Data2, self.use_offset_trans_Data3, self.use_offset_trans_Data4, self.use_offset_trans_Data5, self.use_offset_trans_Data6, self.use_offset_trans_Data7, self.use_offset_trans_Data8, self.use_offset_trans_Data9, self.use_offset_trans_Data10] return use_tra_data_offset_gui def use_tra_data_jitter_gui(self): use_tra_data_jitter_gui = [self.use_jitter_trans_Data1, self.use_jitter_trans_Data2, self.use_jitter_trans_Data3, self.use_jitter_trans_Data4, self.use_jitter_trans_Data5, self.use_jitter_trans_Data6, self.use_jitter_trans_Data7, self.use_jitter_trans_Data8, self.use_jitter_trans_Data9, self.use_jitter_trans_Data10] return use_tra_data_jitter_gui def tra_data_errors_gui(self): tra_data_errors_gui = [self.err_trans_Data1, self.err_trans_Data2, self.err_trans_Data3, self.err_trans_Data4, self.err_trans_Data5, self.err_trans_Data6, self.err_trans_Data7, self.err_trans_Data8, self.err_trans_Data9, self.err_trans_Data10] return tra_data_errors_gui def tra_data_errors_jitter_gui(self): tra_data_errors_jitter_gui = [self.err_jitter_trans_Data1, self.err_jitter_trans_Data2, self.err_jitter_trans_Data3, self.err_jitter_trans_Data4, self.err_jitter_trans_Data5, self.err_jitter_trans_Data6, self.err_jitter_trans_Data7, self.err_jitter_trans_Data8, self.err_jitter_trans_Data9, self.err_jitter_trans_Data10] return tra_data_errors_jitter_gui def param_bounds_gui(self): param_bounds_gui = [[self.K_min_1, self.K_max_1], [self.P_min_1, self.P_max_1], [self.e_min_1, self.e_max_1], [self.om_min_1, self.om_max_1], [self.ma_min_1, self.ma_max_1], [self.incl_min_1, self.incl_max_1], [self.Omega_min_1, self.Omega_max_1], [self.t0_min_1, self.t0_max_1], [self.pl_rad_min_1, self.pl_rad_max_1], [self.a_sol_min_1, self.a_sol_max_1], [self.K_min_2, self.K_max_2], [self.P_min_2, self.P_max_2], [self.e_min_2, self.e_max_2], [self.om_min_2, self.om_max_2], [self.ma_min_2, self.ma_max_2], [self.incl_min_2, self.incl_max_2], [self.Omega_min_2, self.Omega_max_2], [self.t0_min_2, self.t0_max_2], [self.pl_rad_min_2, self.pl_rad_max_2], [self.a_sol_min_2, self.a_sol_max_2], [self.K_min_3, self.K_max_3], [self.P_min_3, self.P_max_3], [self.e_min_3, self.e_max_3], [self.om_min_3, self.om_max_3], [self.ma_min_3, self.ma_max_3], [self.incl_min_3, self.incl_max_3], [self.Omega_min_3, self.Omega_max_3], [self.t0_min_3, self.t0_max_3], [self.pl_rad_min_3, self.pl_rad_max_3], [self.a_sol_min_3, self.a_sol_max_3], [self.K_min_4, self.K_max_4], [self.P_min_4, self.P_max_4], [self.e_min_4, self.e_max_4], [self.om_min_4, self.om_max_4], [self.ma_min_4, self.ma_max_4], [self.incl_min_4, self.incl_max_4], [self.Omega_min_4, self.Omega_max_4], [self.t0_min_4, self.t0_max_4], [self.pl_rad_min_4, self.pl_rad_max_4], [self.a_sol_min_4, self.a_sol_max_4], [self.K_min_5, self.K_max_5], [self.P_min_5, self.P_max_5], [self.e_min_5, self.e_max_5], [self.om_min_5, self.om_max_5], [self.ma_min_5, self.ma_max_5], [self.incl_min_5, self.incl_max_5], [self.Omega_min_5, self.Omega_max_5], [self.t0_min_5, self.t0_max_5], [self.pl_rad_min_5, self.pl_rad_max_5], [self.a_sol_min_5, self.a_sol_max_5], [self.K_min_6, self.K_max_6], [self.P_min_6, self.P_max_6], [self.e_min_6, self.e_max_6], [self.om_min_6, self.om_max_6], [self.ma_min_6, self.ma_max_6], [self.incl_min_6, self.incl_max_6], [self.Omega_min_6, self.Omega_max_6], [self.t0_min_6, self.t0_max_6], [self.pl_rad_min_6, self.pl_rad_max_6], [self.a_sol_min_6, self.a_sol_max_6], [self.K_min_7, self.K_max_7], [self.P_min_7, self.P_max_7], [self.e_min_7, self.e_max_7], [self.om_min_7, self.om_max_7], [self.ma_min_7, self.ma_max_7], [self.incl_min_7, self.incl_max_7], [self.Omega_min_7, self.Omega_max_7], [self.t0_min_7, self.t0_max_7], [self.pl_rad_min_7, self.pl_rad_max_7], [self.a_sol_min_7, self.a_sol_max_7], [self.K_min_8, self.K_max_8], [self.P_min_8, self.P_max_8], [self.e_min_8, self.e_max_8], [self.om_min_8, self.om_max_8], [self.ma_min_8, self.ma_max_8], [self.incl_min_8, self.incl_max_8], [self.Omega_min_8, self.Omega_max_8], [self.t0_min_8, self.t0_max_8], [self.pl_rad_min_8, self.pl_rad_max_8], [self.a_sol_min_8, self.a_sol_max_8], [self.K_min_9, self.K_max_9], [self.P_min_9, self.P_max_9], [self.e_min_9, self.e_max_9], [self.om_min_9, self.om_max_9], [self.ma_min_9, self.ma_max_9], [self.incl_min_9, self.incl_max_9], [self.Omega_min_9, self.Omega_max_9], [self.t0_min_9, self.t0_max_9], [self.pl_rad_min_9, self.pl_rad_max_9], [self.a_sol_min_9, self.a_sol_max_9]] return param_bounds_gui def offset_bounds_gui(self): offset_bounds_gui = [[self.Data1_min, self.Data1_max], [self.Data2_min, self.Data2_max], [self.Data3_min, self.Data3_max], [self.Data4_min, self.Data4_max], [self.Data5_min, self.Data5_max], [self.Data6_min, self.Data6_max], [self.Data7_min, self.Data7_max], [self.Data8_min, self.Data8_max], [self.Data9_min, self.Data9_max], [self.Data10_min, self.Data10_max]] return offset_bounds_gui def jitter_bounds_gui(self): jitter_bounds_gui = [[self.jitter1_min, self.jitter1_max], [self.jitter2_min, self.jitter2_max], [self.jitter3_min, self.jitter3_max], [self.jitter4_min, self.jitter4_max], [self.jitter5_min, self.jitter5_max], [self.jitter6_min, self.jitter6_max], [self.jitter7_min, self.jitter7_max], [self.jitter8_min, self.jitter8_max], [self.jitter9_min, self.jitter9_max], [self.jitter10_min, self.Data10_max]] return jitter_bounds_gui def om_dot_bounds_gui(self): om_dot_bounds_gui = [[self.omega_dot_min_1, self.omega_dot_max_1], [self.omega_dot_min_2, self.omega_dot_max_2], [self.omega_dot_min_3, self.omega_dot_max_3], [self.omega_dot_min_4, self.omega_dot_max_4], [self.omega_dot_min_5, self.omega_dot_max_5], [self.omega_dot_min_6, self.omega_dot_max_6], [self.omega_dot_min_7, self.omega_dot_max_7], [self.omega_dot_min_8, self.omega_dot_max_8], [self.omega_dot_min_9, self.omega_dot_max_9]] return om_dot_bounds_gui def use_uni_ld_models(self): use_uni_ld_models = [self.use_uniform_ld_1, self.use_uniform_ld_2, self.use_uniform_ld_3, self.use_uniform_ld_4, self.use_uniform_ld_5, self.use_uniform_ld_6, self.use_uniform_ld_7, self.use_uniform_ld_8, self.use_uniform_ld_9, self.use_uniform_ld_10] return use_uni_ld_models def use_lin_ld_models(self): use_lin_ld_models = [self.use_linear_ld_1, self.use_linear_ld_2, self.use_linear_ld_3, self.use_linear_ld_4, self.use_linear_ld_5, self.use_linear_ld_6, self.use_linear_ld_7, self.use_linear_ld_8, self.use_linear_ld_9, self.use_linear_ld_10] return use_lin_ld_models def use_quad_ld_models(self): use_quad_ld_models = [self.use_quadratic_ld_1, self.use_quadratic_ld_2, self.use_quadratic_ld_3, self.use_quadratic_ld_4, self.use_quadratic_ld_5, self.use_quadratic_ld_6, self.use_quadratic_ld_7, self.use_quadratic_ld_8, self.use_quadratic_ld_9, self.use_quadratic_ld_10] return use_quad_ld_models def use_nonlin_ld_models(self): use_nonlin_ld_models = [self.use_nonlinear_ld_1, self.use_nonlinear_ld_2, self.use_nonlinear_ld_3, self.use_nonlinear_ld_4, self.use_nonlinear_ld_5, self.use_nonlinear_ld_6, self.use_nonlinear_ld_7, self.use_nonlinear_ld_8, self.use_nonlinear_ld_9, self.use_nonlinear_ld_10] return use_nonlin_ld_models def lin_u(self): lin_u = [self.u1_linear_1, self.u1_linear_2, self.u1_linear_3, self.u1_linear_4, self.u1_linear_5, self.u1_linear_6, self.u1_linear_7, self.u1_linear_8, self.u1_linear_9, self.u1_linear_10] return lin_u def use_lin_u(self): use_lin_u = [self.use_u1_linear_1, self.use_u1_linear_2, self.use_u1_linear_3, self.use_u1_linear_4, self.use_u1_linear_5, self.use_u1_linear_6, self.use_u1_linear_7, self.use_u1_linear_8, self.use_u1_linear_9, self.use_u1_linear_10] return use_lin_u def err_lin_u(self): err_lin_u = [self.err_u1_linear_1, self.err_u1_linear_2, self.err_u1_linear_3, self.err_u1_linear_4, self.err_u1_linear_5, self.err_u1_linear_6, self.err_u1_linear_7, self.err_u1_linear_8, self.err_u1_linear_9, self.err_u1_linear_10] return err_lin_u def quad_u1(self): quad_u1 = [self.u1_quadratic_1, self.u1_quadratic_2, self.u1_quadratic_3, self.u1_quadratic_4, self.u1_quadratic_5, self.u1_quadratic_6, self.u1_quadratic_7, self.u1_quadratic_8, self.u1_quadratic_9, self.u1_quadratic_10] return quad_u1 def use_quad_u1(self): use_quad_u1 = [self.use_u1_quadratic_1, self.use_u1_quadratic_2, self.use_u1_quadratic_3, self.use_u1_quadratic_4, self.use_u1_quadratic_5, self.use_u1_quadratic_6, self.use_u1_quadratic_7, self.use_u1_quadratic_8, self.use_u1_quadratic_9, self.use_u1_quadratic_10] return use_quad_u1 def err_quad_u1(self): err_quad_u1 = [self.err_u1_quadratic_1, self.err_u1_quadratic_2, self.err_u1_quadratic_3, self.err_u1_quadratic_4, self.err_u1_quadratic_5, self.err_u1_quadratic_6, self.err_u1_quadratic_7, self.err_u1_quadratic_8, self.err_u1_quadratic_9, self.err_u1_quadratic_10] return err_quad_u1 def quad_u2(self): quad_u2 = [self.u2_quadratic_1, self.u2_quadratic_2, self.u2_quadratic_3, self.u2_quadratic_4, self.u2_quadratic_5, self.u2_quadratic_6, self.u2_quadratic_7, self.u2_quadratic_8, self.u2_quadratic_9, self.u2_quadratic_10] return quad_u2 def use_quad_u2(self): use_quad_u2 = [self.use_u2_quadratic_1, self.use_u2_quadratic_2, self.use_u2_quadratic_3, self.use_u2_quadratic_4, self.use_u2_quadratic_5, self.use_u2_quadratic_6, self.use_u2_quadratic_7, self.use_u2_quadratic_8, self.use_u2_quadratic_9, self.use_u2_quadratic_10] return use_quad_u2 def err_quad_u2(self): err_quad_u2 = [self.err_u2_quadratic_1, self.err_u2_quadratic_2, self.err_u2_quadratic_3, self.err_u2_quadratic_4, self.err_u2_quadratic_5, self.err_u2_quadratic_6, self.err_u2_quadratic_7, self.err_u2_quadratic_8, self.err_u2_quadratic_9, self.err_u2_quadratic_10] return err_quad_u2 def nonlin_u1(self): nonlin_u1 = [self.u1_nonlin_1, self.u1_nonlin_2, self.u1_nonlin_3, self.u1_nonlin_4, self.u1_nonlin_5, self.u1_nonlin_6, self.u1_nonlin_7, self.u1_nonlin_8, self.u1_nonlin_9, self.u1_nonlin_10] return nonlin_u1 def use_nonlin_u1(self): use_nonlin_u1 = [self.use_u1_nonlin_1, self.use_u1_nonlin_2, self.use_u1_nonlin_3, self.use_u1_nonlin_4, self.use_u1_nonlin_5, self.use_u1_nonlin_6, self.use_u1_nonlin_7, self.use_u1_nonlin_8, self.use_u1_nonlin_9, self.use_u1_nonlin_10] return use_nonlin_u1 def err_nonlin_u1(self): err_nonlin_u1 = [self.err_u1_nonlin_1, self.err_u1_nonlin_2, self.err_u1_nonlin_3, self.err_u1_nonlin_4, self.err_u1_nonlin_5, self.err_u1_nonlin_6, self.err_u1_nonlin_7, self.err_u1_nonlin_8, self.err_u1_nonlin_9, self.err_u1_nonlin_10] return err_nonlin_u1 def nonlin_u2(self): nonlin_u2 = [self.u2_nonlin_1, self.u2_nonlin_2, self.u2_nonlin_3, self.u2_nonlin_4, self.u2_nonlin_5, self.u2_nonlin_6, self.u2_nonlin_7, self.u2_nonlin_8, self.u2_nonlin_9, self.u2_nonlin_10] return nonlin_u2 def use_nonlin_u2(self): use_nonlin_u2 = [self.use_u2_nonlin_1, self.use_u2_nonlin_2, self.use_u2_nonlin_3, self.use_u2_nonlin_4, self.use_u2_nonlin_5, self.use_u2_nonlin_6, self.use_u2_nonlin_7, self.use_u2_nonlin_8, self.use_u2_nonlin_9, self.use_u2_nonlin_10] return use_nonlin_u2 def err_nonlin_u2(self): err_nonlin_u2 = [self.err_u2_nonlin_1, self.err_u2_nonlin_2, self.err_u2_nonlin_3, self.err_u2_nonlin_4, self.err_u2_nonlin_5, self.err_u2_nonlin_6, self.err_u2_nonlin_7, self.err_u2_nonlin_8, self.err_u2_nonlin_9, self.err_u2_nonlin_10] return err_nonlin_u2 def nonlin_u3(self): nonlin_u3 = [self.u3_nonlin_1, self.u3_nonlin_2, self.u3_nonlin_3, self.u3_nonlin_4, self.u3_nonlin_5, self.u3_nonlin_6, self.u3_nonlin_7, self.u3_nonlin_8, self.u3_nonlin_9, self.u3_nonlin_10] return nonlin_u3 def use_nonlin_u3(self): use_nonlin_u3 = [self.use_u3_nonlin_1, self.use_u3_nonlin_2, self.use_u3_nonlin_3, self.use_u3_nonlin_4, self.use_u3_nonlin_5, self.use_u3_nonlin_6, self.use_u3_nonlin_7, self.use_u3_nonlin_8, self.use_u3_nonlin_9, self.use_u3_nonlin_10] return use_nonlin_u3 def err_nonlin_u3(self): err_nonlin_u3 = [self.err_u3_nonlin_1, self.err_u3_nonlin_2, self.err_u3_nonlin_3, self.err_u3_nonlin_4, self.err_u3_nonlin_5, self.err_u3_nonlin_6, self.err_u3_nonlin_7, self.err_u3_nonlin_8, self.err_u3_nonlin_9, self.err_u3_nonlin_10] return err_nonlin_u3 def nonlin_u4(self): nonlin_u4 = [self.u4_nonlin_1, self.u4_nonlin_2, self.u4_nonlin_3, self.u4_nonlin_4, self.u4_nonlin_5, self.u4_nonlin_6, self.u4_nonlin_7, self.u4_nonlin_8, self.u4_nonlin_9, self.u4_nonlin_10] return nonlin_u4 def use_nonlin_u4(self): use_nonlin_u4 = [self.use_u4_nonlin_1, self.use_u4_nonlin_2, self.use_u4_nonlin_3, self.use_u4_nonlin_4, self.use_u4_nonlin_5, self.use_u4_nonlin_6, self.use_u4_nonlin_7, self.use_u4_nonlin_8, self.use_u4_nonlin_9, self.use_u4_nonlin_10] return use_nonlin_u4 def err_nonlin_u4(self): err_nonlin_u4 = [self.err_u4_nonlin_1, self.err_u4_nonlin_2, self.err_u4_nonlin_3, self.err_u4_nonlin_4, self.err_u4_nonlin_5, self.err_u4_nonlin_6, self.err_u4_nonlin_7, self.err_u4_nonlin_8, self.err_u4_nonlin_9, self.err_u4_nonlin_10] return err_nonlin_u4 def ld_u1_bounds_gui(self): ld_u1_bounds_gui = [[self.u1_min_1, self.u1_max_1], [self.u1_min_2, self.u1_max_2], [self.u1_min_3, self.u1_max_3], [self.u1_min_4, self.u1_max_4], [self.u1_min_5, self.u1_max_5], [self.u1_min_6, self.u1_max_6], [self.u1_min_7, self.u1_max_7], [self.u1_min_8, self.u1_max_8], [self.u1_min_9, self.u1_max_9], [self.u1_min_10, self.u1_max_10]] return ld_u1_bounds_gui def ld_u2_bounds_gui(self): ld_u2_bounds_gui = [[self.u2_min_1, self.u2_max_1], [self.u2_min_2, self.u2_max_2], [self.u2_min_3, self.u2_max_3], [self.u2_min_4, self.u2_max_4], [self.u2_min_5, self.u2_max_5], [self.u2_min_6, self.u2_max_6], [self.u2_min_7, self.u2_max_7], [self.u2_min_8, self.u2_max_8], [self.u2_min_9, self.u2_max_9], [self.u2_min_10, self.u2_max_10]] return ld_u2_bounds_gui def ld_u3_bounds_gui(self): ld_u3_bounds_gui = [[self.u3_min_1, self.u3_max_1], [self.u3_min_2, self.u3_max_2], [self.u3_min_3, self.u3_max_3], [self.u3_min_4, self.u3_max_4], [self.u3_min_5, self.u3_max_5], [self.u3_min_6, self.u3_max_6], [self.u3_min_7, self.u3_max_7], [self.u3_min_8, self.u3_max_8], [self.u3_min_9, self.u3_max_9], [self.u3_min_10, self.u3_max_10]] return ld_u3_bounds_gui def ld_u4_bounds_gui(self): ld_u4_bounds_gui = [[self.u4_min_1, self.u4_max_1], [self.u4_min_2, self.u4_max_2], [self.u4_min_3, self.u4_max_3], [self.u4_min_4, self.u4_max_4], [self.u4_min_5, self.u4_max_5], [self.u4_min_6, self.u4_max_6], [self.u4_min_7, self.u4_max_7], [self.u4_min_8, self.u4_max_8], [self.u4_min_9, self.u4_max_9], [self.u4_min_10, self.u4_max_10]] return ld_u4_bounds_gui def param_nr_priors_gui(self): param_nr_priors_gui = [[self.K_mean_1, self.K_sigma_1, self.use_K_norm_pr_1], [self.P_mean_1, self.P_sigma_1, self.use_P_norm_pr_1], [self.e_mean_1, self.e_sigma_1, self.use_e_norm_pr_1], [self.om_mean_1, self.om_sigma_1, self.use_om_norm_pr_1], [self.ma_mean_1, self.ma_sigma_1, self.use_ma_norm_pr_1], [self.incl_mean_1, self.incl_sigma_1, self.use_incl_norm_pr_1], [self.Omega_mean_1, self.Omega_sigma_1, self.use_Omega_norm_pr_1], [self.t0_mean_1, self.t0_sigma_1, self.use_t0_norm_pr_1], [self.pl_rad_mean_1, self.pl_rad_sigma_1, self.use_pl_rad_norm_pr_1], [self.a_sol_mean_1, self.a_sol_sigma_1, self.use_a_sol_norm_pr_1], [self.K_mean_2, self.K_sigma_2, self.use_K_norm_pr_2], [self.P_mean_2, self.P_sigma_2, self.use_P_norm_pr_2], [self.e_mean_2, self.e_sigma_2, self.use_e_norm_pr_2], [self.om_mean_2, self.om_sigma_2, self.use_om_norm_pr_2], [self.ma_mean_2, self.ma_sigma_2, self.use_ma_norm_pr_2], [self.incl_mean_2, self.incl_sigma_2, self.use_incl_norm_pr_2], [self.Omega_mean_2, self.Omega_sigma_2, self.use_Omega_norm_pr_2], [self.t0_mean_2, self.t0_sigma_2, self.use_t0_norm_pr_2], [self.pl_rad_mean_2, self.pl_rad_sigma_2, self.use_pl_rad_norm_pr_2], [self.a_sol_mean_2, self.a_sol_sigma_2, self.use_a_sol_norm_pr_2], [self.K_mean_3, self.K_sigma_3, self.use_K_norm_pr_3], [self.P_mean_3, self.P_sigma_3, self.use_P_norm_pr_3], [self.e_mean_3, self.e_sigma_3, self.use_e_norm_pr_3], [self.om_mean_3, self.om_sigma_3, self.use_om_norm_pr_3], [self.ma_mean_3, self.ma_sigma_3, self.use_ma_norm_pr_3], [self.incl_mean_3, self.incl_sigma_3, self.use_incl_norm_pr_3], [self.Omega_mean_3, self.Omega_sigma_3, self.use_Omega_norm_pr_3], [self.t0_mean_3, self.t0_sigma_3, self.use_t0_norm_pr_3], [self.pl_rad_mean_3, self.pl_rad_sigma_3, self.use_pl_rad_norm_pr_3], [self.a_sol_mean_3, self.a_sol_sigma_3, self.use_a_sol_norm_pr_3], [self.K_mean_4, self.K_sigma_4, self.use_K_norm_pr_4], [self.P_mean_4, self.P_sigma_4, self.use_P_norm_pr_4], [self.e_mean_4, self.e_sigma_4, self.use_e_norm_pr_4], [self.om_mean_4, self.om_sigma_4, self.use_om_norm_pr_4], [self.ma_mean_4, self.ma_sigma_4, self.use_ma_norm_pr_4], [self.incl_mean_4, self.incl_sigma_4, self.use_incl_norm_pr_4], [self.Omega_mean_4, self.Omega_sigma_4, self.use_Omega_norm_pr_4], [self.t0_mean_4, self.t0_sigma_4, self.use_t0_norm_pr_4], [self.pl_rad_mean_4, self.pl_rad_sigma_4, self.use_pl_rad_norm_pr_4], [self.a_sol_mean_4, self.a_sol_sigma_4, self.use_a_sol_norm_pr_4], [self.K_mean_5, self.K_sigma_5, self.use_K_norm_pr_5], [self.P_mean_5, self.P_sigma_5, self.use_P_norm_pr_5], [self.e_mean_5, self.e_sigma_5, self.use_e_norm_pr_5], [self.om_mean_5, self.om_sigma_5, self.use_om_norm_pr_5], [self.ma_mean_5, self.ma_sigma_5, self.use_ma_norm_pr_5], [self.incl_mean_5, self.incl_sigma_5, self.use_incl_norm_pr_5], [self.Omega_mean_5, self.Omega_sigma_5, self.use_Omega_norm_pr_5], [self.t0_mean_5, self.t0_sigma_5, self.use_t0_norm_pr_5], [self.pl_rad_mean_5, self.pl_rad_sigma_5, self.use_pl_rad_norm_pr_5], [self.a_sol_mean_5, self.a_sol_sigma_5, self.use_a_sol_norm_pr_5], [self.K_mean_6, self.K_sigma_6, self.use_K_norm_pr_6], [self.P_mean_6, self.P_sigma_6, self.use_P_norm_pr_6], [self.e_mean_6, self.e_sigma_6, self.use_e_norm_pr_6], [self.om_mean_6, self.om_sigma_6, self.use_om_norm_pr_6], [self.ma_mean_6, self.ma_sigma_6, self.use_ma_norm_pr_6], [self.incl_mean_6, self.incl_sigma_6, self.use_incl_norm_pr_6], [self.Omega_mean_6, self.Omega_sigma_6, self.use_Omega_norm_pr_6], [self.t0_mean_6, self.t0_sigma_6, self.use_t0_norm_pr_6], [self.pl_rad_mean_6, self.pl_rad_sigma_6, self.use_pl_rad_norm_pr_6], [self.a_sol_mean_6, self.a_sol_sigma_6, self.use_a_sol_norm_pr_6], [self.K_mean_7, self.K_sigma_7, self.use_K_norm_pr_7], [self.P_mean_7, self.P_sigma_7, self.use_P_norm_pr_7], [self.e_mean_7, self.e_sigma_7, self.use_e_norm_pr_7], [self.om_mean_7, self.om_sigma_7, self.use_om_norm_pr_7], [self.ma_mean_7, self.ma_sigma_7, self.use_ma_norm_pr_7], [self.incl_mean_7, self.incl_sigma_7, self.use_incl_norm_pr_7], [self.Omega_mean_7, self.Omega_sigma_7, self.use_Omega_norm_pr_7], [self.t0_mean_7, self.t0_sigma_7, self.use_t0_norm_pr_7], [self.pl_rad_mean_7, self.pl_rad_sigma_7, self.use_pl_rad_norm_pr_7], [self.a_sol_mean_7, self.a_sol_sigma_7, self.use_a_sol_norm_pr_7], [self.K_mean_8, self.K_sigma_8, self.use_K_norm_pr_8], [self.P_mean_8, self.P_sigma_8, self.use_P_norm_pr_8], [self.e_mean_8, self.e_sigma_8, self.use_e_norm_pr_8], [self.om_mean_8, self.om_sigma_8, self.use_om_norm_pr_8], [self.ma_mean_8, self.ma_sigma_8, self.use_ma_norm_pr_8], [self.incl_mean_8, self.incl_sigma_8, self.use_incl_norm_pr_8], [self.Omega_mean_8, self.Omega_sigma_8, self.use_Omega_norm_pr_8], [self.t0_mean_8, self.t0_sigma_8, self.use_t0_norm_pr_8], [self.pl_rad_mean_8, self.pl_rad_sigma_8, self.use_pl_rad_norm_pr_8], [self.a_sol_mean_8, self.a_sol_sigma_8, self.use_a_sol_norm_pr_8], [self.K_mean_9, self.K_sigma_9, self.use_K_norm_pr_9], [self.P_mean_9, self.P_sigma_9, self.use_P_norm_pr_9], [self.e_mean_9, self.e_sigma_9, self.use_e_norm_pr_9], [self.om_mean_9, self.om_sigma_9, self.use_om_norm_pr_9], [self.ma_mean_9, self.ma_sigma_9, self.use_ma_norm_pr_9], [self.incl_mean_9, self.incl_sigma_9, self.use_incl_norm_pr_9], [self.Omega_mean_9, self.Omega_sigma_9, self.use_Omega_norm_pr_9], [self.t0_mean_9, self.t0_sigma_9, self.use_t0_norm_pr_9], [self.pl_rad_mean_9, self.pl_rad_sigma_9, self.use_pl_rad_norm_pr_9], [self.a_sol_mean_9, self.a_sol_sigma_9, self.use_a_sol_norm_pr_9]] return param_nr_priors_gui def param_jeff_priors_gui(self): param_jeff_priors_gui = [[self.K_jeff_alpha_1, self.K_jeff_beta_1, self.use_K_jeff_pr_1], [self.P_jeff_alpha_1, self.P_jeff_beta_1, self.use_P_jeff_pr_1], [self.e_jeff_alpha_1, self.e_jeff_beta_1, self.use_e_jeff_pr_1], [self.om_jeff_alpha_1, self.om_jeff_beta_1, self.use_om_jeff_pr_1], [self.ma_jeff_alpha_1, self.ma_jeff_beta_1, self.use_ma_jeff_pr_1], [self.incl_jeff_alpha_1, self.incl_jeff_beta_1, self.use_incl_jeff_pr_1], [self.Omega_jeff_alpha_1, self.Omega_jeff_beta_1, self.use_Omega_jeff_pr_1], [self.t0_jeff_alpha_1, self.t0_jeff_beta_1, self.use_t0_jeff_pr_1], [self.pl_rad_jeff_alpha_1, self.pl_rad_jeff_beta_1, self.use_pl_rad_jeff_pr_1], [self.a_sol_jeff_alpha_1, self.a_sol_jeff_beta_1, self.use_a_sol_jeff_pr_1], [self.K_jeff_alpha_2, self.K_jeff_beta_2, self.use_K_jeff_pr_2], [self.P_jeff_alpha_2, self.P_jeff_beta_2, self.use_P_jeff_pr_2], [self.e_jeff_alpha_2, self.e_jeff_beta_2, self.use_e_jeff_pr_2], [self.om_jeff_alpha_2, self.om_jeff_beta_2, self.use_om_jeff_pr_2], [self.ma_jeff_alpha_2, self.ma_jeff_beta_2, self.use_ma_jeff_pr_2], [self.incl_jeff_alpha_2, self.incl_jeff_beta_2, self.use_incl_jeff_pr_2], [self.Omega_jeff_alpha_2, self.Omega_jeff_beta_2, self.use_Omega_jeff_pr_2], [self.t0_jeff_alpha_2, self.t0_jeff_beta_2, self.use_t0_jeff_pr_2], [self.pl_rad_jeff_alpha_2, self.pl_rad_jeff_beta_2, self.use_pl_rad_jeff_pr_2], [self.a_sol_jeff_alpha_2, self.a_sol_jeff_beta_2, self.use_a_sol_jeff_pr_2], [self.K_jeff_alpha_3, self.K_jeff_beta_3, self.use_K_jeff_pr_3], [self.P_jeff_alpha_3, self.P_jeff_beta_3, self.use_P_jeff_pr_3], [self.e_jeff_alpha_3, self.e_jeff_beta_3, self.use_e_jeff_pr_3], [self.om_jeff_alpha_3, self.om_jeff_beta_3, self.use_om_jeff_pr_3], [self.ma_jeff_alpha_3, self.ma_jeff_beta_3, self.use_ma_jeff_pr_3], [self.incl_jeff_alpha_3, self.incl_jeff_beta_3, self.use_incl_jeff_pr_3], [self.Omega_jeff_alpha_3, self.Omega_jeff_beta_3, self.use_Omega_jeff_pr_3], [self.t0_jeff_alpha_3, self.t0_jeff_beta_3, self.use_t0_jeff_pr_3], [self.pl_rad_jeff_alpha_3, self.pl_rad_jeff_beta_3, self.use_pl_rad_jeff_pr_3], [self.a_sol_jeff_alpha_3, self.a_sol_jeff_beta_3, self.use_a_sol_jeff_pr_3], [self.K_jeff_alpha_4, self.K_jeff_beta_4, self.use_K_jeff_pr_4], [self.P_jeff_alpha_4, self.P_jeff_beta_4, self.use_P_jeff_pr_4], [self.e_jeff_alpha_4, self.e_jeff_beta_4, self.use_e_jeff_pr_4], [self.om_jeff_alpha_4, self.om_jeff_beta_4, self.use_om_jeff_pr_4], [self.ma_jeff_alpha_4, self.ma_jeff_beta_4, self.use_ma_jeff_pr_4], [self.incl_jeff_alpha_4, self.incl_jeff_beta_4, self.use_incl_jeff_pr_4], [self.Omega_jeff_alpha_4, self.Omega_jeff_beta_4, self.use_Omega_jeff_pr_4], [self.t0_jeff_alpha_4, self.t0_jeff_beta_4, self.use_t0_jeff_pr_4], [self.pl_rad_jeff_alpha_4, self.pl_rad_jeff_beta_4, self.use_pl_rad_jeff_pr_4], [self.a_sol_jeff_alpha_4, self.a_sol_jeff_beta_4, self.use_a_sol_jeff_pr_4], [self.K_jeff_alpha_5, self.K_jeff_beta_5, self.use_K_jeff_pr_5], [self.P_jeff_alpha_5, self.P_jeff_beta_5, self.use_P_jeff_pr_5], [self.e_jeff_alpha_5, self.e_jeff_beta_5, self.use_e_jeff_pr_5], [self.om_jeff_alpha_5, self.om_jeff_beta_5, self.use_om_jeff_pr_5], [self.ma_jeff_alpha_5, self.ma_jeff_beta_5, self.use_ma_jeff_pr_5], [self.incl_jeff_alpha_5, self.incl_jeff_beta_5, self.use_incl_jeff_pr_5], [self.Omega_jeff_alpha_5, self.Omega_jeff_beta_5, self.use_Omega_jeff_pr_5], [self.t0_jeff_alpha_5, self.t0_jeff_beta_5, self.use_t0_jeff_pr_5], [self.pl_rad_jeff_alpha_5, self.pl_rad_jeff_beta_5, self.use_pl_rad_jeff_pr_5], [self.a_sol_jeff_alpha_5, self.a_sol_jeff_beta_5, self.use_a_sol_jeff_pr_5], [self.K_jeff_alpha_6, self.K_jeff_beta_6, self.use_K_jeff_pr_6], [self.P_jeff_alpha_6, self.P_jeff_beta_6, self.use_P_jeff_pr_6], [self.e_jeff_alpha_6, self.e_jeff_beta_6, self.use_e_jeff_pr_6], [self.om_jeff_alpha_6, self.om_jeff_beta_6, self.use_om_jeff_pr_6], [self.ma_jeff_alpha_6, self.ma_jeff_beta_6, self.use_ma_jeff_pr_6], [self.incl_jeff_alpha_6, self.incl_jeff_beta_6, self.use_incl_jeff_pr_6], [self.Omega_jeff_alpha_6, self.Omega_jeff_beta_6, self.use_Omega_jeff_pr_6], [self.t0_jeff_alpha_6, self.t0_jeff_beta_6, self.use_t0_jeff_pr_6], [self.pl_rad_jeff_alpha_6, self.pl_rad_jeff_beta_6, self.use_pl_rad_jeff_pr_6], [self.a_sol_jeff_alpha_6, self.a_sol_jeff_beta_6, self.use_a_sol_jeff_pr_6], [self.K_jeff_alpha_7, self.K_jeff_beta_7, self.use_K_jeff_pr_7], [self.P_jeff_alpha_7, self.P_jeff_beta_7, self.use_P_jeff_pr_7], [self.e_jeff_alpha_7, self.e_jeff_beta_7, self.use_e_jeff_pr_7], [self.om_jeff_alpha_7, self.om_jeff_beta_7, self.use_om_jeff_pr_7], [self.ma_jeff_alpha_7, self.ma_jeff_beta_7, self.use_ma_jeff_pr_7], [self.incl_jeff_alpha_7, self.incl_jeff_beta_7, self.use_incl_jeff_pr_7], [self.Omega_jeff_alpha_7, self.Omega_jeff_beta_7, self.use_Omega_jeff_pr_7], [self.t0_jeff_alpha_7, self.t0_jeff_beta_7, self.use_t0_jeff_pr_7], [self.pl_rad_jeff_alpha_7, self.pl_rad_jeff_beta_7, self.use_pl_rad_jeff_pr_7], [self.a_sol_jeff_alpha_7, self.a_sol_jeff_beta_7, self.use_a_sol_jeff_pr_7], [self.K_jeff_alpha_8, self.K_jeff_beta_8, self.use_K_jeff_pr_8], [self.P_jeff_alpha_8, self.P_jeff_beta_8, self.use_P_jeff_pr_8], [self.e_jeff_alpha_8, self.e_jeff_beta_8, self.use_e_jeff_pr_8], [self.om_jeff_alpha_8, self.om_jeff_beta_8, self.use_om_jeff_pr_8], [self.ma_jeff_alpha_8, self.ma_jeff_beta_8, self.use_ma_jeff_pr_8], [self.incl_jeff_alpha_8, self.incl_jeff_beta_8, self.use_incl_jeff_pr_8], [self.Omega_jeff_alpha_8, self.Omega_jeff_beta_8, self.use_Omega_jeff_pr_8], [self.t0_jeff_alpha_8, self.t0_jeff_beta_8, self.use_t0_jeff_pr_8], [self.pl_rad_jeff_alpha_8, self.pl_rad_jeff_beta_8, self.use_pl_rad_jeff_pr_8], [self.a_sol_jeff_alpha_8, self.a_sol_jeff_beta_8, self.use_a_sol_jeff_pr_8], [self.K_jeff_alpha_9, self.K_jeff_beta_9, self.use_K_jeff_pr_9], [self.P_jeff_alpha_9, self.P_jeff_beta_9, self.use_P_jeff_pr_9], [self.e_jeff_alpha_9, self.e_jeff_beta_9, self.use_e_jeff_pr_9], [self.om_jeff_alpha_9, self.om_jeff_beta_9, self.use_om_jeff_pr_9], [self.ma_jeff_alpha_9, self.ma_jeff_beta_9, self.use_ma_jeff_pr_9], [self.incl_jeff_alpha_9, self.incl_jeff_beta_9, self.use_incl_jeff_pr_9], [self.Omega_jeff_alpha_9, self.Omega_jeff_beta_9, self.use_Omega_jeff_pr_9], [self.t0_jeff_alpha_9, self.t0_jeff_beta_9, self.use_t0_jeff_pr_9], [self.pl_rad_jeff_alpha_9, self.pl_rad_jeff_beta_9, self.use_pl_rad_jeff_pr_9], [self.a_sol_jeff_alpha_9, self.a_sol_jeff_beta_9, self.use_a_sol_jeff_pr_9]] return param_jeff_priors_gui def gp_rot_params(self): gp_rot_params = [self.GP_rot_kernel_Amp, self.GP_rot_kernel_time_sc, self.GP_rot_kernel_Per, self.GP_rot_kernel_fact] return gp_rot_params def gp_rot_errors_gui(self): gp_rot_errors_gui = [self.err_rot_kernel_Amp, self.err_rot_kernel_time_sc, self.err_rot_kernel_Per, self.err_rot_kernel_fact] return gp_rot_errors_gui def use_gp_rot_params(self): use_gp_rot_params = [self.use_GP_rot_kernel_Amp, self.use_GP_rot_kernel_time_sc, self.use_GP_rot_kernel_Per, self.use_GP_rot_kernel_fact] return use_gp_rot_params def gp_sho_params(self): gp_sho_params = [self.GP_sho_kernel_S, self.GP_sho_kernel_Q, self.GP_sho_kernel_omega] return gp_sho_params def use_gp_sho_params(self): use_gp_sho_params = [self.use_GP_sho_kernel_S, self.use_GP_sho_kernel_Q, self.use_GP_sho_kernel_omega] return use_gp_sho_params def gp_sho_errors_gui(self): gp_sho_errors_gui = [self.err_sho_kernel_S, self.err_sho_kernel_Q, self.err_sho_kernel_omega] return gp_sho_errors_gui def tra_gp_rot_params(self): tra_gp_rot_params = [self.tra_GP_rot_kernel_Amp, self.tra_GP_rot_kernel_time_sc, self.tra_GP_rot_kernel_Per, self.tra_GP_rot_kernel_fact] return tra_gp_rot_params def use_tra_gp_rot_params(self): use_tra_gp_rot_params = [self.use_tra_GP_rot_kernel_Amp, self.use_tra_GP_rot_kernel_time_sc, self.use_tra_GP_rot_kernel_Per, self.use_tra_GP_rot_kernel_fact] return use_tra_gp_rot_params def tra_gp_sho_params(self): tra_gp_sho_params = [self.tra_GP_sho_kernel_S, self.tra_GP_sho_kernel_Q, self.tra_GP_sho_kernel_omega] return tra_gp_sho_params def use_tra_gp_sho_params(self): use_tra_gp_sho_params = [self.use_tra_GP_sho_kernel_S, self.use_tra_GP_sho_kernel_Q, self.use_tra_GP_sho_kernel_omega] return use_tra_gp_sho_params def param_a_gui(self): param_a_gui = [self.label_a1, self.label_a2, self.label_a3, self.label_a4, self.label_a5, self.label_a6, self.label_a7, self.label_a8, self.label_a9] return param_a_gui def param_mass_gui(self): param_mass_gui = [self.label_mass1, self.label_mass2, self.label_mass3, self.label_mass4, self.label_mass5, self.label_mass6, self.label_mass7, self.label_mass8, self.label_mass9] return param_mass_gui def param_t_peri_gui(self): param_t_peri_gui = [self.label_t_peri1, self.label_t_peri2, self.label_t_peri3, self.label_t_peri4, self.label_t_peri5, self.label_t_peri6, self.label_t_peri7, self.label_t_peri8, self.label_t_peri9] return param_t_peri_gui def planet_checked_gui(self): planet_checked_gui = [self.use_Planet1, self.use_Planet2, self.use_Planet3, self.use_Planet4, self.use_Planet5, self.use_Planet6, self.use_Planet7, self.use_Planet8, self.use_Planet9] return planet_checked_gui def bin_rv_data(self): bin_rv_data = [[self.RV_bin_data_1, self.use_RV_bin_data_1], [self.RV_bin_data_2, self.use_RV_bin_data_2], [self.RV_bin_data_3, self.use_RV_bin_data_3], [self.RV_bin_data_4, self.use_RV_bin_data_4], [self.RV_bin_data_5, self.use_RV_bin_data_5], [self.RV_bin_data_6, self.use_RV_bin_data_6], [self.RV_bin_data_7, self.use_RV_bin_data_7], [self.RV_bin_data_8, self.use_RV_bin_data_8], [self.RV_bin_data_9, self.use_RV_bin_data_9], [self.RV_bin_data_10, self.use_RV_bin_data_10]] return bin_rv_data def add_rv_error(self): add_rv_error = [[self.inflate_RV_sigma_1, self.use_inflate_RV_sigma_1], [self.inflate_RV_sigma_2, self.use_inflate_RV_sigma_2], [self.inflate_RV_sigma_3, self.use_inflate_RV_sigma_3], [self.inflate_RV_sigma_4, self.use_inflate_RV_sigma_4], [self.inflate_RV_sigma_5, self.use_inflate_RV_sigma_5], [self.inflate_RV_sigma_6, self.use_inflate_RV_sigma_6], [self.inflate_RV_sigma_7, self.use_inflate_RV_sigma_7], [self.inflate_RV_sigma_8, self.use_inflate_RV_sigma_8], [self.inflate_RV_sigma_9, self.use_inflate_RV_sigma_9], [self.inflate_RV_sigma_10, self.use_inflate_RV_sigma_10]] return add_rv_error def rv_sigma_clip(self): rv_sigma_clip = [[self.RV_sigma_clip_1, self.use_RV_sigma_clip_1], [self.RV_sigma_clip_2, self.use_RV_sigma_clip_2], [self.RV_sigma_clip_3, self.use_RV_sigma_clip_3], [self.RV_sigma_clip_4, self.use_RV_sigma_clip_4], [self.RV_sigma_clip_5, self.use_RV_sigma_clip_5], [self.RV_sigma_clip_6, self.use_RV_sigma_clip_6], [self.RV_sigma_clip_7, self.use_RV_sigma_clip_7], [self.RV_sigma_clip_8, self.use_RV_sigma_clip_8], [self.RV_sigma_clip_9, self.use_RV_sigma_clip_9], [self.RV_sigma_clip_10, self.use_RV_sigma_clip_10]] return rv_sigma_clip def act_sigma_clip(self): act_sigma_clip = [[self.act_sigma_clip_1, self.use_act_sigma_clip_1], [self.act_sigma_clip_2, self.use_act_sigma_clip_2], [self.act_sigma_clip_3, self.use_act_sigma_clip_3], [self.act_sigma_clip_4, self.use_act_sigma_clip_4], [self.act_sigma_clip_5, self.use_act_sigma_clip_5], [self.act_sigma_clip_6, self.use_act_sigma_clip_6], [self.act_sigma_clip_7, self.use_act_sigma_clip_7], [self.act_sigma_clip_8, self.use_act_sigma_clip_8], [self.act_sigma_clip_9, self.use_act_sigma_clip_9], [self.act_sigma_clip_10, self.use_act_sigma_clip_10]] return act_sigma_clip def act_remove_mean(self): act_remove_mean = [self.act_remove_mean_1, self.act_remove_mean_2, self.act_remove_mean_3, self.act_remove_mean_4, self.act_remove_mean_5, self.act_remove_mean_6, self.act_remove_mean_7, self.act_remove_mean_8, self.act_remove_mean_9, self.act_remove_mean_10] return act_remove_mean def tra_norm(self): tra_norm = [self.tra_norm_1, self.tra_norm_2, self.tra_norm_3, self.tra_norm_4, self.tra_norm_5, self.tra_norm_6, self.tra_norm_7, self.tra_norm_8, self.tra_norm_9, self.tra_norm_10] return tra_norm def tra_dilution(self): tra_dilution = [[self.tra_dilution_1, self.use_tra_dilution_1], [self.tra_dilution_2, self.use_tra_dilution_2], [self.tra_dilution_3, self.use_tra_dilution_3], [self.tra_dilution_4, self.use_tra_dilution_4], [self.tra_dilution_5, self.use_tra_dilution_5], [self.tra_dilution_6, self.use_tra_dilution_6], [self.tra_dilution_7, self.use_tra_dilution_7], [self.tra_dilution_8, self.use_tra_dilution_8], [self.tra_dilution_9, self.use_tra_dilution_9], [self.tra_dilution_10, self.use_tra_dilution_10]] return tra_dilution def arb_param_gui(self): arb_param_gui = [self.arb_K_1, self.arb_P_1, self.arb_e_1, self.arb_om_1, self.arb_ma_1, self.arb_incl_1, self.arb_Om_1, self.arb_K_2, self.arb_P_2, self.arb_e_2, self.arb_om_2, self.arb_ma_2, self.arb_incl_2, self.arb_Om_2, self.arb_K_3, self.arb_P_3, self.arb_e_3, self.arb_om_3, self.arb_ma_3, self.arb_incl_3, self.arb_Om_3, self.arb_K_4, self.arb_P_4, self.arb_e_4, self.arb_om_4, self.arb_ma_4, self.arb_incl_4, self.arb_Om_4, self.arb_K_5, self.arb_P_5, self.arb_e_5, self.arb_om_5, self.arb_ma_5, self.arb_incl_5, self.arb_Om_5, self.arb_K_6, self.arb_P_6, self.arb_e_6, self.arb_om_6, self.arb_ma_6, self.arb_incl_6, self.arb_Om_6, self.arb_K_7, self.arb_P_7, self.arb_e_7, self.arb_om_7, self.arb_ma_7, self.arb_incl_7, self.arb_Om_7, self.arb_K_8, self.arb_P_8, self.arb_e_8, self.arb_om_8, self.arb_ma_8, self.arb_incl_8, self.arb_Om_8, self.arb_K_9, self.arb_P_9, self.arb_e_9, self.arb_om_9, self.arb_ma_9, self.arb_incl_9, self.arb_Om_9] return arb_param_gui def arb_param_gui_use(self): arb_param_gui_use = [self.use_arb_Planet_1, self.use_arb_Planet_2, self.use_arb_Planet_3, self.use_arb_Planet_4, self.use_arb_Planet_5, self.use_arb_Planet_6, self.use_arb_Planet_7, self.use_arb_Planet_8, self.use_arb_Planet_9] return arb_param_gui_use def ttv_data_to_planet(self): ttv_data_to_planet = [self.ttv_data_planet_1, self.ttv_data_planet_2, self.ttv_data_planet_3, self.ttv_data_planet_4, self.ttv_data_planet_5, self.ttv_data_planet_6, self.ttv_data_planet_7, self.ttv_data_planet_8, self.ttv_data_planet_9, self.ttv_data_planet_10] return ttv_data_to_planet def use_ttv_data_to_planet(self): use_ttv_data_to_planet = [self.use_ttv_data_1, self.use_ttv_data_2, self.use_ttv_data_3, self.use_ttv_data_4, self.use_ttv_data_5, self.use_ttv_data_6, self.use_ttv_data_7, self.use_ttv_data_8, self.use_ttv_data_9, self.use_ttv_data_10] return use_ttv_data_to_planet
class HaltListener: def stream_read_halted(self, chunk: int, _time: int) -> None: pass def stream_read_resumed(self, chunk: int, _time: int): pass
class Haltlistener: def stream_read_halted(self, chunk: int, _time: int) -> None: pass def stream_read_resumed(self, chunk: int, _time: int): pass
class Solution: def solve(self, words): bitmasks = [] for j,word in enumerate(words): bitmask = [0]*26 distincts = 0 for char in word: i = ord(char) - ord('a') if bitmask[i] == 0: distincts += 1 bitmask[i] = 1 if distincts == 26: break bitmasks.append(bitmask) ans = 0 for i in range(len(words)): js = set(range(i+1,len(words))) for letter_i in range(26): if bitmasks[i][letter_i] == 0: continue for j in list(js): if bitmasks[j][letter_i] == 1: js.remove(j) for j in js: ans = max(ans, len(words[i]) + len(words[j])) return ans
class Solution: def solve(self, words): bitmasks = [] for (j, word) in enumerate(words): bitmask = [0] * 26 distincts = 0 for char in word: i = ord(char) - ord('a') if bitmask[i] == 0: distincts += 1 bitmask[i] = 1 if distincts == 26: break bitmasks.append(bitmask) ans = 0 for i in range(len(words)): js = set(range(i + 1, len(words))) for letter_i in range(26): if bitmasks[i][letter_i] == 0: continue for j in list(js): if bitmasks[j][letter_i] == 1: js.remove(j) for j in js: ans = max(ans, len(words[i]) + len(words[j])) return ans
# print(range(5)) # a = range(1,10,5) # for x in a: # print(x) # num =1 # rem = num%2 # if rem==0: # print('The number is even') # else: # print('The number is odd') # print("I am not inside if statement") # num = -2 # if num>0: # print("Number is positive") # if (num % 2) == 0: # print('Number is even') # else: # print('Number is odd') # elif num<0: # print("Number is negative") # else: # print("Number is zero") # var = False # if var: # print('Hello') # amount = int(input("Enter amount: ")) # if amount >= 1000: # discount = amount*0.10 # print ("Discount",discount) # else: # discount = amount*0.05 # print ("Discount",discount) # print ("Net payable:",amount-discount) var = 100 if(var == 100): print ("This is 100")
var = 100 if var == 100: print('This is 100')
def entrada_notas(): notas = input().split(' ') nota1 = float(notas[0]) nota2 = float(notas[1]) nota3 = float(notas[2]) nota4 = float(notas[3]) return nota1, nota2, nota3, nota4 def media(n1, n2, n3, n4): med = (2 * n1 + 3 * n2 + 4 * n3 + n4)/10 print(f'Media: {med:.1f}') if med >= 7.0: print('Aluno aprovado.') elif med < 5.0: print('Aluno reprovado.') elif 5.0 <= med <= 6.9: print('Aluno em exame.') exame_final = float(input()) print(f'Nota do exame: {exame_final:.1f}') nota_final = (exame_final + med)/2 if nota_final >= 5.0: print('Aluno aprovado.') else: print('Aluno reprovado') print(f'Media final: {nota_final}') exame1, exame2, exame3, exame4 = entrada_notas() media(exame1, exame2, exame3, exame4)
def entrada_notas(): notas = input().split(' ') nota1 = float(notas[0]) nota2 = float(notas[1]) nota3 = float(notas[2]) nota4 = float(notas[3]) return (nota1, nota2, nota3, nota4) def media(n1, n2, n3, n4): med = (2 * n1 + 3 * n2 + 4 * n3 + n4) / 10 print(f'Media: {med:.1f}') if med >= 7.0: print('Aluno aprovado.') elif med < 5.0: print('Aluno reprovado.') elif 5.0 <= med <= 6.9: print('Aluno em exame.') exame_final = float(input()) print(f'Nota do exame: {exame_final:.1f}') nota_final = (exame_final + med) / 2 if nota_final >= 5.0: print('Aluno aprovado.') else: print('Aluno reprovado') print(f'Media final: {nota_final}') (exame1, exame2, exame3, exame4) = entrada_notas() media(exame1, exame2, exame3, exame4)
#! /usr/bin/env python ''' (This question is super complicated and artificial.) (Refer Sumita Arora: Strings Q5) ''' A = int(input("Enter the integer: ")) S = input("Enter the string: ") # extract digits D = int(''.join( e for e in S if e.isdigit() )) R = A + D print("{} + {} = {}".format(A, D, R))
""" (This question is super complicated and artificial.) (Refer Sumita Arora: Strings Q5) """ a = int(input('Enter the integer: ')) s = input('Enter the string: ') d = int(''.join((e for e in S if e.isdigit()))) r = A + D print('{} + {} = {}'.format(A, D, R))
#!/usr/bin/env python population = input("Please enter population value: ") print("You have entered: ", population)
population = input('Please enter population value: ') print('You have entered: ', population)
op_str = 'acc +7' def parse_operation(operation_str): op_list = operation_str.strip().split() operation = op_list[0] op_sign = op_list[1][0] steps = op_list[1][1:] return {'operation': operation, 'sign': op_sign, 'steps': int(steps), 'visited': False} #print(parse_operation(op_str)) #operations_file = open('data/test_operations.txt') operations_file = open('data/operations.txt') operations_dicts = [parse_operation(item) for item in operations_file.readlines()] operations_file.close() #print(operations_dicts[0]) accumulator = 0 location = 0 cycle = False while 1 == 1: if operations_dicts[location]['visited']: break operations_dicts[location]['visited'] = True if operations_dicts[location]['operation'] == 'acc': if operations_dicts[location]['sign'] == '+': accumulator += operations_dicts[location]['steps'] elif operations_dicts[location]['sign'] == '-': accumulator -= operations_dicts[location]['steps'] location += 1 elif operations_dicts[location]['operation'] == 'nop': location += 1 elif operations_dicts[location]['operation'] == 'jmp': if operations_dicts[location]['sign'] == '+': location += operations_dicts[location]['steps'] elif operations_dicts[location]['sign'] == '-': location -= operations_dicts[location]['steps'] print(accumulator)
op_str = 'acc +7' def parse_operation(operation_str): op_list = operation_str.strip().split() operation = op_list[0] op_sign = op_list[1][0] steps = op_list[1][1:] return {'operation': operation, 'sign': op_sign, 'steps': int(steps), 'visited': False} operations_file = open('data/operations.txt') operations_dicts = [parse_operation(item) for item in operations_file.readlines()] operations_file.close() accumulator = 0 location = 0 cycle = False while 1 == 1: if operations_dicts[location]['visited']: break operations_dicts[location]['visited'] = True if operations_dicts[location]['operation'] == 'acc': if operations_dicts[location]['sign'] == '+': accumulator += operations_dicts[location]['steps'] elif operations_dicts[location]['sign'] == '-': accumulator -= operations_dicts[location]['steps'] location += 1 elif operations_dicts[location]['operation'] == 'nop': location += 1 elif operations_dicts[location]['operation'] == 'jmp': if operations_dicts[location]['sign'] == '+': location += operations_dicts[location]['steps'] elif operations_dicts[location]['sign'] == '-': location -= operations_dicts[location]['steps'] print(accumulator)
SOC_IRAM_LOW = 0x40020000 SOC_IRAM_HIGH = 0x40070000 SOC_DRAM_LOW = 0x3ffb0000 SOC_DRAM_HIGH = 0x40000000 SOC_RTC_DRAM_LOW = 0x3ff9e000 SOC_RTC_DRAM_HIGH = 0x3ffa0000 SOC_RTC_DATA_LOW = 0x50000000 SOC_RTC_DATA_HIGH = 0x50002000
soc_iram_low = 1073872896 soc_iram_high = 1074200576 soc_dram_low = 1073414144 soc_dram_high = 1073741824 soc_rtc_dram_low = 1073340416 soc_rtc_dram_high = 1073348608 soc_rtc_data_low = 1342177280 soc_rtc_data_high = 1342185472
ies = [] ies.append({ "ie_type" : "Node ID", "ie_value" : "Node ID", "presence" : "M", "instance" : "0", "comment" : "This IE shall contain the unique identifier of the sending Node."}) ies.append({ "ie_type" : "Cause", "ie_value" : "Cause", "presence" : "M", "instance" : "0", "comment" : "This IE shall indicate the acceptance or the rejection of the corresponding request message."}) ies.append({ "ie_type" : "UP Function Features", "ie_value" : "UP Function Features", "presence" : "O", "instance" : "0", "comment" : "If present, this IE shall indicate the supported Features when the sending node is the UP function."}) ies.append({ "ie_type" : "CP Function Features", "ie_value" : "CP Function Features", "presence" : "O", "instance" : "0", "comment" : "If present, this IE shall indicate the supported Features when the sending node is the CP function."}) msg_list[key]["ies"] = ies
ies = [] ies.append({'ie_type': 'Node ID', 'ie_value': 'Node ID', 'presence': 'M', 'instance': '0', 'comment': 'This IE shall contain the unique identifier of the sending Node.'}) ies.append({'ie_type': 'Cause', 'ie_value': 'Cause', 'presence': 'M', 'instance': '0', 'comment': 'This IE shall indicate the acceptance or the rejection of the corresponding request message.'}) ies.append({'ie_type': 'UP Function Features', 'ie_value': 'UP Function Features', 'presence': 'O', 'instance': '0', 'comment': 'If present, this IE shall indicate the supported Features when the sending node is the UP function.'}) ies.append({'ie_type': 'CP Function Features', 'ie_value': 'CP Function Features', 'presence': 'O', 'instance': '0', 'comment': 'If present, this IE shall indicate the supported Features when the sending node is the CP function.'}) msg_list[key]['ies'] = ies
''' This is a sample input, you can change it of course but you have to follow rules of the questions ''' compressed_string = "2[1[b]10[c]]a" def decompress(str=compressed_string): string = "" number_stack = [] replace_index_stack = [] bracket_index_stack = [] i = 0 while i < len(str): if str[i] == "[": # storing indexes in coressponding stacks replace_index_stack.insert(0, i - len(string)) number_stack.insert(0, int(string)) bracket_index_stack.insert(0, i+1) string = "" elif str[i] == "]": # updating base string with uncompressed part temp = str[bracket_index_stack[0]:i] * number_stack[0] str = str.replace(str[replace_index_stack[0]:i+1], temp) # updating index to next position from decompressed part i = replace_index_stack[0]+len(temp) # poping the top item from stacks which is used already number_stack.pop(0) replace_index_stack.pop(0) bracket_index_stack.pop(0) string = "" continue else: string += str[i] i += 1 return str print(decompress())
""" This is a sample input, you can change it of course but you have to follow rules of the questions """ compressed_string = '2[1[b]10[c]]a' def decompress(str=compressed_string): string = '' number_stack = [] replace_index_stack = [] bracket_index_stack = [] i = 0 while i < len(str): if str[i] == '[': replace_index_stack.insert(0, i - len(string)) number_stack.insert(0, int(string)) bracket_index_stack.insert(0, i + 1) string = '' elif str[i] == ']': temp = str[bracket_index_stack[0]:i] * number_stack[0] str = str.replace(str[replace_index_stack[0]:i + 1], temp) i = replace_index_stack[0] + len(temp) number_stack.pop(0) replace_index_stack.pop(0) bracket_index_stack.pop(0) string = '' continue else: string += str[i] i += 1 return str print(decompress())
def add(a,b): return a+b def sub(a,b): return a-b def multiply(a,b): return a*b def div(a,b): return a/b
def add(a, b): return a + b def sub(a, b): return a - b def multiply(a, b): return a * b def div(a, b): return a / b
class Node: def __init__(self, data): self.data = data self.next = None class LinkedList: def __init__(self): self.head = None def add(self, data): if self.head is None: self.head = Node(data) else: temp = self.head self.head = Node(data) self.head.next = temp def reverse(self, node): if node.next is None: self.head = node return self.reverse(node.next) temp = node.next temp.next = node node.next = None def printList(self): if self.head is None: print("LinkedList is empty") else: temp = self.head while(temp): print(temp.data) temp = temp.next llist = LinkedList() for i in range(0, 5): llist.add(i) llist.reverse(llist.head) llist.printList()
class Node: def __init__(self, data): self.data = data self.next = None class Linkedlist: def __init__(self): self.head = None def add(self, data): if self.head is None: self.head = node(data) else: temp = self.head self.head = node(data) self.head.next = temp def reverse(self, node): if node.next is None: self.head = node return self.reverse(node.next) temp = node.next temp.next = node node.next = None def print_list(self): if self.head is None: print('LinkedList is empty') else: temp = self.head while temp: print(temp.data) temp = temp.next llist = linked_list() for i in range(0, 5): llist.add(i) llist.reverse(llist.head) llist.printList()
#!/usr/bin/python x = int(raw_input("Ingrese el input1: ")) print(not x)
x = int(raw_input('Ingrese el input1: ')) print(not x)
''' Visit the link : https://reeborg.ca/reeborg.html?lang=en&mode=python&menu=worlds%2Fmenus%2Freeborg_intro_en.json&name=Hurdle%202&url=worlds%2Ftutorial_en%2Fhurdle2.json ''' def turn_right(): turn_left() turn_left() turn_left() def complete(): move() turn_left() move() turn_right() move() turn_right() move() turn_left() while not at_goal(): complete()
""" Visit the link : https://reeborg.ca/reeborg.html?lang=en&mode=python&menu=worlds%2Fmenus%2Freeborg_intro_en.json&name=Hurdle%202&url=worlds%2Ftutorial_en%2Fhurdle2.json """ def turn_right(): turn_left() turn_left() turn_left() def complete(): move() turn_left() move() turn_right() move() turn_right() move() turn_left() while not at_goal(): complete()
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. DEPS = [ 'bisect_tester_staging', 'chromium', 'chromium_tests', 'recipe_engine/path', 'recipe_engine/properties', 'recipe_engine/step', ] def RunSteps(api): api.path.c.dynamic_paths['bisect_results'] = api.path['start_dir'].join( 'bisect_results') api.chromium.set_config('chromium') test = api.chromium_tests.steps.BisectTestStaging() test.pre_run(api, '') try: test.run(api, '') finally: api.step('details', []) api.step.active_result.presentation.logs['details'] = [ 'compile_targets: %r' % test.compile_targets(api), 'uses_local_devices: %r' % test.uses_local_devices, ] def GenTests(api): bisect_config = { 'test_type': 'perf', 'command': './tools/perf/run_benchmark -v ' '--browser=android-chromium --output-format=valueset ' 'page_cycler_v2.intl_ar_fa_he', 'metric': 'warm_times/page_load_time', 'repeat_count': '2', 'max_time_minutes': '5', 'truncate_percent': '25', 'bug_id': '425582', 'gs_bucket': 'chrome-perf', 'builder_host': 'master4.golo.chromium.org', 'builder_port': '8341' } yield ( api.test('basic') + api.properties( bisect_config=bisect_config, buildername='test_buildername', bot_id='test_bot_id') )
deps = ['bisect_tester_staging', 'chromium', 'chromium_tests', 'recipe_engine/path', 'recipe_engine/properties', 'recipe_engine/step'] def run_steps(api): api.path.c.dynamic_paths['bisect_results'] = api.path['start_dir'].join('bisect_results') api.chromium.set_config('chromium') test = api.chromium_tests.steps.BisectTestStaging() test.pre_run(api, '') try: test.run(api, '') finally: api.step('details', []) api.step.active_result.presentation.logs['details'] = ['compile_targets: %r' % test.compile_targets(api), 'uses_local_devices: %r' % test.uses_local_devices] def gen_tests(api): bisect_config = {'test_type': 'perf', 'command': './tools/perf/run_benchmark -v --browser=android-chromium --output-format=valueset page_cycler_v2.intl_ar_fa_he', 'metric': 'warm_times/page_load_time', 'repeat_count': '2', 'max_time_minutes': '5', 'truncate_percent': '25', 'bug_id': '425582', 'gs_bucket': 'chrome-perf', 'builder_host': 'master4.golo.chromium.org', 'builder_port': '8341'} yield (api.test('basic') + api.properties(bisect_config=bisect_config, buildername='test_buildername', bot_id='test_bot_id'))
def longestCommonSubsequence(str1, str2): if not str1 or not str2: return [] dp = [[0 for _ in range(len(str2))] for __ in range(len(str1))] commons = [] inc = 0 for i in range(len(str1)): if str1[i] == str2[0]: inc = 1 dp[i][0] = inc inc = 0 for j in range(len(str2)): if str2[j] == str1[0]: inc = 1 dp[0][j] = inc for i in range(1, len(str1)): for j in range(1, len(str2)): if str1[i] == str2[j]: dp[i][j] = 1 + dp[i - 1][j - 1] else: dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) row = len(str1) - 1 col = len(str2) - 1 while row >= 0 and col >= 0: if col - 1 >= 0 and dp[row][col] == dp[row][col - 1]: col -= 1 elif row - 1 >= 0 and dp[row][col] == dp[row - 1][col]: row -= 1 else: if str1[row] == str2[col]: commons.insert(0, str1[row]) row -= 1 col -= 1 return commons
def longest_common_subsequence(str1, str2): if not str1 or not str2: return [] dp = [[0 for _ in range(len(str2))] for __ in range(len(str1))] commons = [] inc = 0 for i in range(len(str1)): if str1[i] == str2[0]: inc = 1 dp[i][0] = inc inc = 0 for j in range(len(str2)): if str2[j] == str1[0]: inc = 1 dp[0][j] = inc for i in range(1, len(str1)): for j in range(1, len(str2)): if str1[i] == str2[j]: dp[i][j] = 1 + dp[i - 1][j - 1] else: dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) row = len(str1) - 1 col = len(str2) - 1 while row >= 0 and col >= 0: if col - 1 >= 0 and dp[row][col] == dp[row][col - 1]: col -= 1 elif row - 1 >= 0 and dp[row][col] == dp[row - 1][col]: row -= 1 else: if str1[row] == str2[col]: commons.insert(0, str1[row]) row -= 1 col -= 1 return commons
# -*- coding: utf-8 -*- class Node: def __init__(self, node_type): self.type = node_type self.node_problems = [] @property def name(self): return "" @property def problems(self): return self.node_problems class ValueNode(Node): def __init__(self, node_type, value): super().__init__(node_type) self.value = value class ParentNode(Node): def __init__(self, node_type): super().__init__(node_type) self.__children = [] self.__children_map = {} @property def problems(self): pbs = self.node_problems.copy() for chld in self.__children: pbs.extend(chld.problems) return pbs def _get_children(self, name=None): if name is None: return self.__children else: return self.__children_map.get(name, []) def _add_child(self, child): self.__children.append(child) if child.name not in self.__children_map: self.__children_map[child.name] = [child] else: self.__children_map[child.name].append(child)
class Node: def __init__(self, node_type): self.type = node_type self.node_problems = [] @property def name(self): return '' @property def problems(self): return self.node_problems class Valuenode(Node): def __init__(self, node_type, value): super().__init__(node_type) self.value = value class Parentnode(Node): def __init__(self, node_type): super().__init__(node_type) self.__children = [] self.__children_map = {} @property def problems(self): pbs = self.node_problems.copy() for chld in self.__children: pbs.extend(chld.problems) return pbs def _get_children(self, name=None): if name is None: return self.__children else: return self.__children_map.get(name, []) def _add_child(self, child): self.__children.append(child) if child.name not in self.__children_map: self.__children_map[child.name] = [child] else: self.__children_map[child.name].append(child)
''' https://leetcode.com/problems/maximum-subarray/ ''' class Solution(object): def maxSubArray(self, nums): if len(nums) == 1: return nums[0] m = nums[0] h = {0:nums[0]} for i in range(1, len(nums)): # we loop through the array and store the longest subarray which ends at element i-1 (inclusive) # adding the element at index i to the maximum sum at index i - 1 would result in a higher sum than simply # starting a new array with length 1 (only including one element, arr[i]), then we update the dictionary # to account for the inclusion of the element at index i. # if the element at index[i] + the value of the max subarray at i-1 is not higher than # the value of arr[i], we simply start a new array at arr[i], becuase that new array would, by definition, # be of a greater value than whatever array ended at index i-1. # example: # arr [1,4,-6,8,1] # h [1,5,-1,8,9] #notice how at index 0,1 and 2, we add element i to the previous sum, # but at index 3, we do not add the element to the previous indexed sum, we # simply set the max array value to the value of the element. becuase max(8, 8 + (-1)) = 8. #and for index 4, we also add the item at i to the previous sum h[i] = max(nums[i], nums[i] + h[i-1]) if h[i] > m: # we see if the max sum at index i is higher than the currently recorded max sum # if True, we update the max sum. m = h[i] # we return the max sum (int) return m
""" https://leetcode.com/problems/maximum-subarray/ """ class Solution(object): def max_sub_array(self, nums): if len(nums) == 1: return nums[0] m = nums[0] h = {0: nums[0]} for i in range(1, len(nums)): h[i] = max(nums[i], nums[i] + h[i - 1]) if h[i] > m: m = h[i] return m
input = open('input.txt', 'r').read().split("\n") # Part 1 x = 0 depth = 0 for line in input: line_elements = line.split(' ') cmd = line_elements[0] distance = int(line_elements[1]) if cmd == 'forward': x += distance elif cmd == 'down': depth += distance else: depth += -distance print('X: ' + str(x)) print('Depth: ' + str(depth)) # Part 2 aim = 0 horizontal = 0 depth = 0 for line in input: line_elements = line.split(' ') cmd = line_elements[0] value = int(line_elements[1]) if cmd == 'forward': horizontal += value depth += aim * value elif cmd == 'down': aim += value else: aim += -value print('Part 2') print('X: ' + str(x)) print('Depth: ' + str(depth)) print('Answer: ' + str(x * depth))
input = open('input.txt', 'r').read().split('\n') x = 0 depth = 0 for line in input: line_elements = line.split(' ') cmd = line_elements[0] distance = int(line_elements[1]) if cmd == 'forward': x += distance elif cmd == 'down': depth += distance else: depth += -distance print('X: ' + str(x)) print('Depth: ' + str(depth)) aim = 0 horizontal = 0 depth = 0 for line in input: line_elements = line.split(' ') cmd = line_elements[0] value = int(line_elements[1]) if cmd == 'forward': horizontal += value depth += aim * value elif cmd == 'down': aim += value else: aim += -value print('Part 2') print('X: ' + str(x)) print('Depth: ' + str(depth)) print('Answer: ' + str(x * depth))
_base_ = [ '../../_base_/models/swav/r50.py', '../../_base_/datasets/imagenet/swav_mcrop-2-6_sz224_96_bs32.py', '../../_base_/default_runtime.py', ] # model settings model = dict( type='SwAV', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(3,), # no conv-1, x-1: stage-x norm_cfg=dict(type='SyncBN'), style='pytorch'), neck=dict( type='SwAVNeck', in_channels=2048, hid_channels=2048, out_channels=128, with_avg_pool=True), head=dict( type='SwAVHead', feat_dim=128, # equal to neck['out_channels'] epsilon=0.05, temperature=0.1, num_crops=[2, 6],) ) # interval for accumulate gradient update_interval = 8 # total: 8 x bs64 x 8 accumulates = bs4096 # additional hooks custom_hooks = [ dict(type='SwAVHook', priority='VERY_HIGH', batch_size=64, epoch_queue_starts=15, crops_for_assign=[0, 1], feat_dim=128, queue_length=3840) ] # optimizer optimizer = dict( type='LARS', lr=0.6 * 16, # lr=0.6 / bs256 momentum=0.9, weight_decay=1e-6, paramwise_options={ '(bn|ln|gn)(\d+)?.(weight|bias)': dict(weight_decay=0., lars_exclude=True), 'bias': dict(weight_decay=0., lars_exclude=True), }) # apex use_fp16 = True fp16 = dict(type='apex', loss_scale=dict(init_scale=512., mode='dynamic')) # optimizer args optimizer_config = dict( update_interval=update_interval, use_fp16=use_fp16, grad_clip=None, cancel_grad=dict(prototypes=2503), # cancel grad of `prototypes` for 1 ep ) # lr scheduler lr_config = dict( policy='CosineAnnealing', by_epoch=False, min_lr=6e-4, warmup='linear', warmup_iters=10, warmup_by_epoch=True, warmup_ratio=1e-5, ) # runtime settings runner = dict(type='EpochBasedRunner', max_epochs=200)
_base_ = ['../../_base_/models/swav/r50.py', '../../_base_/datasets/imagenet/swav_mcrop-2-6_sz224_96_bs32.py', '../../_base_/default_runtime.py'] model = dict(type='SwAV', backbone=dict(type='ResNet', depth=50, num_stages=4, out_indices=(3,), norm_cfg=dict(type='SyncBN'), style='pytorch'), neck=dict(type='SwAVNeck', in_channels=2048, hid_channels=2048, out_channels=128, with_avg_pool=True), head=dict(type='SwAVHead', feat_dim=128, epsilon=0.05, temperature=0.1, num_crops=[2, 6])) update_interval = 8 custom_hooks = [dict(type='SwAVHook', priority='VERY_HIGH', batch_size=64, epoch_queue_starts=15, crops_for_assign=[0, 1], feat_dim=128, queue_length=3840)] optimizer = dict(type='LARS', lr=0.6 * 16, momentum=0.9, weight_decay=1e-06, paramwise_options={'(bn|ln|gn)(\\d+)?.(weight|bias)': dict(weight_decay=0.0, lars_exclude=True), 'bias': dict(weight_decay=0.0, lars_exclude=True)}) use_fp16 = True fp16 = dict(type='apex', loss_scale=dict(init_scale=512.0, mode='dynamic')) optimizer_config = dict(update_interval=update_interval, use_fp16=use_fp16, grad_clip=None, cancel_grad=dict(prototypes=2503)) lr_config = dict(policy='CosineAnnealing', by_epoch=False, min_lr=0.0006, warmup='linear', warmup_iters=10, warmup_by_epoch=True, warmup_ratio=1e-05) runner = dict(type='EpochBasedRunner', max_epochs=200)
# File: vmray_consts.py # # Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) VMRAY_JSON_SERVER = "vmray_server" VMRAY_JSON_API_KEY = "vmray_api_key" VMRAY_JSON_DISABLE_CERT = "disable_cert_verification" VMRAY_ERR_SERVER_CONNECTION = "Could not connect to server. {}" VMRAY_ERR_CONNECTIVITY_TEST = "Connectivity test failed" VMRAY_SUCC_CONNECTIVITY_TEST = "Connectivity test passed" VMRAY_ERR_UNSUPPORTED_HASH = "Unsupported hash" VMRAY_ERR_SAMPLE_NOT_FOUND = "Could not find sample" VMRAY_ERR_OPEN_ZIP = "Could not open zip file" VMRAY_ERR_ADD_VAULT = "Could not add file to vault" VMRAY_ERR_MULTIPART = "File is a multipart sample. Multipart samples are not supported" VMRAY_ERR_MALFORMED_ZIP = "Malformed zip" VMRAY_ERR_SUBMIT_FILE = "Could not submit file" VMRAY_ERR_GET_SUBMISSION = "Could not get submission" VMRAY_ERR_SUBMISSION_NOT_FINISHED = "Submission is not finished" VMRAY_ERR_NO_SUBMISSIONS = "Sample has no submissions" VMRAY_ERR_FILE_EXISTS = "File already exists" VMRAY_ERR_REST_API = "REST API Error" VMRAY_ERR_CODE_MSG = "Error code unavailable" VMRAY_ERR_MSG_UNAVAILABLE = "Error message unavailable. Please check the asset configuration and|or action parameters" VMRAY_PARSE_ERR_MSG = "Unable to parse the error message. Please check the asset configuration and|or action parameters" VMRAY_ERR_SERVER_RES = "Error processing server response. {}" VMRAY_INVALID_INTEGER_ERR_MSG = "Please provide a valid integer value in the {}" VMRAY_NEGATIVE_INTEGER_ERR_MSG = "Please provide a valid non-negative integer value in the {}" ACTION_ID_VMRAY_GET_FILE = "get_file" ACTION_ID_VMRAY_DETONATE_FILE = "detonate_file" ACTION_ID_VMRAY_DETONATE_URL = "detonate_url" ACTION_ID_VMRAY_GET_REPORT = "get_report" ACTION_ID_VMRAY_GET_INFO = "get_info" VMRAY_DEFAULT_PASSWORD = b"infected" DEFAULT_TIMEOUT = 60 * 10 VMRAY_SEVERITY_NOT_SUSPICIOUS = "not_suspicious" VMRAY_SEVERITY_SUSPICIOUS = "suspicious" VMRAY_SEVERITY_MALICIOUS = "malicious" VMRAY_SEVERITY_BLACKLISTED = "blacklisted" VMRAY_SEVERITY_WHITELISTED = "whitelisted" VMRAY_SEVERITY_UNKNOWN = "unknown" VMRAY_SEVERITY_ERROR = "error" SAMPLE_TYPE_MAPPING = { "Apple Script": "apple script", "Archive": "archive", "CFB File": "compound binary file", "Email (EML)": "email", "Email (MSG)": "email", "Excel Document": "xls", "HTML Application": "html application", "HTML Application (Shell Link)": "html application", "HTML Document": "html document", "Hanword Document": "hanword document", "JScript": "jscript", "Java Archive": "jar", "Java Class": "java class", "macOS App": "macos app", "macOS Executable": "macos executable", "macOS PKG": "macos installer", "MHTML Document": "mhtml document", "MSI Setup": "msi", "Macromedia Flash": "flash", "Microsoft Access Database": "mdb", "Microsoft Project Document": "mpp", "Microsoft Publisher Document": "pub", "Microsoft Visio Document": "vsd", "PDF Document": "pdf", "PowerShell Script": "powershell", "PowerShell Script (Shell Link)": "powershell", "Powerpoint Document": "ppt", "Python Script": "python script", "RTF Document": "rtf", "Shell Script": "shell script", "URL": "url", "VBScript": "vbscript", "Windows ActiveX Control (x86-32)": "pe file", "Windows ActiveX Control (x86-64)": "pe file", "Windows Batch File": "batch file", "Windows Batch File (Shell Link)": "batch file", "Windows DLL (x86-32)": "dll", "Windows DLL (x86-64)": "dll", "Windows Driver (x86-32)": "pe file", "Windows Driver (x86-64)": "pe file", "Windows Exe (Shell Link)": "pe file", "Windows Exe (x86-32)": "pe file", "Windows Exe (x86-64)": "pe file", "Windows Help File": "windows help file", "Windows Script File": "windows script file", "Word Document": "doc", }
vmray_json_server = 'vmray_server' vmray_json_api_key = 'vmray_api_key' vmray_json_disable_cert = 'disable_cert_verification' vmray_err_server_connection = 'Could not connect to server. {}' vmray_err_connectivity_test = 'Connectivity test failed' vmray_succ_connectivity_test = 'Connectivity test passed' vmray_err_unsupported_hash = 'Unsupported hash' vmray_err_sample_not_found = 'Could not find sample' vmray_err_open_zip = 'Could not open zip file' vmray_err_add_vault = 'Could not add file to vault' vmray_err_multipart = 'File is a multipart sample. Multipart samples are not supported' vmray_err_malformed_zip = 'Malformed zip' vmray_err_submit_file = 'Could not submit file' vmray_err_get_submission = 'Could not get submission' vmray_err_submission_not_finished = 'Submission is not finished' vmray_err_no_submissions = 'Sample has no submissions' vmray_err_file_exists = 'File already exists' vmray_err_rest_api = 'REST API Error' vmray_err_code_msg = 'Error code unavailable' vmray_err_msg_unavailable = 'Error message unavailable. Please check the asset configuration and|or action parameters' vmray_parse_err_msg = 'Unable to parse the error message. Please check the asset configuration and|or action parameters' vmray_err_server_res = 'Error processing server response. {}' vmray_invalid_integer_err_msg = 'Please provide a valid integer value in the {}' vmray_negative_integer_err_msg = 'Please provide a valid non-negative integer value in the {}' action_id_vmray_get_file = 'get_file' action_id_vmray_detonate_file = 'detonate_file' action_id_vmray_detonate_url = 'detonate_url' action_id_vmray_get_report = 'get_report' action_id_vmray_get_info = 'get_info' vmray_default_password = b'infected' default_timeout = 60 * 10 vmray_severity_not_suspicious = 'not_suspicious' vmray_severity_suspicious = 'suspicious' vmray_severity_malicious = 'malicious' vmray_severity_blacklisted = 'blacklisted' vmray_severity_whitelisted = 'whitelisted' vmray_severity_unknown = 'unknown' vmray_severity_error = 'error' sample_type_mapping = {'Apple Script': 'apple script', 'Archive': 'archive', 'CFB File': 'compound binary file', 'Email (EML)': 'email', 'Email (MSG)': 'email', 'Excel Document': 'xls', 'HTML Application': 'html application', 'HTML Application (Shell Link)': 'html application', 'HTML Document': 'html document', 'Hanword Document': 'hanword document', 'JScript': 'jscript', 'Java Archive': 'jar', 'Java Class': 'java class', 'macOS App': 'macos app', 'macOS Executable': 'macos executable', 'macOS PKG': 'macos installer', 'MHTML Document': 'mhtml document', 'MSI Setup': 'msi', 'Macromedia Flash': 'flash', 'Microsoft Access Database': 'mdb', 'Microsoft Project Document': 'mpp', 'Microsoft Publisher Document': 'pub', 'Microsoft Visio Document': 'vsd', 'PDF Document': 'pdf', 'PowerShell Script': 'powershell', 'PowerShell Script (Shell Link)': 'powershell', 'Powerpoint Document': 'ppt', 'Python Script': 'python script', 'RTF Document': 'rtf', 'Shell Script': 'shell script', 'URL': 'url', 'VBScript': 'vbscript', 'Windows ActiveX Control (x86-32)': 'pe file', 'Windows ActiveX Control (x86-64)': 'pe file', 'Windows Batch File': 'batch file', 'Windows Batch File (Shell Link)': 'batch file', 'Windows DLL (x86-32)': 'dll', 'Windows DLL (x86-64)': 'dll', 'Windows Driver (x86-32)': 'pe file', 'Windows Driver (x86-64)': 'pe file', 'Windows Exe (Shell Link)': 'pe file', 'Windows Exe (x86-32)': 'pe file', 'Windows Exe (x86-64)': 'pe file', 'Windows Help File': 'windows help file', 'Windows Script File': 'windows script file', 'Word Document': 'doc'}
IDENTIFIER = 'everything' NEWSPAPER_DIR = 'newspapers_everything' RESULTS_DIR = 'results_everything' MIN_FREQUENCY = 50 EPOCHS = 40 MODEL_OPTIONS = { 'vector_size': 100, 'alpha': 0.1, 'window': 8, 'sample': 0.00001, 'workers': 8 } VOCABULARY = f'{IDENTIFIER}.dict'
identifier = 'everything' newspaper_dir = 'newspapers_everything' results_dir = 'results_everything' min_frequency = 50 epochs = 40 model_options = {'vector_size': 100, 'alpha': 0.1, 'window': 8, 'sample': 1e-05, 'workers': 8} vocabulary = f'{IDENTIFIER}.dict'
a, b, c = map(int, input().split()) x = max(a, b, c) total = a + b + c if x % 2 != total % 2: x += 1 print((3 * x - total) // 2)
(a, b, c) = map(int, input().split()) x = max(a, b, c) total = a + b + c if x % 2 != total % 2: x += 1 print((3 * x - total) // 2)
count = 0 sum = 0 while True: X = float(input('')) if X >= 0 and X <= 10: count += 1 sum += X if count == 2: average = sum / count print('media = %0.2f' %average) break else: print('nota invalida')
count = 0 sum = 0 while True: x = float(input('')) if X >= 0 and X <= 10: count += 1 sum += X if count == 2: average = sum / count print('media = %0.2f' % average) break else: print('nota invalida')
commands = [] while True: try: line = input() except: break if not line: break commands.append(line.split()) for starting_a in range(155, 160): d = {'a': starting_a, 'b': 0, 'c': 0, 'd': 0} i = 0 out = [] while len(out) < 100: if commands[i][0] == 'inc' and commands[i+1][0] == 'dec' and commands[i+2][0] == 'jnz' and commands[i+1][1] == commands[i+2][1] and commands[i+2][2] == '-2': d[commands[i][1]] += d[commands[i+1][1]] d[commands[i+1][1]] = 0 i += 3 continue elif commands[i][0] == 'cpy': a, b = commands[i][1:] if a.isalpha(): d[b] = d[a] elif b.isalpha(): d[b] = int(a) elif commands[i][0] == 'inc': d[commands[i][1]] += 1 elif commands[i][0] == 'dec': d[commands[i][1]] -= 1 elif commands[i][0] == 'jnz': a, b = commands[i][1:] if a.isalpha(): if d[a] != 0: i += (d[b] if b.isalpha() else int(b)) - 1 else: if int(a) != 0: i += (d[b] if b.isalpha() else int(b)) - 1 elif commands[i][0] == 'tgl': a = commands[i][1] if a.isalpha(): a = d[a] else: a = int(a) if i + a >= 0 and i + a < len(commands): command = commands[i + a][0] if command == 'inc': command = 'dec' elif command == 'dec': command = 'inc' elif command == 'jnz': command = 'cpy' elif command == 'cpy': command = 'jnz' elif command == 'tgl': command = 'inc' commands[i + a][0] = command elif commands[i][0] == 'out': out.append(d[commands[i][1]]) i += 1 if out == [i % 2 for i in range(100)]: print(starting_a)
commands = [] while True: try: line = input() except: break if not line: break commands.append(line.split()) for starting_a in range(155, 160): d = {'a': starting_a, 'b': 0, 'c': 0, 'd': 0} i = 0 out = [] while len(out) < 100: if commands[i][0] == 'inc' and commands[i + 1][0] == 'dec' and (commands[i + 2][0] == 'jnz') and (commands[i + 1][1] == commands[i + 2][1]) and (commands[i + 2][2] == '-2'): d[commands[i][1]] += d[commands[i + 1][1]] d[commands[i + 1][1]] = 0 i += 3 continue elif commands[i][0] == 'cpy': (a, b) = commands[i][1:] if a.isalpha(): d[b] = d[a] elif b.isalpha(): d[b] = int(a) elif commands[i][0] == 'inc': d[commands[i][1]] += 1 elif commands[i][0] == 'dec': d[commands[i][1]] -= 1 elif commands[i][0] == 'jnz': (a, b) = commands[i][1:] if a.isalpha(): if d[a] != 0: i += (d[b] if b.isalpha() else int(b)) - 1 elif int(a) != 0: i += (d[b] if b.isalpha() else int(b)) - 1 elif commands[i][0] == 'tgl': a = commands[i][1] if a.isalpha(): a = d[a] else: a = int(a) if i + a >= 0 and i + a < len(commands): command = commands[i + a][0] if command == 'inc': command = 'dec' elif command == 'dec': command = 'inc' elif command == 'jnz': command = 'cpy' elif command == 'cpy': command = 'jnz' elif command == 'tgl': command = 'inc' commands[i + a][0] = command elif commands[i][0] == 'out': out.append(d[commands[i][1]]) i += 1 if out == [i % 2 for i in range(100)]: print(starting_a)
tiles = [ (17, 20946, 50678), # https://www.openstreetmap.org/way/215472849 (17, 20959, 50673), # https://www.openstreetmap.org/node/1713279804 (17, 20961, 50675), # https://www.openstreetmap.org/node/3188857553 (17, 20969, 50656), # https://www.openstreetmap.org/node/3396659022 (17, 21013, 50637), # https://www.openstreetmap.org/node/1467717312 (17, 21019, 50617), # https://www.openstreetmap.org/node/2286100659 (17, 21028, 50645), # https://www.openstreetmap.org/node/3711137981 (17, 38597, 49266), # https://www.openstreetmap.org/node/3810578539 (17, 38598, 49259), # http://www.openstreetmap.org/node/2678466844 (17, 38600, 49261), # https://www.openstreetmap.org/node/1429062988 (17, 38601, 49258), # https://www.openstreetmap.org/node/1058296287 ] for z, x, y in tiles: assert_has_feature( z, x, y, 'pois', { 'kind': 'toys' })
tiles = [(17, 20946, 50678), (17, 20959, 50673), (17, 20961, 50675), (17, 20969, 50656), (17, 21013, 50637), (17, 21019, 50617), (17, 21028, 50645), (17, 38597, 49266), (17, 38598, 49259), (17, 38600, 49261), (17, 38601, 49258)] for (z, x, y) in tiles: assert_has_feature(z, x, y, 'pois', {'kind': 'toys'})
''' Given two integer arrays nums1 and nums2, return the maximum length of a subarray that appears in both arrays. Input: nums1 = [1,2,3,2,1], nums2 = [3,2,1,4,7] Output: 3 Explanation: The repeated subarray with maximum length is [3,2,1]. Input: num1 = [3], nums2 = [3] Output: 1 Input: [1,2], [4,6] Output: 0 Input: nums1 = [0,0,0,0], nums2 = [0,0,0,0,0] Output: 4 Precondition: len(nums1) = m len(nums2) = n m, n >= 1 C1: single elements in both, same C2: single elements in both, not same C3: 0 as a result C4: result > 0 C5: result = len(min(m,n)) Algo: Brute Force: O(mn*min(m,n)) For each element in nums1, try to find same element in nums2 O(mn) if found, extend as long as possible return the longest size DP: dp[i][j]: common prefix length for nums1[i:] and nums2[j:] dp[i][j] = dp[i+1][j+1] if nums1[i] = nums2[j] dp[m][n] = 0 result: max of all possible i,j in dp[i][j] Runtime: O(mn) Space: O(mn) ''' class Solution: def findLength(self, nums1: List[int], nums2: List[int]) -> int: m = len(nums1) n = len(nums2) dp = [[0 for _ in range(n + 1)] for _ in range(m + 1)] for i in range(m - 1, -1, -1): for j in range(n - 1, -1, -1): if nums1[i] == nums2[j]: dp[i][j] = dp[i+1][j+1] + 1 return max(max(x) for x in dp)
""" Given two integer arrays nums1 and nums2, return the maximum length of a subarray that appears in both arrays. Input: nums1 = [1,2,3,2,1], nums2 = [3,2,1,4,7] Output: 3 Explanation: The repeated subarray with maximum length is [3,2,1]. Input: num1 = [3], nums2 = [3] Output: 1 Input: [1,2], [4,6] Output: 0 Input: nums1 = [0,0,0,0], nums2 = [0,0,0,0,0] Output: 4 Precondition: len(nums1) = m len(nums2) = n m, n >= 1 C1: single elements in both, same C2: single elements in both, not same C3: 0 as a result C4: result > 0 C5: result = len(min(m,n)) Algo: Brute Force: O(mn*min(m,n)) For each element in nums1, try to find same element in nums2 O(mn) if found, extend as long as possible return the longest size DP: dp[i][j]: common prefix length for nums1[i:] and nums2[j:] dp[i][j] = dp[i+1][j+1] if nums1[i] = nums2[j] dp[m][n] = 0 result: max of all possible i,j in dp[i][j] Runtime: O(mn) Space: O(mn) """ class Solution: def find_length(self, nums1: List[int], nums2: List[int]) -> int: m = len(nums1) n = len(nums2) dp = [[0 for _ in range(n + 1)] for _ in range(m + 1)] for i in range(m - 1, -1, -1): for j in range(n - 1, -1, -1): if nums1[i] == nums2[j]: dp[i][j] = dp[i + 1][j + 1] + 1 return max((max(x) for x in dp))
def data_generator_enabled(request): return {'DATA_GENERATOR_ENABLED': True}
def data_generator_enabled(request): return {'DATA_GENERATOR_ENABLED': True}
class Encoders: def __init__(self, aStar): self.aStar = aStar self.countLeft = 0 self.countRight = 0 self.lastCountLeft = 0 self.lastCountRight = 0 self.countSignLeft = 1 self.countSignRight = -1 self.aStar.reset_encoders() def readCounts(self): countLeft, countRight = self.aStar.read_encoders() diffLeft = (countLeft - self.lastCountLeft) % 0x10000 if diffLeft >= 0x8000: diffLeft -= 0x10000 diffRight = (countRight - self.lastCountRight) % 0x10000 if diffRight >= 0x8000: diffRight -= 0x10000 self.countLeft += self.countSignLeft * diffLeft self.countRight += self.countSignRight * diffRight self.lastCountLeft = countLeft self.lastCountRight = countRight return self.countLeft, self.countRight def reset(self): self.countLeft = 0 self.countRight = 0
class Encoders: def __init__(self, aStar): self.aStar = aStar self.countLeft = 0 self.countRight = 0 self.lastCountLeft = 0 self.lastCountRight = 0 self.countSignLeft = 1 self.countSignRight = -1 self.aStar.reset_encoders() def read_counts(self): (count_left, count_right) = self.aStar.read_encoders() diff_left = (countLeft - self.lastCountLeft) % 65536 if diffLeft >= 32768: diff_left -= 65536 diff_right = (countRight - self.lastCountRight) % 65536 if diffRight >= 32768: diff_right -= 65536 self.countLeft += self.countSignLeft * diffLeft self.countRight += self.countSignRight * diffRight self.lastCountLeft = countLeft self.lastCountRight = countRight return (self.countLeft, self.countRight) def reset(self): self.countLeft = 0 self.countRight = 0
def DectoHex(n): if isinstance(n,int) == True: hexnum = hex(n)[2:] return hexnum.upper() else: intnum = int(n) hexnum = hex(intnum)[2:] return hexnum.upper()
def decto_hex(n): if isinstance(n, int) == True: hexnum = hex(n)[2:] return hexnum.upper() else: intnum = int(n) hexnum = hex(intnum)[2:] return hexnum.upper()
params = [ { 'dronename': 'drone', 'stateofhealth': 100.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 85.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'missionspeed', 'ylabel': 'alpha', 'title': 'Stolaroff', 'simulationtype': 'simple', 'model': 'abdilla', 'xbegin': 0.0, 'xend': 15.0, 'xnumber': 10, 'validation': False, 'validationcase': 'Stolaroff2018', 'batterytechnology': 'current' }, { 'validation': False, 'validationcase': 'Ostler2009', 'drone': True, 'dronename': 'drone', 'stateofhealth': 100.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 89.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'missionspeed', 'ylabel': 'power', 'title': 'Ostler2009', 'simulationtype': 'simple', 'xbegin': 0.0, 'xend': 30.0, 'xnumber': 20, 'batterytechnology': 'current' }, { 'drone': True, 'dronename': 'drone', 'stateofhealth': 100.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 89.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'payload', 'ylabel': 'endurance', 'title': 'FreeFLY_Alta8', 'simulationtype': 'simple', 'xbegin': 0.0, 'xend': 10.0, 'xnumber': 100, 'validation': False, 'validationcase': 'FreeFLYAlta8', 'batterytechnology': 'current' }, { 'dronename': 'drone', 'stateofhealth': 100.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 0.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'payload', 'ylabel': 'endurance', 'title': 'FreeFLY_Alta8', 'simulationtype': 'simple', 'xbegin': 0.0, 'xend': 1.0, 'xnumber': 20, 'validation': False, 'validationcase': 'FireFLY6Pro', 'batterytechnology': 'current' }, { 'dronename': 'drone', 'stateofhealth': 90.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 0.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'payload', 'ylabel': 'power', 'title': 'First_test', 'simulationtype': 'simple', 'model': 'abdilla', 'xbegin': 0.5, 'xend': 1.5, 'xnumber': 10, 'validation': False, 'validationcase': 'Dorling2017_3S', 'batterytechnology': 'current' }, { 'dronename': 'drone', 'stateofhealth': 90.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 0.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'payload', 'ylabel': 'power', 'title': 'First_test', 'simulationtype': 'simple', 'model': 'abdilla', 'xbegin': 0.5, 'xend': 1.5, 'xnumber': 10, 'validation': False, 'validationcase': 'Dorling2017_4S', 'batterytechnology': 'current' }, { 'dronename': 'drone', 'stateofhealth': 100.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 0.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'missionspeed', 'ylabel': 'power', 'title': 'DiFranco', 'simulationtype': 'simple', 'model': 'abdilla', 'xbegin': 0.0, 'xend': 16.0, 'xnumber': 20, 'validation': False, 'validationcase': 'DiFranco2016', 'batterytechnology': 'current' }, { 'dronename': 'drone', 'stateofhealth': 100.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 0.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'missionspeed', 'ylabel': 'power', 'title': 'Stolaroff', 'simulationtype': 'simple', 'model': 'abdilla', 'xbegin': 0.0, 'xend': 16.0, 'xnumber': 20, 'validation': False, 'validationcase': 'Chang2016', 'batterytechnology': 'current' }, { 'dronename': 'drone', 'stateofhealth': 90.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 0.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'payload', 'ylabel': 'endurance', 'title': 'Abdilla 2015 Endurance vs Payload Validation Test', 'simulationtype': 'simple', 'model': 'abdilla', 'xbegin': 0.4, 'xend': 0.55, 'xnumber': 20, 'validation': False, 'validationcase': 'Abdilla2015endurance', 'batterytechnology': 'current' } ]
params = [{'dronename': 'drone', 'stateofhealth': 100.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 85.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'missionspeed', 'ylabel': 'alpha', 'title': 'Stolaroff', 'simulationtype': 'simple', 'model': 'abdilla', 'xbegin': 0.0, 'xend': 15.0, 'xnumber': 10, 'validation': False, 'validationcase': 'Stolaroff2018', 'batterytechnology': 'current'}, {'validation': False, 'validationcase': 'Ostler2009', 'drone': True, 'dronename': 'drone', 'stateofhealth': 100.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 89.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'missionspeed', 'ylabel': 'power', 'title': 'Ostler2009', 'simulationtype': 'simple', 'xbegin': 0.0, 'xend': 30.0, 'xnumber': 20, 'batterytechnology': 'current'}, {'drone': True, 'dronename': 'drone', 'stateofhealth': 100.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 89.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'payload', 'ylabel': 'endurance', 'title': 'FreeFLY_Alta8', 'simulationtype': 'simple', 'xbegin': 0.0, 'xend': 10.0, 'xnumber': 100, 'validation': False, 'validationcase': 'FreeFLYAlta8', 'batterytechnology': 'current'}, {'dronename': 'drone', 'stateofhealth': 100.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 0.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'payload', 'ylabel': 'endurance', 'title': 'FreeFLY_Alta8', 'simulationtype': 'simple', 'xbegin': 0.0, 'xend': 1.0, 'xnumber': 20, 'validation': False, 'validationcase': 'FireFLY6Pro', 'batterytechnology': 'current'}, {'dronename': 'drone', 'stateofhealth': 90.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 0.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'payload', 'ylabel': 'power', 'title': 'First_test', 'simulationtype': 'simple', 'model': 'abdilla', 'xbegin': 0.5, 'xend': 1.5, 'xnumber': 10, 'validation': False, 'validationcase': 'Dorling2017_3S', 'batterytechnology': 'current'}, {'dronename': 'drone', 'stateofhealth': 90.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 0.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'payload', 'ylabel': 'power', 'title': 'First_test', 'simulationtype': 'simple', 'model': 'abdilla', 'xbegin': 0.5, 'xend': 1.5, 'xnumber': 10, 'validation': False, 'validationcase': 'Dorling2017_4S', 'batterytechnology': 'current'}, {'dronename': 'drone', 'stateofhealth': 100.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 0.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'missionspeed', 'ylabel': 'power', 'title': 'DiFranco', 'simulationtype': 'simple', 'model': 'abdilla', 'xbegin': 0.0, 'xend': 16.0, 'xnumber': 20, 'validation': False, 'validationcase': 'DiFranco2016', 'batterytechnology': 'current'}, {'dronename': 'drone', 'stateofhealth': 100.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 0.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'missionspeed', 'ylabel': 'power', 'title': 'Stolaroff', 'simulationtype': 'simple', 'model': 'abdilla', 'xbegin': 0.0, 'xend': 16.0, 'xnumber': 20, 'validation': False, 'validationcase': 'Chang2016', 'batterytechnology': 'current'}, {'dronename': 'drone', 'stateofhealth': 90.0, 'startstateofcharge': 100.0, 'altitude': 100.0, 'temperaturesealevel': 15.0, 'rain': False, 'dropsize': 0.0, 'liquidwatercontent': 1.0, 'temperature': 15.0, 'wind': False, 'windspeed': 0.0, 'winddirection': 0.0, 'relativehumidity': 0.0, 'icing': False, 'timestep': 1, 'plot': True, 'xlabel': 'payload', 'ylabel': 'endurance', 'title': 'Abdilla 2015 Endurance vs Payload Validation Test', 'simulationtype': 'simple', 'model': 'abdilla', 'xbegin': 0.4, 'xend': 0.55, 'xnumber': 20, 'validation': False, 'validationcase': 'Abdilla2015endurance', 'batterytechnology': 'current'}]
skip_files = ["Fleece+CoreFoundation.h"] excluded = ["FLStr","operatorslice","operatorFLSlice","FLMutableArray_Retain","FLMutableArray_Release","FLMutableDict_Retain","FLMutableDict_Release","FLEncoder_NewWritingToFile","FLSliceResult_Free"] default_param_name = {"FLValue":"value","FLSliceResult":"slice","FLSlice":"slice","FLArray":"array","FLArrayIterator*":"i","FLDictIterator*":"i","FLDict":"dict","FLDictKey":"key","FLKeyPath":"keyPath","FLDictKey*":"dictKey","FLSharedKeys":"shared","FLEncoder":"encoder","long":"l","ulong":"u","bool":"b","float":"f","double":"d","FLError*":"outError","int64_t":"l","uint64_t":"u","FLString":"str","FLStringResult":"str"} param_bridge_types = ["FLSlice", "FLString", "size_t", "size_t*"] force_no_bridge = ["FLSlice_Compare", "FLSlice_Equal","FLSliceResult_Retain","FLSliceResult_Release","FLSlice_Copy","FLDoc_FromResultData"] return_bridge_types = ["FLSliceResult", "FLSlice", "size_t", "FLString", "FLStringResult"] type_map = {"int32_t":"int","uint32_t":"uint","int64_t":"long","uint64_t":"ulong","size_t":"UIntPtr","size_t*":"UIntPtr*","unsigned":"uint","FLValue":"FLValue*","FLDict":"FLDict*","FLArray":"FLArray*","FLEncoder":"FLEncoder*","FLSharedKeys":"FLSharedKeys*","FLKeyPath":"FLKeyPath*","FLDoc":"FLDoc*","FLDeepIterator":"FLDeepIterator*"} literals = {"FLSlice_Compare":".nobridge .int FLSlice_Compare FLSlice:left FLSlice:right"} reserved = ["string","base"]
skip_files = ['Fleece+CoreFoundation.h'] excluded = ['FLStr', 'operatorslice', 'operatorFLSlice', 'FLMutableArray_Retain', 'FLMutableArray_Release', 'FLMutableDict_Retain', 'FLMutableDict_Release', 'FLEncoder_NewWritingToFile', 'FLSliceResult_Free'] default_param_name = {'FLValue': 'value', 'FLSliceResult': 'slice', 'FLSlice': 'slice', 'FLArray': 'array', 'FLArrayIterator*': 'i', 'FLDictIterator*': 'i', 'FLDict': 'dict', 'FLDictKey': 'key', 'FLKeyPath': 'keyPath', 'FLDictKey*': 'dictKey', 'FLSharedKeys': 'shared', 'FLEncoder': 'encoder', 'long': 'l', 'ulong': 'u', 'bool': 'b', 'float': 'f', 'double': 'd', 'FLError*': 'outError', 'int64_t': 'l', 'uint64_t': 'u', 'FLString': 'str', 'FLStringResult': 'str'} param_bridge_types = ['FLSlice', 'FLString', 'size_t', 'size_t*'] force_no_bridge = ['FLSlice_Compare', 'FLSlice_Equal', 'FLSliceResult_Retain', 'FLSliceResult_Release', 'FLSlice_Copy', 'FLDoc_FromResultData'] return_bridge_types = ['FLSliceResult', 'FLSlice', 'size_t', 'FLString', 'FLStringResult'] type_map = {'int32_t': 'int', 'uint32_t': 'uint', 'int64_t': 'long', 'uint64_t': 'ulong', 'size_t': 'UIntPtr', 'size_t*': 'UIntPtr*', 'unsigned': 'uint', 'FLValue': 'FLValue*', 'FLDict': 'FLDict*', 'FLArray': 'FLArray*', 'FLEncoder': 'FLEncoder*', 'FLSharedKeys': 'FLSharedKeys*', 'FLKeyPath': 'FLKeyPath*', 'FLDoc': 'FLDoc*', 'FLDeepIterator': 'FLDeepIterator*'} literals = {'FLSlice_Compare': '.nobridge .int FLSlice_Compare FLSlice:left FLSlice:right'} reserved = ['string', 'base']
''' Created on 27 Aug 2010 @author: dev solr configurations ''' solr_base_url = "http://solr:8983/solr/" solr_urls = { 'all' : solr_base_url + 'all', 'locations' : solr_base_url + 'locations', 'comments' : solr_base_url + 'comments', 'images' : solr_base_url + 'images', 'works' : solr_base_url + 'works', 'people' : solr_base_url + 'people', 'manifestations' : solr_base_url + 'manifestations', 'institutions' : solr_base_url + 'institutions', 'resources' : solr_base_url + 'resources', } solr_urls_stage = { 'all' : solr_base_url + 'all_stage', 'locations' : solr_base_url + 'locations_stage', 'comments' : solr_base_url + 'comments_stage', 'images' : solr_base_url + 'images_stage', 'works' : solr_base_url + 'works_stage', 'people' : solr_base_url + 'people_stage', 'manifestations' : solr_base_url + 'manifestations_stage', 'institutions' : solr_base_url + 'institutions_stage', 'resources' : solr_base_url + 'resources_stage', }
""" Created on 27 Aug 2010 @author: dev solr configurations """ solr_base_url = 'http://solr:8983/solr/' solr_urls = {'all': solr_base_url + 'all', 'locations': solr_base_url + 'locations', 'comments': solr_base_url + 'comments', 'images': solr_base_url + 'images', 'works': solr_base_url + 'works', 'people': solr_base_url + 'people', 'manifestations': solr_base_url + 'manifestations', 'institutions': solr_base_url + 'institutions', 'resources': solr_base_url + 'resources'} solr_urls_stage = {'all': solr_base_url + 'all_stage', 'locations': solr_base_url + 'locations_stage', 'comments': solr_base_url + 'comments_stage', 'images': solr_base_url + 'images_stage', 'works': solr_base_url + 'works_stage', 'people': solr_base_url + 'people_stage', 'manifestations': solr_base_url + 'manifestations_stage', 'institutions': solr_base_url + 'institutions_stage', 'resources': solr_base_url + 'resources_stage'}
def clean_version( version: str, *, build: bool = False, patch: bool = False, commit: bool = False, drop_v: bool = False, flat: bool = False, ): "Clean up and transform the many flavours of versions" # 'v1.13.0-103-gb137d064e' --> 'v1.13-103' if version in ["", "-"]: return version nibbles = version.split("-") if not patch: if nibbles[0] >= "1.10.0" and nibbles[0].endswith(".0"): # remove the last ".0" nibbles[0] = nibbles[0][0:-2] if len(nibbles) == 1: version = nibbles[0] elif build and build != "dirty": if not commit: version = "-".join(nibbles[0:-1]) else: version = "-".join(nibbles) else: # version = "-".join((nibbles[0], LATEST)) # HACK: this is not always right, but good enough most of the time version = "latest" if flat: version = version.strip().replace(".", "_") if drop_v: version = version.lstrip("v") else: # prefix with `v` but not before latest if not version.startswith("v") and version.lower() != "latest": version = "v" + version return version
def clean_version(version: str, *, build: bool=False, patch: bool=False, commit: bool=False, drop_v: bool=False, flat: bool=False): """Clean up and transform the many flavours of versions""" if version in ['', '-']: return version nibbles = version.split('-') if not patch: if nibbles[0] >= '1.10.0' and nibbles[0].endswith('.0'): nibbles[0] = nibbles[0][0:-2] if len(nibbles) == 1: version = nibbles[0] elif build and build != 'dirty': if not commit: version = '-'.join(nibbles[0:-1]) else: version = '-'.join(nibbles) else: version = 'latest' if flat: version = version.strip().replace('.', '_') if drop_v: version = version.lstrip('v') elif not version.startswith('v') and version.lower() != 'latest': version = 'v' + version return version
print("Insert an in integer") n = input() nn = n + n nnn = nn + n result = int(n) + int(nn) + int(nnn) print(result)
print('Insert an in integer') n = input() nn = n + n nnn = nn + n result = int(n) + int(nn) + int(nnn) print(result)
# ______________________________________________________________________________ # The Wumpus World class Gold(Thing): def __eq__(self, rhs): '''All Gold are equal''' return rhs.__class__ == Gold pass class Bump(Thing): pass class Glitter(Thing): pass class Pit(Thing): pass class Breeze(Thing): pass class Arrow(Thing): pass class Scream(Thing): pass class Wumpus(Agent): screamed = False pass class Stench(Thing): pass class Explorer(Agent): holding = [] has_arrow = True killed_by = "" direction = Direction("right") def can_grab(self, thing): '''Explorer can only grab gold''' return thing.__class__ == Gold class WumpusEnvironment(XYEnvironment): pit_probability = 0.2 #Probability to spawn a pit in a location. (From Chapter 7.2) #Room should be 4x4 grid of rooms. The extra 2 for walls def __init__(self, agent_program, width=6, height=6): super(WumpusEnvironment, self).__init__(width, height) self.init_world(agent_program) def init_world(self, program): '''Spawn items to the world based on probabilities from the book''' "WALLS" self.add_walls() "PITS" for x in range(self.x_start, self.x_end): for y in range(self.y_start, self.y_end): if random.random() < self.pit_probability: self.add_thing(Pit(), (x,y), True) self.add_thing(Breeze(), (x - 1,y), True) self.add_thing(Breeze(), (x,y - 1), True) self.add_thing(Breeze(), (x + 1,y), True) self.add_thing(Breeze(), (x,y + 1), True) "WUMPUS" w_x, w_y = self.random_location_inbounds(exclude = (1,1)) self.add_thing(Wumpus(lambda x: ""), (w_x, w_y), True) self.add_thing(Stench(), (w_x - 1, w_y), True) self.add_thing(Stench(), (w_x + 1, w_y), True) self.add_thing(Stench(), (w_x, w_y - 1), True) self.add_thing(Stench(), (w_x, w_y + 1), True) "GOLD" self.add_thing(Gold(), self.random_location_inbounds(exclude = (1,1)), True) #self.add_thing(Gold(), (2,1), True) Making debugging a whole lot easier "AGENT" self.add_thing(Explorer(program), (1,1), True) def get_world(self, show_walls = True): '''returns the items in the world''' result = [] x_start,y_start = (0,0) if show_walls else (1,1) x_end,y_end = (self.width, self.height) if show_walls else (self.width - 1, self.height - 1) for x in range(x_start, x_end): row = [] for y in range(y_start, y_end): row.append(self.list_things_at((x,y))) result.append(row) return result def percepts_from(self, agent, location, tclass = Thing): '''Returns percepts from a given location, and replaces some items with percepts from chapter 7.''' thing_percepts = { Gold: Glitter(), Wall: Bump(), Wumpus: Stench(), Pit: Breeze() } '''Agents don't need to get their percepts''' thing_percepts[agent.__class__] = None '''Gold only glitters in its cell''' if location != agent.location: thing_percepts[Gold] = None result = [thing_percepts.get(thing.__class__, thing) for thing in self.things if thing.location == location and isinstance(thing, tclass)] return result if len(result) else [None] def percept(self, agent): '''Returns things in adjacent (not diagonal) cells of the agent. Result format: [Left, Right, Up, Down, Center / Current location]''' x,y = agent.location result = [] result.append(self.percepts_from(agent, (x - 1,y))) result.append(self.percepts_from(agent, (x + 1,y))) result.append(self.percepts_from(agent, (x,y - 1))) result.append(self.percepts_from(agent, (x,y + 1))) result.append(self.percepts_from(agent, (x,y))) '''The wumpus gives out a a loud scream once it's killed.''' wumpus = [thing for thing in self.things if isinstance(thing, Wumpus)] if len(wumpus) and not wumpus[0].alive and not wumpus[0].screamed: result[-1].append(Scream()) wumpus[0].screamed = True return result def execute_action(self, agent, action): '''Modify the state of the environment based on the agent's actions Performance score taken directly out of the book''' if isinstance(agent, Explorer) and self.in_danger(agent): return agent.bump = False if action == 'TurnRight': agent.direction = agent.direction + Direction.R agent.performance -= 1 elif action == 'TurnLeft': agent.direction = agent.direction + Direction.L agent.performance -= 1 elif action == 'Forward': agent.bump = self.move_to(agent, agent.direction.move_forward(agent.location)) agent.performance -= 1 elif action == 'Grab': things = [thing for thing in self.list_things_at(agent.location) if agent.can_grab(thing)] if len(things): print("Grabbing", things[0].__class__.__name__) if len(things): agent.holding.append(things[0]) agent.performance -= 1 elif action == 'Climb': if agent.location == (1,1): #Agent can only climb out of (1,1) agent.performance += 1000 if Gold() in agent.holding else 0 self.delete_thing(agent) elif action == 'Shoot': '''The arrow travels straight down the path the agent is facing''' if agent.has_arrow: arrow_travel = agent.direction.move_forward(agent.location) while(self.is_inbounds(arrow_travel)): wumpus = [thing for thing in self.list_things_at(arrow_travel) if isinstance(thing, Wumpus)] if len(wumpus): wumpus[0].alive = False break arrow_travel = agent.direction.move_forward(agent.location) agent.has_arrow = False def in_danger(self, agent): '''Checks if Explorer is in danger (Pit or Wumpus), if he is, kill him''' for thing in self.list_things_at(agent.location): if isinstance(thing, Pit) or (isinstance(thing, Wumpus) and thing.alive): agent.alive = False agent.performance -= 1000 agent.killed_by = thing.__class__.__name__ return True return False def is_done(self): '''The game is over when the Explorer is killed or if he climbs out of the cave only at (1,1)''' explorer = [agent for agent in self.agents if isinstance(agent, Explorer) ] if len(explorer): if explorer[0].alive: return False else: print("Death by {} [-1000].".format(explorer[0].killed_by)) else: print("Explorer climbed out {}." .format("with Gold [+1000]!" if Gold() not in self.things else "without Gold [+0]")) return True #Almost done. Arrow needs to be implemented
class Gold(Thing): def __eq__(self, rhs): """All Gold are equal""" return rhs.__class__ == Gold pass class Bump(Thing): pass class Glitter(Thing): pass class Pit(Thing): pass class Breeze(Thing): pass class Arrow(Thing): pass class Scream(Thing): pass class Wumpus(Agent): screamed = False pass class Stench(Thing): pass class Explorer(Agent): holding = [] has_arrow = True killed_by = '' direction = direction('right') def can_grab(self, thing): """Explorer can only grab gold""" return thing.__class__ == Gold class Wumpusenvironment(XYEnvironment): pit_probability = 0.2 def __init__(self, agent_program, width=6, height=6): super(WumpusEnvironment, self).__init__(width, height) self.init_world(agent_program) def init_world(self, program): """Spawn items to the world based on probabilities from the book""" 'WALLS' self.add_walls() 'PITS' for x in range(self.x_start, self.x_end): for y in range(self.y_start, self.y_end): if random.random() < self.pit_probability: self.add_thing(pit(), (x, y), True) self.add_thing(breeze(), (x - 1, y), True) self.add_thing(breeze(), (x, y - 1), True) self.add_thing(breeze(), (x + 1, y), True) self.add_thing(breeze(), (x, y + 1), True) 'WUMPUS' (w_x, w_y) = self.random_location_inbounds(exclude=(1, 1)) self.add_thing(wumpus(lambda x: ''), (w_x, w_y), True) self.add_thing(stench(), (w_x - 1, w_y), True) self.add_thing(stench(), (w_x + 1, w_y), True) self.add_thing(stench(), (w_x, w_y - 1), True) self.add_thing(stench(), (w_x, w_y + 1), True) 'GOLD' self.add_thing(gold(), self.random_location_inbounds(exclude=(1, 1)), True) 'AGENT' self.add_thing(explorer(program), (1, 1), True) def get_world(self, show_walls=True): """returns the items in the world""" result = [] (x_start, y_start) = (0, 0) if show_walls else (1, 1) (x_end, y_end) = (self.width, self.height) if show_walls else (self.width - 1, self.height - 1) for x in range(x_start, x_end): row = [] for y in range(y_start, y_end): row.append(self.list_things_at((x, y))) result.append(row) return result def percepts_from(self, agent, location, tclass=Thing): """Returns percepts from a given location, and replaces some items with percepts from chapter 7.""" thing_percepts = {Gold: glitter(), Wall: bump(), Wumpus: stench(), Pit: breeze()} "Agents don't need to get their percepts" thing_percepts[agent.__class__] = None 'Gold only glitters in its cell' if location != agent.location: thing_percepts[Gold] = None result = [thing_percepts.get(thing.__class__, thing) for thing in self.things if thing.location == location and isinstance(thing, tclass)] return result if len(result) else [None] def percept(self, agent): """Returns things in adjacent (not diagonal) cells of the agent. Result format: [Left, Right, Up, Down, Center / Current location]""" (x, y) = agent.location result = [] result.append(self.percepts_from(agent, (x - 1, y))) result.append(self.percepts_from(agent, (x + 1, y))) result.append(self.percepts_from(agent, (x, y - 1))) result.append(self.percepts_from(agent, (x, y + 1))) result.append(self.percepts_from(agent, (x, y))) "The wumpus gives out a a loud scream once it's killed." wumpus = [thing for thing in self.things if isinstance(thing, Wumpus)] if len(wumpus) and (not wumpus[0].alive) and (not wumpus[0].screamed): result[-1].append(scream()) wumpus[0].screamed = True return result def execute_action(self, agent, action): """Modify the state of the environment based on the agent's actions Performance score taken directly out of the book""" if isinstance(agent, Explorer) and self.in_danger(agent): return agent.bump = False if action == 'TurnRight': agent.direction = agent.direction + Direction.R agent.performance -= 1 elif action == 'TurnLeft': agent.direction = agent.direction + Direction.L agent.performance -= 1 elif action == 'Forward': agent.bump = self.move_to(agent, agent.direction.move_forward(agent.location)) agent.performance -= 1 elif action == 'Grab': things = [thing for thing in self.list_things_at(agent.location) if agent.can_grab(thing)] if len(things): print('Grabbing', things[0].__class__.__name__) if len(things): agent.holding.append(things[0]) agent.performance -= 1 elif action == 'Climb': if agent.location == (1, 1): agent.performance += 1000 if gold() in agent.holding else 0 self.delete_thing(agent) elif action == 'Shoot': 'The arrow travels straight down the path the agent is facing' if agent.has_arrow: arrow_travel = agent.direction.move_forward(agent.location) while self.is_inbounds(arrow_travel): wumpus = [thing for thing in self.list_things_at(arrow_travel) if isinstance(thing, Wumpus)] if len(wumpus): wumpus[0].alive = False break arrow_travel = agent.direction.move_forward(agent.location) agent.has_arrow = False def in_danger(self, agent): """Checks if Explorer is in danger (Pit or Wumpus), if he is, kill him""" for thing in self.list_things_at(agent.location): if isinstance(thing, Pit) or (isinstance(thing, Wumpus) and thing.alive): agent.alive = False agent.performance -= 1000 agent.killed_by = thing.__class__.__name__ return True return False def is_done(self): """The game is over when the Explorer is killed or if he climbs out of the cave only at (1,1)""" explorer = [agent for agent in self.agents if isinstance(agent, Explorer)] if len(explorer): if explorer[0].alive: return False else: print('Death by {} [-1000].'.format(explorer[0].killed_by)) else: print('Explorer climbed out {}.'.format('with Gold [+1000]!' if gold() not in self.things else 'without Gold [+0]')) return True
print(divmod(100, 7)) print(7 > 2 and 1 > 6) print(7 > 2 or 1 > 6) number_list = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] print(number_list[2:8]) print(number_list[0:9:3]) print(number_list[0:10:3])
print(divmod(100, 7)) print(7 > 2 and 1 > 6) print(7 > 2 or 1 > 6) number_list = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] print(number_list[2:8]) print(number_list[0:9:3]) print(number_list[0:10:3])
# https://docs.python.org/3/library/functions.html#built-in-functions my_results = [True, True, 2*2==4, True] print(all(my_results)) # all statements in the sequence should be truthy to get True else we get False my_results.append(False) print(my_results) print(all(my_results)) #In logic this is called universal quantor, all my)_results must be truthy for all to return True print(any(my_results)) # any just needs one true result inside, existences kvantors, one or more items are true print(len(my_results)) my_results.append(9000) print("max", max(my_results)) # we only have 1 or 0 in my_results my_results.append(-30) print(my_results) print("min", min(my_results)) print("summa", sum(my_results)) # well when summing booleans True is 1 and False is 0 # print(min(my_results))
my_results = [True, True, 2 * 2 == 4, True] print(all(my_results)) my_results.append(False) print(my_results) print(all(my_results)) print(any(my_results)) print(len(my_results)) my_results.append(9000) print('max', max(my_results)) my_results.append(-30) print(my_results) print('min', min(my_results)) print('summa', sum(my_results))
#!/usr/bin/env pyrate build_output = ['makefile'] ex_d = executable('exampleM2_debug.bin', 'test.cpp foo.cpp', compiler_opts = '-O0') ex_r = executable('exampleM2_release.bin', 'test.cpp foo.cpp', compiler_opts = '-O3') default_targets = ex_r
build_output = ['makefile'] ex_d = executable('exampleM2_debug.bin', 'test.cpp foo.cpp', compiler_opts='-O0') ex_r = executable('exampleM2_release.bin', 'test.cpp foo.cpp', compiler_opts='-O3') default_targets = ex_r
class DescriptionError(Exception): pass class ParseError(DescriptionError): pass class GettingError(DescriptionError): pass
class Descriptionerror(Exception): pass class Parseerror(DescriptionError): pass class Gettingerror(DescriptionError): pass
MyAttr = 'eval:1' My_Attr = 'eval:foo=1;bar=2;foo+bar' attr_1 = 'tango:a/b/c/d' attr_2 = 'a/b/c/d' attr1 = 'eval:"Hello_World!!"' foo = 'eval:/@Foo/True' # 1foo = 'eval:2' Foo = 'eval:False' res_attr = 'res:attr1' dev1 = 'tango:a/b/c' # invalid for attribute dev2 = 'eval:@foo' # invalid for attribute
my_attr = 'eval:1' my__attr = 'eval:foo=1;bar=2;foo+bar' attr_1 = 'tango:a/b/c/d' attr_2 = 'a/b/c/d' attr1 = 'eval:"Hello_World!!"' foo = 'eval:/@Foo/True' foo = 'eval:False' res_attr = 'res:attr1' dev1 = 'tango:a/b/c' dev2 = 'eval:@foo'
# Program to input a number and find it's sum of digits n = int(input("Enter the number: ")) tot = 0 while(n>0): d = n%10 tot = tot+d n=n//10 print("Sum of Digits is:",tot)
n = int(input('Enter the number: ')) tot = 0 while n > 0: d = n % 10 tot = tot + d n = n // 10 print('Sum of Digits is:', tot)
def func(): print("func() in one.py") print("TOP LEVEL ONE.PY") if __name__ == "__main__": print("one.py is being run directly") else: print("one.py has been imported")
def func(): print('func() in one.py') print('TOP LEVEL ONE.PY') if __name__ == '__main__': print('one.py is being run directly') else: print('one.py has been imported')
class NessusObject(object): def __init__(self, server): self._id = None self._server = server def save(self): if self._id is None: return getattr(self._server, "create_%s" % self.__class__.__name__.lower())(self) else: return getattr(self._server, "update_%s" % self.__class__.__name__.lower())(self) def delete(self): if self._id is not None: return getattr(self._server, "delete_%s" % self.__class__.__name__.lower())(self) @property def id(self): return self._id @id.setter def id(self, _id): self._id = _id
class Nessusobject(object): def __init__(self, server): self._id = None self._server = server def save(self): if self._id is None: return getattr(self._server, 'create_%s' % self.__class__.__name__.lower())(self) else: return getattr(self._server, 'update_%s' % self.__class__.__name__.lower())(self) def delete(self): if self._id is not None: return getattr(self._server, 'delete_%s' % self.__class__.__name__.lower())(self) @property def id(self): return self._id @id.setter def id(self, _id): self._id = _id
#Find structs by field type. #@author Rena #@category Struct #@keybinding #@menupath #@toolbar StringColumnDisplay = ghidra.app.tablechooser.StringColumnDisplay AddressableRowObject = ghidra.app.tablechooser.AddressableRowObject TableChooserExecutor = ghidra.app.tablechooser.TableChooserExecutor DTM = state.tool.getService(ghidra.app.services.DataTypeManagerService) AF = currentProgram.getAddressFactory() DT = currentProgram.getDataTypeManager() listing = currentProgram.getListing() mem = currentProgram.getMemory() def addrToInt(addr): return int(str(addr), 16) def intToAddr(addr): return AF.getAddress("0x%08X" % addr) class Executor(TableChooserExecutor): def getButtonName(self): return "Edit Structure" def execute(self, row): DTM.edit(row.struc) # show the structure editor return False # do not remove row class StructNameColumn(StringColumnDisplay): def getColumnName(self): return "Struct Name" def getColumnValue(self, row): return row.struc.displayName class StructLengthColumn(StringColumnDisplay): def getColumnName(self): return "Struct Size" def getColumnValue(self, row): return row.struc.length class StructListResult(AddressableRowObject): def __init__(self, struc): self.struc = struc def getAddress(self): return intToAddr(self.struc.length) def run(): # XXX find a way to make this UI better. # criteria is eg: # B8=*int (a struct with an int* at 0xB8) # B8=* (a struct with any pointer at 0xB8) # B8=2 (a struct with any field at 0xB8 with length 2) # B8=*2 (a struct with a pointer at 0xB8 to something with length 2) # B8 (a struct with any field starting at 0xB8) params = askString("Find Struct", "Enter search criteria") params = params.split(';') monitor.initialize(len(params)) candidates = list(DT.allStructures) def showResults(): executor = Executor() tbl = createTableChooserDialog("Matching Structs", executor) tbl.addCustomColumn(StructNameColumn()) tbl.addCustomColumn(StructLengthColumn()) #printf("show %d results\n", len(candidates)) for res in candidates: #printf("%s\n", res.displayName) tbl.add(StructListResult(res)) tbl.show() tbl.setMessage("%d results" % len(candidates)) def removeResult(struc): candidates.remove(struc) #print("remove", struc.name, "#res", len(candidates)) def checkComponent(struc, comp, offset, typ): # return True if match, False if not. # does component match given offset/type? if comp.offset != offset: return False if typ is None: return True # match any type at this offset # if this is a pointer, walk the dataType chain # to reach the base type tp = typ dt = comp.dataType while tp.startswith('*'): if (not hasattr(dt, 'dataType')) or dt.dataType is None: #printf("[X] %s.%s @%X type is %s\n", struc.name, # comp.fieldName, offset, str(getattr(dt, 'dataType'))) return False dt = dt.dataType tp = tp[1:] # check the name # remove spaces for simplicity tp = tp.replace(' ', '') nm = dt.name.replace(' ', '') if tp.isnumeric(): #printf("[%s] %s.%s @%X size is %d\n", # "O" if dt.length == int(tp) else "X", # struc.name, comp.fieldName, offset, dt.length) if dt.length == int(tp): return True else: #printf("[%s] %s.%s @%X type is %d\n", # "O" if nm == tp else "X", # struc.name, comp.fieldName, offset, dt.length) if nm == tp: return True #comp.dataType.name, numElements, elementLength, length, dataType #comp.fieldName, comment, endOffset, bitFieldComponent, dataType, length, offset, ordinal return False def evaluateParam(param): param = param.split('=') offset = int(param[0], 16) if len(param) < 2: # no type given - find any struct which has a field # beginning at this offset. typ = None else: # user specified a type for the field typ = param[1] #printf("Evaluate '%s', #res=%d\n", param, len(candidates)) remove = [] for struc in candidates: monitor.checkCanceled() #monitor.incrementProgress(1) #monitor.setMessage("Checking %s" % struc.displayName) #print("check", struc.displayName) match = False for comp in struc.components: if checkComponent(struc, comp, offset, typ): match = True break if not match: remove.append(struc) for struc in remove: removeResult(struc) #printf("Evaluated '%s', #res=%d\n", param, len(candidates)) for param in params: monitor.checkCanceled() monitor.incrementProgress(1) monitor.setMessage("Checking %s" % param) evaluateParam(param) if len(candidates) == 0: break #popup("Found %d matches (see console)" % len(candidates)) showResults() run()
string_column_display = ghidra.app.tablechooser.StringColumnDisplay addressable_row_object = ghidra.app.tablechooser.AddressableRowObject table_chooser_executor = ghidra.app.tablechooser.TableChooserExecutor dtm = state.tool.getService(ghidra.app.services.DataTypeManagerService) af = currentProgram.getAddressFactory() dt = currentProgram.getDataTypeManager() listing = currentProgram.getListing() mem = currentProgram.getMemory() def addr_to_int(addr): return int(str(addr), 16) def int_to_addr(addr): return AF.getAddress('0x%08X' % addr) class Executor(TableChooserExecutor): def get_button_name(self): return 'Edit Structure' def execute(self, row): DTM.edit(row.struc) return False class Structnamecolumn(StringColumnDisplay): def get_column_name(self): return 'Struct Name' def get_column_value(self, row): return row.struc.displayName class Structlengthcolumn(StringColumnDisplay): def get_column_name(self): return 'Struct Size' def get_column_value(self, row): return row.struc.length class Structlistresult(AddressableRowObject): def __init__(self, struc): self.struc = struc def get_address(self): return int_to_addr(self.struc.length) def run(): params = ask_string('Find Struct', 'Enter search criteria') params = params.split(';') monitor.initialize(len(params)) candidates = list(DT.allStructures) def show_results(): executor = executor() tbl = create_table_chooser_dialog('Matching Structs', executor) tbl.addCustomColumn(struct_name_column()) tbl.addCustomColumn(struct_length_column()) for res in candidates: tbl.add(struct_list_result(res)) tbl.show() tbl.setMessage('%d results' % len(candidates)) def remove_result(struc): candidates.remove(struc) def check_component(struc, comp, offset, typ): if comp.offset != offset: return False if typ is None: return True tp = typ dt = comp.dataType while tp.startswith('*'): if not hasattr(dt, 'dataType') or dt.dataType is None: return False dt = dt.dataType tp = tp[1:] tp = tp.replace(' ', '') nm = dt.name.replace(' ', '') if tp.isnumeric(): if dt.length == int(tp): return True elif nm == tp: return True return False def evaluate_param(param): param = param.split('=') offset = int(param[0], 16) if len(param) < 2: typ = None else: typ = param[1] remove = [] for struc in candidates: monitor.checkCanceled() match = False for comp in struc.components: if check_component(struc, comp, offset, typ): match = True break if not match: remove.append(struc) for struc in remove: remove_result(struc) for param in params: monitor.checkCanceled() monitor.incrementProgress(1) monitor.setMessage('Checking %s' % param) evaluate_param(param) if len(candidates) == 0: break show_results() run()
expected_output = { "interface": { "GigabitEthernet1/0/1": { "out": { "mcast_pkts": 188396, "bcast_pkts": 0, "ucast_pkts": 124435064, "name": "GigabitEthernet1/0/1", "octets": 24884341205, }, "in": { "mcast_pkts": 214513, "bcast_pkts": 0, "ucast_pkts": 15716712, "name": "GigabitEthernet1/0/1", "octets": 3161931167, }, } } }
expected_output = {'interface': {'GigabitEthernet1/0/1': {'out': {'mcast_pkts': 188396, 'bcast_pkts': 0, 'ucast_pkts': 124435064, 'name': 'GigabitEthernet1/0/1', 'octets': 24884341205}, 'in': {'mcast_pkts': 214513, 'bcast_pkts': 0, 'ucast_pkts': 15716712, 'name': 'GigabitEthernet1/0/1', 'octets': 3161931167}}}}
DOMAIN = "echonet_lite" MANUFACTURER = { 0x0B: "Panasonic", 0x69: "Toshiba", 0x2f: "AIPHONE", } CONF_STATE_CLASS = "state_class"
domain = 'echonet_lite' manufacturer = {11: 'Panasonic', 105: 'Toshiba', 47: 'AIPHONE'} conf_state_class = 'state_class'
files = ['avalon_mm_bfm_pkg.vhd', 'avalon_st_bfm_pkg.vhd', 'axilite_bfm_pkg.vhd', 'axistream_bfm_pkg.vhd', 'gmii_bfm_pkg.vhd', 'gpio_bfm_pkg.vhd', 'i2c_bfm_pkg.vhd', 'rgmii_bfm_pkg.vhd', 'sbi_bfm_pkg.vhd', 'spi_bfm_pkg.vhd', 'uart_bfm_pkg.vhd', ]
files = ['avalon_mm_bfm_pkg.vhd', 'avalon_st_bfm_pkg.vhd', 'axilite_bfm_pkg.vhd', 'axistream_bfm_pkg.vhd', 'gmii_bfm_pkg.vhd', 'gpio_bfm_pkg.vhd', 'i2c_bfm_pkg.vhd', 'rgmii_bfm_pkg.vhd', 'sbi_bfm_pkg.vhd', 'spi_bfm_pkg.vhd', 'uart_bfm_pkg.vhd']
#pragma repy restrictions.loose # create a junk.py file myfo = open("junk.py","w") print >> myfo, "print 'Hello world'" myfo.close() removefile("junk.py") # should be removed...
myfo = open('junk.py', 'w') (print >> myfo, "print 'Hello world'") myfo.close() removefile('junk.py')
a = ['a','b','c'] b = ['1','2','3','4','5','6'] c = list(zip(*b)) print(a) print(c) for d,e in zip(c,a): print(d) print(e)
a = ['a', 'b', 'c'] b = ['1', '2', '3', '4', '5', '6'] c = list(zip(*b)) print(a) print(c) for (d, e) in zip(c, a): print(d) print(e)
#!/usr/bin/env python # coding: utf-8 # # Mendel's First Law # ## Problem # # Probability is the mathematical study of randomly occurring phenomena. We will model such a phenomenon with a random variable, which is simply a variable that can take a number of different distinct outcomes depending on the result of an underlying random process. # # For example, say that we have a bag containing 3 red balls and 2 blue balls. If we let **X** represent the random variable corresponding to the color of a drawn ball, then the probability of each of the two outcomes is given by **Pr(X = red) = 35** and **Pr(X = blue) = 25**. # # Random variables can be combined to yield new random variables. Returning to the ball example, let Y model the color of a second ball drawn from the bag (without replacing the first ball). The probability of Y being red depends on whether the first ball was red or blue. To represent all outcomes of X and Y, we therefore use a probability tree diagram. This branching diagram represents all possible individual probabilities for X and Y, with outcomes at the endpoints ("leaves") of the tree. The probability of any outcome is given by the product of probabilities along the path from the beginning of the tree; see Figure 2 for an illustrative example. # # An event is simply a collection of outcomes. Because outcomes are distinct, the probability of an event can be written as the sum of the probabilities of its constituent outcomes. For our colored ball example, let **A** be the event **"Y is blue."** **Pr(A)** is equal to the sum of the probabilities of two different outcomes: # >**Pr(X = blue and Y = blue) + Pr(X = red and Y = blue)**, or **310 + 110 = 25**. # # > **Given:** Three positive integers **k**, **m**, and **n**, representing a population containing **k + m + n** organisms: **k** individuals are homozygous dominant for a factor, **m** are heterozygous, and **n** are homozygous recessive. # # > **Return:** The probability that two randomly selected mating organisms will produce an individual possessing a dominant allele (and thus displaying the dominant phenotype). Assume that any two organisms can mate. # In[ ]: def mendel(x, y, z): #calculate the probability of recessive traits only total = x + y + z twoRecess = (z/total)*((z-1)/(total-1)) twoHetero = (y/total)*((y-1)/(total-1)) heteroRecess = (z/total)*(y/(total-1)) + (y/total)*(z/(total-1)) recessProb = twoRecess + twoHetero*1/4 + heteroRecess*1/2 print(1-recessProb) # take the complement # In[ ]: with open ("rosalind_iprb.txt", "r") as file: #replace filename with your filename line = file.readline().split() x, y, z = [int(n) for n in line] print(x, y, z) file.close() print(mendel(x, y, z))
def mendel(x, y, z): total = x + y + z two_recess = z / total * ((z - 1) / (total - 1)) two_hetero = y / total * ((y - 1) / (total - 1)) hetero_recess = z / total * (y / (total - 1)) + y / total * (z / (total - 1)) recess_prob = twoRecess + twoHetero * 1 / 4 + heteroRecess * 1 / 2 print(1 - recessProb) with open('rosalind_iprb.txt', 'r') as file: line = file.readline().split() (x, y, z) = [int(n) for n in line] print(x, y, z) file.close() print(mendel(x, y, z))
# examples on set and dict comprehensions # EXAMPLES OF SET COMPREHENSION # making a set comprehension is actually really easy # instead of a list, we'll just use a set notation as follows: my_list = [char for char in 'hello'] my_set = {char for char in 'hello'} print(my_list) print(my_set) my_list1 = [num for num in range(10)] my_set1 = {num for num in range(10)} print(my_list1) print(my_set1) my_list2 = [num ** 2 for num in range(50) if num % 2 == 0] my_set2 = {num ** 2 for num in range(50) if num % 2 == 0} print(my_list2) print(my_set2) # EXAMPLE OF DICT COMPREHENSIONS # Example 1: simple_dict = {'a': 1, 'b': 2} my_dict = {k: v ** 2 for k, v in simple_dict.items()} # for each of the key:value pair in the simple_dict, we raise the value by the power of 2 and add it to my_dict print(my_dict) # Example 2: if we only want the even values from simple_dict to be in my_dict, then, we have the following dict comprehension my_dict2 = {k: v ** 2 for k, v in simple_dict.items() if v % 2 == 0} print(my_dict2) # Example 3: If we want to make a dict from a list where the list item is the key and item*2 is the value in the dict, using dict comprehension: my_dict3 = {item: item * 2 for item in [1, 2, 3]} print(my_dict3) ''' Output: ------ ['h', 'e', 'l', 'l', 'o'] {'o', 'h', 'l', 'e'} [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} [0, 4, 16, 36, 64, 100, 144, 196, 256, 324, 400, 484, 576, 676, 784, 900, 1024, 1156, 1296, 1444, 1600, 1764, 1936, 2116, 2304] {0, 256, 1024, 2304, 4, 900, 1156, 16, 144, 400, 784, 1296, 1936, 36, 676, 1444, 64, 576, 1600, 196, 324, 2116, 100, 484, 1764} {'a': 1, 'b': 4} {'b': 4} {1: 2, 2: 4, 3: 6} '''
my_list = [char for char in 'hello'] my_set = {char for char in 'hello'} print(my_list) print(my_set) my_list1 = [num for num in range(10)] my_set1 = {num for num in range(10)} print(my_list1) print(my_set1) my_list2 = [num ** 2 for num in range(50) if num % 2 == 0] my_set2 = {num ** 2 for num in range(50) if num % 2 == 0} print(my_list2) print(my_set2) simple_dict = {'a': 1, 'b': 2} my_dict = {k: v ** 2 for (k, v) in simple_dict.items()} print(my_dict) my_dict2 = {k: v ** 2 for (k, v) in simple_dict.items() if v % 2 == 0} print(my_dict2) my_dict3 = {item: item * 2 for item in [1, 2, 3]} print(my_dict3) "\nOutput:\n------\n['h', 'e', 'l', 'l', 'o']\n{'o', 'h', 'l', 'e'}\n[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}\n[0, 4, 16, 36, 64, 100, 144, 196, 256, 324, 400, 484, 576, 676, 784, 900, 1024, 1156, 1296, 1444, 1600, 1764, 1936, 2116, 2304]\n{0, 256, 1024, 2304, 4, 900, 1156, 16, 144, 400, 784, 1296, 1936, 36, 676, 1444, 64, 576, 1600, 196, 324, 2116, 100, 484, 1764}\n{'a': 1, 'b': 4}\n{'b': 4}\n{1: 2, 2: 4, 3: 6}\n"
class HtmlReportException(Exception): pass class HtmlReport: def __init__(self): self.path = None self.file = None self.header = None self.start_time = None self.is_initialized = False def __del__(self): if self.is_initialized and self.file: self.write('</body></html>\n') self.file.close() def set_path(self, path): self.path = path def initialize_file(self, path): if self.is_initialized: self.file = open(path, 'w', encoding='utf-8', buffering=1) def write(self, string): if self.is_initialized: if not self.file: raise HtmlReportException('HTML report is not initialized') self.file.write(string.encode('utf-8').decode('utf-8', errors='ignore'))
class Htmlreportexception(Exception): pass class Htmlreport: def __init__(self): self.path = None self.file = None self.header = None self.start_time = None self.is_initialized = False def __del__(self): if self.is_initialized and self.file: self.write('</body></html>\n') self.file.close() def set_path(self, path): self.path = path def initialize_file(self, path): if self.is_initialized: self.file = open(path, 'w', encoding='utf-8', buffering=1) def write(self, string): if self.is_initialized: if not self.file: raise html_report_exception('HTML report is not initialized') self.file.write(string.encode('utf-8').decode('utf-8', errors='ignore'))
SIZE = 9 INPUT_LEVEL_DIR = "File.txt" INPUT_CONSTRAINTS_DIR = "Constraints.txt" OUTPUT_SOLUTION_DIR = "Solution.txt" ASSIGNED_VALUE_NUM = 0
size = 9 input_level_dir = 'File.txt' input_constraints_dir = 'Constraints.txt' output_solution_dir = 'Solution.txt' assigned_value_num = 0
class Mother: @staticmethod def take_screenshot(): print('I can make a screenshot') @staticmethod def receive_email(): print('I can receive email') class Father: @staticmethod def drive_car(): print('I can drive a car ') @staticmethod def play_music(): print(f'Play music while driving') class Grandfather: @staticmethod def smoke(): print('I can drive a car ') @staticmethod def sing(): print(f'Play music while driving') class Kid(Mother, Father, Grandfather): def behave(self): self.take_screenshot() self.drive_car() self.smoke() kid = Kid() kid.behave() kid.drive_car() print(Kid.mro())
class Mother: @staticmethod def take_screenshot(): print('I can make a screenshot') @staticmethod def receive_email(): print('I can receive email') class Father: @staticmethod def drive_car(): print('I can drive a car ') @staticmethod def play_music(): print(f'Play music while driving') class Grandfather: @staticmethod def smoke(): print('I can drive a car ') @staticmethod def sing(): print(f'Play music while driving') class Kid(Mother, Father, Grandfather): def behave(self): self.take_screenshot() self.drive_car() self.smoke() kid = kid() kid.behave() kid.drive_car() print(Kid.mro())
class NewsModule: def __init__(self): pass def update(self): pass
class Newsmodule: def __init__(self): pass def update(self): pass
# AUTOGENERATED! DO NOT EDIT! File to edit: 01_Virtual_data_setup.ipynb (unless otherwise specified). __all__ = ['Get_sub_watersheds'] # Cell def Get_sub_watersheds(watershed, order_max, order_min = 4): '''Obtains the sub-watersheds a different orders starting from the order_max and ending on the order_min, there is no return, it only updates the watershed.Table''' orders = np.arange(order_max, order_min, -1).tolist() for Prun in orders: #Finds the connections points Ho = Prun watershed.Table['prun_'+str(Ho)] = 0 idx = watershed.Table.loc[watershed.Table['h_order']>=Ho].index for i in idx: size = watershed.Table.loc[(watershed.Table['dest'] == i) & (watershed.Table['h_order'] >= Ho-1)] if size.shape[0] >= 2: watershed.Table.loc[size.index, 'prun_'+str(Ho)] = 1 #Finds all the links that belong to a pruning level idx = watershed.Table.loc[watershed.Table['prun_'+str(Ho)] == 1].sort_values(by = ['Acum'], ascending = False).index cont = 2 for i in idx: #Finds the watershed upstream t = am.hlmModel(linkid=i) idx_t = watershed.Table.index.intersection(t.Table.index) #Assign that pruning level to the sub-watershed watershed.Table.loc[idx_t, 'prun_'+str(Ho)] = cont #Go to next pruning level cont += 1 print('Prun %d done' % Prun)
__all__ = ['Get_sub_watersheds'] def get_sub_watersheds(watershed, order_max, order_min=4): """Obtains the sub-watersheds a different orders starting from the order_max and ending on the order_min, there is no return, it only updates the watershed.Table""" orders = np.arange(order_max, order_min, -1).tolist() for prun in orders: ho = Prun watershed.Table['prun_' + str(Ho)] = 0 idx = watershed.Table.loc[watershed.Table['h_order'] >= Ho].index for i in idx: size = watershed.Table.loc[(watershed.Table['dest'] == i) & (watershed.Table['h_order'] >= Ho - 1)] if size.shape[0] >= 2: watershed.Table.loc[size.index, 'prun_' + str(Ho)] = 1 idx = watershed.Table.loc[watershed.Table['prun_' + str(Ho)] == 1].sort_values(by=['Acum'], ascending=False).index cont = 2 for i in idx: t = am.hlmModel(linkid=i) idx_t = watershed.Table.index.intersection(t.Table.index) watershed.Table.loc[idx_t, 'prun_' + str(Ho)] = cont cont += 1 print('Prun %d done' % Prun)
class Slot: def __init__(self, name="", description = ""): self.type = type # categorical, verbatim self.name = name self.description = description self.values = ["not-present"] self.values_descriptions = ["Ignore me, I'm used for programming."] def len (self): return len(self.values) def add_value (self, value, value_description=""): if value not in self.values: self.values.append(value) self.values_descriptions.append(value_description) def __repr__(self): str = "Slot [{}]:\n".format(self.name) str+= "\tDescription: {}\n".format(self.description) if self.type is not "verbatim": str+= "\tValues: CATEGORICAL, {} values\n".format(len(self.values_descriptions)) for i in range (len(self.values)): str+= "\t\t{}\t{}\n".format(self.values[i], self.values_descriptions[i]) else: str+= "\tValues: VERBATIM\n" return str class Slots: # this is for one MEI only def __init__(self): self.slots = [] def add_slot_value_pair(self, slot_name, slot_value, slot_description = ""): found = False for slot in self.slots: if slot.name == slot_name: found = True break if not found: self.slots.append(Slot(slot_name, slot_description)) for slot in self.slots: if slot.name == slot_name: slot.add_value(slot_value) def get_slot_object(self, slot_name): for slot in self.slots: if slot.name == slot_name: return slot raise Exception("Slot not found: "+slot_name) def __repr__(self): str = "Slots object contains {} slots:\n".format(len(self.slots)) str+= "_"*60+"\n" for slot in self.slots: str+=slot.__repr__() return str
class Slot: def __init__(self, name='', description=''): self.type = type self.name = name self.description = description self.values = ['not-present'] self.values_descriptions = ["Ignore me, I'm used for programming."] def len(self): return len(self.values) def add_value(self, value, value_description=''): if value not in self.values: self.values.append(value) self.values_descriptions.append(value_description) def __repr__(self): str = 'Slot [{}]:\n'.format(self.name) str += '\tDescription: {}\n'.format(self.description) if self.type is not 'verbatim': str += '\tValues: CATEGORICAL, {} values\n'.format(len(self.values_descriptions)) for i in range(len(self.values)): str += '\t\t{}\t{}\n'.format(self.values[i], self.values_descriptions[i]) else: str += '\tValues: VERBATIM\n' return str class Slots: def __init__(self): self.slots = [] def add_slot_value_pair(self, slot_name, slot_value, slot_description=''): found = False for slot in self.slots: if slot.name == slot_name: found = True break if not found: self.slots.append(slot(slot_name, slot_description)) for slot in self.slots: if slot.name == slot_name: slot.add_value(slot_value) def get_slot_object(self, slot_name): for slot in self.slots: if slot.name == slot_name: return slot raise exception('Slot not found: ' + slot_name) def __repr__(self): str = 'Slots object contains {} slots:\n'.format(len(self.slots)) str += '_' * 60 + '\n' for slot in self.slots: str += slot.__repr__() return str
# Check if removing an edge of a binary tree can divide # the tree in two equal halves # Count the number of nodes, say n. Then traverse the tree # in bottom up manner and check if n - s = s class Node: def __init__(self, val): self.val = val self.left = None self.right = None def count(root): if not root: return 0 return count(root.left) + count(root.right) + 1 def check_util(root, n): if root == None: return False # Check for root if count(root) == n - count(root): return True # Check for all the other nodes return check_util(root.left, n) or check_util(root.right, n) def check(root): n = count(rot) return check_util(root, n)
class Node: def __init__(self, val): self.val = val self.left = None self.right = None def count(root): if not root: return 0 return count(root.left) + count(root.right) + 1 def check_util(root, n): if root == None: return False if count(root) == n - count(root): return True return check_util(root.left, n) or check_util(root.right, n) def check(root): n = count(rot) return check_util(root, n)
class Cipher: def __init__(self, codestring): # Hints: # Does the capitalization of the words or letter matter here? # Is hello the same as Hello or even hElLo in terms of definition? Yes # Maybe we should convert everything to uppercase # Add your code here self.alphabet = None # Add alphabet here by replacing None with the answer self.codestring = "" for letter in 'ZYXWVUTSRQPONMLKJIHGFEDCBA': if None not in codestring: # Replace None with answer self.codestring += None # Replace None with answer self.codestring = codestring + self.codestring self.code = {} for (a,b) in zip(self.codestring.upper(), None): # Replace None & "None2" with the answers self.code["None2"] = None self.inverse = {} for (a,b) in zip(None, self.alphabet): self.inverse[None] = "None2" # Replace None & "None2" with the answers def encode(self, plaintext): # Add your code here encoded_string = "" for c in None: #Replace None with the answer if c.isalpha(): encoded_string += None #Replace None with the answer else: encoded_string += None return "".join(encoded_string) def decode(self, ciphertext): # Add your code here decoded_string = "" for c in None: #Replace None with the answer if None: #Replace None with the answer decoded_string += self.code[None] #Replace None with the answer else: None #Replace None with the answer (it's 1 line of code) return "".join(decoded_string)
class Cipher: def __init__(self, codestring): self.alphabet = None self.codestring = '' for letter in 'ZYXWVUTSRQPONMLKJIHGFEDCBA': if None not in codestring: self.codestring += None self.codestring = codestring + self.codestring self.code = {} for (a, b) in zip(self.codestring.upper(), None): self.code['None2'] = None self.inverse = {} for (a, b) in zip(None, self.alphabet): self.inverse[None] = 'None2' def encode(self, plaintext): encoded_string = '' for c in None: if c.isalpha(): encoded_string += None else: encoded_string += None return ''.join(encoded_string) def decode(self, ciphertext): decoded_string = '' for c in None: if None: decoded_string += self.code[None] else: None return ''.join(decoded_string)
description = 'FRM II FAK40 information (cooling water system)' group = 'lowlevel' tango_base = 'tango://ictrlfs.ictrl.frm2:10000/frm2/' devices = dict( FAK40_Cap = device('nicos.devices.entangle.AnalogInput', tangodevice = tango_base +'fak40/CF001', description = 'The capacity of the cooling water system', pollinterval = 60, maxage = 120, ), FAK40_Press = device('nicos.devices.entangle.AnalogInput', tangodevice = tango_base +'fak40/CP001', description = 'The pressure inside the cooling water system', pollinterval = 60, maxage = 120, ), )
description = 'FRM II FAK40 information (cooling water system)' group = 'lowlevel' tango_base = 'tango://ictrlfs.ictrl.frm2:10000/frm2/' devices = dict(FAK40_Cap=device('nicos.devices.entangle.AnalogInput', tangodevice=tango_base + 'fak40/CF001', description='The capacity of the cooling water system', pollinterval=60, maxage=120), FAK40_Press=device('nicos.devices.entangle.AnalogInput', tangodevice=tango_base + 'fak40/CP001', description='The pressure inside the cooling water system', pollinterval=60, maxage=120))
# # PySNMP MIB module DHCP-SERVER-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///home/tin/Dev/mibs.snmplabs.com/asn1/DHCP-SERVER-MIB # Produced by pysmi-0.3.4 at Fri Jan 31 21:33:35 2020 # On host bier platform Linux version 5.4.0-3-amd64 by user tin # Using Python version 3.7.6 (default, Jan 19 2020, 22:34:52) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection") NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup") Integer32, Counter64, iso, Bits, Unsigned32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, ObjectIdentity, Counter32, Gauge32, MibIdentifier, TimeTicks, enterprises, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "Counter64", "iso", "Bits", "Unsigned32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "ObjectIdentity", "Counter32", "Gauge32", "MibIdentifier", "TimeTicks", "enterprises", "ModuleIdentity") RowStatus, TruthValue, TextualConvention, DisplayString, DateAndTime = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "TruthValue", "TextualConvention", "DisplayString", "DateAndTime") lucent = MibIdentifier((1, 3, 6, 1, 4, 1, 1751)) products = MibIdentifier((1, 3, 6, 1, 4, 1, 1751, 1)) mibs = MibIdentifier((1, 3, 6, 1, 4, 1, 1751, 2)) ipspg = MibIdentifier((1, 3, 6, 1, 4, 1, 1751, 1, 48)) ipspgServices = MibIdentifier((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1)) ipspgDHCP = MibIdentifier((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1)) ipspgDNS = MibIdentifier((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 2)) ipspgTrap = MibIdentifier((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2)) dhcpServMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1)) if mibBuilder.loadTexts: dhcpServMib.setLastUpdated('0606220830Z') if mibBuilder.loadTexts: dhcpServMib.setOrganization('Lucent Technologies') if mibBuilder.loadTexts: dhcpServMib.setContactInfo(' James Offutt Postal: Lucent Technologies 400 Lapp Road Malvern, PA 19355 USA Tel: +1 610-722-7900 Fax: +1 610-725-8559') if mibBuilder.loadTexts: dhcpServMib.setDescription('The Vendor Specific MIB module for entities implementing the server side of the Bootstrap Protocol (BOOTP) and the Dynamic Host Configuration protocol (DHCP) for Internet Protocol version 4 (IPv4).') dhcpServMibTraps = ObjectIdentity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0)) if mibBuilder.loadTexts: dhcpServMibTraps.setStatus('current') if mibBuilder.loadTexts: dhcpServMibTraps.setDescription('DHCP Server MIB traps.') dhcpServMibObjects = ObjectIdentity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1)) if mibBuilder.loadTexts: dhcpServMibObjects.setStatus('current') if mibBuilder.loadTexts: dhcpServMibObjects.setDescription('DHCP Server MIB objects are all defined in this branch.') dhcpServSystem = ObjectIdentity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 1)) if mibBuilder.loadTexts: dhcpServSystem.setStatus('current') if mibBuilder.loadTexts: dhcpServSystem.setDescription('Group of objects that are related to the overall system.') dhcpServSubnetCounters = ObjectIdentity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 2)) if mibBuilder.loadTexts: dhcpServSubnetCounters.setStatus('current') if mibBuilder.loadTexts: dhcpServSubnetCounters.setDescription('Group of objects that count various subnet data values') dhcpServBootpCounters = ObjectIdentity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 3)) if mibBuilder.loadTexts: dhcpServBootpCounters.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpCounters.setDescription('Group of objects that count various BOOTP events.') dhcpServDhcpCounters = ObjectIdentity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4)) if mibBuilder.loadTexts: dhcpServDhcpCounters.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCounters.setDescription('Group of objects that count various DHCP Statistics.') dhcpServBootpStatistics = ObjectIdentity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5)) if mibBuilder.loadTexts: dhcpServBootpStatistics.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatistics.setDescription('Group of objects that measure various BOOTP statistics.') dhcpServDhcpStatistics = ObjectIdentity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6)) if mibBuilder.loadTexts: dhcpServDhcpStatistics.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatistics.setDescription('Group of objects that measure various DHCP statistics.') dhcpServConfiguration = ObjectIdentity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7)) if mibBuilder.loadTexts: dhcpServConfiguration.setStatus('current') if mibBuilder.loadTexts: dhcpServConfiguration.setDescription('Objects that contain pre-configured and Dynamic Config. Info.') dhcpServFailover = ObjectIdentity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8)) if mibBuilder.loadTexts: dhcpServFailover.setStatus('current') if mibBuilder.loadTexts: dhcpServFailover.setDescription('Objects that contain partner server info.') class DhcpServTimeInterval(TextualConvention, Gauge32): description = 'The number of milli-seconds that has elapsed since some epoch. Systems that cannot measure events to the milli-second resolution SHOULD round this value to the next available resolution that the system supports.' status = 'current' dhcpServSystemDescr = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServSystemDescr.setStatus('current') if mibBuilder.loadTexts: dhcpServSystemDescr.setDescription('A textual description of the server. This value should include the full name and version identification of the server. This string MUST contain only printable NVT ASCII characters.') dhcpServSystemStatus = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("starting", 0), ("running", 1), ("stopping", 2), ("stopped", 3), ("reload", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServSystemStatus.setStatus('current') if mibBuilder.loadTexts: dhcpServSystemStatus.setDescription(' Dhcp System Server Status ') dhcpServSystemUpTime = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServSystemUpTime.setStatus('current') if mibBuilder.loadTexts: dhcpServSystemUpTime.setDescription('If the server has a persistent state (e.g., a process), this value will be the seconds elapsed since it started. For software without persistant state, this value will be zero.') dhcpServSystemResetTime = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServSystemResetTime.setStatus('current') if mibBuilder.loadTexts: dhcpServSystemResetTime.setDescription("If the server has a persistent state (e.g., a process) and supports a `reset' operation (e.g., can be told to re-read configuration files), this value will be the seconds elapsed since the last time the name server was `reset.' For software that does not have persistence or does not support a `reset' operation, this value will be zero.") dhcpServCountUsedSubnets = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 2, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServCountUsedSubnets.setStatus('current') if mibBuilder.loadTexts: dhcpServCountUsedSubnets.setDescription('The number subnets managed by the server (i.e. configured), from which the server has issued at least one lease.') dhcpServCountUnusedSubnets = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 2, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServCountUnusedSubnets.setStatus('current') if mibBuilder.loadTexts: dhcpServCountUnusedSubnets.setDescription('The number subnets managed by the server (i.e. configured), from which the server has issued no leases.') dhcpServCountFullSubnets = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 2, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServCountFullSubnets.setStatus('current') if mibBuilder.loadTexts: dhcpServCountFullSubnets.setDescription('The number subnets managed by the server (i.e. configured), in which the address pools have been exhausted.') dhcpServBootpCountRequests = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 3, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServBootpCountRequests.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpCountRequests.setDescription('The number of packets received that contain a Message Type of 1 (BOOTREQUEST) in the first octet and do not contain option number 53 (DHCP Message Type) in the options.') dhcpServBootpCountInvalids = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 3, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServBootpCountInvalids.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpCountInvalids.setDescription('The number of packets received that do not contain a Message Type of 1 (BOOTREQUEST) in the first octet or are not valid BOOTP packets (e.g.: too short, invalid field in packet header).') dhcpServBootpCountReplies = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 3, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServBootpCountReplies.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpCountReplies.setDescription('The number of packets sent that contain a Message Type of 1 (BOOTREQUEST) in the first octet and do not contain option number 53 (DHCP Message Type) in the options.') dhcpServBootpCountDroppedUnknownClients = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 3, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServBootpCountDroppedUnknownClients.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpCountDroppedUnknownClients.setDescription('The number of BOOTP packets dropped due to the server not recognizing or not providing service to the hardware address received in the incoming packet.') dhcpServBootpCountDroppedNotServingSubnet = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 3, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServBootpCountDroppedNotServingSubnet.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpCountDroppedNotServingSubnet.setDescription('The number of BOOTP packets dropped due to the server not being configured or not otherwise able to serve addresses on the subnet from which this message was received.') dhcpServDhcpCountDiscovers = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpCountDiscovers.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountDiscovers.setDescription('The number of DHCPDISCOVER (option 53 with value 1) packets received.') dhcpServDhcpCountRequests = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpCountRequests.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountRequests.setDescription('The number of DHCPREQUEST (option 53 with value 3) packets received.') dhcpServDhcpCountReleases = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpCountReleases.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountReleases.setDescription('The number of DHCPRELEASE (option 53 with value 7) packets received.') dhcpServDhcpCountDeclines = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpCountDeclines.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountDeclines.setDescription('The number of DHCPDECLINE (option 53 with value 4) packets received.') dhcpServDhcpCountInforms = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpCountInforms.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountInforms.setDescription('The number of DHCPINFORM (option 53 with value 8) packets received.') dhcpServDhcpCountInvalids = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpCountInvalids.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountInvalids.setDescription('The number of DHCP packets received whose DHCP message type (i.e.: option number 53) is not understood or handled by the server.') dhcpServDhcpCountOffers = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpCountOffers.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountOffers.setDescription('The number of DHCPOFFER (option 53 with value 2) packets sent.') dhcpServDhcpCountAcks = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpCountAcks.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountAcks.setDescription('The number of DHCPACK (option 53 with value 5) packets sent.') dhcpServDhcpCountNacks = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpCountNacks.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountNacks.setDescription('The number of DHCPNACK (option 53 with value 6) packets sent.') dhcpServDhcpCountDroppedUnknownClient = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpCountDroppedUnknownClient.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountDroppedUnknownClient.setDescription('The number of DHCP packets dropped due to the server not recognizing or not providing service to the client-id and/or hardware address received in the incoming packet.') dhcpServDhcpCountDroppedNotServingSubnet = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpCountDroppedNotServingSubnet.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountDroppedNotServingSubnet.setDescription('The number of DHCP packets dropped due to the server not being configured or not otherwise able to serve addresses on the subnet from which this message was received.') dhcpServBootpStatMinArrivalInterval = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5, 1), DhcpServTimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServBootpStatMinArrivalInterval.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatMinArrivalInterval.setDescription('The minimum amount of time between receiving two BOOTP messages. A message is received at the server when the server is able to begin processing the message. This typically occurs immediately after the message is read into server memory. If no messages have been received, then this object contains a zero value.') dhcpServBootpStatMaxArrivalInterval = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5, 2), DhcpServTimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServBootpStatMaxArrivalInterval.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatMaxArrivalInterval.setDescription('The maximum amount of time between receiving two BOOTP messages. A message is received at the server when the server is able to begin processing the message. This typically occurs immediately after the message is read into server memory. If no messages have been received, then this object contains a zero value.') dhcpServBootpStatLastArrivalTime = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5, 3), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServBootpStatLastArrivalTime.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatLastArrivalTime.setDescription('The number of seconds since the last valid BOOTP message was received by the server. Invalid messages do not cause this value to change. If valid no messages have been received, then this object contains a zero value.') dhcpServBootpStatMinResponseTime = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5, 4), DhcpServTimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServBootpStatMinResponseTime.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatMinResponseTime.setDescription('The smallest time interval measured as the difference between the arrival of a BOOTP message at the server and the successful transmission of the response to that message. A message is received at the server when the server is able to begin processing the message. A message is transmitted after the server has no further use for the message. Note that the operating system may still have the message queued internally. The operating system queue time is not to be considered as part of the response time. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcpServBootpStatMaxResponseTime = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5, 5), DhcpServTimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServBootpStatMaxResponseTime.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatMaxResponseTime.setDescription('The largest time interval measured as the difference between the arrival of a BOOTP message at the server and the successful transmission of the response to that message. A message is received at the server when the server is able to begin processing the message. A message is transmitted after the server has no further use for the message. Note that the operating system may still have the message queued internally. The operating system queue time is not to be considered as part of the response time. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcpServBootpStatSumResponseTime = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5, 6), DhcpServTimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServBootpStatSumResponseTime.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatSumResponseTime.setDescription('The sum of the response time intervals in milli-seconds where a response time interval is measured as the difference between the arrival of a BOOTP message at the server and the successful transmission of the response to that message. A message is received at the server when the server is able to begin processing the message. A message is transmitted after the server has no further use for the message. Note that the operating system may still have the message queued internally. The operating system queue time is not to be considered as part of the response time. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcpServDhcpStatMinArrivalInterval = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6, 1), DhcpServTimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpStatMinArrivalInterval.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatMinArrivalInterval.setDescription('The minimum amount of time between receiving two DHCP messages. A message is received at the server when the server is able to begin processing the message. This typically occurs immediately after the message is read into server memory. If no messages have been received, then this object contains a zero value.') dhcpServDhcpStatMaxArrivalInterval = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6, 2), DhcpServTimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpStatMaxArrivalInterval.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatMaxArrivalInterval.setDescription('The maximum amount of time between receiving two DHCP messages. A message is received at the server when the server is able to begin processing the message. This typically occurs immediately after the message is read into server memory. If no messages have been received, then this object contains a zero value.') dhcpServDhcpStatLastArrivalTime = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6, 3), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpStatLastArrivalTime.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatLastArrivalTime.setDescription('The number of seconds since the last valid DHCP message was received by the server. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcpServDhcpStatMinResponseTime = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6, 4), DhcpServTimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpStatMinResponseTime.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatMinResponseTime.setDescription('The smallest time interval measured as the difference between the arrival of a DHCP message at the server and the successful transmission of the response to that message. A message is received at the server when the server is able to begin processing the message. A message is transmitted after the server has no further use for the message. Note that the operating system may still have the message queued internally. The operating system queue time is not to be considered as part of the response time. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcpServDhcpStatMaxResponseTime = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6, 5), DhcpServTimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpStatMaxResponseTime.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatMaxResponseTime.setDescription('The largest time interval measured as the difference between the arrival of a DHCP message at the server and the successful transmission of the response to that message. A message is received at the server when the server is able to begin processing the message. A message is transmitted after the server has no further use for the message. Note that the operating system may still have the message queued internally. The operating system queue time is not to be considered as part of the response time. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcpServDhcpStatSumResponseTime = MibScalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6, 6), DhcpServTimeInterval()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServDhcpStatSumResponseTime.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatSumResponseTime.setDescription('The sum of the response time intervals in milli-seconds where a response time interval is measured as the difference between the arrival of a DHCP message at the server and the successful transmission of the response to that message. A message is received at the server when the server is able to begin processing the message. A message is transmitted after the server has no further use for the message. Note that the operating system may still have the message queued internally. The operating system queue time is not to be considered as part of the response time. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcpServRangeTable = MibTable((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2), ) if mibBuilder.loadTexts: dhcpServRangeTable.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeTable.setDescription('A list of ranges that are configured on this server.') dhcpServRangeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1), ).setIndexNames((0, "DHCP-SERVER-MIB", "dhcpServRangeSubnetAddr"), (0, "DHCP-SERVER-MIB", "dhcpServRangeStart")) if mibBuilder.loadTexts: dhcpServRangeEntry.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeEntry.setDescription('A logical row in the serverRangeTable.') dhcpServRangeSubnetAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServRangeSubnetAddr.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeSubnetAddr.setDescription('The IP address defining a subnet') dhcpServRangeSubnetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServRangeSubnetMask.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeSubnetMask.setDescription('The subnet mask (DHCP option 1) provided to any client offered an address from this range.') dhcpServRangeStart = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServRangeStart.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeStart.setDescription('Start of Subnet Address, Index for Conceptual Tabl, Type IP address ') dhcpServRangeEnd = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 4), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServRangeEnd.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeEnd.setDescription('The IP address of the last address in the range. The value of range end must be greater than or equal to the value of range start.') dhcpServRangeInUse = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 5), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServRangeInUse.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeInUse.setDescription('The number of addresses in this range that are currently in use. This number includes those addresses whose lease has not expired and addresses which have been reserved (either by the server or through configuration).') dhcpServRangeOutstandingOffers = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 6), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServRangeOutstandingOffers.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeOutstandingOffers.setDescription('The number of outstanding DHCPOFFER messages for this range is reported with this value. An offer is outstanding if the server has sent a DHCPOFFER message to a client, but has not yet received a DHCPREQUEST message from the client nor has the server-specific timeout (limiting the time in which a client can respond to the offer message) for the offer message expired.') dhcpServRangeUnavailable = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 7), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServRangeUnavailable.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeUnavailable.setDescription(' Dhcp Server IP Addresses unavailable in a Subnet ') dhcpServRangeType = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("manBootp", 1), ("autoBootp", 2), ("manDhcp", 3), ("autoDhcp", 4), ("dynamicDhcp", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServRangeType.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeType.setDescription('Dhcp Server Client Lease Type ') dhcpServRangeUnused = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 9), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServRangeUnused.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeUnused.setDescription('The number of addresses in this range that are currently unused. This number includes those addresses whose lease has not expired and addresses which have been reserved (either by the server or through configuration).') dhcpServFailoverTable = MibTable((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8, 1), ) if mibBuilder.loadTexts: dhcpServFailoverTable.setStatus('current') if mibBuilder.loadTexts: dhcpServFailoverTable.setDescription('A list of partner server.') dhcpServFailoverEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8, 1, 1), ).setIndexNames((0, "DHCP-SERVER-MIB", "dhcpServFailoverPartnerAddr")) if mibBuilder.loadTexts: dhcpServFailoverEntry.setStatus('current') if mibBuilder.loadTexts: dhcpServFailoverEntry.setDescription('A logical row in the serverFailoverTable.') dhcpServFailoverPartnerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8, 1, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServFailoverPartnerAddr.setStatus('current') if mibBuilder.loadTexts: dhcpServFailoverPartnerAddr.setDescription('The IP address defining a partner server') dhcpServFailoverPartnerType = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("primary", 1), ("failover", 2), ("unconfigured", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServFailoverPartnerType.setStatus('current') if mibBuilder.loadTexts: dhcpServFailoverPartnerType.setDescription('Dhcp Server Failover server type ') dhcpServFailoverPartnerStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("unknown", 0), ("syncing", 1), ("active", 2), ("inactive", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServFailoverPartnerStatus.setStatus('current') if mibBuilder.loadTexts: dhcpServFailoverPartnerStatus.setDescription('Dhcp Server Partner status ') dhcpServFailoverPartnerPolltime = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dhcpServFailoverPartnerPolltime.setStatus('current') if mibBuilder.loadTexts: dhcpServFailoverPartnerPolltime.setDescription('The last time there was a successfull communication with the partner server. This value is local time in seconds since some epoch.') ipspgDhcpTrapTable = MibTable((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1), ) if mibBuilder.loadTexts: ipspgDhcpTrapTable.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrapTable.setDescription("The agent's table of IPSPG alarm information.") ipspgDhcpTrapEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1), ).setIndexNames((0, "DHCP-SERVER-MIB", "ipspgDhcpTrIndex")) if mibBuilder.loadTexts: ipspgDhcpTrapEntry.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrapEntry.setDescription('Information about the last alarm trap generated by the agent.') ipspgDhcpTrIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 31))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipspgDhcpTrIndex.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrIndex.setDescription('Index into the IPSPG Alarm traps') ipspgDhcpTrSequence = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipspgDhcpTrSequence.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrSequence.setDescription('Counter of the number of IPSPG alarm traps since the agent was last initialized') ipspgDhcpTrId = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 3))).clone(namedValues=NamedValues(("monitor", 1), ("analyzer", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipspgDhcpTrId.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrId.setDescription('The application which generated this IPSPG alarm.') ipspgDhcpTrText = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipspgDhcpTrText.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrText.setDescription('An ASCII string describing the IPSPG alarm condition/cause.') ipspgDhcpTrPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("inform", 1), ("warning", 2), ("minor", 3), ("major", 4), ("critical", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipspgDhcpTrPriority.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrPriority.setDescription('The priority level as set on the agent for this Calss and Type of trap.') ipspgDhcpTrClass = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipspgDhcpTrClass.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrClass.setDescription('The Class number of the described IPSPG alarm.') ipspgDhcpTrType = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipspgDhcpTrType.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrType.setDescription('The type number of the described IPSPG alarm.') ipspgDhcpTrTime = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipspgDhcpTrTime.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrTime.setDescription('The time that the condition or event occurred which caused generation of this alarm. This value is given in seconds since 00:00:00 Greenwich mean time (GMT) January 1, 1970.') ipspgDhcpTrSuspect = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipspgDhcpTrSuspect.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrSuspect.setDescription('An ASCII string describing the host which caused the IPSPG alarm.') ipspgDhcpTrDiagId = MibTableColumn((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipspgDhcpTrDiagId.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrDiagId.setDescription('An integer describing the diagnosis which triggered this IPSPG alarm.') dhcpServerStarted = NotificationType((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 1)).setObjects(("DHCP-SERVER-MIB", "ipspgDhcpTrSequence"), ("DHCP-SERVER-MIB", "ipspgDhcpTrId"), ("DHCP-SERVER-MIB", "ipspgDhcpTrText"), ("DHCP-SERVER-MIB", "ipspgDhcpTrPriority"), ("DHCP-SERVER-MIB", "ipspgDhcpTrClass"), ("DHCP-SERVER-MIB", "ipspgDhcpTrType"), ("DHCP-SERVER-MIB", "ipspgDhcpTrTime"), ("DHCP-SERVER-MIB", "ipspgDhcpTrSuspect"), ("DHCP-SERVER-MIB", "ipspgDhcpTrDiagId")) if mibBuilder.loadTexts: dhcpServerStarted.setStatus('current') if mibBuilder.loadTexts: dhcpServerStarted.setDescription('The monitor has determined that the DHCP server has been started.') dhcpServerStopped = NotificationType((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 2)).setObjects(("DHCP-SERVER-MIB", "ipspgDhcpTrSequence"), ("DHCP-SERVER-MIB", "ipspgDhcpTrId"), ("DHCP-SERVER-MIB", "ipspgDhcpTrText"), ("DHCP-SERVER-MIB", "ipspgDhcpTrPriority"), ("DHCP-SERVER-MIB", "ipspgDhcpTrClass"), ("DHCP-SERVER-MIB", "ipspgDhcpTrType"), ("DHCP-SERVER-MIB", "ipspgDhcpTrTime"), ("DHCP-SERVER-MIB", "ipspgDhcpTrSuspect"), ("DHCP-SERVER-MIB", "ipspgDhcpTrDiagId")) if mibBuilder.loadTexts: dhcpServerStopped.setStatus('current') if mibBuilder.loadTexts: dhcpServerStopped.setDescription('The monitor has determined that the DHCP server has been stopped.') dhcpServerReload = NotificationType((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 3)).setObjects(("DHCP-SERVER-MIB", "ipspgDhcpTrSequence"), ("DHCP-SERVER-MIB", "ipspgDhcpTrId"), ("DHCP-SERVER-MIB", "ipspgDhcpTrText"), ("DHCP-SERVER-MIB", "ipspgDhcpTrPriority"), ("DHCP-SERVER-MIB", "ipspgDhcpTrClass"), ("DHCP-SERVER-MIB", "ipspgDhcpTrType"), ("DHCP-SERVER-MIB", "ipspgDhcpTrTime"), ("DHCP-SERVER-MIB", "ipspgDhcpTrSuspect"), ("DHCP-SERVER-MIB", "ipspgDhcpTrDiagId")) if mibBuilder.loadTexts: dhcpServerReload.setStatus('current') if mibBuilder.loadTexts: dhcpServerReload.setDescription('The monitor has determined that the DHCP server has been reloaded.') dhcpServerSubnetDepleted = NotificationType((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 4)).setObjects(("DHCP-SERVER-MIB", "ipspgDhcpTrSequence"), ("DHCP-SERVER-MIB", "ipspgDhcpTrId"), ("DHCP-SERVER-MIB", "ipspgDhcpTrText"), ("DHCP-SERVER-MIB", "ipspgDhcpTrPriority"), ("DHCP-SERVER-MIB", "ipspgDhcpTrClass"), ("DHCP-SERVER-MIB", "ipspgDhcpTrType"), ("DHCP-SERVER-MIB", "ipspgDhcpTrTime"), ("DHCP-SERVER-MIB", "ipspgDhcpTrSuspect"), ("DHCP-SERVER-MIB", "ipspgDhcpTrDiagId")) if mibBuilder.loadTexts: dhcpServerSubnetDepleted.setStatus('current') if mibBuilder.loadTexts: dhcpServerSubnetDepleted.setDescription('The monitor has determined that the DHCP server has run out of addresses in a subnet.') dhcpServerBadPacket = NotificationType((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 5)).setObjects(("DHCP-SERVER-MIB", "ipspgDhcpTrSequence"), ("DHCP-SERVER-MIB", "ipspgDhcpTrId"), ("DHCP-SERVER-MIB", "ipspgDhcpTrText"), ("DHCP-SERVER-MIB", "ipspgDhcpTrPriority"), ("DHCP-SERVER-MIB", "ipspgDhcpTrClass"), ("DHCP-SERVER-MIB", "ipspgDhcpTrType"), ("DHCP-SERVER-MIB", "ipspgDhcpTrTime"), ("DHCP-SERVER-MIB", "ipspgDhcpTrSuspect"), ("DHCP-SERVER-MIB", "ipspgDhcpTrDiagId")) if mibBuilder.loadTexts: dhcpServerBadPacket.setStatus('current') if mibBuilder.loadTexts: dhcpServerBadPacket.setDescription('The monitor has determined that the DHCP server has received a bad DHCP or Bootp packet.') dhcpServerFailoverActive = NotificationType((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 6)).setObjects(("DHCP-SERVER-MIB", "ipspgDhcpTrSequence"), ("DHCP-SERVER-MIB", "ipspgDhcpTrId"), ("DHCP-SERVER-MIB", "ipspgDhcpTrText"), ("DHCP-SERVER-MIB", "ipspgDhcpTrPriority"), ("DHCP-SERVER-MIB", "ipspgDhcpTrClass"), ("DHCP-SERVER-MIB", "ipspgDhcpTrType"), ("DHCP-SERVER-MIB", "ipspgDhcpTrTime"), ("DHCP-SERVER-MIB", "ipspgDhcpTrSuspect"), ("DHCP-SERVER-MIB", "ipspgDhcpTrDiagId")) if mibBuilder.loadTexts: dhcpServerFailoverActive.setStatus('current') if mibBuilder.loadTexts: dhcpServerFailoverActive.setDescription('This trap is issued by the secondary server. It indicates a primary partner server is down and its scopes are now being served by this failover server.') dhcpServerFailoverReturnedControl = NotificationType((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 7)).setObjects(("DHCP-SERVER-MIB", "ipspgDhcpTrSequence"), ("DHCP-SERVER-MIB", "ipspgDhcpTrId"), ("DHCP-SERVER-MIB", "ipspgDhcpTrText"), ("DHCP-SERVER-MIB", "ipspgDhcpTrPriority"), ("DHCP-SERVER-MIB", "ipspgDhcpTrClass"), ("DHCP-SERVER-MIB", "ipspgDhcpTrType"), ("DHCP-SERVER-MIB", "ipspgDhcpTrTime"), ("DHCP-SERVER-MIB", "ipspgDhcpTrSuspect"), ("DHCP-SERVER-MIB", "ipspgDhcpTrDiagId")) if mibBuilder.loadTexts: dhcpServerFailoverReturnedControl.setStatus('current') if mibBuilder.loadTexts: dhcpServerFailoverReturnedControl.setDescription('This trap is issued by the secondary server. It indicates that the failover server has returned control to its primary partner.') dhcpServerSubnetThresholdExceeded = NotificationType((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 8)).setObjects(("DHCP-SERVER-MIB", "ipspgDhcpTrSequence"), ("DHCP-SERVER-MIB", "ipspgDhcpTrId"), ("DHCP-SERVER-MIB", "ipspgDhcpTrText"), ("DHCP-SERVER-MIB", "ipspgDhcpTrPriority"), ("DHCP-SERVER-MIB", "ipspgDhcpTrClass"), ("DHCP-SERVER-MIB", "ipspgDhcpTrType"), ("DHCP-SERVER-MIB", "ipspgDhcpTrTime"), ("DHCP-SERVER-MIB", "ipspgDhcpTrSuspect"), ("DHCP-SERVER-MIB", "ipspgDhcpTrDiagId")) if mibBuilder.loadTexts: dhcpServerSubnetThresholdExceeded.setStatus('current') if mibBuilder.loadTexts: dhcpServerSubnetThresholdExceeded.setDescription('This trap is issued when subnet threshold is exceeded.') dhcpServerSubnetThresholdDescent = NotificationType((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 9)).setObjects(("DHCP-SERVER-MIB", "ipspgDhcpTrSequence"), ("DHCP-SERVER-MIB", "ipspgDhcpTrId"), ("DHCP-SERVER-MIB", "ipspgDhcpTrText"), ("DHCP-SERVER-MIB", "ipspgDhcpTrPriority"), ("DHCP-SERVER-MIB", "ipspgDhcpTrClass"), ("DHCP-SERVER-MIB", "ipspgDhcpTrType"), ("DHCP-SERVER-MIB", "ipspgDhcpTrTime"), ("DHCP-SERVER-MIB", "ipspgDhcpTrSuspect"), ("DHCP-SERVER-MIB", "ipspgDhcpTrDiagId")) if mibBuilder.loadTexts: dhcpServerSubnetThresholdDescent.setStatus('current') if mibBuilder.loadTexts: dhcpServerSubnetThresholdDescent.setDescription('This trap is issued when subnet unavailable lease percentage falls below the descent threshold value.') dhcpServerDropUnknownClient = NotificationType((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 10)).setObjects(("DHCP-SERVER-MIB", "ipspgDhcpTrSequence"), ("DHCP-SERVER-MIB", "ipspgDhcpTrId"), ("DHCP-SERVER-MIB", "ipspgDhcpTrText"), ("DHCP-SERVER-MIB", "ipspgDhcpTrPriority"), ("DHCP-SERVER-MIB", "ipspgDhcpTrClass"), ("DHCP-SERVER-MIB", "ipspgDhcpTrType"), ("DHCP-SERVER-MIB", "ipspgDhcpTrTime"), ("DHCP-SERVER-MIB", "ipspgDhcpTrSuspect"), ("DHCP-SERVER-MIB", "ipspgDhcpTrDiagId")) if mibBuilder.loadTexts: dhcpServerDropUnknownClient.setStatus('current') if mibBuilder.loadTexts: dhcpServerDropUnknownClient.setDescription('This trap is issued when the server drops a client message because the client MAC address is either in a MAC exclusion pool or is not in an inclusion pool.') dhcpServerPingResponseReceived = NotificationType((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 11)).setObjects(("DHCP-SERVER-MIB", "ipspgDhcpTrSequence"), ("DHCP-SERVER-MIB", "ipspgDhcpTrId"), ("DHCP-SERVER-MIB", "ipspgDhcpTrText"), ("DHCP-SERVER-MIB", "ipspgDhcpTrPriority"), ("DHCP-SERVER-MIB", "ipspgDhcpTrClass"), ("DHCP-SERVER-MIB", "ipspgDhcpTrType"), ("DHCP-SERVER-MIB", "ipspgDhcpTrTime"), ("DHCP-SERVER-MIB", "ipspgDhcpTrSuspect"), ("DHCP-SERVER-MIB", "ipspgDhcpTrDiagId")) if mibBuilder.loadTexts: dhcpServerPingResponseReceived.setStatus('current') if mibBuilder.loadTexts: dhcpServerPingResponseReceived.setDescription('This trap is issued when the server receives a ping response.') mibBuilder.exportSymbols("DHCP-SERVER-MIB", dhcpServDhcpStatMaxArrivalInterval=dhcpServDhcpStatMaxArrivalInterval, dhcpServDhcpStatMinResponseTime=dhcpServDhcpStatMinResponseTime, dhcpServDhcpStatMaxResponseTime=dhcpServDhcpStatMaxResponseTime, dhcpServDhcpStatistics=dhcpServDhcpStatistics, dhcpServDhcpCountDeclines=dhcpServDhcpCountDeclines, dhcpServBootpCounters=dhcpServBootpCounters, dhcpServBootpCountInvalids=dhcpServBootpCountInvalids, dhcpServBootpStatMaxResponseTime=dhcpServBootpStatMaxResponseTime, ipspgDhcpTrText=ipspgDhcpTrText, dhcpServFailover=dhcpServFailover, dhcpServSystem=dhcpServSystem, dhcpServMibTraps=dhcpServMibTraps, DhcpServTimeInterval=DhcpServTimeInterval, PYSNMP_MODULE_ID=dhcpServMib, dhcpServDhcpStatMinArrivalInterval=dhcpServDhcpStatMinArrivalInterval, ipspgDhcpTrClass=ipspgDhcpTrClass, dhcpServMib=dhcpServMib, dhcpServBootpStatMaxArrivalInterval=dhcpServBootpStatMaxArrivalInterval, dhcpServRangeEntry=dhcpServRangeEntry, dhcpServRangeInUse=dhcpServRangeInUse, dhcpServDhcpCountDiscovers=dhcpServDhcpCountDiscovers, dhcpServBootpCountDroppedUnknownClients=dhcpServBootpCountDroppedUnknownClients, dhcpServBootpCountReplies=dhcpServBootpCountReplies, ipspgDhcpTrPriority=ipspgDhcpTrPriority, dhcpServerFailoverReturnedControl=dhcpServerFailoverReturnedControl, dhcpServDhcpCountAcks=dhcpServDhcpCountAcks, ipspgDhcpTrTime=ipspgDhcpTrTime, dhcpServFailoverPartnerType=dhcpServFailoverPartnerType, dhcpServConfiguration=dhcpServConfiguration, dhcpServRangeEnd=dhcpServRangeEnd, dhcpServCountUsedSubnets=dhcpServCountUsedSubnets, dhcpServerStarted=dhcpServerStarted, ipspgDhcpTrSuspect=ipspgDhcpTrSuspect, dhcpServBootpCountDroppedNotServingSubnet=dhcpServBootpCountDroppedNotServingSubnet, dhcpServDhcpCountReleases=dhcpServDhcpCountReleases, ipspgDhcpTrapEntry=ipspgDhcpTrapEntry, dhcpServDhcpCountDroppedUnknownClient=dhcpServDhcpCountDroppedUnknownClient, dhcpServRangeOutstandingOffers=dhcpServRangeOutstandingOffers, dhcpServDhcpCountNacks=dhcpServDhcpCountNacks, dhcpServerDropUnknownClient=dhcpServerDropUnknownClient, lucent=lucent, mibs=mibs, ipspgDhcpTrapTable=ipspgDhcpTrapTable, dhcpServRangeUnavailable=dhcpServRangeUnavailable, dhcpServerReload=dhcpServerReload, dhcpServRangeUnused=dhcpServRangeUnused, dhcpServCountFullSubnets=dhcpServCountFullSubnets, dhcpServRangeSubnetMask=dhcpServRangeSubnetMask, dhcpServDhcpCountDroppedNotServingSubnet=dhcpServDhcpCountDroppedNotServingSubnet, dhcpServRangeType=dhcpServRangeType, dhcpServRangeTable=dhcpServRangeTable, dhcpServSystemDescr=dhcpServSystemDescr, ipspgDhcpTrSequence=ipspgDhcpTrSequence, dhcpServerFailoverActive=dhcpServerFailoverActive, dhcpServerStopped=dhcpServerStopped, ipspgTrap=ipspgTrap, ipspgDhcpTrId=ipspgDhcpTrId, dhcpServerBadPacket=dhcpServerBadPacket, ipspgServices=ipspgServices, ipspgDhcpTrType=ipspgDhcpTrType, dhcpServDhcpCountRequests=dhcpServDhcpCountRequests, dhcpServDhcpCountInforms=dhcpServDhcpCountInforms, dhcpServDhcpCountOffers=dhcpServDhcpCountOffers, products=products, dhcpServerSubnetThresholdExceeded=dhcpServerSubnetThresholdExceeded, ipspgDhcpTrIndex=ipspgDhcpTrIndex, dhcpServerPingResponseReceived=dhcpServerPingResponseReceived, dhcpServRangeStart=dhcpServRangeStart, dhcpServSubnetCounters=dhcpServSubnetCounters, dhcpServFailoverPartnerAddr=dhcpServFailoverPartnerAddr, dhcpServDhcpStatLastArrivalTime=dhcpServDhcpStatLastArrivalTime, ipspgDNS=ipspgDNS, dhcpServerSubnetDepleted=dhcpServerSubnetDepleted, ipspg=ipspg, dhcpServBootpCountRequests=dhcpServBootpCountRequests, dhcpServFailoverPartnerPolltime=dhcpServFailoverPartnerPolltime, dhcpServDhcpStatSumResponseTime=dhcpServDhcpStatSumResponseTime, dhcpServSystemUpTime=dhcpServSystemUpTime, dhcpServBootpStatMinResponseTime=dhcpServBootpStatMinResponseTime, dhcpServBootpStatSumResponseTime=dhcpServBootpStatSumResponseTime, dhcpServFailoverEntry=dhcpServFailoverEntry, ipspgDhcpTrDiagId=ipspgDhcpTrDiagId, ipspgDHCP=ipspgDHCP, dhcpServCountUnusedSubnets=dhcpServCountUnusedSubnets, dhcpServFailoverPartnerStatus=dhcpServFailoverPartnerStatus, dhcpServMibObjects=dhcpServMibObjects, dhcpServDhcpCounters=dhcpServDhcpCounters, dhcpServerSubnetThresholdDescent=dhcpServerSubnetThresholdDescent, dhcpServBootpStatMinArrivalInterval=dhcpServBootpStatMinArrivalInterval, dhcpServSystemResetTime=dhcpServSystemResetTime, dhcpServFailoverTable=dhcpServFailoverTable, dhcpServBootpStatistics=dhcpServBootpStatistics, dhcpServDhcpCountInvalids=dhcpServDhcpCountInvalids, dhcpServSystemStatus=dhcpServSystemStatus, dhcpServBootpStatLastArrivalTime=dhcpServBootpStatLastArrivalTime, dhcpServRangeSubnetAddr=dhcpServRangeSubnetAddr)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_range_constraint, constraints_union, value_size_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsUnion', 'ValueSizeConstraint', 'ConstraintsIntersection') (notification_group, module_compliance, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance', 'ObjectGroup') (integer32, counter64, iso, bits, unsigned32, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, object_identity, counter32, gauge32, mib_identifier, time_ticks, enterprises, module_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'Counter64', 'iso', 'Bits', 'Unsigned32', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'ObjectIdentity', 'Counter32', 'Gauge32', 'MibIdentifier', 'TimeTicks', 'enterprises', 'ModuleIdentity') (row_status, truth_value, textual_convention, display_string, date_and_time) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'TruthValue', 'TextualConvention', 'DisplayString', 'DateAndTime') lucent = mib_identifier((1, 3, 6, 1, 4, 1, 1751)) products = mib_identifier((1, 3, 6, 1, 4, 1, 1751, 1)) mibs = mib_identifier((1, 3, 6, 1, 4, 1, 1751, 2)) ipspg = mib_identifier((1, 3, 6, 1, 4, 1, 1751, 1, 48)) ipspg_services = mib_identifier((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1)) ipspg_dhcp = mib_identifier((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1)) ipspg_dns = mib_identifier((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 2)) ipspg_trap = mib_identifier((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2)) dhcp_serv_mib = module_identity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1)) if mibBuilder.loadTexts: dhcpServMib.setLastUpdated('0606220830Z') if mibBuilder.loadTexts: dhcpServMib.setOrganization('Lucent Technologies') if mibBuilder.loadTexts: dhcpServMib.setContactInfo(' James Offutt Postal: Lucent Technologies 400 Lapp Road Malvern, PA 19355 USA Tel: +1 610-722-7900 Fax: +1 610-725-8559') if mibBuilder.loadTexts: dhcpServMib.setDescription('The Vendor Specific MIB module for entities implementing the server side of the Bootstrap Protocol (BOOTP) and the Dynamic Host Configuration protocol (DHCP) for Internet Protocol version 4 (IPv4).') dhcp_serv_mib_traps = object_identity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0)) if mibBuilder.loadTexts: dhcpServMibTraps.setStatus('current') if mibBuilder.loadTexts: dhcpServMibTraps.setDescription('DHCP Server MIB traps.') dhcp_serv_mib_objects = object_identity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1)) if mibBuilder.loadTexts: dhcpServMibObjects.setStatus('current') if mibBuilder.loadTexts: dhcpServMibObjects.setDescription('DHCP Server MIB objects are all defined in this branch.') dhcp_serv_system = object_identity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 1)) if mibBuilder.loadTexts: dhcpServSystem.setStatus('current') if mibBuilder.loadTexts: dhcpServSystem.setDescription('Group of objects that are related to the overall system.') dhcp_serv_subnet_counters = object_identity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 2)) if mibBuilder.loadTexts: dhcpServSubnetCounters.setStatus('current') if mibBuilder.loadTexts: dhcpServSubnetCounters.setDescription('Group of objects that count various subnet data values') dhcp_serv_bootp_counters = object_identity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 3)) if mibBuilder.loadTexts: dhcpServBootpCounters.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpCounters.setDescription('Group of objects that count various BOOTP events.') dhcp_serv_dhcp_counters = object_identity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4)) if mibBuilder.loadTexts: dhcpServDhcpCounters.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCounters.setDescription('Group of objects that count various DHCP Statistics.') dhcp_serv_bootp_statistics = object_identity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5)) if mibBuilder.loadTexts: dhcpServBootpStatistics.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatistics.setDescription('Group of objects that measure various BOOTP statistics.') dhcp_serv_dhcp_statistics = object_identity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6)) if mibBuilder.loadTexts: dhcpServDhcpStatistics.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatistics.setDescription('Group of objects that measure various DHCP statistics.') dhcp_serv_configuration = object_identity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7)) if mibBuilder.loadTexts: dhcpServConfiguration.setStatus('current') if mibBuilder.loadTexts: dhcpServConfiguration.setDescription('Objects that contain pre-configured and Dynamic Config. Info.') dhcp_serv_failover = object_identity((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8)) if mibBuilder.loadTexts: dhcpServFailover.setStatus('current') if mibBuilder.loadTexts: dhcpServFailover.setDescription('Objects that contain partner server info.') class Dhcpservtimeinterval(TextualConvention, Gauge32): description = 'The number of milli-seconds that has elapsed since some epoch. Systems that cannot measure events to the milli-second resolution SHOULD round this value to the next available resolution that the system supports.' status = 'current' dhcp_serv_system_descr = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServSystemDescr.setStatus('current') if mibBuilder.loadTexts: dhcpServSystemDescr.setDescription('A textual description of the server. This value should include the full name and version identification of the server. This string MUST contain only printable NVT ASCII characters.') dhcp_serv_system_status = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3, 4))).clone(namedValues=named_values(('starting', 0), ('running', 1), ('stopping', 2), ('stopped', 3), ('reload', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServSystemStatus.setStatus('current') if mibBuilder.loadTexts: dhcpServSystemStatus.setDescription(' Dhcp System Server Status ') dhcp_serv_system_up_time = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServSystemUpTime.setStatus('current') if mibBuilder.loadTexts: dhcpServSystemUpTime.setDescription('If the server has a persistent state (e.g., a process), this value will be the seconds elapsed since it started. For software without persistant state, this value will be zero.') dhcp_serv_system_reset_time = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServSystemResetTime.setStatus('current') if mibBuilder.loadTexts: dhcpServSystemResetTime.setDescription("If the server has a persistent state (e.g., a process) and supports a `reset' operation (e.g., can be told to re-read configuration files), this value will be the seconds elapsed since the last time the name server was `reset.' For software that does not have persistence or does not support a `reset' operation, this value will be zero.") dhcp_serv_count_used_subnets = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 2, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServCountUsedSubnets.setStatus('current') if mibBuilder.loadTexts: dhcpServCountUsedSubnets.setDescription('The number subnets managed by the server (i.e. configured), from which the server has issued at least one lease.') dhcp_serv_count_unused_subnets = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 2, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServCountUnusedSubnets.setStatus('current') if mibBuilder.loadTexts: dhcpServCountUnusedSubnets.setDescription('The number subnets managed by the server (i.e. configured), from which the server has issued no leases.') dhcp_serv_count_full_subnets = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 2, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServCountFullSubnets.setStatus('current') if mibBuilder.loadTexts: dhcpServCountFullSubnets.setDescription('The number subnets managed by the server (i.e. configured), in which the address pools have been exhausted.') dhcp_serv_bootp_count_requests = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 3, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServBootpCountRequests.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpCountRequests.setDescription('The number of packets received that contain a Message Type of 1 (BOOTREQUEST) in the first octet and do not contain option number 53 (DHCP Message Type) in the options.') dhcp_serv_bootp_count_invalids = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 3, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServBootpCountInvalids.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpCountInvalids.setDescription('The number of packets received that do not contain a Message Type of 1 (BOOTREQUEST) in the first octet or are not valid BOOTP packets (e.g.: too short, invalid field in packet header).') dhcp_serv_bootp_count_replies = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 3, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServBootpCountReplies.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpCountReplies.setDescription('The number of packets sent that contain a Message Type of 1 (BOOTREQUEST) in the first octet and do not contain option number 53 (DHCP Message Type) in the options.') dhcp_serv_bootp_count_dropped_unknown_clients = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 3, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServBootpCountDroppedUnknownClients.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpCountDroppedUnknownClients.setDescription('The number of BOOTP packets dropped due to the server not recognizing or not providing service to the hardware address received in the incoming packet.') dhcp_serv_bootp_count_dropped_not_serving_subnet = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 3, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServBootpCountDroppedNotServingSubnet.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpCountDroppedNotServingSubnet.setDescription('The number of BOOTP packets dropped due to the server not being configured or not otherwise able to serve addresses on the subnet from which this message was received.') dhcp_serv_dhcp_count_discovers = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpCountDiscovers.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountDiscovers.setDescription('The number of DHCPDISCOVER (option 53 with value 1) packets received.') dhcp_serv_dhcp_count_requests = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpCountRequests.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountRequests.setDescription('The number of DHCPREQUEST (option 53 with value 3) packets received.') dhcp_serv_dhcp_count_releases = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpCountReleases.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountReleases.setDescription('The number of DHCPRELEASE (option 53 with value 7) packets received.') dhcp_serv_dhcp_count_declines = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpCountDeclines.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountDeclines.setDescription('The number of DHCPDECLINE (option 53 with value 4) packets received.') dhcp_serv_dhcp_count_informs = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpCountInforms.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountInforms.setDescription('The number of DHCPINFORM (option 53 with value 8) packets received.') dhcp_serv_dhcp_count_invalids = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 6), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpCountInvalids.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountInvalids.setDescription('The number of DHCP packets received whose DHCP message type (i.e.: option number 53) is not understood or handled by the server.') dhcp_serv_dhcp_count_offers = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpCountOffers.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountOffers.setDescription('The number of DHCPOFFER (option 53 with value 2) packets sent.') dhcp_serv_dhcp_count_acks = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpCountAcks.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountAcks.setDescription('The number of DHCPACK (option 53 with value 5) packets sent.') dhcp_serv_dhcp_count_nacks = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 9), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpCountNacks.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountNacks.setDescription('The number of DHCPNACK (option 53 with value 6) packets sent.') dhcp_serv_dhcp_count_dropped_unknown_client = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 10), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpCountDroppedUnknownClient.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountDroppedUnknownClient.setDescription('The number of DHCP packets dropped due to the server not recognizing or not providing service to the client-id and/or hardware address received in the incoming packet.') dhcp_serv_dhcp_count_dropped_not_serving_subnet = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 4, 11), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpCountDroppedNotServingSubnet.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpCountDroppedNotServingSubnet.setDescription('The number of DHCP packets dropped due to the server not being configured or not otherwise able to serve addresses on the subnet from which this message was received.') dhcp_serv_bootp_stat_min_arrival_interval = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5, 1), dhcp_serv_time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServBootpStatMinArrivalInterval.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatMinArrivalInterval.setDescription('The minimum amount of time between receiving two BOOTP messages. A message is received at the server when the server is able to begin processing the message. This typically occurs immediately after the message is read into server memory. If no messages have been received, then this object contains a zero value.') dhcp_serv_bootp_stat_max_arrival_interval = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5, 2), dhcp_serv_time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServBootpStatMaxArrivalInterval.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatMaxArrivalInterval.setDescription('The maximum amount of time between receiving two BOOTP messages. A message is received at the server when the server is able to begin processing the message. This typically occurs immediately after the message is read into server memory. If no messages have been received, then this object contains a zero value.') dhcp_serv_bootp_stat_last_arrival_time = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5, 3), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServBootpStatLastArrivalTime.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatLastArrivalTime.setDescription('The number of seconds since the last valid BOOTP message was received by the server. Invalid messages do not cause this value to change. If valid no messages have been received, then this object contains a zero value.') dhcp_serv_bootp_stat_min_response_time = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5, 4), dhcp_serv_time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServBootpStatMinResponseTime.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatMinResponseTime.setDescription('The smallest time interval measured as the difference between the arrival of a BOOTP message at the server and the successful transmission of the response to that message. A message is received at the server when the server is able to begin processing the message. A message is transmitted after the server has no further use for the message. Note that the operating system may still have the message queued internally. The operating system queue time is not to be considered as part of the response time. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcp_serv_bootp_stat_max_response_time = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5, 5), dhcp_serv_time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServBootpStatMaxResponseTime.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatMaxResponseTime.setDescription('The largest time interval measured as the difference between the arrival of a BOOTP message at the server and the successful transmission of the response to that message. A message is received at the server when the server is able to begin processing the message. A message is transmitted after the server has no further use for the message. Note that the operating system may still have the message queued internally. The operating system queue time is not to be considered as part of the response time. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcp_serv_bootp_stat_sum_response_time = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 5, 6), dhcp_serv_time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServBootpStatSumResponseTime.setStatus('current') if mibBuilder.loadTexts: dhcpServBootpStatSumResponseTime.setDescription('The sum of the response time intervals in milli-seconds where a response time interval is measured as the difference between the arrival of a BOOTP message at the server and the successful transmission of the response to that message. A message is received at the server when the server is able to begin processing the message. A message is transmitted after the server has no further use for the message. Note that the operating system may still have the message queued internally. The operating system queue time is not to be considered as part of the response time. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcp_serv_dhcp_stat_min_arrival_interval = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6, 1), dhcp_serv_time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpStatMinArrivalInterval.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatMinArrivalInterval.setDescription('The minimum amount of time between receiving two DHCP messages. A message is received at the server when the server is able to begin processing the message. This typically occurs immediately after the message is read into server memory. If no messages have been received, then this object contains a zero value.') dhcp_serv_dhcp_stat_max_arrival_interval = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6, 2), dhcp_serv_time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpStatMaxArrivalInterval.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatMaxArrivalInterval.setDescription('The maximum amount of time between receiving two DHCP messages. A message is received at the server when the server is able to begin processing the message. This typically occurs immediately after the message is read into server memory. If no messages have been received, then this object contains a zero value.') dhcp_serv_dhcp_stat_last_arrival_time = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6, 3), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpStatLastArrivalTime.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatLastArrivalTime.setDescription('The number of seconds since the last valid DHCP message was received by the server. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcp_serv_dhcp_stat_min_response_time = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6, 4), dhcp_serv_time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpStatMinResponseTime.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatMinResponseTime.setDescription('The smallest time interval measured as the difference between the arrival of a DHCP message at the server and the successful transmission of the response to that message. A message is received at the server when the server is able to begin processing the message. A message is transmitted after the server has no further use for the message. Note that the operating system may still have the message queued internally. The operating system queue time is not to be considered as part of the response time. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcp_serv_dhcp_stat_max_response_time = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6, 5), dhcp_serv_time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpStatMaxResponseTime.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatMaxResponseTime.setDescription('The largest time interval measured as the difference between the arrival of a DHCP message at the server and the successful transmission of the response to that message. A message is received at the server when the server is able to begin processing the message. A message is transmitted after the server has no further use for the message. Note that the operating system may still have the message queued internally. The operating system queue time is not to be considered as part of the response time. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcp_serv_dhcp_stat_sum_response_time = mib_scalar((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 6, 6), dhcp_serv_time_interval()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServDhcpStatSumResponseTime.setStatus('current') if mibBuilder.loadTexts: dhcpServDhcpStatSumResponseTime.setDescription('The sum of the response time intervals in milli-seconds where a response time interval is measured as the difference between the arrival of a DHCP message at the server and the successful transmission of the response to that message. A message is received at the server when the server is able to begin processing the message. A message is transmitted after the server has no further use for the message. Note that the operating system may still have the message queued internally. The operating system queue time is not to be considered as part of the response time. Invalid messages do not cause this value to change. If no valid messages have been received, then this object contains a zero value.') dhcp_serv_range_table = mib_table((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2)) if mibBuilder.loadTexts: dhcpServRangeTable.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeTable.setDescription('A list of ranges that are configured on this server.') dhcp_serv_range_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1)).setIndexNames((0, 'DHCP-SERVER-MIB', 'dhcpServRangeSubnetAddr'), (0, 'DHCP-SERVER-MIB', 'dhcpServRangeStart')) if mibBuilder.loadTexts: dhcpServRangeEntry.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeEntry.setDescription('A logical row in the serverRangeTable.') dhcp_serv_range_subnet_addr = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServRangeSubnetAddr.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeSubnetAddr.setDescription('The IP address defining a subnet') dhcp_serv_range_subnet_mask = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServRangeSubnetMask.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeSubnetMask.setDescription('The subnet mask (DHCP option 1) provided to any client offered an address from this range.') dhcp_serv_range_start = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 3), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServRangeStart.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeStart.setDescription('Start of Subnet Address, Index for Conceptual Tabl, Type IP address ') dhcp_serv_range_end = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 4), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServRangeEnd.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeEnd.setDescription('The IP address of the last address in the range. The value of range end must be greater than or equal to the value of range start.') dhcp_serv_range_in_use = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 5), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServRangeInUse.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeInUse.setDescription('The number of addresses in this range that are currently in use. This number includes those addresses whose lease has not expired and addresses which have been reserved (either by the server or through configuration).') dhcp_serv_range_outstanding_offers = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 6), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServRangeOutstandingOffers.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeOutstandingOffers.setDescription('The number of outstanding DHCPOFFER messages for this range is reported with this value. An offer is outstanding if the server has sent a DHCPOFFER message to a client, but has not yet received a DHCPREQUEST message from the client nor has the server-specific timeout (limiting the time in which a client can respond to the offer message) for the offer message expired.') dhcp_serv_range_unavailable = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 7), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServRangeUnavailable.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeUnavailable.setDescription(' Dhcp Server IP Addresses unavailable in a Subnet ') dhcp_serv_range_type = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('manBootp', 1), ('autoBootp', 2), ('manDhcp', 3), ('autoDhcp', 4), ('dynamicDhcp', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServRangeType.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeType.setDescription('Dhcp Server Client Lease Type ') dhcp_serv_range_unused = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 7, 2, 1, 9), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServRangeUnused.setStatus('current') if mibBuilder.loadTexts: dhcpServRangeUnused.setDescription('The number of addresses in this range that are currently unused. This number includes those addresses whose lease has not expired and addresses which have been reserved (either by the server or through configuration).') dhcp_serv_failover_table = mib_table((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8, 1)) if mibBuilder.loadTexts: dhcpServFailoverTable.setStatus('current') if mibBuilder.loadTexts: dhcpServFailoverTable.setDescription('A list of partner server.') dhcp_serv_failover_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8, 1, 1)).setIndexNames((0, 'DHCP-SERVER-MIB', 'dhcpServFailoverPartnerAddr')) if mibBuilder.loadTexts: dhcpServFailoverEntry.setStatus('current') if mibBuilder.loadTexts: dhcpServFailoverEntry.setDescription('A logical row in the serverFailoverTable.') dhcp_serv_failover_partner_addr = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8, 1, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServFailoverPartnerAddr.setStatus('current') if mibBuilder.loadTexts: dhcpServFailoverPartnerAddr.setDescription('The IP address defining a partner server') dhcp_serv_failover_partner_type = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('primary', 1), ('failover', 2), ('unconfigured', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServFailoverPartnerType.setStatus('current') if mibBuilder.loadTexts: dhcpServFailoverPartnerType.setDescription('Dhcp Server Failover server type ') dhcp_serv_failover_partner_status = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('unknown', 0), ('syncing', 1), ('active', 2), ('inactive', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServFailoverPartnerStatus.setStatus('current') if mibBuilder.loadTexts: dhcpServFailoverPartnerStatus.setDescription('Dhcp Server Partner status ') dhcp_serv_failover_partner_polltime = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 1, 8, 1, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dhcpServFailoverPartnerPolltime.setStatus('current') if mibBuilder.loadTexts: dhcpServFailoverPartnerPolltime.setDescription('The last time there was a successfull communication with the partner server. This value is local time in seconds since some epoch.') ipspg_dhcp_trap_table = mib_table((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1)) if mibBuilder.loadTexts: ipspgDhcpTrapTable.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrapTable.setDescription("The agent's table of IPSPG alarm information.") ipspg_dhcp_trap_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1)).setIndexNames((0, 'DHCP-SERVER-MIB', 'ipspgDhcpTrIndex')) if mibBuilder.loadTexts: ipspgDhcpTrapEntry.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrapEntry.setDescription('Information about the last alarm trap generated by the agent.') ipspg_dhcp_tr_index = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 31))).setMaxAccess('readonly') if mibBuilder.loadTexts: ipspgDhcpTrIndex.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrIndex.setDescription('Index into the IPSPG Alarm traps') ipspg_dhcp_tr_sequence = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ipspgDhcpTrSequence.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrSequence.setDescription('Counter of the number of IPSPG alarm traps since the agent was last initialized') ipspg_dhcp_tr_id = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 3))).clone(namedValues=named_values(('monitor', 1), ('analyzer', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ipspgDhcpTrId.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrId.setDescription('The application which generated this IPSPG alarm.') ipspg_dhcp_tr_text = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(0, 80))).setMaxAccess('readonly') if mibBuilder.loadTexts: ipspgDhcpTrText.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrText.setDescription('An ASCII string describing the IPSPG alarm condition/cause.') ipspg_dhcp_tr_priority = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('inform', 1), ('warning', 2), ('minor', 3), ('major', 4), ('critical', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ipspgDhcpTrPriority.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrPriority.setDescription('The priority level as set on the agent for this Calss and Type of trap.') ipspg_dhcp_tr_class = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: ipspgDhcpTrClass.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrClass.setDescription('The Class number of the described IPSPG alarm.') ipspg_dhcp_tr_type = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: ipspgDhcpTrType.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrType.setDescription('The type number of the described IPSPG alarm.') ipspg_dhcp_tr_time = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: ipspgDhcpTrTime.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrTime.setDescription('The time that the condition or event occurred which caused generation of this alarm. This value is given in seconds since 00:00:00 Greenwich mean time (GMT) January 1, 1970.') ipspg_dhcp_tr_suspect = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 9), display_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: ipspgDhcpTrSuspect.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrSuspect.setDescription('An ASCII string describing the host which caused the IPSPG alarm.') ipspg_dhcp_tr_diag_id = mib_table_column((1, 3, 6, 1, 4, 1, 1751, 1, 48, 2, 1, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: ipspgDhcpTrDiagId.setStatus('current') if mibBuilder.loadTexts: ipspgDhcpTrDiagId.setDescription('An integer describing the diagnosis which triggered this IPSPG alarm.') dhcp_server_started = notification_type((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 1)).setObjects(('DHCP-SERVER-MIB', 'ipspgDhcpTrSequence'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrId'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrText'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrPriority'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrClass'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrType'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrTime'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrSuspect'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrDiagId')) if mibBuilder.loadTexts: dhcpServerStarted.setStatus('current') if mibBuilder.loadTexts: dhcpServerStarted.setDescription('The monitor has determined that the DHCP server has been started.') dhcp_server_stopped = notification_type((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 2)).setObjects(('DHCP-SERVER-MIB', 'ipspgDhcpTrSequence'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrId'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrText'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrPriority'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrClass'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrType'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrTime'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrSuspect'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrDiagId')) if mibBuilder.loadTexts: dhcpServerStopped.setStatus('current') if mibBuilder.loadTexts: dhcpServerStopped.setDescription('The monitor has determined that the DHCP server has been stopped.') dhcp_server_reload = notification_type((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 3)).setObjects(('DHCP-SERVER-MIB', 'ipspgDhcpTrSequence'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrId'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrText'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrPriority'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrClass'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrType'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrTime'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrSuspect'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrDiagId')) if mibBuilder.loadTexts: dhcpServerReload.setStatus('current') if mibBuilder.loadTexts: dhcpServerReload.setDescription('The monitor has determined that the DHCP server has been reloaded.') dhcp_server_subnet_depleted = notification_type((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 4)).setObjects(('DHCP-SERVER-MIB', 'ipspgDhcpTrSequence'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrId'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrText'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrPriority'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrClass'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrType'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrTime'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrSuspect'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrDiagId')) if mibBuilder.loadTexts: dhcpServerSubnetDepleted.setStatus('current') if mibBuilder.loadTexts: dhcpServerSubnetDepleted.setDescription('The monitor has determined that the DHCP server has run out of addresses in a subnet.') dhcp_server_bad_packet = notification_type((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 5)).setObjects(('DHCP-SERVER-MIB', 'ipspgDhcpTrSequence'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrId'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrText'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrPriority'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrClass'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrType'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrTime'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrSuspect'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrDiagId')) if mibBuilder.loadTexts: dhcpServerBadPacket.setStatus('current') if mibBuilder.loadTexts: dhcpServerBadPacket.setDescription('The monitor has determined that the DHCP server has received a bad DHCP or Bootp packet.') dhcp_server_failover_active = notification_type((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 6)).setObjects(('DHCP-SERVER-MIB', 'ipspgDhcpTrSequence'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrId'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrText'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrPriority'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrClass'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrType'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrTime'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrSuspect'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrDiagId')) if mibBuilder.loadTexts: dhcpServerFailoverActive.setStatus('current') if mibBuilder.loadTexts: dhcpServerFailoverActive.setDescription('This trap is issued by the secondary server. It indicates a primary partner server is down and its scopes are now being served by this failover server.') dhcp_server_failover_returned_control = notification_type((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 7)).setObjects(('DHCP-SERVER-MIB', 'ipspgDhcpTrSequence'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrId'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrText'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrPriority'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrClass'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrType'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrTime'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrSuspect'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrDiagId')) if mibBuilder.loadTexts: dhcpServerFailoverReturnedControl.setStatus('current') if mibBuilder.loadTexts: dhcpServerFailoverReturnedControl.setDescription('This trap is issued by the secondary server. It indicates that the failover server has returned control to its primary partner.') dhcp_server_subnet_threshold_exceeded = notification_type((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 8)).setObjects(('DHCP-SERVER-MIB', 'ipspgDhcpTrSequence'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrId'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrText'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrPriority'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrClass'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrType'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrTime'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrSuspect'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrDiagId')) if mibBuilder.loadTexts: dhcpServerSubnetThresholdExceeded.setStatus('current') if mibBuilder.loadTexts: dhcpServerSubnetThresholdExceeded.setDescription('This trap is issued when subnet threshold is exceeded.') dhcp_server_subnet_threshold_descent = notification_type((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 9)).setObjects(('DHCP-SERVER-MIB', 'ipspgDhcpTrSequence'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrId'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrText'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrPriority'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrClass'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrType'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrTime'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrSuspect'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrDiagId')) if mibBuilder.loadTexts: dhcpServerSubnetThresholdDescent.setStatus('current') if mibBuilder.loadTexts: dhcpServerSubnetThresholdDescent.setDescription('This trap is issued when subnet unavailable lease percentage falls below the descent threshold value.') dhcp_server_drop_unknown_client = notification_type((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 10)).setObjects(('DHCP-SERVER-MIB', 'ipspgDhcpTrSequence'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrId'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrText'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrPriority'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrClass'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrType'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrTime'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrSuspect'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrDiagId')) if mibBuilder.loadTexts: dhcpServerDropUnknownClient.setStatus('current') if mibBuilder.loadTexts: dhcpServerDropUnknownClient.setDescription('This trap is issued when the server drops a client message because the client MAC address is either in a MAC exclusion pool or is not in an inclusion pool.') dhcp_server_ping_response_received = notification_type((1, 3, 6, 1, 4, 1, 1751, 1, 48, 1, 1, 1, 0, 11)).setObjects(('DHCP-SERVER-MIB', 'ipspgDhcpTrSequence'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrId'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrText'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrPriority'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrClass'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrType'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrTime'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrSuspect'), ('DHCP-SERVER-MIB', 'ipspgDhcpTrDiagId')) if mibBuilder.loadTexts: dhcpServerPingResponseReceived.setStatus('current') if mibBuilder.loadTexts: dhcpServerPingResponseReceived.setDescription('This trap is issued when the server receives a ping response.') mibBuilder.exportSymbols('DHCP-SERVER-MIB', dhcpServDhcpStatMaxArrivalInterval=dhcpServDhcpStatMaxArrivalInterval, dhcpServDhcpStatMinResponseTime=dhcpServDhcpStatMinResponseTime, dhcpServDhcpStatMaxResponseTime=dhcpServDhcpStatMaxResponseTime, dhcpServDhcpStatistics=dhcpServDhcpStatistics, dhcpServDhcpCountDeclines=dhcpServDhcpCountDeclines, dhcpServBootpCounters=dhcpServBootpCounters, dhcpServBootpCountInvalids=dhcpServBootpCountInvalids, dhcpServBootpStatMaxResponseTime=dhcpServBootpStatMaxResponseTime, ipspgDhcpTrText=ipspgDhcpTrText, dhcpServFailover=dhcpServFailover, dhcpServSystem=dhcpServSystem, dhcpServMibTraps=dhcpServMibTraps, DhcpServTimeInterval=DhcpServTimeInterval, PYSNMP_MODULE_ID=dhcpServMib, dhcpServDhcpStatMinArrivalInterval=dhcpServDhcpStatMinArrivalInterval, ipspgDhcpTrClass=ipspgDhcpTrClass, dhcpServMib=dhcpServMib, dhcpServBootpStatMaxArrivalInterval=dhcpServBootpStatMaxArrivalInterval, dhcpServRangeEntry=dhcpServRangeEntry, dhcpServRangeInUse=dhcpServRangeInUse, dhcpServDhcpCountDiscovers=dhcpServDhcpCountDiscovers, dhcpServBootpCountDroppedUnknownClients=dhcpServBootpCountDroppedUnknownClients, dhcpServBootpCountReplies=dhcpServBootpCountReplies, ipspgDhcpTrPriority=ipspgDhcpTrPriority, dhcpServerFailoverReturnedControl=dhcpServerFailoverReturnedControl, dhcpServDhcpCountAcks=dhcpServDhcpCountAcks, ipspgDhcpTrTime=ipspgDhcpTrTime, dhcpServFailoverPartnerType=dhcpServFailoverPartnerType, dhcpServConfiguration=dhcpServConfiguration, dhcpServRangeEnd=dhcpServRangeEnd, dhcpServCountUsedSubnets=dhcpServCountUsedSubnets, dhcpServerStarted=dhcpServerStarted, ipspgDhcpTrSuspect=ipspgDhcpTrSuspect, dhcpServBootpCountDroppedNotServingSubnet=dhcpServBootpCountDroppedNotServingSubnet, dhcpServDhcpCountReleases=dhcpServDhcpCountReleases, ipspgDhcpTrapEntry=ipspgDhcpTrapEntry, dhcpServDhcpCountDroppedUnknownClient=dhcpServDhcpCountDroppedUnknownClient, dhcpServRangeOutstandingOffers=dhcpServRangeOutstandingOffers, dhcpServDhcpCountNacks=dhcpServDhcpCountNacks, dhcpServerDropUnknownClient=dhcpServerDropUnknownClient, lucent=lucent, mibs=mibs, ipspgDhcpTrapTable=ipspgDhcpTrapTable, dhcpServRangeUnavailable=dhcpServRangeUnavailable, dhcpServerReload=dhcpServerReload, dhcpServRangeUnused=dhcpServRangeUnused, dhcpServCountFullSubnets=dhcpServCountFullSubnets, dhcpServRangeSubnetMask=dhcpServRangeSubnetMask, dhcpServDhcpCountDroppedNotServingSubnet=dhcpServDhcpCountDroppedNotServingSubnet, dhcpServRangeType=dhcpServRangeType, dhcpServRangeTable=dhcpServRangeTable, dhcpServSystemDescr=dhcpServSystemDescr, ipspgDhcpTrSequence=ipspgDhcpTrSequence, dhcpServerFailoverActive=dhcpServerFailoverActive, dhcpServerStopped=dhcpServerStopped, ipspgTrap=ipspgTrap, ipspgDhcpTrId=ipspgDhcpTrId, dhcpServerBadPacket=dhcpServerBadPacket, ipspgServices=ipspgServices, ipspgDhcpTrType=ipspgDhcpTrType, dhcpServDhcpCountRequests=dhcpServDhcpCountRequests, dhcpServDhcpCountInforms=dhcpServDhcpCountInforms, dhcpServDhcpCountOffers=dhcpServDhcpCountOffers, products=products, dhcpServerSubnetThresholdExceeded=dhcpServerSubnetThresholdExceeded, ipspgDhcpTrIndex=ipspgDhcpTrIndex, dhcpServerPingResponseReceived=dhcpServerPingResponseReceived, dhcpServRangeStart=dhcpServRangeStart, dhcpServSubnetCounters=dhcpServSubnetCounters, dhcpServFailoverPartnerAddr=dhcpServFailoverPartnerAddr, dhcpServDhcpStatLastArrivalTime=dhcpServDhcpStatLastArrivalTime, ipspgDNS=ipspgDNS, dhcpServerSubnetDepleted=dhcpServerSubnetDepleted, ipspg=ipspg, dhcpServBootpCountRequests=dhcpServBootpCountRequests, dhcpServFailoverPartnerPolltime=dhcpServFailoverPartnerPolltime, dhcpServDhcpStatSumResponseTime=dhcpServDhcpStatSumResponseTime, dhcpServSystemUpTime=dhcpServSystemUpTime, dhcpServBootpStatMinResponseTime=dhcpServBootpStatMinResponseTime, dhcpServBootpStatSumResponseTime=dhcpServBootpStatSumResponseTime, dhcpServFailoverEntry=dhcpServFailoverEntry, ipspgDhcpTrDiagId=ipspgDhcpTrDiagId, ipspgDHCP=ipspgDHCP, dhcpServCountUnusedSubnets=dhcpServCountUnusedSubnets, dhcpServFailoverPartnerStatus=dhcpServFailoverPartnerStatus, dhcpServMibObjects=dhcpServMibObjects, dhcpServDhcpCounters=dhcpServDhcpCounters, dhcpServerSubnetThresholdDescent=dhcpServerSubnetThresholdDescent, dhcpServBootpStatMinArrivalInterval=dhcpServBootpStatMinArrivalInterval, dhcpServSystemResetTime=dhcpServSystemResetTime, dhcpServFailoverTable=dhcpServFailoverTable, dhcpServBootpStatistics=dhcpServBootpStatistics, dhcpServDhcpCountInvalids=dhcpServDhcpCountInvalids, dhcpServSystemStatus=dhcpServSystemStatus, dhcpServBootpStatLastArrivalTime=dhcpServBootpStatLastArrivalTime, dhcpServRangeSubnetAddr=dhcpServRangeSubnetAddr)
#!/usr/bin/python3 # https://practice.geeksforgeeks.org/problems/max-level-sum-in-binary-tree/1 def maxLevelSum(root): # Code here h = {} level = 0 getLevelSum(root, level, h) return max(h.values()) def getLevelSum(root, level, h): if root == None: return if level not in h: h[level] = 0 h[level] += root.data getLevelSum(root.left, level+1, h) getLevelSum(root.right, level+1, h)
def max_level_sum(root): h = {} level = 0 get_level_sum(root, level, h) return max(h.values()) def get_level_sum(root, level, h): if root == None: return if level not in h: h[level] = 0 h[level] += root.data get_level_sum(root.left, level + 1, h) get_level_sum(root.right, level + 1, h)
A = [10,13,7] B = [1,2,3,4,5,6] def sum_all(A, B): ASum = sum(A) #print(ASum) BSum = sum(B) #print(BSum) TSum = ASum+BSum #print(TSum) return ASum, BSum, TSum ASum, BSum, TSum = sum_all(A,B) print('The sum of list 1 is '+str(ASum)) print('The sum of list 2 is '+str(BSum)) print('The sum of both lists is '+str(TSum))
a = [10, 13, 7] b = [1, 2, 3, 4, 5, 6] def sum_all(A, B): a_sum = sum(A) b_sum = sum(B) t_sum = ASum + BSum return (ASum, BSum, TSum) (a_sum, b_sum, t_sum) = sum_all(A, B) print('The sum of list 1 is ' + str(ASum)) print('The sum of list 2 is ' + str(BSum)) print('The sum of both lists is ' + str(TSum))
class ScriptBase(type): def __init__(cls, name, bases, attrs): if cls is None: return if not hasattr(cls, "plugins"): cls.plugins = [] else: cls.plugins.append(cls) class ServerBase: __metaclass__ = ScriptBase def __init__(self): super(ServerBase, self).__init__() def setup(self, nysa): self.n = nysa
class Scriptbase(type): def __init__(cls, name, bases, attrs): if cls is None: return if not hasattr(cls, 'plugins'): cls.plugins = [] else: cls.plugins.append(cls) class Serverbase: __metaclass__ = ScriptBase def __init__(self): super(ServerBase, self).__init__() def setup(self, nysa): self.n = nysa
class BuildProducts(object): '''A class to help keep track of build products in the build. Really this is just a wrapper around a dict stored at the key 'BUILD_TOOL' in an environment. This class doesn't worry about what stored in that dict, though it's generally things like SharedLib configurators and such. ''' def __init__(self, env): '''This looks up or, if necessary, creates a few keys in the `env` that are used by this class. ''' self.env = env try: products = env['BUILD_TOOL'] except KeyError: env['BUILD_TOOL'] = {} products = env['BUILD_TOOL'] try: products = products['BUILD_PRODUCTS'] except KeyError: products['BUILD_PRODUCTS'] = {} products = products['BUILD_PRODUCTS'] self.products = products def __getitem__(self, name): '''Get the build product at `name`. ''' return self.products[name] def __setitem__(self, name, product): '''Set the build product at `name` to `product`. ''' self.products[name] = product
class Buildproducts(object): """A class to help keep track of build products in the build. Really this is just a wrapper around a dict stored at the key 'BUILD_TOOL' in an environment. This class doesn't worry about what stored in that dict, though it's generally things like SharedLib configurators and such. """ def __init__(self, env): """This looks up or, if necessary, creates a few keys in the `env` that are used by this class. """ self.env = env try: products = env['BUILD_TOOL'] except KeyError: env['BUILD_TOOL'] = {} products = env['BUILD_TOOL'] try: products = products['BUILD_PRODUCTS'] except KeyError: products['BUILD_PRODUCTS'] = {} products = products['BUILD_PRODUCTS'] self.products = products def __getitem__(self, name): """Get the build product at `name`. """ return self.products[name] def __setitem__(self, name, product): """Set the build product at `name` to `product`. """ self.products[name] = product
class ResourceObject: def __init__(self, resource_type, resource_name, mem_limit_threshold, mem_request_threshold, cpu_limit_threshold, cpu_request_threshold, max_hit): self.resource_type = resource_type self.resource_name = resource_name self.cpu_limit = 0 self.mem_limit = 0 self.cpu_request = 0 self.mem_request = 0 self.mem_hits = 0 self.cpu_hits = 0 self.mem_limit_threshold = mem_limit_threshold self.mem_request_threshold = mem_request_threshold self.cpu_limit_threshold = cpu_limit_threshold self.cpu_request_threshold = cpu_request_threshold self.max_hit = max_hit def __hit_cpu(self): if self.cpu_limit > self.cpu_limit_threshold or self.cpu_request > self.cpu_request_threshold: self.cpu_hits += 1 if self.cpu_hits > self.max_hit: self.cpu_hits = 1 else: self.cpu_hits = 0 def __hit_mem(self): if self.mem_limit > self.mem_limit_threshold or self.mem_request > self.mem_request_threshold: self.mem_hits += 1 if self.mem_hits > self.max_hit: self.mem_hits = 1 else: self.mem_hits = 0 def update_memory(self, request, limit): self.mem_limit = limit self.mem_request = request self.__hit_mem() def update_cpu(self, request, limit): self.cpu_limit = limit self.cpu_request = request self.__hit_cpu() def get_notification(self, report_type): message = '' cpu_message = '' mem_message = '' if self.cpu_hits > 0: cpu_message = f" [cpu request: {self.cpu_request}% , cpu limit: {self.cpu_limit}%]" if self.mem_hits > 0: mem_message = f" [memory request: {self.mem_request}% , memory limit: {self.mem_limit}%]" if report_type == "all" and (self.cpu_hits == 1 or self.mem_hits == 1): if self.cpu_hits > 0 and self.mem_hits > 0: message = ' and' message = f"{cpu_message}{message}{mem_message}" elif report_type == 'cpu' and self.cpu_hits == 1: message = cpu_message elif report_type == 'memory' and self.mem_hits == 1: message = mem_message if message != '': message = f"[{self.resource_type}] {self.resource_name} is under stress:{message}" return message
class Resourceobject: def __init__(self, resource_type, resource_name, mem_limit_threshold, mem_request_threshold, cpu_limit_threshold, cpu_request_threshold, max_hit): self.resource_type = resource_type self.resource_name = resource_name self.cpu_limit = 0 self.mem_limit = 0 self.cpu_request = 0 self.mem_request = 0 self.mem_hits = 0 self.cpu_hits = 0 self.mem_limit_threshold = mem_limit_threshold self.mem_request_threshold = mem_request_threshold self.cpu_limit_threshold = cpu_limit_threshold self.cpu_request_threshold = cpu_request_threshold self.max_hit = max_hit def __hit_cpu(self): if self.cpu_limit > self.cpu_limit_threshold or self.cpu_request > self.cpu_request_threshold: self.cpu_hits += 1 if self.cpu_hits > self.max_hit: self.cpu_hits = 1 else: self.cpu_hits = 0 def __hit_mem(self): if self.mem_limit > self.mem_limit_threshold or self.mem_request > self.mem_request_threshold: self.mem_hits += 1 if self.mem_hits > self.max_hit: self.mem_hits = 1 else: self.mem_hits = 0 def update_memory(self, request, limit): self.mem_limit = limit self.mem_request = request self.__hit_mem() def update_cpu(self, request, limit): self.cpu_limit = limit self.cpu_request = request self.__hit_cpu() def get_notification(self, report_type): message = '' cpu_message = '' mem_message = '' if self.cpu_hits > 0: cpu_message = f' [cpu request: {self.cpu_request}% , cpu limit: {self.cpu_limit}%]' if self.mem_hits > 0: mem_message = f' [memory request: {self.mem_request}% , memory limit: {self.mem_limit}%]' if report_type == 'all' and (self.cpu_hits == 1 or self.mem_hits == 1): if self.cpu_hits > 0 and self.mem_hits > 0: message = ' and' message = f'{cpu_message}{message}{mem_message}' elif report_type == 'cpu' and self.cpu_hits == 1: message = cpu_message elif report_type == 'memory' and self.mem_hits == 1: message = mem_message if message != '': message = f'[{self.resource_type}] {self.resource_name} is under stress:{message}' return message
M = [] size1 = int(input()) for i in range(size1): row = [] for j in range(size1): row.append(int(input())) M.append(row) M2 = [] for i in range(size1): row = [] for j in range(size1): row.append(int(input())) M2.append(row) result = [ [ 0 for i in range(size1) ] for j in range(size1) ] for i in range(size1): for j in range(size1): for k in range(size1): result[i][j] += M[i][k] * M2[k][j] for i in range(size1): print(result[i])
m = [] size1 = int(input()) for i in range(size1): row = [] for j in range(size1): row.append(int(input())) M.append(row) m2 = [] for i in range(size1): row = [] for j in range(size1): row.append(int(input())) M2.append(row) result = [[0 for i in range(size1)] for j in range(size1)] for i in range(size1): for j in range(size1): for k in range(size1): result[i][j] += M[i][k] * M2[k][j] for i in range(size1): print(result[i])
MYSQL_HOST = 'localhost' MYSQL_DBNAME = 'spider' MYSQL_USER = 'root' MYSQL_PASSWD = '123456' MYSQL_PORT = 3306 MYSQL_CHARSET = 'utf8' MYSQL_UNICODE = True
mysql_host = 'localhost' mysql_dbname = 'spider' mysql_user = 'root' mysql_passwd = '123456' mysql_port = 3306 mysql_charset = 'utf8' mysql_unicode = True
squares = [1, 4, 9, 16, 25] i = 0 while i < len(squares): print(i, squares[i]) i = i + 1 words = ['cat', 'window', 'defenestrate'] for w in words: print(w, len(w)) for i in range(len(words)): print(i, words[i], len(words[i]))
squares = [1, 4, 9, 16, 25] i = 0 while i < len(squares): print(i, squares[i]) i = i + 1 words = ['cat', 'window', 'defenestrate'] for w in words: print(w, len(w)) for i in range(len(words)): print(i, words[i], len(words[i]))
def ov_range(a_1,a_2,b_1,b_2): big_a=a_1 small_a=a_2 big_b=b_1 small_b=b_1 if a_1<a_2: big_a=a_2 small_a=a_1 elif a_1>a_2: big_a=a_1 small_a=a_2 if b_1>b_2: big_b=b_1 small_b=b_2 elif b_1<b_2: big_b=b_2 small_b=b_1 #print(big_a, '\n', small_a, '\n', big_b, '\n', small_b) interval_1=big_a - small_a interval_2=big_b - small_b # when they dont overlap if small_a > big_b: return 0 elif small_b>big_a: return 0 # When a dips into b if big_b>big_a and small_a>small_b: interval_1 = big_a - small_a return interval_1 #when b completly overlaps a if big_a>big_b and small_b>small_a: interval_1 = big_b - small_b return interval_1 elif big_a>big_b and big_b>small_a: interval_1= big_b - small_a return interval_1 #when a overlaps in b if small_b<big_a: interval_1=big_a - small_b return interval_1 if small_b<big_b: interval_2=big_b - small_a #when b overlap in a if big_a>big_b and big_b>small_a: interval_1= big_b - small_a return interval_1 #Good job # Test function def test(a1, a2, b1, b2, expected): print(a1, a2, '&', b1, b2, '=>', ov_range(a1, a2, b1, b2), '\t', ov_range(a1, a2, b1, b2) == expected) test(2,5,-1,3, 1) test(3, 0, 2, 4, 1) test(0, 5, 0, 1000, 5) test(0, 1000, 0, 5, 5) test(1, 4, 0, 5, 3) test(0, 5, 2, 4, 2) test(2,4,0,5, 2) test(1,10,-5,-5,0) test(10,1,5,15,5) test(-5, 0, 2, 4, 0) test(-5, -5, 2, 4, 0) test(5, 0, 1, 1, 0) test(7, -2, -1, 4, 5)
def ov_range(a_1, a_2, b_1, b_2): big_a = a_1 small_a = a_2 big_b = b_1 small_b = b_1 if a_1 < a_2: big_a = a_2 small_a = a_1 elif a_1 > a_2: big_a = a_1 small_a = a_2 if b_1 > b_2: big_b = b_1 small_b = b_2 elif b_1 < b_2: big_b = b_2 small_b = b_1 interval_1 = big_a - small_a interval_2 = big_b - small_b if small_a > big_b: return 0 elif small_b > big_a: return 0 if big_b > big_a and small_a > small_b: interval_1 = big_a - small_a return interval_1 if big_a > big_b and small_b > small_a: interval_1 = big_b - small_b return interval_1 elif big_a > big_b and big_b > small_a: interval_1 = big_b - small_a return interval_1 if small_b < big_a: interval_1 = big_a - small_b return interval_1 if small_b < big_b: interval_2 = big_b - small_a if big_a > big_b and big_b > small_a: interval_1 = big_b - small_a return interval_1 def test(a1, a2, b1, b2, expected): print(a1, a2, '&', b1, b2, '=>', ov_range(a1, a2, b1, b2), '\t', ov_range(a1, a2, b1, b2) == expected) test(2, 5, -1, 3, 1) test(3, 0, 2, 4, 1) test(0, 5, 0, 1000, 5) test(0, 1000, 0, 5, 5) test(1, 4, 0, 5, 3) test(0, 5, 2, 4, 2) test(2, 4, 0, 5, 2) test(1, 10, -5, -5, 0) test(10, 1, 5, 15, 5) test(-5, 0, 2, 4, 0) test(-5, -5, 2, 4, 0) test(5, 0, 1, 1, 0) test(7, -2, -1, 4, 5)
class ContactInformation(object): def __init__(self, name, weight=100, *args, **kwargs): self.name = name self.weight = weight def __str__(self): return "Unusable Contact: {:s} ({:d})".format(self.name, self.weight) class EmailAddress(ContactInformation): def __init__(self, name, email, *args, **kwargs): super(EmailAddress, self).__init__(name, *args, **kwargs) self.email = email def __str__(self): return "Email: {:s} <{:s}> ({:d})".format(self.name, self.email, self.weight) class PhoneNumber(ContactInformation): def __init__(self, name, phone, sms_ok=True, voice_ok=False, *args, **kwargs): super(PhoneNumber, self).__init__(name, *args, **kwargs) self.phone = phone self.sms_ok = sms_ok self.voice_ok = voice_ok def __str__(self): methods = [] if self.sms_ok: methods.append('sms') if self.voice_ok: methods.append('voice') return "Phone: {:s} <{:s}> [{:s}] ({:d})".format(self.name, self.phone, ', '.join(methods), self.weight) class HipChat(ContactInformation): def __init__(self, name, room, username=None, mention=None, notify=None, server=None, *args, **kwargs): super(HipChat, self).__init__(name, *args, **kwargs) self.room = room self.username = username self.server = server if mention is None: self.mention = True if username else False else: self.mention = mention if notify is None: self.notify = False if username else True else: self.notify = notify def __str__(self): path = [self.room] if self.server: path.insert(0, self.server) if self.username: path.append(self.username) features = [] if self.mention: features.append('mention') if self.notify: features.append('notify') return "HipChat: {:s} <{:s}> [{:s}] ({:d})".format(self.name, '/'.join(path), ', '.join(features), self.weight) class Recipient(object): def __init__(self, name, contacts=None, *args, **kwargs): self.name = name self._contacts = contacts or [] def __str__(self): return "{:s}: {:s}: {:s}".format(self.__class__.__name__, self.name, map(str, self.contacts) or 'No Contact Information') def contacts(self, of_type=None, include_all=False, **having): returned_types = [] for contact in sorted(self._contacts, key=lambda v: v.weight): if of_type and not isinstance(contact, of_type): continue for key, value in having.items(): if getattr(contact, key, None) != value: break else: if not include_all and contact.__class__ in returned_types: continue returned_types.append(contact.__class__) yield contact class Group(object): def __init__(self, name, groups=None, recipients=None, *args, **kwargs): self.name = name self._groups = groups or [] self._recipients = recipients or [] def groups(self, recursive=True): for group in self._groups: yield group if recursive: for group_ in group.groups(recursive=True): yield group_ def recipients(self, recursive=True): for recipient in self._recipients: yield recipient if recursive: for group in self.groups(recursive=False): for recipient in group.recipients(recursive=True): yield recipient def contacts(self, of_type=None, include_all=False, recursive=True, **having): for recipient in self.recipients(recursive=recursive): for contact in recipient.contacts(of_type=of_type, include_all=include_all, **having): yield contact
class Contactinformation(object): def __init__(self, name, weight=100, *args, **kwargs): self.name = name self.weight = weight def __str__(self): return 'Unusable Contact: {:s} ({:d})'.format(self.name, self.weight) class Emailaddress(ContactInformation): def __init__(self, name, email, *args, **kwargs): super(EmailAddress, self).__init__(name, *args, **kwargs) self.email = email def __str__(self): return 'Email: {:s} <{:s}> ({:d})'.format(self.name, self.email, self.weight) class Phonenumber(ContactInformation): def __init__(self, name, phone, sms_ok=True, voice_ok=False, *args, **kwargs): super(PhoneNumber, self).__init__(name, *args, **kwargs) self.phone = phone self.sms_ok = sms_ok self.voice_ok = voice_ok def __str__(self): methods = [] if self.sms_ok: methods.append('sms') if self.voice_ok: methods.append('voice') return 'Phone: {:s} <{:s}> [{:s}] ({:d})'.format(self.name, self.phone, ', '.join(methods), self.weight) class Hipchat(ContactInformation): def __init__(self, name, room, username=None, mention=None, notify=None, server=None, *args, **kwargs): super(HipChat, self).__init__(name, *args, **kwargs) self.room = room self.username = username self.server = server if mention is None: self.mention = True if username else False else: self.mention = mention if notify is None: self.notify = False if username else True else: self.notify = notify def __str__(self): path = [self.room] if self.server: path.insert(0, self.server) if self.username: path.append(self.username) features = [] if self.mention: features.append('mention') if self.notify: features.append('notify') return 'HipChat: {:s} <{:s}> [{:s}] ({:d})'.format(self.name, '/'.join(path), ', '.join(features), self.weight) class Recipient(object): def __init__(self, name, contacts=None, *args, **kwargs): self.name = name self._contacts = contacts or [] def __str__(self): return '{:s}: {:s}: {:s}'.format(self.__class__.__name__, self.name, map(str, self.contacts) or 'No Contact Information') def contacts(self, of_type=None, include_all=False, **having): returned_types = [] for contact in sorted(self._contacts, key=lambda v: v.weight): if of_type and (not isinstance(contact, of_type)): continue for (key, value) in having.items(): if getattr(contact, key, None) != value: break else: if not include_all and contact.__class__ in returned_types: continue returned_types.append(contact.__class__) yield contact class Group(object): def __init__(self, name, groups=None, recipients=None, *args, **kwargs): self.name = name self._groups = groups or [] self._recipients = recipients or [] def groups(self, recursive=True): for group in self._groups: yield group if recursive: for group_ in group.groups(recursive=True): yield group_ def recipients(self, recursive=True): for recipient in self._recipients: yield recipient if recursive: for group in self.groups(recursive=False): for recipient in group.recipients(recursive=True): yield recipient def contacts(self, of_type=None, include_all=False, recursive=True, **having): for recipient in self.recipients(recursive=recursive): for contact in recipient.contacts(of_type=of_type, include_all=include_all, **having): yield contact
MODELS = { "pwc": ( 'configs/pwcnet/pwcnet_ft_4x1_300k_sintel_final_384x768.py', 'checkpoints/pwcnet_ft_4x1_300k_sintel_final_384x768.pth' ), "flownetc": ( 'configs/flownet/flownetc_8x1_sfine_sintel_384x448.py', 'checkpoints/flownetc_8x1_sfine_sintel_384x448.pth' ), "raft": ( "configs/raft/raft_8x2_100k_mixed_368x768.py", "checkpoints/raft_8x2_100k_mixed_368x768.pth" ) }
models = {'pwc': ('configs/pwcnet/pwcnet_ft_4x1_300k_sintel_final_384x768.py', 'checkpoints/pwcnet_ft_4x1_300k_sintel_final_384x768.pth'), 'flownetc': ('configs/flownet/flownetc_8x1_sfine_sintel_384x448.py', 'checkpoints/flownetc_8x1_sfine_sintel_384x448.pth'), 'raft': ('configs/raft/raft_8x2_100k_mixed_368x768.py', 'checkpoints/raft_8x2_100k_mixed_368x768.pth')}
''' Implementation of exponential search Time Complexity: O(logn) Space Complexity: Depends on implementation of binary_search {O(logn): recursive, O(1):iterative} Used for unbounded search, when the length of array is infinite or not known ''' #iterative implementation of binary search def binary_search(arr, s, e, x): ''' #arr: the array in which we need to find an element (sorted, increasing order) #s: start index #e: end index #x: element we are looking for ''' #search until arr becomes empty [] while (e>=s): m = s + int((e-s)/2) #middle index if x==arr[m]: #if found at mid return index return m elif x>arr[m]: #if x>arr[m] search only in the right array s = m+1 elif x<arr[m]: #if x<arr[m] search only in the left array e = m-1 return -1 def exponential_search(arr, n, x): if x==arr[0]: return 0; i=1 #index #keep increasing index until the indexed element is smaller and then do binary search while i<n and x>arr[i]: i = i*2 return binary_search(arr, int(i/2), min(i, n), x) arr = [2,3,4,10,40] x = 10 index = exponential_search(arr, len(arr), x) if index==-1: print("Element not present in list") else: print("Element",x,"is present at",index)
""" Implementation of exponential search Time Complexity: O(logn) Space Complexity: Depends on implementation of binary_search {O(logn): recursive, O(1):iterative} Used for unbounded search, when the length of array is infinite or not known """ def binary_search(arr, s, e, x): """ #arr: the array in which we need to find an element (sorted, increasing order) #s: start index #e: end index #x: element we are looking for """ while e >= s: m = s + int((e - s) / 2) if x == arr[m]: return m elif x > arr[m]: s = m + 1 elif x < arr[m]: e = m - 1 return -1 def exponential_search(arr, n, x): if x == arr[0]: return 0 i = 1 while i < n and x > arr[i]: i = i * 2 return binary_search(arr, int(i / 2), min(i, n), x) arr = [2, 3, 4, 10, 40] x = 10 index = exponential_search(arr, len(arr), x) if index == -1: print('Element not present in list') else: print('Element', x, 'is present at', index)
class VaderStreamsConstants(object): __slots__ = [] BASE_URL = 'http://vapi.vaders.tv/' CATEGORIES_JSON_FILE_NAME = 'categories.json' CATEGORIES_PATH = 'epg/categories' CHANNELS_JSON_FILE_NAME = 'channels.json' CHANNELS_PATH = 'epg/channels' DB_FILE_NAME = 'vaderstreams.db' DEFAULT_EPG_SOURCE = 'vaderstreams' DEFAULT_PLAYLIST_PROTOCOL = 'hls' DEFAULT_PLAYLIST_TYPE = 'dynamic' EPG_BASE_URL = 'http://vaders.tv/' JSON_EPG_TIME_DELTA_HOURS = 1 MATCHCENTER_SCHEDULE_JSON_FILE_NAME = 'schedule.json' MATCHCENTER_SCHEDULE_PATH = 'mc/schedule' PROVIDER_NAME = 'VaderStreams' TEMPORARY_DB_FILE_NAME = 'vaderstreams_temp.db' VALID_EPG_SOURCE_VALUES = ['other', 'vaderstreams'] VALID_PLAYLIST_PROTOCOL_VALUES = ['hls', 'mpegts'] VALID_PLAYLIST_TYPE_VALUES = ['dynamic', 'static'] VALID_SERVER_VALUES = ['auto'] XML_EPG_FILE_NAME = 'p2.xml.gz' _provider_name = PROVIDER_NAME.lower()
class Vaderstreamsconstants(object): __slots__ = [] base_url = 'http://vapi.vaders.tv/' categories_json_file_name = 'categories.json' categories_path = 'epg/categories' channels_json_file_name = 'channels.json' channels_path = 'epg/channels' db_file_name = 'vaderstreams.db' default_epg_source = 'vaderstreams' default_playlist_protocol = 'hls' default_playlist_type = 'dynamic' epg_base_url = 'http://vaders.tv/' json_epg_time_delta_hours = 1 matchcenter_schedule_json_file_name = 'schedule.json' matchcenter_schedule_path = 'mc/schedule' provider_name = 'VaderStreams' temporary_db_file_name = 'vaderstreams_temp.db' valid_epg_source_values = ['other', 'vaderstreams'] valid_playlist_protocol_values = ['hls', 'mpegts'] valid_playlist_type_values = ['dynamic', 'static'] valid_server_values = ['auto'] xml_epg_file_name = 'p2.xml.gz' _provider_name = PROVIDER_NAME.lower()
class Vector: def __init__(self, inputs: list): self.inputs = inputs def dot(self, weigths): dot_product = 0 for index in range(len(self.inputs)): dot_product = dot_product + (self.inputs[index] * weigths.inputs[index]) return dot_product
class Vector: def __init__(self, inputs: list): self.inputs = inputs def dot(self, weigths): dot_product = 0 for index in range(len(self.inputs)): dot_product = dot_product + self.inputs[index] * weigths.inputs[index] return dot_product
dependency_matcher_patterns = { "pattern_parameter_adverbial_clause": [ {"RIGHT_ID": "action_head", "RIGHT_ATTRS": {"POS": "VERB"}}, { "LEFT_ID": "action_head", "REL_OP": ">", "RIGHT_ID": "condition_head", "RIGHT_ATTRS": {"DEP": "advcl"}, }, { "LEFT_ID": "condition_head", "REL_OP": ">", "RIGHT_ID": "dependee_param", "RIGHT_ATTRS": {"DEP": {"IN": ["nsubj", "nsubjpass"]}}, }, ] }
dependency_matcher_patterns = {'pattern_parameter_adverbial_clause': [{'RIGHT_ID': 'action_head', 'RIGHT_ATTRS': {'POS': 'VERB'}}, {'LEFT_ID': 'action_head', 'REL_OP': '>', 'RIGHT_ID': 'condition_head', 'RIGHT_ATTRS': {'DEP': 'advcl'}}, {'LEFT_ID': 'condition_head', 'REL_OP': '>', 'RIGHT_ID': 'dependee_param', 'RIGHT_ATTRS': {'DEP': {'IN': ['nsubj', 'nsubjpass']}}}]}
PAGE_ITEM_LIMIT = 10 RSS_ITEM_LIMIT = 10 OUTPUT_DIRECTORY = ""
page_item_limit = 10 rss_item_limit = 10 output_directory = ''
''' EASY 203. Remove Linked List Elements You are given a license key represented as a string S which consists only alphanumeric character and dashes. The string is separated into N+1 groups by N dashes. Given a number K, we would want to reformat the strings such that each group contains exactly K characters, except for the first group which could be shorter than K, but still must contain at least one character. Furthermore, there must be a dash inserted between two groups and all lowercase letters should be converted to uppercase. Given a non-empty string S and a number K, format the string according to the rules described above. Example 1: Input: S = "5F3Z-2e-9-w", K = 4 Output: "5F3Z-2E9W" Explanation: The string S has been split into two parts, each part has 4 characters. Note that the two extra dashes are not needed and can be removed. ''' class Solution: def removeElements(self, head: ListNode, val: int) -> ListNode: dummy_head = ListNode(-1) dummy_head.next = head curr = dummy_head while curr.next: if curr.next.val == val: curr.next = curr.next.next else: curr = curr.next return dummy_head.next
""" EASY 203. Remove Linked List Elements You are given a license key represented as a string S which consists only alphanumeric character and dashes. The string is separated into N+1 groups by N dashes. Given a number K, we would want to reformat the strings such that each group contains exactly K characters, except for the first group which could be shorter than K, but still must contain at least one character. Furthermore, there must be a dash inserted between two groups and all lowercase letters should be converted to uppercase. Given a non-empty string S and a number K, format the string according to the rules described above. Example 1: Input: S = "5F3Z-2e-9-w", K = 4 Output: "5F3Z-2E9W" Explanation: The string S has been split into two parts, each part has 4 characters. Note that the two extra dashes are not needed and can be removed. """ class Solution: def remove_elements(self, head: ListNode, val: int) -> ListNode: dummy_head = list_node(-1) dummy_head.next = head curr = dummy_head while curr.next: if curr.next.val == val: curr.next = curr.next.next else: curr = curr.next return dummy_head.next
cities = [ 'Vilnius', 'Kaunas', 'Klaipeda', 'Siauliai', 'Panevezys', 'Alytus', 'Dainava (Kaunas)', 'Eiguliai', 'Marijampole', 'Mazeikiai', 'Silainiai', 'Fabijoniskes', 'Jonava', 'Utena', 'Pasilaiciai', 'Kedainiai', 'Seskine', 'Lazdynai', 'Telsiai', 'Visaginas', 'Taurage', 'Justiniskes', 'Ukmerge', 'Aleksotas', 'Plunge', 'Naujamiestis', 'Kretinga', 'Silute', 'Vilkpede', 'Radviliskis', 'Pilaite', 'Palanga', 'Druskininkai', 'Gargzdai', 'Rokiskis', 'Birzai', 'Kursenai', 'Garliava', 'Elektrenai', 'Jurbarkas', 'Vilkaviskis', 'Raseiniai', 'Anyksciai', 'Naujoji Akmene', 'Lentvaris', 'Grigiskes', 'Prienai', 'Joniskis', 'Kelme', 'Rasos', 'Varena', 'Kaisiadorys', 'Pasvalys', 'Kupiskis', 'Zarasai', 'Skuodas', 'Sirvintos', 'Kazlu Ruda', 'Moletai', 'Salcininkai', 'Svencioneliai', 'Sakiai', 'Ignalina', 'Pabrade', 'Kybartai', 'Nemencine', 'Silale', 'Pakruojis', 'Svencionys', 'Trakai', 'Vievis' ]
cities = ['Vilnius', 'Kaunas', 'Klaipeda', 'Siauliai', 'Panevezys', 'Alytus', 'Dainava (Kaunas)', 'Eiguliai', 'Marijampole', 'Mazeikiai', 'Silainiai', 'Fabijoniskes', 'Jonava', 'Utena', 'Pasilaiciai', 'Kedainiai', 'Seskine', 'Lazdynai', 'Telsiai', 'Visaginas', 'Taurage', 'Justiniskes', 'Ukmerge', 'Aleksotas', 'Plunge', 'Naujamiestis', 'Kretinga', 'Silute', 'Vilkpede', 'Radviliskis', 'Pilaite', 'Palanga', 'Druskininkai', 'Gargzdai', 'Rokiskis', 'Birzai', 'Kursenai', 'Garliava', 'Elektrenai', 'Jurbarkas', 'Vilkaviskis', 'Raseiniai', 'Anyksciai', 'Naujoji Akmene', 'Lentvaris', 'Grigiskes', 'Prienai', 'Joniskis', 'Kelme', 'Rasos', 'Varena', 'Kaisiadorys', 'Pasvalys', 'Kupiskis', 'Zarasai', 'Skuodas', 'Sirvintos', 'Kazlu Ruda', 'Moletai', 'Salcininkai', 'Svencioneliai', 'Sakiai', 'Ignalina', 'Pabrade', 'Kybartai', 'Nemencine', 'Silale', 'Pakruojis', 'Svencionys', 'Trakai', 'Vievis']
def add_numbers(num1, num2): return num1 + num2 def subtract_numbers(num1, num2): return num1 - num2 def multiply_numbers(num1, num2): return num1 * num2 def divide_numbers(num1, num2): return num1 / num2
def add_numbers(num1, num2): return num1 + num2 def subtract_numbers(num1, num2): return num1 - num2 def multiply_numbers(num1, num2): return num1 * num2 def divide_numbers(num1, num2): return num1 / num2
REQUEST_DELETE_CONTENT_RANGE = 'deleteContentRange' REQUEST_DELETE_TABLE_ROW = 'deleteTableRow' REQUEST_INSERT_TABLE = 'insertTable' REQUEST_INSERT_TABLE_ROW = 'insertTableRow' REQUEST_INSERT_TEXT = 'insertText' REQUEST_MERGE_TABLE_CELLS = 'mergeTableCells' REQUEST_UPDATE_TEXT_STYLE = 'updateTextStyle' BODY = 'body' BOLD = 'bold' BOOKMARK_ID = 'bookmarkId' CONTENT = 'content' COLUMN_INDEX = 'columnIndex' COLUMN_SPAN = 'columnSpan' CONTENT = 'content' ELEMENTS = 'elements' END_INDEX = 'endIndex' END_OF_SEGMENT_LOCATION = 'endOfSegmentLocation' FIELDS = 'fields' HEADING_ID = 'headingId' INDEX = 'index' INSERT_BELOW = 'insertBelow' ITALIC = 'italic' LINK = 'link' LOCATION = 'location' NUMBER_OF_COLUMNS = 'columns' NUMBER_OF_ROWS = 'rows' PARAGRAPH = 'paragraph' RANGE = 'range' ROW_INDEX = 'rowIndex' ROW_SPAN = 'rowSpan' SEGMENT_ID = 'segmentId' SMALL_CAPS = 'smallCaps' START_INDEX = 'startIndex' STRIKETHROUGH = 'strikethrough' TABLE = 'table' TABLE_CELLS = 'tableCells' TABLE_CELL_LOCATION = 'tableCellLocation' TABLE_RANGE = 'tableRange' TABLE_ROWS = 'tableRows' TABLE_START_LOCATION = 'tableStartLocation' TEXT = 'text' TEXT_RUN = 'textRun' TEXT_STYLE = 'textStyle' UNDERLINE = 'underline' URL = 'url' GOOGLE_DOC_URL_PREFIX = 'https://docs.google.com/document/d/' GOOGLE_DOC_MIMETYPE = 'application/vnd.google-apps.document' WORD_DOC_MIMETYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
request_delete_content_range = 'deleteContentRange' request_delete_table_row = 'deleteTableRow' request_insert_table = 'insertTable' request_insert_table_row = 'insertTableRow' request_insert_text = 'insertText' request_merge_table_cells = 'mergeTableCells' request_update_text_style = 'updateTextStyle' body = 'body' bold = 'bold' bookmark_id = 'bookmarkId' content = 'content' column_index = 'columnIndex' column_span = 'columnSpan' content = 'content' elements = 'elements' end_index = 'endIndex' end_of_segment_location = 'endOfSegmentLocation' fields = 'fields' heading_id = 'headingId' index = 'index' insert_below = 'insertBelow' italic = 'italic' link = 'link' location = 'location' number_of_columns = 'columns' number_of_rows = 'rows' paragraph = 'paragraph' range = 'range' row_index = 'rowIndex' row_span = 'rowSpan' segment_id = 'segmentId' small_caps = 'smallCaps' start_index = 'startIndex' strikethrough = 'strikethrough' table = 'table' table_cells = 'tableCells' table_cell_location = 'tableCellLocation' table_range = 'tableRange' table_rows = 'tableRows' table_start_location = 'tableStartLocation' text = 'text' text_run = 'textRun' text_style = 'textStyle' underline = 'underline' url = 'url' google_doc_url_prefix = 'https://docs.google.com/document/d/' google_doc_mimetype = 'application/vnd.google-apps.document' word_doc_mimetype = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
sum = lambda a,b : a + b print("suma: "+ str(sum(1,2))) # Map lambdas names = ["Christian", "yamile", "Anddy", "Lucero", "Evelyn"] names = map(lambda name:name.upper(),names) print(list(names)) def decrement_list (*vargs): return list(map(lambda number: number - 1,vargs)) print(decrement_list(1,2,3)) #all def is_all_strings(lst): return all(type(l) == str for l in lst) print(is_all_strings(['2',3])) #sorted numbers = [2,3,5,1,8,3,7,9,4] print(numbers) print(sorted(numbers)) print(sorted(numbers,reverse=True)) print(numbers) def extremes(ass): return min (ass),max(ass) print(extremes([1,2,3,4,5])) print(extremes("alcatraz")) print(extremes([1,2,3,4,5])) print(all(n%2==0 for n in [10, 2, 0, 4, 4, 4, 40]))
sum = lambda a, b: a + b print('suma: ' + str(sum(1, 2))) names = ['Christian', 'yamile', 'Anddy', 'Lucero', 'Evelyn'] names = map(lambda name: name.upper(), names) print(list(names)) def decrement_list(*vargs): return list(map(lambda number: number - 1, vargs)) print(decrement_list(1, 2, 3)) def is_all_strings(lst): return all((type(l) == str for l in lst)) print(is_all_strings(['2', 3])) numbers = [2, 3, 5, 1, 8, 3, 7, 9, 4] print(numbers) print(sorted(numbers)) print(sorted(numbers, reverse=True)) print(numbers) def extremes(ass): return (min(ass), max(ass)) print(extremes([1, 2, 3, 4, 5])) print(extremes('alcatraz')) print(extremes([1, 2, 3, 4, 5])) print(all((n % 2 == 0 for n in [10, 2, 0, 4, 4, 4, 40])))
# python3 theory/conditionals.py def plus(a, b): if type(a) is int or type(a) is float: if type(b) is int or type(b) is float: return a + b else: return None else: return None print(plus(1, '10')) def can_drink(age): print(f"You are {age} years old.") if age < 18: print("You can't drink.") elif age == 18 or age == 19: print("Go easy on it cowbow.") elif age > 19 and age < 25: print("Buckle up son.") else: print("Enjoy your drink!") can_drink(17) can_drink(19) can_drink(21) can_drink(25)
def plus(a, b): if type(a) is int or type(a) is float: if type(b) is int or type(b) is float: return a + b else: return None else: return None print(plus(1, '10')) def can_drink(age): print(f'You are {age} years old.') if age < 18: print("You can't drink.") elif age == 18 or age == 19: print('Go easy on it cowbow.') elif age > 19 and age < 25: print('Buckle up son.') else: print('Enjoy your drink!') can_drink(17) can_drink(19) can_drink(21) can_drink(25)
def os_return(distro): if distro == 'rhel': return_value = { 'distribution': 'centos', 'version': '7.5', 'dist_name': 'CentOS Linux', 'based_on': 'rhel' } elif distro == 'ubuntu': return_value = { 'distribution': 'ec2', 'version': '16.04', 'dist_name': 'Ubuntu', 'based_on': 'debian' } elif distro == 'suse': return_value = { 'distribution': 'sles', 'version': '12', 'dist_name': 'SLES', 'based_on': 'suse' } return return_value def system_compatability(test_pass=True): if test_pass: return { 'OS': 'PASS', 'version': 'PASS' } return { 'OS': 'PASS', 'version': 'FAIL' } def memory_cpu(test_pass=True): if test_pass: return { 'memory': { 'minimum': 16.0, 'actual': 251.88 }, 'cpu_cores': { 'minimum': 8, 'actual': 64 } } return { 'memory': { 'minimum': 16.0, 'actual': 14.88 }, 'cpu_cores': { 'minimum': 8, 'actual': 4 } } def mounts(test_pass=True): if test_pass: return { '/': { 'recommended': 130.0, 'free': 498.13, 'total': 499.7, 'mount_options': 'rw,inode64,noquota', 'file_system': 'xfs', 'ftype': '1' }, '/tmp': { 'recommended': 30.0, 'free': 39.13, 'total': 39.7, 'mount_options': 'rw,inode64,noquota', 'file_system': 'ext4' }, } return { '/': { 'recommended': 0.0, 'free': 19.13, 'total': 19.7, 'mount_options': 'rw,inode64,noquota', 'file_system': 'xfs', 'ftype': '0' }, '/tmp': { 'recommended': 30.0, 'free': 19.13, 'total': 19.7, 'mount_options': 'rw,inode64,noquota', 'file_system': 'ext4' }, '/opt/anaconda': { 'recommended': 100.0, 'free': 98.13, 'total': 99.7, 'mount_options': 'rw,inode64,noquota', 'file_system': 'ext4' }, '/var': { 'recommended': 100.0, 'free': 98.13, 'total': 99.7, 'mount_options': 'rw,inode64,noquota', 'file_system': 'ext4' } } def resolv_conf(test_pass=True): if test_pass: return { 'search_domains': ['test.domain', 'another.domain'], 'options': [] } return { 'search_domains': [ 'test.domain', 'another.domain', 'again.domain', 'optional.domain' ], 'options': ['timeout:2', 'rotate'] } def resolv_conf_warn(): return { 'search_domains': ['test.domain', 'another.domain'], 'options': ['rotate'] } def ports(test_pass=True): if test_pass: return { 'eth0': { '80': 'open', '443': 'open', '32009': 'open', '61009': 'open', '65535': 'open' } } return { 'eth0': { '80': 'open', '443': 'closed', '32009': 'closed', '61009': 'closed', '65535': 'closed' } } def agents(test_pass=True): if test_pass: return {'running': []} return {'running': ['puppet-agent']} def modules(test_pass=True): if test_pass: return { 'missing': [], 'enabled': [ 'iptable_filter', 'br_netfilter', 'iptable_nat', 'ebtables', 'overlay' ] } return { 'missing': [ 'iptable_filter', 'br_netfilter', 'iptable_nat', 'ebtables' ], 'enabled': ['overlay'] } def sysctl(test_pass=True): if test_pass: return { 'enabled': [ 'net.bridge.bridge-nf-call-iptables', 'net.bridge.bridge-nf-call-ip6tables', 'fs.may_detach_mounts', 'net.ipv4.ip_forward' ], 'disabled': [] } return { 'enabled': ['net.ipv4.ip_forward'], 'disabled': [ 'net.bridge.bridge-nf-call-ip6tables', 'net.bridge.bridge-nf-call-iptables', 'fs.may_detach_mounts' ] } def selinux(test_pass=True): if test_pass: return { 'getenforce': 'disabled', 'config': 'permissive' } return { 'getenforce': 'disabled', 'config': 'enforcing' } def infinity(test_pass=True): if test_pass: return True return False
def os_return(distro): if distro == 'rhel': return_value = {'distribution': 'centos', 'version': '7.5', 'dist_name': 'CentOS Linux', 'based_on': 'rhel'} elif distro == 'ubuntu': return_value = {'distribution': 'ec2', 'version': '16.04', 'dist_name': 'Ubuntu', 'based_on': 'debian'} elif distro == 'suse': return_value = {'distribution': 'sles', 'version': '12', 'dist_name': 'SLES', 'based_on': 'suse'} return return_value def system_compatability(test_pass=True): if test_pass: return {'OS': 'PASS', 'version': 'PASS'} return {'OS': 'PASS', 'version': 'FAIL'} def memory_cpu(test_pass=True): if test_pass: return {'memory': {'minimum': 16.0, 'actual': 251.88}, 'cpu_cores': {'minimum': 8, 'actual': 64}} return {'memory': {'minimum': 16.0, 'actual': 14.88}, 'cpu_cores': {'minimum': 8, 'actual': 4}} def mounts(test_pass=True): if test_pass: return {'/': {'recommended': 130.0, 'free': 498.13, 'total': 499.7, 'mount_options': 'rw,inode64,noquota', 'file_system': 'xfs', 'ftype': '1'}, '/tmp': {'recommended': 30.0, 'free': 39.13, 'total': 39.7, 'mount_options': 'rw,inode64,noquota', 'file_system': 'ext4'}} return {'/': {'recommended': 0.0, 'free': 19.13, 'total': 19.7, 'mount_options': 'rw,inode64,noquota', 'file_system': 'xfs', 'ftype': '0'}, '/tmp': {'recommended': 30.0, 'free': 19.13, 'total': 19.7, 'mount_options': 'rw,inode64,noquota', 'file_system': 'ext4'}, '/opt/anaconda': {'recommended': 100.0, 'free': 98.13, 'total': 99.7, 'mount_options': 'rw,inode64,noquota', 'file_system': 'ext4'}, '/var': {'recommended': 100.0, 'free': 98.13, 'total': 99.7, 'mount_options': 'rw,inode64,noquota', 'file_system': 'ext4'}} def resolv_conf(test_pass=True): if test_pass: return {'search_domains': ['test.domain', 'another.domain'], 'options': []} return {'search_domains': ['test.domain', 'another.domain', 'again.domain', 'optional.domain'], 'options': ['timeout:2', 'rotate']} def resolv_conf_warn(): return {'search_domains': ['test.domain', 'another.domain'], 'options': ['rotate']} def ports(test_pass=True): if test_pass: return {'eth0': {'80': 'open', '443': 'open', '32009': 'open', '61009': 'open', '65535': 'open'}} return {'eth0': {'80': 'open', '443': 'closed', '32009': 'closed', '61009': 'closed', '65535': 'closed'}} def agents(test_pass=True): if test_pass: return {'running': []} return {'running': ['puppet-agent']} def modules(test_pass=True): if test_pass: return {'missing': [], 'enabled': ['iptable_filter', 'br_netfilter', 'iptable_nat', 'ebtables', 'overlay']} return {'missing': ['iptable_filter', 'br_netfilter', 'iptable_nat', 'ebtables'], 'enabled': ['overlay']} def sysctl(test_pass=True): if test_pass: return {'enabled': ['net.bridge.bridge-nf-call-iptables', 'net.bridge.bridge-nf-call-ip6tables', 'fs.may_detach_mounts', 'net.ipv4.ip_forward'], 'disabled': []} return {'enabled': ['net.ipv4.ip_forward'], 'disabled': ['net.bridge.bridge-nf-call-ip6tables', 'net.bridge.bridge-nf-call-iptables', 'fs.may_detach_mounts']} def selinux(test_pass=True): if test_pass: return {'getenforce': 'disabled', 'config': 'permissive'} return {'getenforce': 'disabled', 'config': 'enforcing'} def infinity(test_pass=True): if test_pass: return True return False