content
stringlengths
7
1.05M
price_list = { 1 : 4.0, 2 : 4.5, 3 : 5.0, 4 : 2.0, 5 : 1.5} values = input() product_code, price_product = [int(value) for value in values.split(' ')] print('Total: R$ {:.2f}'.format(price_list[product_code] * price_product))
# try out the Python stack functions # TODO: create a new empty stack stack = [] # TODO: push items onto the stack stack.append(1) stack.append(2) stack.append(3) stack.append(4) # TODO: print the stack contents print(stack) #TODO: pop an item off the stack x = stack.pop() print(x) print(stack)
class Sword(): def __init__(self, name, damage): self.damage = damage self.name = name @staticmethod def showAbilities(): print("Swords can only attack orcs and elves, and do zero damage agains magic armour.") Sword.showAbilities()
# 피보나치 구하는 함수 def fiboonacci(num): output = 1 before1 = before2 = 1 if num == 0: output = 0 elif num == 1 or num == 2: output = 1 else: for i in range(num - 2): before1 = before2 # 1 1 2 before2 = output # 1 2 3 output = before1 + before2 # 2 3 return output T = int(input()) # 테스트케이스의 수 for i in range(T): N = int(input()) if N >= 2: a = fiboonacci(N - 1) b = fiboonacci(N) elif N == 1: a = 0 b = 1 elif N == 0: a = 1 b = 0 print(a, b)
class EdsError(Exception): """EDS base exception.""" class DuplicateIncludeError(Exception): """Raised when a duplicate include occurs.""" class PluginNameNotFoundError(EdsError): """Raised when a specific plugin is not found.""" class PluginNameMismatchError(EdsError): """Raised when a plugin name does not match the 'plugin_name' attribute of the object.""" class UnknownPluginIntefaceError(EdsError): """Raised when a plugin group or interface is unknown.""" class PluginInterfaceNotImplementedError(EdsError): """Raised when a plugin does not implement the expected interface.""" class DuplicatePluginError(EdsError): """Raised when a specific name has multiple plugins.""" class NoPluginsFoundError(EdsError): """Raised when no template plugins are found.""" class PluginNoNameAttributeError(EdsError): """Raised when a plugin has no 'plugin_name' attribute."""
''' instantiating a class The process of creating a an object from a class. '''
# # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD # # SPDX-License-Identifier: Apache-2.0 # SOC_IRAM_LOW = 0x4037c000 SOC_IRAM_HIGH = 0x403e0000 SOC_DRAM_LOW = 0x3fc80000 SOC_DRAM_HIGH = 0x3fce0000 SOC_RTC_DRAM_LOW = 0x50000000 SOC_RTC_DRAM_HIGH = 0x50002000 SOC_RTC_DATA_LOW = 0x50000000 SOC_RTC_DATA_HIGH = 0x50002000
# greaseweazle/image/hfe.py # # Written & released by Keir Fraser <keir.xen@gmail.com> # # This is free and unencumbered software released into the public domain. # See the file COPYING for more details, or visit <http://unlicense.org>. class HFE: def __init__(self, start_cyl, nr_sides): self.start_cyl = start_cyl self.nr_sides = nr_sides self.nr_revs = None self.track_list = [] @classmethod def from_file(cls, dat): hfe = cls(0, 2) return hfe def get_track(self, cyl, side, writeout=False): return None def append_track(self, flux): pass def get_image(self): return bytes() # Local variables: # python-indent: 4 # End:
# ------------------------------------------------------------------------------ # Access to the CodeHawk Binary Analyzer Analysis Results # Author: Henny Sipma # ------------------------------------------------------------------------------ # The MIT License (MIT) # # Copyright (c) 2016-2020 Kestrel Technology LLC # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # ------------------------------------------------------------------------------ class JumpTable(object): def __init__(self,app,x): self.app = app self.x = x self.base = self.x.get('start') self.tgts = [ n.get('a') for n in self.x.findall('tgt') ] def get_targets(self): return self.tgts def __str__(self): lines = [] lines.append('base: ' + str(self.base)) for t in self.tgts: lines.append(' ' + str(t)) return '\n'.join(lines)
# @desc By Anay '24 def check_age(age): if age < 21: return age return age + 5 def main(): print(check_age(5)) print(check_age(29)) print(check_age(42)) print(check_age(15)) print(check_age(0.38)) print(check_age(21)) if __name__ == '__main__': main()
# https://projecteuler.net/problem=91 # Fast enough """ Note that: OP^2 = X_P^2 + Y_P^2 OQ^2 = X_Q^2 + Y_Q^2 PQ^2 = (X_P - X_Q)^2 + (Y_P - Y_Q)^2 There are 3 cases: 1. OP^2 + OQ^2 = PQ^2 -> X_P * X_Q + Y_P * Y_Q = 0 2. OP^2 + PQ^2 = OQ^2 -> X_P^2 + Y_P^2 - X_P * X_Q - Y_P * Y_Q = 0 3. OQ^2 + PQ^2 = OP^2 -> X_Q^2 + Y_Q^2 - X_P * X_Q - Y_P * Y_Q = 0 """ N = 50 ans = 0 for xP in range(N+1): for yP in range(N+1): if xP == 0 and yP == 0: continue alpha = xP**2 + yP**2 for xQ in range(N+1): for yQ in range(N+1): if xQ == 0 and yQ == 0: continue if xP == xQ and yP == yQ: continue beta = xQ**2 + yQ**2 gamma = xP * xQ + yP * yQ if gamma*(alpha - gamma)*(beta - gamma) == 0: ans = ans + 1 # For each pair (P = (x1, y1), Q = (x2, y2)), we have that (P = (x2, y2), Q = (x1, y1)) is also counted a solution. # So we divide the current answer by 2. print(ans//2)
#test print('==================================') print(' this is just a test ') print('==================================') num = int(input('insert a number: ')) print((num * 5) % 3)
def is_isogram(word): word_dict = dict() for c in word: c = c.lower() if ord('a') <= ord(c) <= ord('z'): word_dict[c] = word_dict.get(c, 0) + 1 if word_dict[c] >= 2: return False return True
class Vector3f(object,IEquatable[Vector3f],IComparable[Vector3f],IComparable,IEpsilonFComparable[Vector3f]): """ Vector3f(x: Single,y: Single,z: Single) """ @staticmethod def Add(point,vector): """ Add(point: Point3f,vector: Vector3f) -> Point3f """ pass def CompareTo(self,other): """ CompareTo(self: Vector3f,other: Vector3f) -> int """ pass @staticmethod def CrossProduct(a,b): """ CrossProduct(a: Vector3f,b: Vector3f) -> Vector3f """ pass def EpsilonEquals(self,other,epsilon): """ EpsilonEquals(self: Vector3f,other: Vector3f,epsilon: Single) -> bool """ pass def Equals(self,*__args): """ Equals(self: Vector3f,vector: Vector3f) -> bool Equals(self: Vector3f,obj: object) -> bool """ pass def GetHashCode(self): """ GetHashCode(self: Vector3f) -> int """ pass @staticmethod def Multiply(*__args): """ Multiply(t: Single,vector: Vector3f) -> Vector3f Multiply(vector: Vector3f,t: Single) -> Vector3f """ pass def PerpendicularTo(self,other): """ PerpendicularTo(self: Vector3f,other: Vector3f) -> bool """ pass def Reverse(self): """ Reverse(self: Vector3f) -> bool """ pass def Rotate(self,angleRadians,rotationAxis): """ Rotate(self: Vector3f,angleRadians: float,rotationAxis: Vector3f) -> bool """ pass def ToString(self): """ ToString(self: Vector3f) -> str """ pass def Transform(self,transformation): """ Transform(self: Vector3f,transformation: Transform) """ pass def Unitize(self): """ Unitize(self: Vector3f) -> bool """ pass def __eq__(self,*args): """ x.__eq__(y) <==> x==y """ pass def __ge__(self,*args): pass def __gt__(self,*args): pass def __init__(self,*args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass def __le__(self,*args): pass def __lt__(self,*args): pass def __mul__(self,*args): """ x.__mul__(y) <==> x*y """ pass @staticmethod def __new__(self,x,y,z): """ __new__[Vector3f]() -> Vector3f __new__(cls: type,x: Single,y: Single,z: Single) """ pass def __ne__(self,*args): pass def __radd__(self,*args): """ __radd__(point: Point3f,vector: Vector3f) -> Point3f """ pass def __reduce_ex__(self,*args): pass def __repr__(self,*args): """ __repr__(self: object) -> str """ pass def __rmul__(self,*args): """ __rmul__(t: Single,vector: Vector3f) -> Vector3f """ pass def __str__(self,*args): pass Length=property(lambda self: object(),lambda self,v: None,lambda self: None) """Get: Length(self: Vector3f) -> Single """ X=property(lambda self: object(),lambda self,v: None,lambda self: None) """Get: X(self: Vector3f) -> Single Set: X(self: Vector3f)=value """ Y=property(lambda self: object(),lambda self,v: None,lambda self: None) """Get: Y(self: Vector3f) -> Single Set: Y(self: Vector3f)=value """ Z=property(lambda self: object(),lambda self,v: None,lambda self: None) """Get: Z(self: Vector3f) -> Single Set: Z(self: Vector3f)=value """ Unset=None XAxis=None YAxis=None ZAxis=None Zero=None # variables with complex values
def reverse(x): num = [] # 存储符号位每一位的数字 if x >= 0: num.append(1) # 非负数 else: num.append(-1) x = abs(x) # 获取每一位的数字 while x >= 10: num.append(x % 10) x = int(x / 10) num.append(x) # 反转数字 res = 0 length = len(num) - 1 for i in range(length): res += num[i+1] * (10 ** (length - i -1)) res = res * num[0] if res <= 2 ** 31 - 1 and res >= -(2 ** 31): return res else: return 0 print(reverse(-0))
option = None def pytest_addoption(parser): parser.addoption('--nproc', help='run tests on n processes', type=int, default=1) parser.addoption('--lsf', help='run tests on with lsf clusters', action="store_true") parser.addoption('--specs', help='test specs') parser.addoption('--cases', help='test case list string or file') parser.addoption('--basic-only', help='only run basic test cases for instructions', action="store_true") parser.addoption('--retry', help='retry last failed cases', action="store_true") parser.addoption('--xlen', help='bits of int register (xreg)', default=64, choices=[32,64], type=int) parser.addoption('--flen', help='bits of float register (freg)', default=64, choices=[32,64], type=int) parser.addoption('--vlen', help='bits of vector register (vreg)', default=1024, choices=[256, 512, 1024, 2048], type=int) parser.addoption('--elen', help='bits of maximum size of vector element', default=64, choices=[32, 64], type=int) parser.addoption('--slen', help='bits of vector striping distance', default=1024, choices=[256, 512, 1024, 2048], type=int) parser.addoption('--clang', help='path of clang compiler', default='clang') parser.addoption('--spike', help='path of spike simulator', default='spike') parser.addoption('--vcs', help='path of vcs simulator', default=None) parser.addoption('--gem5', help='path of gem5 simulator', default=None) parser.addoption('--fsdb', help='generate fsdb waveform file when running vcs simulator', action="store_true") parser.addoption('--tsiloadmem', help='Load binary through TSI instead of backdoor', action="store_true") parser.addoption('--vcstimeout', help='Number of cycles after which VCS stops', default=1000000, type=int) parser.addoption('--verilator', help='path of verilator simulator', default=None)
class ListNode: def __init__(self, x): self.val = x self.next = None def merge_list(head1, head2): if head1 is None: return head2 if head2 is None: return head1 if head2.val < head1.val: head1, head2 = head2, head1 head1.next = merge_list(head1.next, head2) return head1 def get_size(head): curr = head count = 0 while curr is not None: curr = curr.next count += 1 return count def partition(head): size = get_size(head) if size <= 2: return head, size curr = head for i in range(size//2): curr = curr.next return curr, size def sort_list(head: ListNode) -> ListNode: if head is None: return None mid, size = partition(head) if size == 1: return head mid_next = mid.next mid.next = None head = sort_list(head) mid_next = sort_list(mid_next) head = merge_list(head, mid_next) return head def print_list(head): while head is not None: print(head.val) head = head.next def main(): node1 = ListNode(4) node2 = ListNode(3) node3 = ListNode(2) node1.next = node2 node2.next = node3 ans = sort_list(node1) print_list(ans) main()
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def nextLargerNodes(self, head): """ :type head: ListNode :rtype: List[int] """ array = [] stack = [] while head: array.append(0) # Keep going until we find a great value or the stack is empty while stack and stack[-1][1] < head.val: # Assign head's value to array at index from stack array[stack.pop()[0]] = head.val # Add index and head's value to end of stack stack.append((len(array) - 1, head.val)) # Move forward in list head = head.next return array
# 公众号:MarkerJava # 开发时间:2020/10/5 17:25 # scores = {'kobe': 100, 'lebron': 99, 'AD': 88} # 第一种方式使用[] # print(scores['kobe']) # 第二种方式使用get()方法 # print(scores.get('lebron')) # print(scores.get('ab')) scores1 = {'kobe': 100, 'lebron': 99, 'AD': 88} print('kobe' in scores1) print('kobe' not in scores1) # 删除指定的key-value del scores1['kobe'] print(scores1) # 新增元素 scores1['张三'] = 66 print(scores1) # 修改元素 scores1['张三'] = 67 print(scores1)
first_number = int(input()) second_number = int(input()) large_number = max(first_number, second_number) small_number = min(first_number, second_number) remaining_number = 0 gcd = 0 while True: times = large_number // small_number remain = large_number - ( small_number * times ) if 0 == remain: gcd = small_number break else: large_number = small_number small_number = remain print(gcd)
# # PySNMP MIB module HM2-TRAFFICMGMT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HM2-TRAFFICMGMT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:19:47 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint") hm2ConfigurationMibs, HmEnabledStatus = mibBuilder.importSymbols("HM2-TC-MIB", "hm2ConfigurationMibs", "HmEnabledStatus") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") iso, Counter32, IpAddress, TimeTicks, Gauge32, Counter64, ModuleIdentity, Bits, MibIdentifier, Integer32, NotificationType, Unsigned32, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "Counter32", "IpAddress", "TimeTicks", "Gauge32", "Counter64", "ModuleIdentity", "Bits", "MibIdentifier", "Integer32", "NotificationType", "Unsigned32", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") hm2TrafficMgmtMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 248, 11, 31)) hm2TrafficMgmtMib.setRevisions(('2011-03-16 00:00',)) if mibBuilder.loadTexts: hm2TrafficMgmtMib.setLastUpdated('201103160000Z') if mibBuilder.loadTexts: hm2TrafficMgmtMib.setOrganization('Hirschmann Automation and Control GmbH') hm2TrafficMgmtMibNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 11, 31, 0)) hm2TrafficMgmtMibObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 248, 11, 31, 1)) hm2TrafficMgmtIfTable = MibTable((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 1), ) if mibBuilder.loadTexts: hm2TrafficMgmtIfTable.setStatus('current') hm2TrafficMgmtIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: hm2TrafficMgmtIfEntry.setStatus('current') hm2TrafficMgmtIfFlowControl = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 1, 1, 1), HmEnabledStatus().clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hm2TrafficMgmtIfFlowControl.setStatus('current') hm2TrafficMgmtIfEgressShapingRate = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 1, 1, 2), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hm2TrafficMgmtIfEgressShapingRate.setStatus('current') hm2TrafficMgmtIfEgressShapingRateUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("percent", 1), ("kbps", 2))).clone('percent')).setMaxAccess("readonly") if mibBuilder.loadTexts: hm2TrafficMgmtIfEgressShapingRateUnit.setStatus('current') hm2TrafficMgmtIfIngressStormCtlThresholdUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("percent", 1), ("pps", 2))).clone('percent')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hm2TrafficMgmtIfIngressStormCtlThresholdUnit.setStatus('current') hm2TrafficMgmtIfIngressStormCtlBcastMode = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 1, 1, 5), HmEnabledStatus().clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hm2TrafficMgmtIfIngressStormCtlBcastMode.setStatus('current') hm2TrafficMgmtIfIngressStormCtlBcastThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 1, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 14880000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hm2TrafficMgmtIfIngressStormCtlBcastThreshold.setStatus('current') hm2TrafficMgmtIfIngressStormCtlMcastMode = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 1, 1, 7), HmEnabledStatus().clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hm2TrafficMgmtIfIngressStormCtlMcastMode.setStatus('current') hm2TrafficMgmtIfIngressStormCtlMcastThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 1, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 14880000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hm2TrafficMgmtIfIngressStormCtlMcastThreshold.setStatus('current') hm2TrafficMgmtIfIngressStormCtlUcastMode = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 1, 1, 9), HmEnabledStatus().clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hm2TrafficMgmtIfIngressStormCtlUcastMode.setStatus('current') hm2TrafficMgmtIfIngressStormCtlUcastThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 1, 1, 10), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 14880000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: hm2TrafficMgmtIfIngressStormCtlUcastThreshold.setStatus('current') hm2TrafficMgmtFlowControl = MibScalar((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 2), HmEnabledStatus().clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hm2TrafficMgmtFlowControl.setStatus('current') hm2TrafficMgmtIngressStormBucketType = MibScalar((1, 3, 6, 1, 4, 1, 248, 11, 31, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("single-bucket", 1), ("multi-bucket", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hm2TrafficMgmtIngressStormBucketType.setStatus('current') mibBuilder.exportSymbols("HM2-TRAFFICMGMT-MIB", hm2TrafficMgmtIfIngressStormCtlBcastThreshold=hm2TrafficMgmtIfIngressStormCtlBcastThreshold, PYSNMP_MODULE_ID=hm2TrafficMgmtMib, hm2TrafficMgmtIngressStormBucketType=hm2TrafficMgmtIngressStormBucketType, hm2TrafficMgmtIfEgressShapingRateUnit=hm2TrafficMgmtIfEgressShapingRateUnit, hm2TrafficMgmtMibNotifications=hm2TrafficMgmtMibNotifications, hm2TrafficMgmtIfIngressStormCtlBcastMode=hm2TrafficMgmtIfIngressStormCtlBcastMode, hm2TrafficMgmtIfIngressStormCtlThresholdUnit=hm2TrafficMgmtIfIngressStormCtlThresholdUnit, hm2TrafficMgmtIfIngressStormCtlMcastThreshold=hm2TrafficMgmtIfIngressStormCtlMcastThreshold, hm2TrafficMgmtIfTable=hm2TrafficMgmtIfTable, hm2TrafficMgmtFlowControl=hm2TrafficMgmtFlowControl, hm2TrafficMgmtIfIngressStormCtlMcastMode=hm2TrafficMgmtIfIngressStormCtlMcastMode, hm2TrafficMgmtIfIngressStormCtlUcastMode=hm2TrafficMgmtIfIngressStormCtlUcastMode, hm2TrafficMgmtIfEgressShapingRate=hm2TrafficMgmtIfEgressShapingRate, hm2TrafficMgmtMib=hm2TrafficMgmtMib, hm2TrafficMgmtIfFlowControl=hm2TrafficMgmtIfFlowControl, hm2TrafficMgmtMibObjects=hm2TrafficMgmtMibObjects, hm2TrafficMgmtIfEntry=hm2TrafficMgmtIfEntry, hm2TrafficMgmtIfIngressStormCtlUcastThreshold=hm2TrafficMgmtIfIngressStormCtlUcastThreshold)
# Faça um algoritimo em Python que receba o nome e três notas de um aluno. Este deverá exibir o nome e a média do mesmo #saidas: nome, media #entradas: nome, 3 notas #processamento: calcular a média nome = input("Digite o nome do aluno: ") nota1 = input("Digite a nota 1: ") nota2 = input("Digite a nota 2: ") nota3 = input("Digite a nota 3: ") media = (float(nota1) + float(nota2) + float(nota3))/3 print("Nome: " + nome) print("Média: " + str(media))
def find(s): if s > 0 : for i in range(9): if s + i == 10: return i else : return 0 s = 0 t = int(input()) for _ in range(int(t)): n = int(input()) f = n while(n>0): d = n%10 s += d n = n//10 x = find(s) print(str(f)+str(x)) d = 0 s = 0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @File : extractor.py @Time : 2020/4/19 14:55 @Author : Empty Chan @Contact : chen19941018@gmail.com @Description: 解析器,解析爬虫模板的内容,并做处理 @License : (C) Copyright 2016-2020, iFuture Corporation Limited. """
REQUEST_BODY_JSON = """ { "customer_ids": [ "string" ] } """ RESPONSE_200_JSON = """ { "customers_balance": [ { "balance": 1.1, "customer_id": "string" } ] } """
def get_hello(name: str) -> tuple: # noqa: E501 """ # noqa: E501 :param name: :type name: str :rtype: None """ return {"response": f" ola {name}. bem vindo ao clube"}, 200 # import aiohttp # from connexion.lifecycle import ConnexionResponse # async def get_hello(name: str) -> tuple: # noqa: E501 # """ # # noqa: E501 # :param name: # :type name: str # :rtype: None # """ # return aiohttp.web.json_response( # {"response": f" ola {name}. bem vindo ao clube"}, 200 # ) # async def get_hello(name: str) -> tuple: # noqa: E501 # """ # # noqa: E501 # :param name: # :type name: str # :rtype: None # """ # return aiohttp.web.json_response( # {"response": f" ola {name}. bem vindo ao clube"}, 200 # )
x=int(input()) if x < 0: print(-x) else: print(x)
students = int(input()) students_dict = {} top_students = {} for _ in range(students): name = input() grade = float(input()) if name in students_dict: students_dict[name].append(grade) else: students_dict[name] = [grade] # for key, item in students_dict.items(): # if sum(item) / len(item) >= 4.50: # top_students[key] = sum(item) / len(item) top_students = {k: sum(v) / len(v) for k, v in students_dict.items() if sum(v) / len(v) >= 4.50} top_students = dict(sorted(top_students.items(), key=lambda el: -el[1])) [print(f"{name} -> {grade:.2f}") for name, grade in top_students.items()]
TASKS = { "binary_classification": 1, "multi_class_classification": 2, "entity_extraction": 4, "extractive_question_answering": 5, "summarization": 8, "single_column_regression": 10, "speech_recognition": 11, } DATASETS_TASKS = ["text-classification", "question-answering-extractive"]
# enable: C0103 class FooClass: """ Attribute names should be in mixed case, with the first letter lower case, each word separated by having its first letter capitalized just like method names. And all private names should begin with an underscore. """ def __init__(self): """ A init of this class """ # Bad names. self.foo_bar_zar = None self.FooBarZar = None self.a = None self._fooBar_ = None self._fooBar__ = None self.__fooBar_ = None self.___longStart__ = None self.__longEnd___ = None # Good names. self.fooBarZar = None self._fooBarZar = None self.foobar = None # Any __*__ name is accepted. self.__foobar__ = None self.__fooBar__ = None self.__foo_bar__ = None self.__dict__ = {} self.__version__ = {} self.__a__ = {} # In some cases constants are lazy initialized as instance members. self.FOOBARZAR = None
class GuiAbstractObject: def is_clicked(self, mouse): area = (self.position[0] * self.screen.engine.settings.graphic['screen']['resolution_scale'][0], self.position[1] * self.screen.engine.settings.graphic['screen']['resolution_scale'][1], (self.position[0] + self.position[2]) * self.screen.engine.settings.graphic['screen']['resolution_scale'][0], (self.position[1] + self.position[3]) * self.screen.engine.settings.graphic['screen']['resolution_scale'][1] ) if mouse[0][0] >= area[0] and mouse[0][0] <= area[2] \ and mouse[0][1] >= area[1] and mouse[0][1] <= area[3]: return True return False def clicked(self, mouse): print('clicked')
#questão 07 print('='*50) print(" " * 5, "Encontre o resultado de um n° fatorial") print('='*50) num = int(input("Digite o valor do numero: ")) fat = 1 x = 2 while x <= num: fat = fat * x x = x +1 print(f"O resultado do valor de [{num}!] é: {fat}")
class NagiosException(Exception): pass class NagiosUnexpectedResultError(Exception): pass
#!/usr/bin/env python log_dir = os.environ['LOG_DIR'] admin_server_listen_address = os.environ['ADMIN_SERVER_LISTEN_ADDRESS'] admin_server_listen_port = os.environ['ADMIN_SERVER_LISTEN_PORT'] admin_username = os.environ['ADMIN_USERNAME'] admin_password = os.environ['ADMIN_PASSWORD'] managed_server_name = os.environ['MANAGED_SERVER_NAME'] ###################################################################### def set_server_datasource_log_config(_log_dir, _server_name): cd('/Servers/' + _server_name + '/DataSource/' + _server_name) cmo.setRmiJDBCSecurity('Compatibility') cd('/Servers/' + _server_name + '/DataSource/' + _server_name + '/DataSourceLogFile/' + _server_name) cmo.setFileName(_log_dir + '/' + _server_name + '/' + 'datasource.' + _server_name + '.%%yyyy%%%%MM%%%%dd%%_%%HH%%%%mm%%%%ss%%.log') # cmo.setFileName('/dev/null') cmo.setRotationType('byTime') cmo.setRotationTime('00:00') cmo.setFileTimeSpan(24) cmo.setNumberOfFilesLimited(True) cmo.setFileCount(30) cmo.setRotateLogOnStartup(False) ###################################################################### admin_server_url = 't3://' + admin_server_listen_address + ':' + admin_server_listen_port connect(admin_username, admin_password, admin_server_url) edit() startEdit() domain_version = cmo.getDomainVersion() set_server_datasource_log_config(log_dir, managed_server_name) save() activate() exit()
print("Choose from below options:") print("1.Celsius to Fahrenheit.") print("2.Fahrenheit to Celsius.") o=int(input("option(1/2):")) if(o==1): c=float(input("Temperature in Celsius:")) f=1.8*(c)+32.0 f=round(f,1) #temperature in fahrenheit precise to 1 decimal place print("Temperature in Fahrenheit:",f) elif(o==2): f=float(input("Temperature in Fahrenheit:")) c=(f-32)/1.8 c=round(c,1) #temperature in celsius precise to 1 decimal place print("Temperature in Celsius:",c) else: print("Choose 1 or 2.")
#!/usr/bin/env python # $Revision: 1.1.1.12 $ $Date: 2007/01/08 14:40:09 $ kgm """Monitor 1.8 This dummy module is only provided for backward compatibility. It does nothing. class Monitor is now part of Simulation and SimulationXXX.""" __version__ ='1.8 $Revision: 1.1.1.12 $ $Date: 2007/01/08 14:40:09 $' pass
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # */AIPND-revision/intropyproject-classify-pet-images/adjust_results4_isadog.py # # PROGRAMMER: Sotirios Zikas # DATE CREATED: April 16, 2019 def adjust_results4_isadog(results_dic, dogfile): """ Adjusts the results dictionary to determine if classifier correctly classified images 'as a dog' or 'not a dog' especially when not a match. Demonstrates if model architecture correctly classifies dog images even if it gets dog breed wrong (not a match). Parameters: results_dic - Dictionary with 'key' as image filename and 'value' as a List. Where the list will contain the following items: index 0 = pet image label (string) index 1 = classifier label (string) index 2 = 1/0 (int) where 1 = match between pet image and classifer labels and 0 = no match between labels ------ where index 3 & index 4 are added by this function ----- NEW - index 3 = 1/0 (int) where 1 = pet image 'is-a' dog and 0 = pet Image 'is-NOT-a' dog. NEW - index 4 = 1/0 (int) where 1 = Classifier classifies image 'as-a' dog and 0 = Classifier classifies image 'as-NOT-a' dog. dogfile - A text file that contains names of all dogs from the classifier function and dog names from the pet image files. This file has one dog name per line dog names are all in lowercase with spaces separating the distinct words of the dog name. Dog names from the classifier function can be a string of dog names separated by commas when a particular breed of dog has multiple dog names associated with that breed (ex. maltese dog, maltese terrier, maltese) (string - indicates text file's filename) Returns: None - results_dic is mutable data type so no return needed. """ dognames_dic = dict() with open(dogfile, "r") as infile: line = infile.readline() while line != "": line = line.rstrip('\n') if line not in dognames_dic: dognames_dic[line] = [1] line = infile.readline() for key in results_dic: if results_dic[key][0] in dognames_dic: if results_dic[key][1] in dognames_dic: results_dic[key].extend((1,1)) else: results_dic[key].extend((1,0)) else: if results_dic[key][1] in dognames_dic: results_dic[key].extend((0,1)) else: results_dic[key].extend((0,0))
sub = { "а" : { "freq": 10.234, "count": 3243, "sub" : "б" }, "б" : { "freq": 8.324, "count": 123, "sub" : "д" } } print(sub['а']['freq'], sub['б']['sub'])
# This is a single line comment in Python print("Hello World!") # This is a single comment """ For multi-line comments use three double quotes ... """
""" A rnd component generator. """ class RandomComponent: def __init__(self, gen, str, var, par): """ Create a new RandomComponent. :param gen: the random generator. :param str: (dict) streams configuration. :param var: (dict) variates configuration. :param par: (dict) variates parameters. """ self.gen = gen self.str = str self.var = var self.par = par def generate(self, key): """ Generate a random number for the specified key. :param key: a key. :return: a random number for the specified key. """ self.gen.stream(self.str[key]) return self.var[key].generator.generate(u=self.gen, **self.par[key]) def __str__(self): """ String representation. :return: the string representation. """ sb = [ "{attr}={value}".format(attr=attr, value=self.__dict__[attr]) for attr in self.__dict__ if not attr.startswith("__") and not callable(getattr(self, attr)) ] return "RandomComponent({}:{})".format(id(self), ", ".join(sb))
__author__ = 'Nils Schmidt' def memoize_pos_args(fun): """ Memoize the functions positional arguments and return the same result for it """ # arguments, result memo = {} def wrapper(*args, **kwargs): if args in memo: return memo[args] else: memoize = True if kwargs.get("no_memoize"): del kwargs["no_memoize"] memoize = False res = fun(*args, **kwargs) if memoize: memo[args] = res return res return wrapper
class Symbol: def __init__(self,S,sign=1): if type(S) != str: raise TypeError("Symbols must be strings") if S not in "abcdefghijklmnopqrstuvwxyz": raise ValueError("Symbols must be lowercase letters") self.S = S self.sign = sign def __str__(self): if self.sign == 1: return self.S else: return f"-{self.S}" def __eq__(self,other): if type(other) == Symbol: if other.S == self.S: return True return False def __neg__(self): return Symbol(self.S,self.sign*-1) def __add__(self,other): if self == other: return Product([2,self]) else: return Sum([self,other]) ############### ## Combiners ## ############### class Product: def __init__(self,L): if type(L) != list: raise TypeError("Products must be lists") self.L = L def simplify(self): pass def __str__(self): out = "" for i in self.L: out += f"{i}" return out class Sum: def __init__(self,L): if type(L) != list: raise TypeError("Sums must be lists") self.L = L def simplify(self): pass def __str__(self): out = "" for i in self.L: out += f" + {i}" return out #class Ratio: # # def __init__(self,N,D): # self.N = N # self.D = D # # def simplify(self): # pass # # def __str__(self): # return f"({self.N})/({self.D})" # # # # # #class Power: # # def __init__(self,b,p): # self.b = b # self.p = p # # def simplify(self): # pass # # def __str__(self): # return f"{self.b}^{self.p}"
# Enter your code here. Read input from STDIN. Print output to STDOUT n=int(input()) roll_n=set(map(int,input().split())) m=int(input()) roll_m=set(map(int,input().split())) s=roll_n|roll_m print(len(s))
logLevel = 0 def log(msg): if logLevel > 0: print(msg) else: pass def setLogLevel(value): global logLevel logLevel = value
def solution(moves): moves = list(moves) programs = [chr(s) for s in range(ord("a"), ord("a") + 16)] hashmap = {program: position for position, program in enumerate(programs)} movemap = {"s": spin, "x": exchange, "p": partner} seen = [] s = "".join(programs) while s not in seen: seen.append(s) for move, instructions in moves: movemap.get(move)(instructions, programs, hashmap) s = "".join(programs) first = seen[1] billionth = seen[1000000000 % len(seen)] return first, billionth def spin(x, programs, hashmap): spin_size = int(x[0]) % len(programs) new_programs = programs[-spin_size:] + programs[:-spin_size] for i, program in enumerate(programs[-spin_size:]): hashmap[program] = i for program in programs[:-spin_size]: hashmap[program] += spin_size for i in range(len(programs)): programs[i] = new_programs[i] def exchange(positions, programs, hashmap): a, b = map(int, positions) pA, pB = programs[a], programs[b] programs[a], programs[b] = programs[b], programs[a] hashmap[pA], hashmap[pB] = hashmap[pB], hashmap[pA] def partner(prog_names, programs, hashmap): pA, pB = prog_names a, b = hashmap[pA], hashmap[pB] programs[a], programs[b] = programs[b], programs[a] hashmap[pA], hashmap[pB] = hashmap[pB], hashmap[pA] if __name__ == "__main__": with open("aoc_day_16_input.txt", "r") as f: s = ((inst[0], inst[1:].split("/")) for inst in f.readlines()[0].split(",")) answer = solution(s) print(f"Part One: {answer[0]}") print(f"Part Two: {answer[1]}")
# The Nexus software is licensed under the BSD 2-Clause license. # # You should have recieved a copy of this license with the software. # If you did not, you can find one at the following link. # # http://opensource.org/licenses/bsd-license.php if len(parts) < 5: self.client.sendServerMessage("For Make-a-Mob please use:") self.client.sendServerMessage("/entity var blocktype MovementBehavior NearBehavior") self.client.sendServerMessage("MovementBehavior: follow engulf pet random none") self.client.sendServerMessage("NearBehavior: kill explode none") var_continue = False else: if parts[2] == 0 or parts[2].lower() == "air" or parts[2].lower() == "blank" or parts[2].lower() == "clear" or parts[2].lower() == "empty" or parts[2].lower() == "none" or parts[2].lower() == "nothing": self.client.sendServerMessage("Sorry, no invisible Make-a-Mobs allowed.") var_continue = False if var_continue: try: block = int(parts[2]) except ValueError: try: block = globals()['BLOCK_%s' % parts[2].upper()] except KeyError: self.client.sendServerMessage("'%s' is not a valid block type." % parts[2]) var_continue = False if var_continue: validmovebehaviors = ["follow","engulf","pet","random","none"] movementbehavior = parts[3] if movementbehavior not in validmovebehaviors: self.client.sendServerMessage("'%s' is not a valid MovementBehavior." % movementbehavior) var_continue = False if var_continue: validnearbehaviors = ["kill","explode","none"] nearbehavior = parts[4] if nearbehavior not in validnearbehaviors: self.client.sendServerMessage("'%s' is not a valid NearBehavior." % nearbehavior) var_continue = False if var_continue: self.var_entityselected = "var" self.var_entityparts = [block,movementbehavior,nearbehavior]
del_items(0x80122D48) SetType(0x80122D48, "struct THEME_LOC themeLoc[50]") del_items(0x80123490) SetType(0x80123490, "int OldBlock[4]") del_items(0x801234A0) SetType(0x801234A0, "unsigned char L5dungeon[80][80]") del_items(0x80123130) SetType(0x80123130, "struct ShadowStruct SPATS[37]") del_items(0x80123234) SetType(0x80123234, "unsigned char BSTYPES[206]") del_items(0x80123304) SetType(0x80123304, "unsigned char L5BTYPES[206]") del_items(0x801233D4) SetType(0x801233D4, "unsigned char STAIRSUP[34]") del_items(0x801233F8) SetType(0x801233F8, "unsigned char L5STAIRSUP[34]") del_items(0x8012341C) SetType(0x8012341C, "unsigned char STAIRSDOWN[26]") del_items(0x80123438) SetType(0x80123438, "unsigned char LAMPS[10]") del_items(0x80123444) SetType(0x80123444, "unsigned char PWATERIN[74]") del_items(0x80122D38) SetType(0x80122D38, "unsigned char L5ConvTbl[16]") del_items(0x8012B6D0) SetType(0x8012B6D0, "struct ROOMNODE RoomList[81]") del_items(0x8012BD24) SetType(0x8012BD24, "unsigned char predungeon[40][40]") del_items(0x80129E60) SetType(0x80129E60, "int Dir_Xadd[5]") del_items(0x80129E74) SetType(0x80129E74, "int Dir_Yadd[5]") del_items(0x80129E88) SetType(0x80129E88, "struct ShadowStruct SPATSL2[2]") del_items(0x80129E98) SetType(0x80129E98, "unsigned char BTYPESL2[161]") del_items(0x80129F3C) SetType(0x80129F3C, "unsigned char BSTYPESL2[161]") del_items(0x80129FE0) SetType(0x80129FE0, "unsigned char VARCH1[18]") del_items(0x80129FF4) SetType(0x80129FF4, "unsigned char VARCH2[18]") del_items(0x8012A008) SetType(0x8012A008, "unsigned char VARCH3[18]") del_items(0x8012A01C) SetType(0x8012A01C, "unsigned char VARCH4[18]") del_items(0x8012A030) SetType(0x8012A030, "unsigned char VARCH5[18]") del_items(0x8012A044) SetType(0x8012A044, "unsigned char VARCH6[18]") del_items(0x8012A058) SetType(0x8012A058, "unsigned char VARCH7[18]") del_items(0x8012A06C) SetType(0x8012A06C, "unsigned char VARCH8[18]") del_items(0x8012A080) SetType(0x8012A080, "unsigned char VARCH9[18]") del_items(0x8012A094) SetType(0x8012A094, "unsigned char VARCH10[18]") del_items(0x8012A0A8) SetType(0x8012A0A8, "unsigned char VARCH11[18]") del_items(0x8012A0BC) SetType(0x8012A0BC, "unsigned char VARCH12[18]") del_items(0x8012A0D0) SetType(0x8012A0D0, "unsigned char VARCH13[18]") del_items(0x8012A0E4) SetType(0x8012A0E4, "unsigned char VARCH14[18]") del_items(0x8012A0F8) SetType(0x8012A0F8, "unsigned char VARCH15[18]") del_items(0x8012A10C) SetType(0x8012A10C, "unsigned char VARCH16[18]") del_items(0x8012A120) SetType(0x8012A120, "unsigned char VARCH17[14]") del_items(0x8012A130) SetType(0x8012A130, "unsigned char VARCH18[14]") del_items(0x8012A140) SetType(0x8012A140, "unsigned char VARCH19[14]") del_items(0x8012A150) SetType(0x8012A150, "unsigned char VARCH20[14]") del_items(0x8012A160) SetType(0x8012A160, "unsigned char VARCH21[14]") del_items(0x8012A170) SetType(0x8012A170, "unsigned char VARCH22[14]") del_items(0x8012A180) SetType(0x8012A180, "unsigned char VARCH23[14]") del_items(0x8012A190) SetType(0x8012A190, "unsigned char VARCH24[14]") del_items(0x8012A1A0) SetType(0x8012A1A0, "unsigned char VARCH25[18]") del_items(0x8012A1B4) SetType(0x8012A1B4, "unsigned char VARCH26[18]") del_items(0x8012A1C8) SetType(0x8012A1C8, "unsigned char VARCH27[18]") del_items(0x8012A1DC) SetType(0x8012A1DC, "unsigned char VARCH28[18]") del_items(0x8012A1F0) SetType(0x8012A1F0, "unsigned char VARCH29[18]") del_items(0x8012A204) SetType(0x8012A204, "unsigned char VARCH30[18]") del_items(0x8012A218) SetType(0x8012A218, "unsigned char VARCH31[18]") del_items(0x8012A22C) SetType(0x8012A22C, "unsigned char VARCH32[18]") del_items(0x8012A240) SetType(0x8012A240, "unsigned char VARCH33[18]") del_items(0x8012A254) SetType(0x8012A254, "unsigned char VARCH34[18]") del_items(0x8012A268) SetType(0x8012A268, "unsigned char VARCH35[18]") del_items(0x8012A27C) SetType(0x8012A27C, "unsigned char VARCH36[18]") del_items(0x8012A290) SetType(0x8012A290, "unsigned char VARCH37[18]") del_items(0x8012A2A4) SetType(0x8012A2A4, "unsigned char VARCH38[18]") del_items(0x8012A2B8) SetType(0x8012A2B8, "unsigned char VARCH39[18]") del_items(0x8012A2CC) SetType(0x8012A2CC, "unsigned char VARCH40[18]") del_items(0x8012A2E0) SetType(0x8012A2E0, "unsigned char HARCH1[14]") del_items(0x8012A2F0) SetType(0x8012A2F0, "unsigned char HARCH2[14]") del_items(0x8012A300) SetType(0x8012A300, "unsigned char HARCH3[14]") del_items(0x8012A310) SetType(0x8012A310, "unsigned char HARCH4[14]") del_items(0x8012A320) SetType(0x8012A320, "unsigned char HARCH5[14]") del_items(0x8012A330) SetType(0x8012A330, "unsigned char HARCH6[14]") del_items(0x8012A340) SetType(0x8012A340, "unsigned char HARCH7[14]") del_items(0x8012A350) SetType(0x8012A350, "unsigned char HARCH8[14]") del_items(0x8012A360) SetType(0x8012A360, "unsigned char HARCH9[14]") del_items(0x8012A370) SetType(0x8012A370, "unsigned char HARCH10[14]") del_items(0x8012A380) SetType(0x8012A380, "unsigned char HARCH11[14]") del_items(0x8012A390) SetType(0x8012A390, "unsigned char HARCH12[14]") del_items(0x8012A3A0) SetType(0x8012A3A0, "unsigned char HARCH13[14]") del_items(0x8012A3B0) SetType(0x8012A3B0, "unsigned char HARCH14[14]") del_items(0x8012A3C0) SetType(0x8012A3C0, "unsigned char HARCH15[14]") del_items(0x8012A3D0) SetType(0x8012A3D0, "unsigned char HARCH16[14]") del_items(0x8012A3E0) SetType(0x8012A3E0, "unsigned char HARCH17[14]") del_items(0x8012A3F0) SetType(0x8012A3F0, "unsigned char HARCH18[14]") del_items(0x8012A400) SetType(0x8012A400, "unsigned char HARCH19[14]") del_items(0x8012A410) SetType(0x8012A410, "unsigned char HARCH20[14]") del_items(0x8012A420) SetType(0x8012A420, "unsigned char HARCH21[14]") del_items(0x8012A430) SetType(0x8012A430, "unsigned char HARCH22[14]") del_items(0x8012A440) SetType(0x8012A440, "unsigned char HARCH23[14]") del_items(0x8012A450) SetType(0x8012A450, "unsigned char HARCH24[14]") del_items(0x8012A460) SetType(0x8012A460, "unsigned char HARCH25[14]") del_items(0x8012A470) SetType(0x8012A470, "unsigned char HARCH26[14]") del_items(0x8012A480) SetType(0x8012A480, "unsigned char HARCH27[14]") del_items(0x8012A490) SetType(0x8012A490, "unsigned char HARCH28[14]") del_items(0x8012A4A0) SetType(0x8012A4A0, "unsigned char HARCH29[14]") del_items(0x8012A4B0) SetType(0x8012A4B0, "unsigned char HARCH30[14]") del_items(0x8012A4C0) SetType(0x8012A4C0, "unsigned char HARCH31[14]") del_items(0x8012A4D0) SetType(0x8012A4D0, "unsigned char HARCH32[14]") del_items(0x8012A4E0) SetType(0x8012A4E0, "unsigned char HARCH33[14]") del_items(0x8012A4F0) SetType(0x8012A4F0, "unsigned char HARCH34[14]") del_items(0x8012A500) SetType(0x8012A500, "unsigned char HARCH35[14]") del_items(0x8012A510) SetType(0x8012A510, "unsigned char HARCH36[14]") del_items(0x8012A520) SetType(0x8012A520, "unsigned char HARCH37[14]") del_items(0x8012A530) SetType(0x8012A530, "unsigned char HARCH38[14]") del_items(0x8012A540) SetType(0x8012A540, "unsigned char HARCH39[14]") del_items(0x8012A550) SetType(0x8012A550, "unsigned char HARCH40[14]") del_items(0x8012A560) SetType(0x8012A560, "unsigned char USTAIRS[34]") del_items(0x8012A584) SetType(0x8012A584, "unsigned char DSTAIRS[34]") del_items(0x8012A5A8) SetType(0x8012A5A8, "unsigned char WARPSTAIRS[34]") del_items(0x8012A5CC) SetType(0x8012A5CC, "unsigned char CRUSHCOL[20]") del_items(0x8012A5E0) SetType(0x8012A5E0, "unsigned char BIG1[10]") del_items(0x8012A5EC) SetType(0x8012A5EC, "unsigned char BIG2[10]") del_items(0x8012A5F8) SetType(0x8012A5F8, "unsigned char BIG5[10]") del_items(0x8012A604) SetType(0x8012A604, "unsigned char BIG8[10]") del_items(0x8012A610) SetType(0x8012A610, "unsigned char BIG9[10]") del_items(0x8012A61C) SetType(0x8012A61C, "unsigned char BIG10[10]") del_items(0x8012A628) SetType(0x8012A628, "unsigned char PANCREAS1[32]") del_items(0x8012A648) SetType(0x8012A648, "unsigned char PANCREAS2[32]") del_items(0x8012A668) SetType(0x8012A668, "unsigned char CTRDOOR1[20]") del_items(0x8012A67C) SetType(0x8012A67C, "unsigned char CTRDOOR2[20]") del_items(0x8012A690) SetType(0x8012A690, "unsigned char CTRDOOR3[20]") del_items(0x8012A6A4) SetType(0x8012A6A4, "unsigned char CTRDOOR4[20]") del_items(0x8012A6B8) SetType(0x8012A6B8, "unsigned char CTRDOOR5[20]") del_items(0x8012A6CC) SetType(0x8012A6CC, "unsigned char CTRDOOR6[20]") del_items(0x8012A6E0) SetType(0x8012A6E0, "unsigned char CTRDOOR7[20]") del_items(0x8012A6F4) SetType(0x8012A6F4, "unsigned char CTRDOOR8[20]") del_items(0x8012A708) SetType(0x8012A708, "int Patterns[10][100]") del_items(0x80131718) SetType(0x80131718, "unsigned char lockout[40][40]") del_items(0x80131478) SetType(0x80131478, "unsigned char L3ConvTbl[16]") del_items(0x80131488) SetType(0x80131488, "unsigned char L3UP[20]") del_items(0x8013149C) SetType(0x8013149C, "unsigned char L3DOWN[20]") del_items(0x801314B0) SetType(0x801314B0, "unsigned char L3HOLDWARP[20]") del_items(0x801314C4) SetType(0x801314C4, "unsigned char L3TITE1[34]") del_items(0x801314E8) SetType(0x801314E8, "unsigned char L3TITE2[34]") del_items(0x8013150C) SetType(0x8013150C, "unsigned char L3TITE3[34]") del_items(0x80131530) SetType(0x80131530, "unsigned char L3TITE6[42]") del_items(0x8013155C) SetType(0x8013155C, "unsigned char L3TITE7[42]") del_items(0x80131588) SetType(0x80131588, "unsigned char L3TITE8[20]") del_items(0x8013159C) SetType(0x8013159C, "unsigned char L3TITE9[20]") del_items(0x801315B0) SetType(0x801315B0, "unsigned char L3TITE10[20]") del_items(0x801315C4) SetType(0x801315C4, "unsigned char L3TITE11[20]") del_items(0x801315D8) SetType(0x801315D8, "unsigned char L3ISLE1[14]") del_items(0x801315E8) SetType(0x801315E8, "unsigned char L3ISLE2[14]") del_items(0x801315F8) SetType(0x801315F8, "unsigned char L3ISLE3[14]") del_items(0x80131608) SetType(0x80131608, "unsigned char L3ISLE4[14]") del_items(0x80131618) SetType(0x80131618, "unsigned char L3ISLE5[10]") del_items(0x80131624) SetType(0x80131624, "unsigned char L3ANVIL[244]") del_items(0x80136534) SetType(0x80136534, "unsigned char dung[20][20]") del_items(0x801366C4) SetType(0x801366C4, "unsigned char hallok[20]") del_items(0x801366D8) SetType(0x801366D8, "unsigned char L4dungeon[80][80]") del_items(0x80137FD8) SetType(0x80137FD8, "unsigned char L4ConvTbl[16]") del_items(0x80137FE8) SetType(0x80137FE8, "unsigned char L4USTAIRS[42]") del_items(0x80138014) SetType(0x80138014, "unsigned char L4TWARP[42]") del_items(0x80138040) SetType(0x80138040, "unsigned char L4DSTAIRS[52]") del_items(0x80138074) SetType(0x80138074, "unsigned char L4PENTA[52]") del_items(0x801380A8) SetType(0x801380A8, "unsigned char L4PENTA2[52]") del_items(0x801380DC) SetType(0x801380DC, "unsigned char L4BTYPES[140]")
''' some other implementations: recursive: def binary_search(array, key, start, end): if end < start: return -1 else: midpoint = start + (end - start) // 2 if key < array[midpoint]: return binary_search(array, key, start, midpoint - 1) elif key > array[midpoint]: return binary_search(array, key, midpoint + 1, end) else: return midpoint iterative: def binary_search(array, key, start, end): while start <= end: midpoint = start + (end - start) // 2 if key < array[midpoint]: end = midpoint - 1 elif key > array[midpoint]: start = midpoint + 1 else: return midpoint return -1 ''' def binary_search(array, key, start, end): while start < end: midpoint = start + (end - start) // 2 if array[midpoint] < key: start = midpoint + 1 else: end = midpoint if start == end and array[start] == key: return start else: return -1
bil = -4 if (bil > 0): print("Bilangan positif") else: print("Bilangan negatif atau nol")
# -*- coding: utf-8 -*- def codigobasico(): valor1 = 800 valor2 = 100 soma = valor1+valor2 print("O valor 1 é: " + str(valor1) + ", O valor 2 é: " + str(valor2) + ", Aqui está o retorno da soma: " + str(soma)) codigobasico()
input_name: str = input() if input_name == 'Johnny': print('Hello, my love!') else: print(f'Hello, {input_name}!')
def binary_search(array, target): first = 0 last = len(array) - 1 while first <= last: midpoint = (first + last) // 2 if array[midpoint] == target: return midpoint elif array[midpoint] < target: first = midpoint + 1 elif array[midpoint] > target: last = midpoint - 1 return None def verify(index, target): if index is not None: print("Target", target, "found at index:", index) else: print("Target", target, "not in list") array = [x for x in range(1, 11)] print("Input array:", array) verify(binary_search(array, 6), 6) verify(binary_search(array, 20), 20)
def next_bigger(n): """Finds the next bigger number with the same digits.""" # Convert n to a string and a list in reverse for ease. n_string = str(n)[::-1] n_list = [int(x) for x in n_string] # Go through each digit and identify when there is a lower digit. number_previous = n_list[0] for position, number in enumerate(n_list): if number_previous > number: # Create slice of numbers that need to be changed. n_list_piece = n_list[:position+1] # Set the starting digit which will be the next higher than the "number" first_set_list = list(set(n_list_piece)) first_set_list.sort() number_position = first_set_list.index(number) first = first_set_list[number_position+1] # Numbers after the position will always be in sorted order. n_list_piece.sort() n_list_piece.remove(first) n_list_piece = [first] + n_list_piece n_string_piece = "" for z in n_list_piece: n_string_piece += str(z) # Magic if n_list[position+1:]: n_string = n_string[position+1:] solution = n_string[::-1] + n_string_piece else: solution = n_string_piece return int(solution) else: number_previous = number return -1 print(next_bigger(541237520))
class Solution: def heightChecker(self, heights: List[int]) -> int: expected = sorted(heights) indices=0 for i in range(len(heights)): if(heights[i] != expected[i]): indices += 1 return indices
# -*- coding: utf-8 -*- ''' File name: code\jumping_frog\sol_490.py Author: Vaidic Joshi Date created: Oct 20, 2018 Python Version: 3.x ''' # Solution to Project Euler Problem #490 :: Jumping frog # # For more information see: # https://projecteuler.net/problem=490 # Problem Statement ''' There are n stones in a pond, numbered 1 to n. Consecutive stones are spaced one unit apart. A frog sits on stone 1. He wishes to visit each stone exactly once, stopping on stone n. However, he can only jump from one stone to another if they are at most 3 units apart. In other words, from stone i, he can reach a stone j if 1 ≤ j ≤ n and j is in the set {i-3, i-2, i-1, i+1, i+2, i+3}. Let f(n) be the number of ways he can do this. For example, f(6) = 14, as shown below: 1 → 2 → 3 → 4 → 5 → 6 1 → 2 → 3 → 5 → 4 → 6 1 → 2 → 4 → 3 → 5 → 6 1 → 2 → 4 → 5 → 3 → 6 1 → 2 → 5 → 3 → 4 → 6 1 → 2 → 5 → 4 → 3 → 6 1 → 3 → 2 → 4 → 5 → 6 1 → 3 → 2 → 5 → 4 → 6 1 → 3 → 4 → 2 → 5 → 6 1 → 3 → 5 → 2 → 4 → 6 1 → 4 → 2 → 3 → 5 → 6 1 → 4 → 2 → 5 → 3 → 6 1 → 4 → 3 → 2 → 5 → 6 1 → 4 → 5 → 2 → 3 → 6 Other examples are f(10) = 254 and f(40) = 1439682432976. Let S(L) = ∑ f(n)3 for 1 ≤ n ≤ L. Examples: S(10) = 18230635 S(20) = 104207881192114219 S(1 000) mod 109 = 225031475 S(1 000 000) mod 109 = 363486179 Find S(1014) mod 109. ''' # Solution # Solution Approach ''' '''
"""Top-level package for Nearest Neigbor Similarity.""" __author__ = """Shivam Ralli""" __email__ = 'shivamralli167@gmail.com' __version__ = '0.1.0'
s = float(input("Введите корень, который хотите извлечь: ")) x = 1 while abs(x * x - s) > 0.00001: x = (x * x + s) / 2 / x print(x)
def Plus(a,b): return a + b def Minus(a,b): return a - b def Times(a,b): return a*b def Divide(a,b): return a/b
# -*- encoding: utf-8 -*- """ @File : test_basemodel.py @Time : 2020/4/3 0:08 @Author : chise @Email : chise123@live.com @Software: PyCharm @info :测试basemodel的继承 """
def filesFunctionField2list(files, func, field): theList = [] for file in files: record = { "name": file, field: func(file) } theList.append(record) return theList def filesClassFunctionField2list(files, Class, functionString, field): theList = [] for file in files: myClass = Class(file) method = getattr(myClass, functionString) record = { "name": file, field: method() } theList.append(record) return theList
"""PostgreSQL helpers.""" # Use pgcrypto, instead of uuid-ossp # Also create a function uuid_generate_v4 for backward compatibility UUID_SUPPORT_STMT = """CREATE EXTENSION IF NOT EXISTS "pgcrypto"; CREATE OR REPLACE FUNCTION uuid_generate_v4() RETURNS uuid AS ' BEGIN RETURN gen_random_uuid(); END' LANGUAGE 'plpgsql'; """
def print_hi(name): """ :param name: the to say hi :return: None """ # Use a breakpoint in the code line below to debug your script. return f"Hi, {name}" # Press ⌘F8 to toggle the breakpoint. class Hi: def __init__(self): self.hi = "hi there!" def say(self): print(self.hi) # Press the green button in the gutter to run the script. if __name__ == "__main__": print_hi("PyCharm") # See PyCharm help at https://www.jetbrains.com/help/pycharm/
s = 0 for c in range(1, 7): n = int(input(f'Digite o {c}º número inteiro: ')) if n % 2 == 0: s += n print(f'A soma dos números pares é {s}')
cancerlist = ["ACC", "BLCA", "BRCA", "CESC", "CHOL", "COAD", "DLBC", "ESCA", "GBM", "HNSC", "KICH", "KIRC", "KIRP", "LGG", "LIHC", "LUAD", "LUSC", "MESO", "OV", "PAAD", "PCPG", "PRAD", "READ", "SARC", "SKCM", "STAD", "TGCT", "THCA", "THYM", "UCEC", "UCS", "UVM"] input_data_path = "/ngs/data3/public_data/TCGA_FireBrowse/Methylation" merge_data_path = "/home/kwangsookim_lab/joonhyeong_park/Practice" input_tumor = [] input_normal = [] output_merge_tumor = open(merge_data_path + "/PANCANCER.humanmethylation450.tumor.31tumors.txt", "w") output_merge_normal = open(merge_data_path + "/PANCANCER.humanmethylation450.normal.31tumors.txt", 'w') tumor_header = ["Site"] normal_header = ["Site"] for i in range(len(cancerlist)) : cancer_data_path = input_data_path + "/" + cancerlist[i] + ".humanmethylation450/" + cancerlist[i] + ".humanmethylation450." input_tumor.append(open(cancer_data_path + "tumor.txt", 'r')) input_normal.append(open(cancer_data_path + "normal.txt", 'r')) tumor_header += input_tumor[i].readline().replace('\n', '').split()[2:] input_tumor[i].readline() normal_header += input_normal[i].readline().replace('\n', '').split()[2:] input_normal[i].readline() output_merge_tumor.write("\t".join(tumor_header) + "\n") output_merge_normal.write("\t".join(normal_header) + "\n") iteration_number = 0 while(True) : empty_line_check = 0 for i in range(len(cancerlist)) : tumor_line = input_tumor[i].readline().split() normal_line = input_normal[i].readline().split() if(len(normal_line) == 0) : break empty_line_check += len(normal_line) - 1 if(i != 0) : del tumor_line[0] del normal_line[0] output_merge_tumor.write("\t".join(tumor_line)) output_merge_normal.write("\t".join(normal_line)) if(i != len(cancerlist) - 1) : output_merge_tumor.write("\t") output_merge_normal.write("\t") if(empty_line_check == 0) : break output_merge_tumor.write("\n") output_merge_normal.write("\n") if(iteration_number % 10000 == 0) : print(iteration_number) iteration_number += 1
N, L = map(int, input().split()) ans = 0 margin = float("inf") for i in range(1, N + 1): tar = 0 for j in range(1, N + 1): tar += L + j - 1 res = 0 for j in range(1, N + 1): if j == i: continue else: res += L + j - 1 if abs(tar - res) < margin: ans = res margin = abs(tar - res) print(ans)
#!/usr/bin/python3 def max_integer(my_list=[]): if (len(my_list) == 0): return (None) a = my_list[0] for i in range(0, len(my_list)): if (my_list[i] > a): a = my_list[i] return (a)
"""Global constants module.""" GDRIVE_URL = 'https://drive.google.com' DATASET_URL = '{0}/uc?id=1xABlWE790uWmT0mMxbDjn9KZlNUB6Y57'.format(GDRIVE_URL) # dataset LABEL_COLS = ('Jp', 'Becca', 'Katy') # ignore resize NO_RESIZE = (0, 0)
# Enter your code here def triple(num): num = num*3 print(num) triple(6) triple(99)
""" Some exception classes for the ondevice client """ class _Exception(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args) self.msg = args[0] for k,v in kwargs.items(): setattr(self, k, v) class ConfigurationError(_Exception): """ Indicates a missing/faulty configuration value """ pass class ImplementationError(_Exception): """ Indicates implementation issues with a command or module """ pass class TransportError(_Exception): """ Indicates a communication error with the server """ pass class UsageError(_Exception): """ Indicates issues with the commandline usage (unknown command, unsupported argument, etc.) """ pass
EMBED_SIZE = 200 NUM_LAYERS = 2 LR = 0.0001 MAX_GRAD_NORM = 5.0 PAD_ID = 0 UNK_ID = 1 START_ID = 2 EOS_ID = 3 CONV_SIZE = 3 # sanity # BUCKETS = [(55, 50)] # BATCH_SIZE = 10 # NUM_EPOCHS = 50 # NUM_SAMPLES = 498 # HIDDEN_SIZE = 400 # test BUCKETS = [(30, 30), (55, 50)] BATCH_SIZE = 20 NUM_EPOCHS = 3 NUM_SAMPLES = 498 HIDDEN_SIZE = 400 # experiment 1 # BUCKETS = [(16, 28), (31, 28), (51, 28)] # BATCH_SIZE = 400 # NUM_EPOCHS = 5 # NUM_SAMPLES = 40960 # HIDDEN_SIZE = 400 # experiment 2 # BUCKETS = [(102, 28)] # BATCH_SIZE = 300 # NUM_EPOCHS = 5 # NUM_SAMPLES = 40960 # HIDDEN_SIZE = 250
# a = 42 # print(type(a)) # a = str(a) # print(type(a)) a = 42.3 print(type(a)) a = str(a) print(type(a))
# # PySNMP MIB module ENTERASYS-IEEE802DOT11EXT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ENTERASYS-IEEE802DOT11EXT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:49:11 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion") etsysModules, = mibBuilder.importSymbols("ENTERASYS-MIB-NAMES", "etsysModules") dot11WEPDefaultKeyIndex, = mibBuilder.importSymbols("IEEE802dot11-MIB", "dot11WEPDefaultKeyIndex") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") EnabledStatus, = mibBuilder.importSymbols("P-BRIDGE-MIB", "EnabledStatus") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance") IpAddress, iso, Bits, Integer32, NotificationType, ModuleIdentity, TimeTicks, Gauge32, Unsigned32, Counter64, Counter32, ObjectIdentity, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "iso", "Bits", "Integer32", "NotificationType", "ModuleIdentity", "TimeTicks", "Gauge32", "Unsigned32", "Counter64", "Counter32", "ObjectIdentity", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") TruthValue, AutonomousType, MacAddress, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "AutonomousType", "MacAddress", "DisplayString", "TextualConvention") etsysDot11ExtMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9)) etsysDot11ExtMIB.setRevisions(('2002-03-07 19:45', '2001-05-08 18:00',)) if mibBuilder.loadTexts: etsysDot11ExtMIB.setLastUpdated('200203071945Z') if mibBuilder.loadTexts: etsysDot11ExtMIB.setOrganization('Enterasys Networks, Inc') etsysDot11ExtObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1)) etsysDot11ExtLinkTest = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 1)) etsysDot11ExtGeneral = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 2)) etsysDot11ExtBldg = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 3)) etsysDot11ExtWEP = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 4)) etsysDot11ExtEffect = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 5)) etsysDot11ExtLinkTestTable = MibTable((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 1, 1), ) if mibBuilder.loadTexts: etsysDot11ExtLinkTestTable.setStatus('current') etsysDot11ExtLinkTestEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: etsysDot11ExtLinkTestEntry.setStatus('current') etsysDot11ExtLTRemoteStationMAC = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 1, 1, 1, 1), MacAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtLTRemoteStationMAC.setStatus('current') etsysDot11ExtLTRemoteStationName = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 1, 1, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysDot11ExtLTRemoteStationName.setStatus('current') etsysDot11ExtLTTrigger = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtLTTrigger.setStatus('current') etsysDot11ExtLTRemoteContents = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 1, 1, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(84, 84)).setFixedLength(84)).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysDot11ExtLTRemoteContents.setStatus('current') etsysDot11ExtGeneralTable = MibTable((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 2, 1), ) if mibBuilder.loadTexts: etsysDot11ExtGeneralTable.setStatus('current') etsysDot11ExtGeneralEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: etsysDot11ExtGeneralEntry.setStatus('current') etsysDot11ExtPCCardType = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 15))).clone(namedValues=NamedValues(("none", 1), ("deprecatedValue1", 2), ("deprecatedValue2", 3), ("deprecatedValue3", 4), ("ds80211b", 5), ("ds80211a", 6), ("unknown", 15)))).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysDot11ExtPCCardType.setStatus('current') etsysDot11ExtPCCardVersions = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 2, 1, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 80))).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysDot11ExtPCCardVersions.setStatus('current') etsysDot11ExtBridgeMode = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("workgroup", 1), ("lanToLanEndpoint", 2), ("lanToLanMultipoint", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtBridgeMode.setStatus('current') etsysDot11ExtResetOptions = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("noReset", 0), ("resetRadioCardIfNecessary", 1), ("resetRadioCardRegardless", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtResetOptions.setStatus('current') etsysDot11ExtSystemScale = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("low", 1), ("medium", 2), ("high", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtSystemScale.setStatus('current') etsysDot11ExtSecureAccess = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 2, 1, 1, 6), EnabledStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtSecureAccess.setStatus('current') etsysDot11ExtMulticastTxRate = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("fixed1Mbit", 1), ("fixed2Mbit", 2), ("fixedMediumRate", 3), ("fixedHighRate", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtMulticastTxRate.setStatus('current') etsysDot11ExtIntraBSSRelay = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 2, 1, 1, 8), EnabledStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtIntraBSSRelay.setStatus('current') etsysDot11ExtStationName = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 2, 1, 1, 9), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtStationName.setStatus('current') etsysDot11ExtBldgTable = MibTable((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 3, 1), ) if mibBuilder.loadTexts: etsysDot11ExtBldgTable.setStatus('current') etsysDot11ExtBldgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 3, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: etsysDot11ExtBldgEntry.setStatus('current') etsysDot11ExtBldgRemoteMAC1 = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 3, 1, 1, 1), MacAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtBldgRemoteMAC1.setStatus('current') etsysDot11ExtBldgRemoteMAC2 = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 3, 1, 1, 2), MacAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtBldgRemoteMAC2.setStatus('current') etsysDot11ExtBldgRemoteMAC3 = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 3, 1, 1, 3), MacAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtBldgRemoteMAC3.setStatus('current') etsysDot11ExtBldgRemoteMAC4 = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 3, 1, 1, 4), MacAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtBldgRemoteMAC4.setStatus('current') etsysDot11ExtBldgRemoteMAC5 = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 3, 1, 1, 5), MacAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtBldgRemoteMAC5.setStatus('current') etsysDot11ExtBldgRemoteMAC6 = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 3, 1, 1, 6), MacAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtBldgRemoteMAC6.setStatus('current') etsysDot11ExtBldgMPActivationKey = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 3, 1, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(16, 16)).setFixedLength(16)).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtBldgMPActivationKey.setStatus('current') etsysDot11ExtWEPDefaultKeysTable = MibTable((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 4, 1), ) if mibBuilder.loadTexts: etsysDot11ExtWEPDefaultKeysTable.setStatus('current') etsysDot11ExtWEPDefaultKeysEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 4, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "IEEE802dot11-MIB", "dot11WEPDefaultKeyIndex")) if mibBuilder.loadTexts: etsysDot11ExtWEPDefaultKeysEntry.setStatus('current') etsysDot11ExtWEPKeyDefined = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 4, 1, 1, 1), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysDot11ExtWEPKeyDefined.setStatus('current') etsysDot11ExtWEPKeyValue = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 4, 1, 1, 2), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(5, 5), ValueSizeConstraint(13, 13), ))).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysDot11ExtWEPKeyValue.setStatus('current') etsysDot11ExtWEPEnhancedTable = MibTable((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 4, 2), ) if mibBuilder.loadTexts: etsysDot11ExtWEPEnhancedTable.setStatus('current') etsysDot11ExtWEPEnhancedEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 4, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: etsysDot11ExtWEPEnhancedEntry.setStatus('current') etsysDot11ExtWEPEnhancedImplemented = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 4, 2, 1, 1), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysDot11ExtWEPEnhancedImplemented.setStatus('current') etsysDot11ExtOIDNotInEffectTable = MibTable((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 5, 1), ) if mibBuilder.loadTexts: etsysDot11ExtOIDNotInEffectTable.setStatus('current') etsysDot11ExtOIDNotInEffectEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 5, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtOIDIndex")) if mibBuilder.loadTexts: etsysDot11ExtOIDNotInEffectEntry.setStatus('current') etsysDot11ExtOIDIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 5, 1, 1, 1), AutonomousType()) if mibBuilder.loadTexts: etsysDot11ExtOIDIndex.setStatus('current') etsysDot11ExtOIDNotInEffect = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 1, 5, 1, 1, 2), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysDot11ExtOIDNotInEffect.setStatus('current') etsysDot11ExtConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 2)) etsysDot11ExtGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 2, 1)) etsysDot11ExtCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 2, 2)) etsysDot11ExtBaseGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 2, 1, 1)).setObjects(("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtLTRemoteStationMAC"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtLTRemoteStationName"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtLTTrigger"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtLTRemoteContents"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtSystemScale"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtSecureAccess"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtMulticastTxRate"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtIntraBSSRelay"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtPCCardType"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtPCCardVersions"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtBridgeMode"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtResetOptions"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtStationName"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtBldgRemoteMAC1"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtBldgRemoteMAC2"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtBldgRemoteMAC3"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtBldgRemoteMAC4"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtBldgRemoteMAC5"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtBldgRemoteMAC6"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtBldgMPActivationKey"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtWEPKeyDefined"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtWEPKeyValue"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtWEPEnhancedImplemented"), ("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtOIDNotInEffect")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): etsysDot11ExtBaseGroup = etsysDot11ExtBaseGroup.setStatus('current') etsysDot11ExtCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 5624, 1, 2, 9, 2, 2, 1)).setObjects(("ENTERASYS-IEEE802DOT11EXT-MIB", "etsysDot11ExtBaseGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): etsysDot11ExtCompliance = etsysDot11ExtCompliance.setStatus('current') mibBuilder.exportSymbols("ENTERASYS-IEEE802DOT11EXT-MIB", etsysDot11ExtLTRemoteStationMAC=etsysDot11ExtLTRemoteStationMAC, etsysDot11ExtOIDNotInEffect=etsysDot11ExtOIDNotInEffect, etsysDot11ExtPCCardType=etsysDot11ExtPCCardType, etsysDot11ExtMulticastTxRate=etsysDot11ExtMulticastTxRate, etsysDot11ExtLTRemoteContents=etsysDot11ExtLTRemoteContents, etsysDot11ExtWEPDefaultKeysTable=etsysDot11ExtWEPDefaultKeysTable, etsysDot11ExtBldg=etsysDot11ExtBldg, etsysDot11ExtConformance=etsysDot11ExtConformance, etsysDot11ExtLTTrigger=etsysDot11ExtLTTrigger, etsysDot11ExtStationName=etsysDot11ExtStationName, etsysDot11ExtBldgEntry=etsysDot11ExtBldgEntry, etsysDot11ExtBldgRemoteMAC4=etsysDot11ExtBldgRemoteMAC4, etsysDot11ExtOIDNotInEffectTable=etsysDot11ExtOIDNotInEffectTable, etsysDot11ExtWEPKeyValue=etsysDot11ExtWEPKeyValue, etsysDot11ExtOIDIndex=etsysDot11ExtOIDIndex, etsysDot11ExtLinkTest=etsysDot11ExtLinkTest, etsysDot11ExtGeneralTable=etsysDot11ExtGeneralTable, etsysDot11ExtWEP=etsysDot11ExtWEP, etsysDot11ExtBldgRemoteMAC5=etsysDot11ExtBldgRemoteMAC5, etsysDot11ExtPCCardVersions=etsysDot11ExtPCCardVersions, etsysDot11ExtLinkTestEntry=etsysDot11ExtLinkTestEntry, etsysDot11ExtWEPDefaultKeysEntry=etsysDot11ExtWEPDefaultKeysEntry, etsysDot11ExtGroups=etsysDot11ExtGroups, etsysDot11ExtLinkTestTable=etsysDot11ExtLinkTestTable, etsysDot11ExtOIDNotInEffectEntry=etsysDot11ExtOIDNotInEffectEntry, etsysDot11ExtBldgRemoteMAC1=etsysDot11ExtBldgRemoteMAC1, etsysDot11ExtEffect=etsysDot11ExtEffect, etsysDot11ExtBldgMPActivationKey=etsysDot11ExtBldgMPActivationKey, etsysDot11ExtSystemScale=etsysDot11ExtSystemScale, PYSNMP_MODULE_ID=etsysDot11ExtMIB, etsysDot11ExtBldgRemoteMAC6=etsysDot11ExtBldgRemoteMAC6, etsysDot11ExtGeneral=etsysDot11ExtGeneral, etsysDot11ExtWEPEnhancedTable=etsysDot11ExtWEPEnhancedTable, etsysDot11ExtWEPEnhancedEntry=etsysDot11ExtWEPEnhancedEntry, etsysDot11ExtWEPEnhancedImplemented=etsysDot11ExtWEPEnhancedImplemented, etsysDot11ExtBaseGroup=etsysDot11ExtBaseGroup, etsysDot11ExtMIB=etsysDot11ExtMIB, etsysDot11ExtWEPKeyDefined=etsysDot11ExtWEPKeyDefined, etsysDot11ExtResetOptions=etsysDot11ExtResetOptions, etsysDot11ExtSecureAccess=etsysDot11ExtSecureAccess, etsysDot11ExtCompliances=etsysDot11ExtCompliances, etsysDot11ExtBldgTable=etsysDot11ExtBldgTable, etsysDot11ExtLTRemoteStationName=etsysDot11ExtLTRemoteStationName, etsysDot11ExtCompliance=etsysDot11ExtCompliance, etsysDot11ExtGeneralEntry=etsysDot11ExtGeneralEntry, etsysDot11ExtBldgRemoteMAC2=etsysDot11ExtBldgRemoteMAC2, etsysDot11ExtObjects=etsysDot11ExtObjects, etsysDot11ExtIntraBSSRelay=etsysDot11ExtIntraBSSRelay, etsysDot11ExtBldgRemoteMAC3=etsysDot11ExtBldgRemoteMAC3, etsysDot11ExtBridgeMode=etsysDot11ExtBridgeMode)
class Solution: def longestCommonSub(self, a, n, b, m): dp = [[0]*(m+1) for i in range(n+1)] for i in range(1, n+1): for j in range(1, m+1): if a[i-1] == b[j-1]: dp[i][j] = dp[i-1][j-1] + 1 else: dp[i][j] = max(dp[i-1][j], dp[i][j-1]) return dp[n][m] def sequencePatternMatching(self, a:str, b:str)->bool: n = len(a) m = len(b) lcs = self.longestCommonSub(a, n,b,m) if lcs == n: return True else: return False if __name__ == '__main__': a = "AXY" b = "ADXCPY" print(Solution().sequencePatternMatching(a, b))
""" Code for training prototype segmentation model on Cityscapes dataset https://www.cityscapes-dataset.com/ """
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. load("//antlir/bzl:shape.bzl", "shape") load("//antlir/bzl:target_tagger.shape.bzl", "target_tagged_image_source_t") tarball_t = shape.shape( force_root_ownership = shape.field(bool, optional = True), into_dir = shape.path, source = target_tagged_image_source_t, )
# -*- coding: utf-8 -*- if __name__ == '__main__': a = u'\u5f53\u524d\u4e91\u533a\u57df\u6ca1\u6709\u53ef\u7528\u7684' # PROXY\uff0c\u8bf7\u5148\u68c0\u67e5\u5e76\u5b89\u88c5', u'\u76f4\u8fde\u533a\u57df\uff0c\u4e0d\u80fd\u5b89\u88c5PROXY\u548cPAGENT' print(a)
if condition: ... else: ...
r"""Two example systems. The :py:mod:`~example_systems.beryllium` module contains a calculation of the process matrices for a :math:`^9\text{Be}^+` ion addressed by a laser resonant with the :math:`^2S_{1/2}, F=2, m_F=2 \leftrightarrow ^2P_{3/2}, m_J=3/2` level, with perfect :math:`\sigma^+` polarization. The :py:mod:`~example_systems.three_states` module contains a small example three state module. """
# # PySNMP MIB module Juniper-DNS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-DNS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:51:26 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint") InetAddress, InetAddressType = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress", "InetAddressType") juniMibs, = mibBuilder.importSymbols("Juniper-MIBs", "juniMibs") JuniEnable, = mibBuilder.importSymbols("Juniper-TC", "JuniEnable") ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance") NotificationType, iso, Gauge32, Bits, TimeTicks, Counter64, ObjectIdentity, Integer32, Counter32, Unsigned32, MibIdentifier, IpAddress, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "iso", "Gauge32", "Bits", "TimeTicks", "Counter64", "ObjectIdentity", "Integer32", "Counter32", "Unsigned32", "MibIdentifier", "IpAddress", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention") juniDnsMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47)) juniDnsMIB.setRevisions(('2006-09-15 08:32', '2003-09-11 15:50', '2002-09-16 21:44', '2001-03-22 19:29',)) if mibBuilder.loadTexts: juniDnsMIB.setLastUpdated('200609150832Z') if mibBuilder.loadTexts: juniDnsMIB.setOrganization('Juniper Networks, Inc.') class JuniNextServerListIndex(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 2147483647) class ServerListIndex(TextualConvention, Integer32): status = 'current' displayHint = 'd' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 2147483647) class JuniNextLocalDomainNameListIndex(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 2147483647) class LocalDomainNameListIndex(TextualConvention, Integer32): status = 'current' displayHint = 'd' subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 2147483647) class LocalDomainName(TextualConvention, OctetString): reference = 'RFC 854: NVT ASCII character set. See SNMPv2-TC.DisplayString DESCRIPTION for a summary.' status = 'current' displayHint = '1025a' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(0, 1025) juniDnsObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1)) juniDnsGeneral = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 1)) juniDnsServerList = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 2)) juniDnsLocalDomainNameList = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 3)) juniDnsEnable = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 1, 1), JuniEnable()).setMaxAccess("readwrite") if mibBuilder.loadTexts: juniDnsEnable.setStatus('current') juniDnsServerListNextIndex = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 2, 1), JuniNextServerListIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: juniDnsServerListNextIndex.setStatus('current') juniDnsServerListTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 2, 2), ) if mibBuilder.loadTexts: juniDnsServerListTable.setStatus('current') juniDnsServerListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 2, 2, 1), ).setIndexNames((0, "Juniper-DNS-MIB", "juniDnsServerListIndex")) if mibBuilder.loadTexts: juniDnsServerListEntry.setStatus('current') juniDnsServerListIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 2, 2, 1, 1), ServerListIndex()) if mibBuilder.loadTexts: juniDnsServerListIndex.setStatus('current') juniDnsServerListAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 2, 2, 1, 2), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: juniDnsServerListAddress.setStatus('obsolete') juniDnsServerListRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 2, 2, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: juniDnsServerListRowStatus.setStatus('current') juniDnsV4V6ServerListAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 2, 2, 1, 4), InetAddressType()).setMaxAccess("readcreate") if mibBuilder.loadTexts: juniDnsV4V6ServerListAddressType.setStatus('current') juniDnsV4V6ServerListAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 2, 2, 1, 5), InetAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: juniDnsV4V6ServerListAddress.setStatus('current') juniDnsLocalDomainNameListNextIndex = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 3, 1), JuniNextLocalDomainNameListIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: juniDnsLocalDomainNameListNextIndex.setStatus('current') juniDnsLocalDomainNameListTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 3, 2), ) if mibBuilder.loadTexts: juniDnsLocalDomainNameListTable.setStatus('current') juniDnsLocalDomainNameListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 3, 2, 1), ).setIndexNames((0, "Juniper-DNS-MIB", "juniDnsLocalDomainNameListIndex")) if mibBuilder.loadTexts: juniDnsLocalDomainNameListEntry.setStatus('current') juniDnsLocalDomainNameListIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 3, 2, 1, 1), LocalDomainNameListIndex()) if mibBuilder.loadTexts: juniDnsLocalDomainNameListIndex.setStatus('current') juniDnsLocalDomainNameListName = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 3, 2, 1, 2), LocalDomainName()).setMaxAccess("readcreate") if mibBuilder.loadTexts: juniDnsLocalDomainNameListName.setStatus('current') juniDnsLocalDomainNameListRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 1, 3, 2, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: juniDnsLocalDomainNameListRowStatus.setStatus('current') juniDnsConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 2)) juniDnsCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 2, 1)) juniDnsGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 2, 2)) juniDnsCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 2, 1, 1)).setObjects(("Juniper-DNS-MIB", "juniDnsEnableGroup"), ("Juniper-DNS-MIB", "juniDnsServerListGroup"), ("Juniper-DNS-MIB", "juniDnsV4V6ServerListGroup"), ("Juniper-DNS-MIB", "juniDnsLocalDomainNameListGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniDnsCompliance = juniDnsCompliance.setStatus('current') juniDnsEnableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 2, 2, 1)).setObjects(("Juniper-DNS-MIB", "juniDnsEnable")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniDnsEnableGroup = juniDnsEnableGroup.setStatus('current') juniDnsServerListGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 2, 2, 2)).setObjects(("Juniper-DNS-MIB", "juniDnsServerListNextIndex"), ("Juniper-DNS-MIB", "juniDnsServerListAddress"), ("Juniper-DNS-MIB", "juniDnsServerListRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniDnsServerListGroup = juniDnsServerListGroup.setStatus('obsolete') juniDnsLocalDomainNameListGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 2, 2, 3)).setObjects(("Juniper-DNS-MIB", "juniDnsLocalDomainNameListNextIndex"), ("Juniper-DNS-MIB", "juniDnsLocalDomainNameListName"), ("Juniper-DNS-MIB", "juniDnsLocalDomainNameListRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniDnsLocalDomainNameListGroup = juniDnsLocalDomainNameListGroup.setStatus('current') juniDnsV4V6ServerListGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 47, 2, 2, 4)).setObjects(("Juniper-DNS-MIB", "juniDnsServerListNextIndex"), ("Juniper-DNS-MIB", "juniDnsServerListRowStatus"), ("Juniper-DNS-MIB", "juniDnsV4V6ServerListAddress"), ("Juniper-DNS-MIB", "juniDnsV4V6ServerListAddressType")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniDnsV4V6ServerListGroup = juniDnsV4V6ServerListGroup.setStatus('current') mibBuilder.exportSymbols("Juniper-DNS-MIB", juniDnsServerList=juniDnsServerList, PYSNMP_MODULE_ID=juniDnsMIB, juniDnsLocalDomainNameListRowStatus=juniDnsLocalDomainNameListRowStatus, juniDnsLocalDomainNameListName=juniDnsLocalDomainNameListName, juniDnsLocalDomainNameListNextIndex=juniDnsLocalDomainNameListNextIndex, juniDnsConformance=juniDnsConformance, juniDnsMIB=juniDnsMIB, juniDnsServerListNextIndex=juniDnsServerListNextIndex, JuniNextServerListIndex=JuniNextServerListIndex, juniDnsServerListIndex=juniDnsServerListIndex, juniDnsEnableGroup=juniDnsEnableGroup, juniDnsServerListAddress=juniDnsServerListAddress, LocalDomainName=LocalDomainName, juniDnsServerListGroup=juniDnsServerListGroup, JuniNextLocalDomainNameListIndex=JuniNextLocalDomainNameListIndex, LocalDomainNameListIndex=LocalDomainNameListIndex, juniDnsLocalDomainNameListGroup=juniDnsLocalDomainNameListGroup, juniDnsEnable=juniDnsEnable, juniDnsV4V6ServerListAddress=juniDnsV4V6ServerListAddress, juniDnsServerListTable=juniDnsServerListTable, juniDnsLocalDomainNameListEntry=juniDnsLocalDomainNameListEntry, juniDnsGroups=juniDnsGroups, juniDnsV4V6ServerListGroup=juniDnsV4V6ServerListGroup, juniDnsCompliances=juniDnsCompliances, juniDnsCompliance=juniDnsCompliance, juniDnsServerListEntry=juniDnsServerListEntry, juniDnsLocalDomainNameListTable=juniDnsLocalDomainNameListTable, juniDnsGeneral=juniDnsGeneral, juniDnsV4V6ServerListAddressType=juniDnsV4V6ServerListAddressType, juniDnsObjects=juniDnsObjects, juniDnsLocalDomainNameList=juniDnsLocalDomainNameList, ServerListIndex=ServerListIndex, juniDnsLocalDomainNameListIndex=juniDnsLocalDomainNameListIndex, juniDnsServerListRowStatus=juniDnsServerListRowStatus)
# I have no idea if this is actually functioning. def line_intersection(l1, l2): xdiff = (l1[0][0] - l1[1][0], l2[0][0] - l2[1][0]) ydiff = (l1[0][1] - l1[1][1], l2[0][1] - l2[1][1]) def det(a, b): return a[0] * b[1] - a[1] * b[0] div = det(xdiff, ydiff) if div == 0: return False d = (det(*l1), det(*l2)) x = det(d, xdiff) / div y = det(d, ydiff) / div if x < min(l2[0][0], l2[1][0]) or x > max(l2[0][0], l2[1][0]) or y < min(l2[0][1], l2[1][1]) or y > max(l2[0][1], l2[1][1]): return False else: return x,y # 0 0 3 3 # 1 # 4 1 2 2 2 2 1 1 1 main_line = list(map(int, input().split())) num = int(input()) print(line_intersection((A, B), (C, D)))
fr = input('Frase: ') for i in range(len(fr) -1,-1,-1): print(fr[i], end='')
""" Fundamental Template for LinkedList """ # General Definition of a node class ListNode: def __init__(self, x): self.val = x self.next = None class LinkedList: def __init__(self): self.head = None self.tail = None return def push_elements(self, item): """ :param item: Push elements into a SLL :return: """ if not isinstance(item, ListNode): item = ListNode(item) if self.head is None: self.head = item else: self.tail.next = item self.tail = item return def print_list(self): current = self.head while current: print(current.val, end=" ") current = current.next return def reverse_list(self): prev = None current = self.head while current is not None: nxt = current.next current.next = prev prev = current current = nxt self.head = prev def has_cycle(self): fast = self.head slow = self.head while fast is not None and fast.next is not None: fast = fast.next.next slow = slow.next if fast == slow: return True return False def delete_element_given_value(self, data): current = self.head while current: if current.next.val == data: current.next = current.next.next break return def delete_node_given_only_node(self, node): while node.next: node.val = node.next.val if node.next.next is None: node.next = None break else: node = node.next def get_middle_node(self): slow = self.heaf fast = self.head while fast and fast.next: slow = slow.next fast = fast.next return slow def delete_duplicates(self): # Assume I/P list is sorted current = self.head while current and current.next: if current.val == current.next.val: current.next = current.next.next else: current = current.next return self.head if __name__ == "__main__": s1 = ListNode(5) s2 = ListNode(6) s3 = ListNode(7) s4 = ListNode(8) t1 = LinkedList() t1.push_elements(s1) t1.push_elements(s2) t1.push_elements(s3) t1.push_elements(s4) print("Intial LinkedList") t1.print_list() print("\n") print("Reversing the List") t1.reverse_list() t1.print_list()
def solve(arr, k): cur=float("-inf") ans=tuple() total=sum(arr) for i in range(len(arr), k-1, -1): temp=compute(arr, total, i) if temp[0]>cur: cur=temp[0] ans=(temp[1], i) total-=arr[i-1] return ans def compute(arr, total, k): cur=total index=0 avg=cur/k for i in range(k, len(arr)): cur+=arr[i]-arr[i-k] if (cur/k)>=avg: avg=cur/k index=i-k+1 return (avg, index)
# Move all xeroes to right N = int(input('')) array = list(map(int, input().split(' ')[:N])) flag = 0 # BRING/REPLACE ALL NON-ZEROES TO LEFT for index in range(0, len(array)): if(array[index] != 0): array[flag] = array[index] flag = flag+1 # NOW ADD ALL ZEROS TOWARDS RIGHT for index in range(flag, len(array)): array[index] = 0 print(array)
# Space : O(n) # Time : O(n) class Solution: def reverseWords(self, s: str) -> str: l = s.split(" ") for i in range(len(l)): l[i] = l[i][::-1] return " ".join(l)
inputTemplates = { "M3": { "QCD": [ [ 0.0, 0.0004418671450315185, 0.01605229202018541, 0.05825334528354453, 0.08815209477081883, 0.1030093733105401, 0.10513254530282935, 0.09543913272896494, 0.08512520799056993, 0.07489480051367764, 0.06022183314704696, 0.05275434234820922, 0.04426859109280948, 0.03513151550399711, 0.029967498933300033, 0.024464081551639382, 0.020998482981290444, 0.015085519053806937, 0.013212552619472365, 0.010921640496635408, 0.010786019690654257, 0.0079331542797628, 0.007046335967650891, 0.0066796992713355876, 0.00484778962979943, 0.0043565342466071995, 0.0040794364492200835, 0.0027885993970205324, 0.002756423064350152, 0.002331355056268065, 0.0021416660945894994, 0.0017759566793966012, 0.0011629584663072486, 0.001009451124859111, 0.0012831188698206983, 0.0007967669328031654, 0.004698017985185181, 0.0, 0.0, 0.0 ], [ 0.0, 0.0004418671450315186, 0.016052292020185415, 0.05825334528354453, 0.08815209477081884, 0.10300937331054011, 0.10513254530282935, 0.09543913272896497, 0.08512520799056993, 0.07489480051367763, 0.06022183314704697, 0.05275434234820922, 0.04426859109280948, 0.03513151550399711, 0.029967498933300037, 0.024464081551639386, 0.020998482981290444, 0.015085519053806937, 0.013212552619472366, 0.010921640496635408, 0.010786019690654257, 0.0079331542797628, 0.007046335967650892, 0.006679699271335588, 0.00484778962979943, 0.0043565342466071995, 0.004079436449220084, 0.002788599397020533, 0.002756423064350152, 0.002331355056268065, 0.0021416660945894994, 0.0017759566793966015, 0.0011629584663072486, 0.0010094511248591113, 0.0012831188698206985, 0.0007967669328031655, 0.004698017985185181, 0.0, 0.0, 0.0 ], [ 0.0, 0.00044186714503151845, 0.016052292020185405, 0.058253345283544505, 0.0881520947708188, 0.10300937331054005, 0.10513254530282928, 0.09543913272896491, 0.08512520799056988, 0.0748948005136776, 0.06022183314704694, 0.0527543423482092, 0.044268591092809464, 0.035131515503997096, 0.029967498933300023, 0.02446408155163937, 0.020998482981290433, 0.015085519053806931, 0.013212552619472361, 0.010921640496635406, 0.010786019690654252, 0.007933154279762796, 0.007046335967650889, 0.006679699271335586, 0.004847789629799428, 0.004356534246607198, 0.004079436449220083, 0.0027885993970205316, 0.002756423064350151, 0.0023313550562680647, 0.0021416660945894985, 0.0017759566793966006, 0.0011629584663072482, 0.0010094511248591109, 0.0012831188698206976, 0.0007967669328031652, 0.0046980179851851805, 0.0, 0.0, 0.0 ], [ 0.0, 0.00044186714503151856, 0.016052292020185415, 0.058253345283544526, 0.08815209477081883, 0.1030093733105401, 0.10513254530282934, 0.09543913272896495, 0.08512520799056993, 0.07489480051367763, 0.06022183314704697, 0.05275434234820922, 0.04426859109280948, 0.03513151550399711, 0.029967498933300033, 0.024464081551639382, 0.020998482981290444, 0.01508551905380694, 0.013212552619472365, 0.010921640496635408, 0.010786019690654257, 0.0079331542797628, 0.0070463359676508925, 0.006679699271335588, 0.0048477896297994295, 0.0043565342466071995, 0.004079436449220084, 0.002788599397020533, 0.002756423064350152, 0.0023313550562680655, 0.0021416660945894994, 0.0017759566793966015, 0.0011629584663072486, 0.0010094511248591113, 0.0012831188698206983, 0.0007967669328031656, 0.004698017985185182, 0.0, 0.0, 0.0 ], [ 0.0, 0.00044186714503151845, 0.016052292020185408, 0.05825334528354451, 0.08815209477081881, 0.10300937331054007, 0.10513254530282931, 0.09543913272896493, 0.0851252079905699, 0.07489480051367763, 0.060221833147046946, 0.05275434234820921, 0.044268591092809464, 0.0351315155039971, 0.02996749893330003, 0.02446408155163937, 0.02099848298129044, 0.015085519053806935, 0.013212552619472363, 0.010921640496635408, 0.010786019690654255, 0.007933154279762798, 0.00704633596765089, 0.006679699271335587, 0.004847789629799429, 0.004356534246607199, 0.0040794364492200835, 0.0027885993970205324, 0.002756423064350151, 0.0023313550562680647, 0.002141666094589499, 0.001775956679396601, 0.0011629584663072484, 0.001009451124859111, 0.0012831188698206976, 0.0007967669328031653, 0.0046980179851851805, 0.0, 0.0, 0.0 ], [ 0.0, 0.00044186714503151845, 0.016052292020185408, 0.05825334528354452, 0.08815209477081881, 0.1030093733105401, 0.10513254530282932, 0.09543913272896495, 0.08512520799056991, 0.07489480051367763, 0.060221833147046946, 0.052754342348209214, 0.044268591092809464, 0.0351315155039971, 0.02996749893330003, 0.02446408155163937, 0.02099848298129044, 0.015085519053806935, 0.013212552619472363, 0.010921640496635408, 0.010786019690654253, 0.007933154279762798, 0.007046335967650891, 0.006679699271335587, 0.0048477896297994295, 0.004356534246607198, 0.0040794364492200835, 0.0027885993970205324, 0.0027564230643501515, 0.002331355056268065, 0.002141666094589499, 0.001775956679396601, 0.0011629584663072484, 0.001009451124859111, 0.0012831188698206979, 0.0007967669328031655, 0.0046980179851851805, 0.0, 0.0, 0.0 ] ], "SingleTop": [ [ 0.0, 0.0, 0.005832177218207422, 0.03178392883540604, 0.07169459952763149, 0.11287210836676197, 0.12176478715865051, 0.12613012243319208, 0.09279832309977645, 0.0794145472218926, 0.06006907882516122, 0.05255651613575753, 0.040665134899883736, 0.03624912116256268, 0.019772311111878084, 0.021835717802889197, 0.01593884467082636, 0.019743744021810564, 0.008520333396281287, 0.008972922567677826, 0.00866376260113745, 0.010388777243208618, 0.007465864279390942, 0.008541920826701573, 0.0069814633847972846, 0.004641107502972211, 0.005051657691380684, 0.003139862804695983, 0.0064010107328637145, 0.0018922562881085226, 0.000984504344510512, 0.0006270305039092417, 0.0, 0.0004977320603021565, 0.0004854616714298998, 0.0007746782412963946, 0.006848591367048002, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.006464253844897605, 0.026118917653010134, 0.060112787514841975, 0.09584106586560479, 0.12925563138779625, 0.11715408034300653, 0.09440622815766804, 0.0716779573912037, 0.06916348777011985, 0.05498302637465252, 0.042697413569360194, 0.03739191469243603, 0.030265823351673254, 0.02017805782885195, 0.020967376788849502, 0.018012820429670742, 0.01701231602942316, 0.011241488781432862, 0.013054428387246958, 0.011576167379020312, 0.006085157039789595, 0.008138644498565663, 0.003003338789354045, 0.0031858415089799684, 0.005792637555725393, 0.004107311320351441, 0.0009511534181744243, 0.00275249480381622, 0.004384640907243928, 0.0018999453119997332, 0.0023273554030316707, 0.0016001069427164683, 0.0010718452947245862, 0.0012111180899201381, 0.005913165574839969, 0.0, 0.0, 0.0 ], [ 0.0, 0.000730898105715262, 0.004345582215870544, 0.02798607884595784, 0.058042809009575966, 0.08283302044377722, 0.12365219544544459, 0.11925280674249097, 0.07900946342989748, 0.0729889060967615, 0.06555652145311269, 0.05500702243367231, 0.03727507362592039, 0.03497935430893025, 0.038758173666694595, 0.022026642610227798, 0.020289974876133793, 0.02390005152672489, 0.015996129394221792, 0.015502623414619431, 0.013383170539170194, 0.008222802588575384, 0.008923541477108209, 0.009493835160659504, 0.007416365558061059, 0.006450296693177907, 0.006153831272067389, 0.004196024662363883, 0.003400842304431063, 0.005252293744180164, 0.0039361210244639845, 0.004358739163202468, 0.00287066741824079, 0.002285628915640503, 0.002764779086954986, 0.0014452620379491693, 0.011312470708004386, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.01600155485970672, 0.03639273911473297, 0.05968874574025049, 0.10598450262625334, 0.11388841443601717, 0.08307443249770091, 0.08639375480501353, 0.05741122320100601, 0.06314537056043235, 0.053346999957043284, 0.043790356322535307, 0.03638268872477183, 0.028617051623100895, 0.032593396108858065, 0.013798591164209608, 0.02230033822729821, 0.01580926917445075, 0.006236987296217145, 0.017497312659310434, 0.011933038792119726, 0.011202353000571373, 0.005562222992955815, 0.006945493185204689, 0.009975553245066583, 0.005022960250692474, 0.007047783899380394, 0.006433393500369129, 0.006724854313022172, 0.004743829720451964, 0.004778845074539503, 0.005801395394700851, 0.003081124868615164, 0.0023767450175057143, 0.016016677645895455, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0034855705626097616, 0.010025916336663884, 0.027364239400232984, 0.037694745308698235, 0.09663206840536868, 0.09970075477836253, 0.06106233761893696, 0.056412910319662585, 0.057912542580936144, 0.041328923907318675, 0.06704352646140234, 0.047223924190355336, 0.031021114902507748, 0.03758027943204309, 0.022834400563328236, 0.024808105880289092, 0.036654808787627724, 0.031893202006165335, 0.02739260061438384, 0.012395283525136105, 0.01054237296279351, 0.020567685747427896, 0.012583514912694046, 0.009008845505670094, 0.012527762077976097, 0.017938595283369566, 0.010789448025986654, 0.003632023138839643, 0.01816042267512064, 0.0015585333839998625, 0.0027675759622464006, 0.019484546123949304, 0.004103330254325486, 0.009631143922782703, 0.016236944440788555, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0, 0.007336647376339268, 0.02347544978530838, 0.06263222854439522, 0.06610613086026246, 0.035369146080455695, 0.04408531650826217, 0.043560791950211564, 0.09582421142939976, 0.024197640811710778, 0.05814140173848918, 0.025521248131010324, 0.053856110255041584, 0.03162162916096726, 0.07115652068544676, 0.016567788392908175, 0.020825518489763186, 0.02428868407680062, 0.031889226678125646, 0.013637606734355396, 0.029101557862528757, 0.0, 0.025475944986739763, 0.029517463743032837, 0.01538260011507948, 0.006017436893000935, 0.01865575381438486, 0.015824792234214888, 0.0030866067227976217, 0.013980448208807261, 0.0, 0.008943475556169688, 0.025516356476877198, 0.058404265697113315, 0.0, 0.0, 0.0 ] ], "TTJet": [ [ 0.0, 0.0, 0.005866260054832973, 0.032014476569687776, 0.07611743723353019, 0.12269913163544673, 0.204669959277149, 0.1780022148266413, 0.0902222568133845, 0.06720996262179303, 0.045621861833730876, 0.03585930513808567, 0.027308801181492228, 0.022550773464298984, 0.01697272151879135, 0.014303918822958318, 0.009536675235431601, 0.008151062240943892, 0.006990013596176034, 0.005622428289760508, 0.005432733235420568, 0.004571707788875856, 0.0030247979877491816, 0.0025379990687445786, 0.0021322114740614994, 0.0018967639068011742, 0.001600198531484904, 0.001760907897112518, 0.0010930826959057282, 0.0012682896008723822, 0.0007330317183938927, 0.0007410646772215062, 0.000665137515949025, 0.0005346326125257873, 0.00039168832065960966, 0.00025771205206101376, 0.0016387805620258422, 0.0, 0.0, 0.0 ], [ 0.0, 7.262560201399413e-05, 0.005459965341619546, 0.03172214511310284, 0.07699353745814363, 0.12491126396204628, 0.20003559424615688, 0.17066165025335486, 0.08996890767405352, 0.06649813957714566, 0.05061011517828175, 0.03584184011202735, 0.027588795134809475, 0.023294770858547913, 0.01757932753487905, 0.013027107776830716, 0.012195905630129025, 0.009600558514058243, 0.006854961641894884, 0.0058081556303386135, 0.004698636898302152, 0.004593892903081976, 0.003409789788416189, 0.0021757282806029953, 0.002259041246620286, 0.00221698886107549, 0.0020069814624712992, 0.0014849074170667832, 0.0014821376683882836, 0.0009165103021072048, 0.0005584379824681107, 0.0007847520606728024, 0.0004956669967263232, 0.0007192863381122417, 0.00044359338561214204, 0.000283998679673084, 0.0027442824891683155, 0.0, 0.0, 0.0 ], [ 0.0, 0.00010999244899275781, 0.004524250010912452, 0.030522524117397948, 0.06765121697833965, 0.11925184104915117, 0.18208569394951088, 0.1678624854487025, 0.09332137586299127, 0.06492288997550127, 0.05287619322834948, 0.038590428081298624, 0.03148344300415997, 0.024806268142032767, 0.021888358435464855, 0.016696569370059054, 0.012486064354286668, 0.011756333188735998, 0.00958964683937508, 0.007049851662028582, 0.005738821121195343, 0.005400646562344024, 0.004162263767899146, 0.003934996784796343, 0.00356665539154776, 0.0026563631439693474, 0.0022957990527197767, 0.001734408902217747, 0.0018663108219949586, 0.0012663255620451552, 0.0008837863377775026, 0.0013098166043183537, 0.0005873395717754564, 0.0008883902275125473, 0.0008014397012084036, 0.0008264688444718471, 0.004604741454914939, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0023000264038757798, 0.01705439603921528, 0.04910070346416718, 0.09122001899630586, 0.17588293609181563, 0.18507124253611063, 0.09123159958610425, 0.05960162269734152, 0.05217691285173646, 0.04256359509315278, 0.03655345441422678, 0.03347575846500428, 0.024626447013499187, 0.020432978830003327, 0.018561221373061258, 0.015463103655853658, 0.013714304272130806, 0.010177342106655817, 0.007905429232179009, 0.007063551755709067, 0.006327206254554339, 0.005548799854541709, 0.00473154328286029, 0.0028560148177622416, 0.003584833469792769, 0.0031925925174912575, 0.0020649767313211443, 0.002451003450795212, 0.0021984280785497233, 0.0011494329646675383, 0.0013478106212170275, 0.0012014834048370694, 0.0007953963931541348, 0.0008277202379397255, 0.007546113042367408, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.008510891182227956, 0.027618114739544775, 0.0636993366514693, 0.14246282154415016, 0.19098302504658946, 0.0872846975295914, 0.05823132301671626, 0.054630204652622194, 0.05224415539511138, 0.03774462633291826, 0.03664568879307432, 0.03118798584556276, 0.025179552074013272, 0.027141927663582498, 0.018962738084157393, 0.017223786461534024, 0.012446304790499648, 0.016704397350814998, 0.010397188282338298, 0.011885364365900734, 0.00654541669225773, 0.0040150732738811505, 0.00794356577980281, 0.004932553709318321, 0.00832159001726371, 0.004070225735221562, 0.004060922854342003, 0.002952745784692842, 0.0018856875946734997, 0.0019478722702617498, 0.0023680681218760063, 0.0023425849040899396, 0.002593594715463811, 0.014835968744435398, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0021323691782451095, 0.006747644148045247, 0.02513638990110083, 0.09137187949815516, 0.17543353593257902, 0.082276692770331, 0.055565932825706814, 0.04899686699219004, 0.048526846692094026, 0.0430927385806642, 0.045633959497397604, 0.03788645694588343, 0.03701656523569493, 0.027036724921725, 0.025113196273446294, 0.031936114241276965, 0.01971309713885621, 0.01574158090833572, 0.019199474721680914, 0.015918849921157444, 0.020868544525546172, 0.01747935795697653, 0.011748327914222433, 0.011164996360747675, 0.005749847798091752, 0.008617229066506017, 0.0075600827784392515, 0.005840168166936298, 0.004992409839912211, 0.0034805126985320766, 0.004064677716135877, 0.008239422111627327, 0.00550017795981303, 0.030217328781947526, 0.0, 0.0, 0.0 ] ], "V+Jets": [ [ 0.0, 0.0003142927948550799, 0.014512953130632845, 0.05277088304876486, 0.08603434012912506, 0.10506007172016002, 0.1067469629669173, 0.09819689497361543, 0.08685199609224331, 0.0751422047093353, 0.06330097494347225, 0.05305337891368768, 0.042655702448659835, 0.03651482989040328, 0.02983395150144785, 0.02444199511955661, 0.019900292964464696, 0.017253925481071554, 0.014184603279955183, 0.011779383448541635, 0.00996429756420057, 0.008054020034949594, 0.006814650499510039, 0.005461215783698751, 0.004786373871279337, 0.004022818533689391, 0.0032319528725585503, 0.002762787299816871, 0.0021703208306309983, 0.0021801373564605993, 0.0018673122370412762, 0.0014108542664235356, 0.0012263135535731382, 0.0010058133245547092, 0.0009499002073703987, 0.0008661948281679969, 0.004675399379164311, 0.0, 0.0, 0.0 ], [ 0.0, 0.00022095428396729953, 0.012707124119856623, 0.05007359016055423, 0.0816346426541373, 0.10173271618458331, 0.10290453572384554, 0.09596862491288694, 0.0884082114992676, 0.07362064853080143, 0.06504901232482868, 0.05374270427931259, 0.04477683652470922, 0.03677843045188911, 0.03136199798739972, 0.02541267694460663, 0.02154691592437478, 0.018001364153149808, 0.015421585508605756, 0.012398978119919494, 0.01003514773672651, 0.009161746424217295, 0.007765969135257237, 0.006138711956013194, 0.0052930499804763696, 0.004422823978351614, 0.0037285515669491375, 0.0033000573885081388, 0.0021477243482608396, 0.0023129205624489945, 0.0020536026976429207, 0.0015157122589255537, 0.0013647949956127356, 0.001133513142190638, 0.0011879424280584426, 0.0010872865461224862, 0.005588894565542552, 0.0, 0.0, 0.0 ], [ 0.0, 0.00013748062767261643, 0.009877166688101645, 0.03985777001865452, 0.07035317931696078, 0.08564991747635955, 0.09321755789073534, 0.09152769571355399, 0.08454969496307257, 0.07437875824892262, 0.06683322444614226, 0.056037952121561985, 0.04893731863087072, 0.04248881561509729, 0.03354193912141039, 0.029281795324918397, 0.024076685745943033, 0.021720554346112426, 0.018596818125468612, 0.017199212713088562, 0.013127731797598251, 0.010460260246874836, 0.00954157139587826, 0.007835480797804073, 0.007545069860911577, 0.006347245018720189, 0.005118963773785227, 0.004003056250401388, 0.004070861464439643, 0.0029419886267184367, 0.0025250167311909725, 0.002418125998750675, 0.002143447981672106, 0.002081763711086102, 0.0014299016844281053, 0.0011152608200720772, 0.009030716705020644, 0.0, 0.0, 0.0 ], [ 0.0, 3.810027164398639e-05, 0.003721172602538792, 0.022266225487734905, 0.052880858317373075, 0.06936234087048895, 0.08056057120449574, 0.07733315150944509, 0.08125574087757274, 0.07549143445289774, 0.06728456262529578, 0.06192836491888306, 0.05536944645421989, 0.045633394393801645, 0.04032623500121411, 0.03503166182734747, 0.03146724875386978, 0.027856292271809024, 0.021188248413009467, 0.020359562334310768, 0.017957863346561007, 0.015314505194193905, 0.013059129371655766, 0.01171264945102591, 0.010269417507639498, 0.0082138966340941, 0.007373820414424706, 0.005699349402425763, 0.005494052845004428, 0.0035857607089320705, 0.004141242402878959, 0.00366804368163215, 0.0036880485413815184, 0.0022419443424711526, 0.002389293316833953, 0.0017510306661065013, 0.014085339584786628, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0008402959145172021, 0.01012304376017877, 0.03413361809478428, 0.055835686302263654, 0.06144655746472205, 0.07274592538382918, 0.0695957039335041, 0.06912507857595256, 0.06049550766683466, 0.06076662998718386, 0.05139536619729753, 0.05230417197185052, 0.04817265716878424, 0.042399582340700605, 0.038569102780889535, 0.03069187593457968, 0.02962141430746964, 0.02472928826393837, 0.020171917940323816, 0.022754474514120604, 0.018291841915874994, 0.0156584356121414, 0.013409375018530394, 0.01158163392322997, 0.008650132858846873, 0.00852104997162392, 0.0077395923376918545, 0.007206155491780463, 0.006961542442628282, 0.005860017366697022, 0.00391848289653562, 0.004549713178876572, 0.003079624087702752, 0.0036477362613671497, 0.025006768132747617, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 9.377464267757747e-05, 0.0009536114146946773, 0.008546856978907304, 0.025105409968864692, 0.03635345299364116, 0.05233149636769967, 0.06279576970695548, 0.0619969969286244, 0.06518475509471011, 0.057002525687038286, 0.05525064394424468, 0.055771707355333607, 0.050594964937779464, 0.048175642600253726, 0.03993835458284252, 0.04207656080204922, 0.0334895737691743, 0.03163942279546589, 0.02498391970544256, 0.027361052245516607, 0.020400636414576803, 0.01862628852026504, 0.015241004242652663, 0.016301343991875956, 0.013793322994982956, 0.016745694488133258, 0.012666671579355788, 0.011513765256619228, 0.006897541689718618, 0.009931398827012047, 0.005615202714648623, 0.008076860989598289, 0.005774921550162517, 0.005468100083585777, 0.05330075413489653, 0.0, 0.0, 0.0 ] ], "data": [ [ 0.0, 0.00020732908308713005, 0.006997356554190639, 0.037267402684911625, 0.07494946353599752, 0.11750375783963096, 0.17384543616855855, 0.16451562742963768, 0.0927797646814907, 0.06878142331415539, 0.05043279946094439, 0.0388223708080651, 0.03120302700461307, 0.026278961281293735, 0.0210439019333437, 0.0177784688747214, 0.013580054942207018, 0.012698906339086716, 0.007930337428082725, 0.007204685637277769, 0.005286891618721816, 0.0050277302648629035, 0.003835588037111906, 0.0030062717047633857, 0.002954439433991603, 0.0020732908308713003, 0.002021458560099518, 0.0021769553724148654, 0.0016586326646970404, 0.0013476390400663453, 0.0004664904369460426, 0.0009329808738920852, 0.0003628258954024776, 0.0006738195200331726, 0.0004664904369460426, 0.0003628258954024776, 0.003524594412481211, 0.0, 0.0, 0.0 ], [ 0.0, 3.771307889576105e-05, 0.006335797254487856, 0.035827424950973, 0.07572786242268818, 0.1239251772514708, 0.17084024739779755, 0.15775380902096847, 0.09582893347412882, 0.07007090058832403, 0.05336400663750188, 0.04080555136521345, 0.031829838588022324, 0.024362648966661637, 0.02191129883843717, 0.015877206215115403, 0.013086438376829084, 0.011351636747624076, 0.007806607331422537, 0.006373510333383617, 0.006524362648966661, 0.005317544124302308, 0.003884447126263388, 0.0032810378639312114, 0.0027907678382863175, 0.002300497812641424, 0.0018102277869965302, 0.0019610801025795746, 0.0013953839191431588, 0.0011691054457685925, 0.0009051138934982651, 0.000791974656810982, 0.0005656961834364158, 0.0005656961834364158, 0.00041484386785337155, 0.00045255694674913255, 0.0027530547593905565, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.004676616915422886, 0.03189054726368159, 0.07034825870646766, 0.11233830845771144, 0.16432835820895522, 0.16218905472636816, 0.10064676616915423, 0.0691542288557214, 0.052089552238805965, 0.04318407960199005, 0.03228855721393035, 0.028308457711442785, 0.021194029850746268, 0.01890547263681592, 0.014328358208955224, 0.01218905472636816, 0.01054726368159204, 0.008059701492537314, 0.007064676616915423, 0.005920398009950248, 0.004676616915422886, 0.0038308457711442785, 0.003233830845771144, 0.002338308457711443, 0.002238805970149254, 0.0015920398009950248, 0.0019402985074626865, 0.0014427860696517413, 0.0013930348258706466, 0.0011442786069651742, 0.0007462686567164179, 0.0008955223880597015, 0.0008457711442786069, 0.00029850746268656717, 0.0037313432835820895, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0020511418022699304, 0.01887050458088336, 0.055791057021742106, 0.088062354710789, 0.1500068371393409, 0.17489402434021606, 0.09462600847805279, 0.06262819636264187, 0.05825242718446602, 0.04307397784766854, 0.03733078080131273, 0.03432243949131684, 0.025981129495419118, 0.021058389169971284, 0.01736633392588541, 0.01627239163134145, 0.014221249829071518, 0.013400793108163545, 0.010529194584985642, 0.009298509503623684, 0.005059483112265829, 0.0051962258990838235, 0.005469711472719814, 0.003965540817721865, 0.005743197046355805, 0.0030083413099958978, 0.002734855736359907, 0.0025981129495419118, 0.0015041706549979489, 0.0025981129495419118, 0.0013674278681799535, 0.0017776562286339398, 0.0009571995077259675, 0.0012306850813619582, 0.008751538356351703, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0009174311926605505, 0.006880733944954129, 0.03165137614678899, 0.05963302752293578, 0.12201834862385322, 0.19174311926605506, 0.09128440366972478, 0.060550458715596334, 0.05733944954128441, 0.05045871559633028, 0.044954128440366975, 0.0463302752293578, 0.027522935779816515, 0.021559633027522937, 0.029357798165137616, 0.01834862385321101, 0.017889908256880735, 0.012844036697247707, 0.01651376146788991, 0.00871559633027523, 0.01055045871559633, 0.00871559633027523, 0.008256880733944955, 0.0045871559633027525, 0.0045871559633027525, 0.006422018348623854, 0.005045871559633028, 0.004128440366972477, 0.0013761467889908258, 0.003211009174311927, 0.0013761467889908258, 0.003211009174311927, 0.0022935779816513763, 0.0013761467889908258, 0.01834862385321101, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0, 0.007164790174002047, 0.03377686796315251, 0.08290685772773798, 0.14534288638689868, 0.08290685772773798, 0.07164790174002048, 0.05834186284544524, 0.06038894575230297, 0.04401228249744115, 0.04401228249744115, 0.037871033776867964, 0.037871033776867964, 0.03991811668372569, 0.022517911975435005, 0.02456499488229273, 0.016376663254861822, 0.019447287615148415, 0.01023541453428864, 0.016376663254861822, 0.015353121801432959, 0.012282497441146366, 0.012282497441146366, 0.009211873080859774, 0.011258955987717503, 0.011258955987717503, 0.006141248720573183, 0.007164790174002047, 0.008188331627430911, 0.006141248720573183, 0.006141248720573183, 0.0040941658137154556, 0.0040941658137154556, 0.030706243602865918, 0.0, 0.0, 0.0 ] ] }, "absolute_eta": { "QCD": [ [ 0.05987675238307467, 0.06522186801449939, 0.06936891269300377, 0.07829640333350174, 0.08460292507612137, 0.07806791978226571, 0.07703068379218096, 0.031704073447097934, 0.09427044093820772, 0.11600675641580427, 0.1344869003709273, 0.0900188937850448, 0.021047469968270324, 0.0, 0.0 ], [ 0.05987675238307468, 0.06522186801449939, 0.06936891269300377, 0.07829640333350173, 0.08460292507612138, 0.07806791978226571, 0.07703068379218096, 0.03170407344709794, 0.09427044093820772, 0.11600675641580428, 0.1344869003709273, 0.09001889378504481, 0.021047469968270324, 0.0, 0.0 ], [ 0.05987675238307468, 0.06522186801449939, 0.06936891269300377, 0.07829640333350174, 0.08460292507612137, 0.07806791978226571, 0.07703068379218095, 0.03170407344709794, 0.09427044093820772, 0.11600675641580428, 0.1344869003709273, 0.0900188937850448, 0.02104746996827032, 0.0, 0.0 ], [ 0.05987675238307467, 0.06522186801449939, 0.06936891269300376, 0.07829640333350173, 0.08460292507612137, 0.07806791978226571, 0.07703068379218095, 0.031704073447097934, 0.09427044093820772, 0.11600675641580427, 0.1344869003709273, 0.09001889378504481, 0.021047469968270324, 0.0, 0.0 ], [ 0.05987675238307469, 0.0652218680144994, 0.0693689126930038, 0.07829640333350177, 0.0846029250761214, 0.07806791978226574, 0.07703068379218098, 0.03170407344709795, 0.09427044093820774, 0.11600675641580432, 0.1344869003709274, 0.09001889378504484, 0.02104746996827033, 0.0, 0.0 ], [ 0.05987675238307467, 0.06522186801449939, 0.06936891269300376, 0.07829640333350174, 0.08460292507612137, 0.07806791978226572, 0.07703068379218095, 0.031704073447097934, 0.09427044093820772, 0.11600675641580428, 0.1344869003709273, 0.0900188937850448, 0.02104746996827032, 0.0, 0.0 ] ], "SingleTop": [ [ 0.18057558218441327, 0.14499025725382114, 0.14301457067321732, 0.11905510149999471, 0.11116281843218555, 0.10175203166424354, 0.08358722065220654, 0.024903272404934507, 0.0270673005092648, 0.027792316493843693, 0.020813846295080696, 0.01136307728578325, 0.003922604651011212, 0.0, 0.0 ], [ 0.16907559988820747, 0.15424141546526418, 0.1460068746361783, 0.1300906193839936, 0.1063964739259216, 0.1000232454738788, 0.08228563667081995, 0.018089722201396815, 0.032019124346381045, 0.02602573031911643, 0.022796910191220873, 0.01072218606059552, 0.0022264614370255727, 0.0, 0.0 ], [ 0.16003961460015984, 0.1626323442032677, 0.1558254727209446, 0.11305712673294387, 0.12336094402733422, 0.09205742315926084, 0.0775142068231737, 0.026461227676590055, 0.03517330384409255, 0.027647442061625817, 0.012133430061119343, 0.011603624701286785, 0.0024938393882007735, 0.0, 0.0 ], [ 0.15734594848409675, 0.15888786299617055, 0.14814652354908442, 0.14086782219989935, 0.09786627247386094, 0.09662926694197307, 0.09284393641032654, 0.02523098583944025, 0.02753618419509209, 0.02286857701816419, 0.012113382427501733, 0.014989407173932287, 0.0046738302904579246, 0.0, 0.0 ], [ 0.16246752294791864, 0.15318236969029106, 0.1906390406902598, 0.1297060823117596, 0.1386042400986142, 0.07852093522670325, 0.06554985680699696, 0.02079115609683946, 0.03400310240241055, 0.004458509076762609, 0.012248645880851786, 0.009792302376248768, 3.6236394343341215e-05, 0.0, 0.0 ], [ 0.15871640987822966, 0.15470658723972922, 0.21755053984397163, 0.1533375154822228, 0.11998310855118453, 0.08626869845902692, 0.04116515500954365, 0.013292578526454766, 0.026961724289846035, 0.014452548628575262, 0.013565134091215745, 0.0, 0.0, 0.0, 0.0 ] ], "TTJet": [ [ 0.1550545124008465, 0.15200333447806322, 0.1436862018143008, 0.13298893526240232, 0.12138064638016564, 0.09762957809840218, 0.08305499669941117, 0.02363678761091243, 0.036811901085146016, 0.026785286346499862, 0.01634337857373554, 0.00847384086084817, 0.0021506003892662103, 0.0, 0.0 ], [ 0.15808975127740826, 0.15219383074518758, 0.14271015995344613, 0.13167512293756195, 0.11396100462917787, 0.09912118618932568, 0.08319327208386104, 0.022194287617898788, 0.03707235631115356, 0.027925522225522366, 0.019326643549551395, 0.009897596165277064, 0.002639266314628483, 0.0, 0.0 ], [ 0.15874199770924025, 0.15089836772498144, 0.14680274569852497, 0.13660298679841007, 0.11534445603379266, 0.09858125663432105, 0.0838638803072332, 0.019756645643396943, 0.035524658273683216, 0.027139786100692998, 0.01637367661515989, 0.008113890656868862, 0.0022556518036943285, 0.0, 0.0 ], [ 0.16582660651645012, 0.1610555374976697, 0.14677026228381246, 0.1378879509576639, 0.110469194129696, 0.1028065053750657, 0.07775811978136431, 0.019685941077031324, 0.03254771208542584, 0.022355523180477437, 0.014241466088826444, 0.006291155754810762, 0.0023040252717060825, 0.0, 0.0 ], [ 0.1736521960304793, 0.16350182984525446, 0.1422609250027656, 0.14455830491061172, 0.11273444407704002, 0.10339767524840501, 0.07521970265615449, 0.017155293766308036, 0.029652231359880883, 0.020994220007513983, 0.011485919309238313, 0.0037617621544219094, 0.0016254956319265003, 0.0, 0.0 ], [ 0.1747817277705337, 0.16889849861722145, 0.16018415241705022, 0.1451208694903543, 0.12013365391432626, 0.09263394205358792, 0.0704598773869391, 0.021411741844544023, 0.025683289949135886, 0.01197646461682272, 0.004616187660517965, 0.003423724033064587, 0.000675870245902091, 0.0, 0.0 ] ], "V+Jets": [ [ 0.09810317004334954, 0.0987340013013674, 0.10245387658905408, 0.10237809106375455, 0.10598791899285333, 0.10457449516769708, 0.10681369313771015, 0.03443851151421318, 0.07294918890165078, 0.06783182732875304, 0.056051872555258064, 0.037127155408704524, 0.012556197995634203, 0.0, 0.0 ], [ 0.09656302149893584, 0.09777789491691936, 0.10039883058469286, 0.10281822034922027, 0.1033500404439202, 0.10539633428984513, 0.10338779203893626, 0.0335961678370141, 0.07271336912630523, 0.07106426178033483, 0.0588231789442643, 0.04137150761797474, 0.012739380571636847, 0.0, 0.0 ], [ 0.09618069059555734, 0.09993127772863424, 0.10301892816397343, 0.10465766501421543, 0.10326547778632636, 0.10645977234658961, 0.10304636166633643, 0.032782572681552075, 0.07221093148581915, 0.07108301513391589, 0.05628005779754584, 0.0390270624198895, 0.012056187179644715, 0.0, 0.0 ], [ 0.10680681613625684, 0.10551260762245762, 0.10917668940639748, 0.11161748490713201, 0.10941719560109794, 0.1138374532848857, 0.10161332797791646, 0.0335299143257606, 0.0665756499092455, 0.06202811535605133, 0.045718236205316926, 0.026004507320246093, 0.008162001947235502, 0.0, 0.0 ], [ 0.12052741638537087, 0.10846579552963456, 0.11658850567084543, 0.11192714926420477, 0.11775280491057286, 0.10941590622671524, 0.10739117633730312, 0.031503909191679544, 0.06309008040662006, 0.05076946146323644, 0.03643053178704978, 0.020305098964242832, 0.005832163862524572, 0.0, 0.0 ], [ 0.12975384284701516, 0.1267251769167847, 0.12312672165614938, 0.12411696032523022, 0.11582675418832444, 0.10965521123202573, 0.10913622385814377, 0.027345217535621948, 0.053308768731306605, 0.03841122930940112, 0.021513264049698146, 0.016549558772534407, 0.004531070577764191, 0.0, 0.0 ] ], "data": [ [ 0.13787384025294147, 0.14476753226558856, 0.13740734981599545, 0.12574508889234437, 0.11584512517493392, 0.09765199813403826, 0.08806302804125848, 0.024827657699683824, 0.043020784740579486, 0.03628258954024776, 0.026227129010521953, 0.01694915254237288, 0.005338723889493599, 0.0, 0.0 ], [ 0.1466661638256147, 0.14828782621813244, 0.13784130336400663, 0.13267461155528737, 0.11491175139538391, 0.09786543973449992, 0.08451500980540051, 0.023495248152059132, 0.04122039523306682, 0.032697239402624825, 0.023721526625433698, 0.0129732991401418, 0.003130185548348167, 0.0, 0.0 ], [ 0.1528358208955224, 0.14880597014925373, 0.14751243781094528, 0.13417910447761194, 0.1172636815920398, 0.09706467661691542, 0.08373134328358209, 0.01970149253731343, 0.03691542288557214, 0.028407960199004975, 0.020597014925373133, 0.010298507462686566, 0.0026865671641791043, 0.0, 0.0 ], [ 0.1450840968138931, 0.15492957746478875, 0.1450840968138931, 0.1355121017366334, 0.12101736633392589, 0.10255709011349652, 0.0824559004512512, 0.022562559824969235, 0.03432243949131684, 0.027758785724053058, 0.017776562286339396, 0.00943525229044168, 0.0015041706549979489, 0.0, 0.0 ], [ 0.15825688073394495, 0.16834862385321103, 0.1559633027522936, 0.12385321100917432, 0.12568807339449542, 0.1018348623853211, 0.07155963302752294, 0.022018348623853212, 0.033486238532110094, 0.02018348623853211, 0.013302752293577982, 0.0045871559633027525, 0.0009174311926605505, 0.0, 0.0 ], [ 0.18628454452405324, 0.18526100307062437, 0.14943705220061412, 0.1187308085977482, 0.13715455475946775, 0.08700102354145343, 0.061412487205731836, 0.02456499488229273, 0.01842374616171955, 0.015353121801432959, 0.006141248720573183, 0.009211873080859774, 0.0010235414534288639, 0.0, 0.0 ] ] }, "angle_bl": { "QCD": [ [ 0.014948806610719855, 0.040811329597561834, 0.07230211935795718, 0.09245654083596451, 0.08198826353962475, 0.07707368362629263, 0.07128824050954027, 0.07500887052363427, 0.07313950417418742, 0.06999112443841299, 0.07117100434460526, 0.06963996625573543, 0.06937435511875396, 0.06144702385913922, 0.044024700942259534, 0.015334466265610622, 0.0, 0.0, 0.0, 0.0 ], [ 0.014948806610719857, 0.04081132959756185, 0.07230211935795719, 0.09245654083596452, 0.08198826353962477, 0.07707368362629265, 0.07128824050954029, 0.07500887052363427, 0.07313950417418744, 0.069991124438413, 0.07117100434460528, 0.06963996625573544, 0.06937435511875398, 0.06144702385913922, 0.04402470094225954, 0.015334466265610623, 0.0, 0.0, 0.0, 0.0 ], [ 0.014948806610719857, 0.04081132959756185, 0.07230211935795719, 0.09245654083596452, 0.08198826353962475, 0.07707368362629265, 0.07128824050954027, 0.07500887052363427, 0.07313950417418744, 0.069991124438413, 0.07117100434460527, 0.06963996625573544, 0.06937435511875398, 0.06144702385913922, 0.04402470094225954, 0.015334466265610622, 0.0, 0.0, 0.0, 0.0 ], [ 0.014948806610719857, 0.04081132959756185, 0.0723021193579572, 0.09245654083596454, 0.08198826353962478, 0.07707368362629266, 0.07128824050954029, 0.07500887052363428, 0.07313950417418744, 0.06999112443841302, 0.07117100434460528, 0.06963996625573544, 0.06937435511875398, 0.06144702385913923, 0.044024700942259555, 0.015334466265610625, 0.0, 0.0, 0.0, 0.0 ], [ 0.014948806610719857, 0.04081132959756185, 0.07230211935795719, 0.09245654083596454, 0.08198826353962478, 0.07707368362629266, 0.07128824050954029, 0.07500887052363427, 0.07313950417418744, 0.069991124438413, 0.07117100434460527, 0.06963996625573546, 0.06937435511875398, 0.06144702385913923, 0.04402470094225954, 0.015334466265610623, 0.0, 0.0, 0.0, 0.0 ], [ 0.014948806610719853, 0.04081132959756185, 0.07230211935795718, 0.09245654083596452, 0.08198826353962477, 0.07707368362629265, 0.07128824050954029, 0.07500887052363425, 0.07313950417418742, 0.069991124438413, 0.07117100434460527, 0.06963996625573544, 0.06937435511875396, 0.06144702385913922, 0.04402470094225954, 0.015334466265610623, 0.0, 0.0, 0.0, 0.0 ] ], "SingleTop": [ [ 0.0039046088803905993, 0.0468224953538969, 0.09579928482616777, 0.12595253180535548, 0.11777897388008238, 0.1498882626577888, 0.13266536894410155, 0.09526073124638967, 0.09009423712618884, 0.0581134004322832, 0.035990036883331286, 0.02499864359315429, 0.015675007743320927, 0.0064284873235083695, 0.0, 0.0006279293040401627, 0.0, 0.0, 0.0, 0.0 ], [ 0.0030043350271660306, 0.04090570271049234, 0.09921906893962014, 0.13280694993585118, 0.11890105132240404, 0.1384492036480165, 0.12061061527434254, 0.09462047674239636, 0.08625557938505997, 0.05693862407551142, 0.04573908605552821, 0.0370767712650885, 0.014202677471047753, 0.007966212352980747, 0.0033036457944943206, 0.0, 0.0, 0.0, 0.0, 0.0 ], [ 0.005305113055895024, 0.03820766486469783, 0.08859780314960239, 0.12159514179547479, 0.13532397095489504, 0.13146481946982322, 0.1233788256486948, 0.10661246024236333, 0.07947192817124155, 0.07702284821574824, 0.03915642931492725, 0.02387711180017436, 0.015647896598402714, 0.008348368058359947, 0.005421840937790337, 0.0005677777219091426, 0.0, 0.0, 0.0, 0.0 ], [ 0.005373502159378196, 0.03394559712385344, 0.10036628252312571, 0.1268301740947897, 0.132763843085672, 0.13059388443129716, 0.11898859613758431, 0.10078268593932638, 0.08387062667655523, 0.06486620067652175, 0.04499811474394459, 0.03179146606632535, 0.011515261132118149, 0.011871971411068214, 0.0014417937984399403, 0.0, 0.0, 0.0, 0.0, 0.0 ], [ 3.6236394343341215e-05, 0.022192024901051845, 0.0936171041756505, 0.12962619975448886, 0.14378709042327772, 0.12329263844201582, 0.1273403823145343, 0.12538907608746688, 0.07350118737075455, 0.062492193160663685, 0.034915248311680885, 0.040084252462314986, 0.015086722933157425, 0.00863964326859921, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.018180978013050075, 0.1271108104042842, 0.11009502410076885, 0.13029456150713759, 0.08477187366729436, 0.09856207259936148, 0.11798851074054852, 0.12113559223892216, 0.033864511687758385, 0.08447926937520527, 0.02574341736979062, 0.031744650817397045, 0.013459984855643353, 0.002568742622838117, 0.0, 0.0, 0.0, 0.0, 0.0 ] ], "TTJet": [ [ 0.003480091226042866, 0.043984096758788255, 0.11452728728744802, 0.14898203136159344, 0.1560439985753794, 0.1450982592356159, 0.12262834347830495, 0.09590979119544099, 0.0655258657422941, 0.04425877017362726, 0.030056612454449502, 0.015653881802439904, 0.00878533677757391, 0.0032171636031975803, 0.001700338090636742, 0.00014813223716723204, 0.0, 0.0, 0.0, 0.0 ], [ 0.004159459158989972, 0.04706654361068396, 0.11421815935270008, 0.1563841026022785, 0.14965383121264697, 0.14007040911447977, 0.1201856061748921, 0.09338970376184354, 0.0676209523871961, 0.045655689306888764, 0.030207238850880107, 0.017986929069649365, 0.008474479846015974, 0.003634897534104121, 0.0011192912172336225, 0.00017270679951702342, 0.0, 0.0, 0.0, 0.0 ], [ 0.0032581601038781756, 0.04657526905961961, 0.11743934924960031, 0.15089669601363306, 0.15263100075767067, 0.1379052659230357, 0.11695929643988157, 0.092301719219073, 0.06907903054627627, 0.04759067177768197, 0.029020888222445335, 0.019655799243985486, 0.010834201314263448, 0.00401148110295032, 0.0014235242267248685, 0.0004176467992800951, 0.0, 0.0, 0.0, 0.0 ], [ 0.002760937104959862, 0.04880297591087044, 0.12220075782334347, 0.15160861681258872, 0.15457075138800133, 0.13363217509976422, 0.11561962756713415, 0.09006578502558703, 0.06649730974585269, 0.04651019740475168, 0.03152330279310956, 0.01715118539791801, 0.012299336965665219, 0.00473613170958992, 0.0019295894161559233, 9.131983470784158e-05, 0.0, 0.0, 0.0, 0.0 ], [ 0.0044173500599130255, 0.052517009746740964, 0.15360699943658074, 0.15050589373764617, 0.16193409864810168, 0.14142959315605183, 0.10655366091622036, 0.07874301883301783, 0.05240542264521773, 0.042610043751563915, 0.02624073455032506, 0.014945834501212655, 0.008509256675874976, 0.004748373074091724, 0.0006159125147027135, 0.00021679775273854992, 0.0, 0.0, 0.0, 0.0 ], [ 0.0035190108766115155, 0.07751477565596746, 0.16486537665477827, 0.20619457767391186, 0.1561797448906424, 0.11890125995332525, 0.09240630355471696, 0.060022237958876096, 0.04004777375781091, 0.03054078206711892, 0.023459980935669884, 0.012617602409851627, 0.005836939426081265, 0.004561216918333808, 0.0026028787684306896, 0.0007295384978730949, 0.0, 0.0, 0.0, 0.0 ] ], "V+Jets": [ [ 0.005232249690924095, 0.04804504393562702, 0.08665461064850623, 0.11397685384223152, 0.10510580805725092, 0.09639128332438138, 0.10342173364229315, 0.09332936636045015, 0.09259456965073734, 0.08058673012873738, 0.06254861389416443, 0.058726208247432646, 0.029099705980963918, 0.01929873067644767, 0.004645684777564139, 0.0003428071422880995, 0.0, 0.0, 0.0, 0.0 ], [ 0.008153057569074529, 0.051270035698688925, 0.08427410766735173, 0.10196234814846003, 0.10810939436016276, 0.09373650112973582, 0.09866098791532578, 0.10491991292586804, 0.0825251934449296, 0.08118767641716787, 0.06956920693918874, 0.047840857459107176, 0.041155582300322756, 0.018617594513993613, 0.007486227105081234, 0.0005313164055415914, 0.0, 0.0, 0.0, 0.0 ], [ 0.0054733561194921085, 0.04456323225374236, 0.07592348727403073, 0.09287722886846272, 0.12044686637921556, 0.10564601306989904, 0.10295187047187623, 0.09256333027989423, 0.09998876689145801, 0.07577730959705979, 0.060838142101634886, 0.06211686282777812, 0.028783901680846664, 0.025962524091274194, 0.006087108093335067, 0.0, 0.0, 0.0, 0.0, 0.0 ], [ 0.007195744806787184, 0.029642462669177853, 0.06420621534730936, 0.11233903490589119, 0.12454477143817928, 0.08216625297431576, 0.08510506064273342, 0.09040518957328482, 0.12055247076395395, 0.08712992336665631, 0.06093727342953177, 0.05935791460681155, 0.04817501504620984, 0.018791707810709934, 0.00945096261844774, 0.0, 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.04458806406624592, 0.031175629763670495, 0.07809552258309761, 0.08226898864922706, 0.0934169589565704, 0.1013694079433151, 0.07734890252511513, 0.13464099347268435, 0.09485523961791913, 0.09790629756040296, 0.07536367434236739, 0.02551497295485148, 0.03759488650692585, 0.02586046105760723, 0.0, 0.0, 0.0, 0.0, 0.0 ], [ 0.00260442129680468, 0.03972848751584939, 0.02924765873510957, 0.05711568918858208, 0.08990618469918282, 0.10770822649909946, 0.10793313382185941, 0.09972141665085242, 0.1461018433967429, 0.10112523775710691, 0.0721685934724986, 0.07075104525348042, 0.05771902890600391, 0.018169032806827457, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ], "data": [ [ 0.005442388431037164, 0.047063701860778524, 0.10459752241745711, 0.1395843051884103, 0.14310889960089151, 0.14279790597626082, 0.11439382159332401, 0.09500855232467735, 0.07422381174519256, 0.05136578033483647, 0.034831285958637846, 0.022909863681127872, 0.01404654537915306, 0.007256517908049552, 0.0032136007878505158, 0.00015549681231534753, 0.0, 0.0, 0.0, 0.0 ], [ 0.003771307889576105, 0.04623623472620304, 0.11015990345451802, 0.1397269573087947, 0.14843867853371548, 0.13829386031075577, 0.12022929551968622, 0.09390556645044501, 0.07470960929250263, 0.05072409111479861, 0.032584100165937546, 0.02164730728616684, 0.011955046009956252, 0.0057701010710514405, 0.0016593754714134862, 0.00018856539447880525, 0.0, 0.0, 0.0, 0.0 ], [ 0.0031840796019900496, 0.04497512437810945, 0.11069651741293532, 0.1417412935323383, 0.14432835820895523, 0.13706467661691543, 0.11711442786069651, 0.09731343283582089, 0.07139303482587064, 0.05616915422885572, 0.03711442786069652, 0.021641791044776117, 0.01, 0.00527363184079602, 0.0016417910447761193, 0.00034825870646766166, 0.0, 0.0, 0.0, 0.0 ], [ 0.003692055244085875, 0.048133460959934364, 0.11951319567892794, 0.15055380828661288, 0.14344318337207712, 0.13140981813209354, 0.11773553945029401, 0.09216463831532887, 0.06645699439354574, 0.04895391768084234, 0.03404895391768085, 0.023383016545877208, 0.010665937371803639, 0.00765759606180774, 0.001914399015451935, 0.0002734855736359907, 0.0, 0.0, 0.0, 0.0 ], [ 0.005045871559633028, 0.045871559633027525, 0.12752293577981652, 0.13990825688073394, 0.17293577981651376, 0.12155963302752294, 0.11788990825688074, 0.08256880733944955, 0.06651376146788991, 0.05, 0.03256880733944954, 0.01743119266055046, 0.012385321100917432, 0.004128440366972477, 0.003211009174311927, 0.00045871559633027525, 0.0, 0.0, 0.0, 0.0 ], [ 0.0020470829068577278, 0.05322415557830092, 0.172978505629478, 0.15967246673490276, 0.15967246673490276, 0.13203684749232344, 0.09825997952917093, 0.06653019447287616, 0.05834186284544524, 0.032753326509723645, 0.016376663254861822, 0.02968270214943705, 0.009211873080859774, 0.008188331627430911, 0.0010235414534288639, 0.0, 0.0, 0.0, 0.0, 0.0 ] ] } }
def expand_as_one_hot(input, C, ignore_index=None): """ Converts NxDxHxW label image to NxCxDxHxW, where each label gets converted to its corresponding one-hot vector :param input: 4D input image (NxDxHxW) :param C: number of channels/labels :param ignore_index: ignore index to be kept during the expansion :return: 5D output image (NxCxDxHxW) """ assert input.dim() == 4 # expand the input tensor to Nx1xDxHxW before scattering input = input.unsqueeze(1) # create result tensor shape (NxCxDxHxW) shape = list(input.size()) shape[1] = C if ignore_index is not None: # create ignore_index mask for the result mask = input.expand(shape) == ignore_index # clone the src tensor and zero out ignore_index in the input input = input.clone() input[input == ignore_index] = 0 # scatter to get the one-hot tensor result = torch.zeros(shape).to(input.device).scatter_(1, input, 1) # bring back the ignore_index in the result result[mask] = ignore_index return result else: # scatter to get the one-hot tensor return torch.zeros(shape).to(input.device).scatter_(1, input, 1)
class HtmlWriter(): def __init__(self, filename): self.filename = filename self.html_file = open(self.filename, 'w') self.html_file.write( """<!DOCTYPE html>\n""" + \ """<html>\n<body>\n<table border="1" style="width:100%"> \n""") def add_element(self, col_dict): self.html_file.write(' <tr>\n') for key in range(len(col_dict)): self.html_file.write(""" <td>{}</td>\n""".format(col_dict[key])) self.html_file.write(' </tr>\n') def image_tag(self, image_path, height=240, width=320): return """<img src="{}" alt="{}" height={} width={}>""".format( image_path,image_path,height,width) def video_tag(self, video_path, height=240, width=320, autoplay=True): if autoplay: autoplay_str = 'autoplay loop' else: autoplay_str = '' tag = \ """<video width="{}" height="{}" controls {}>""".format(width,height,autoplay_str) + \ """ <source src="{}" type="video/mp4">""".format(video_path) + \ """ Your browser does not support the video tag.""" + \ """</video>""" return tag def colored_text(self,text,color): return '<span style=\"color:' + color + '\">' + text + '</span>' def bg_colored_text(self,text,bg_color,text_color='rgb(0,0,0)'): return f'<span style=\"background-color:{bg_color}; color:{text_color}\">' + text + '</span>' def editable_content(self,content): return """<div contenteditable="True">{}</div>""".format(content) def close(self): self.html_file.write('</table>\n</body>\n</html>') self.html_file.close()
#!/usr/bin/env python3 # -*- coding:utf-8 -*- ''' Author: Luiz Yao (luizyao@163.com) Created Date: 2019-09-26 16:22:12 ----- Last Modified: 2019-09-26 16:33:29 Modified By: Luiz Yao (luizyao@163.com) ----- THIS PROGRAM IS FREE SOFTWARE, IS LICENSED UNDER MIT. A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Copyright © 2019 Yao Meng ----- HISTORY: Date By Comments ---------- -------- --------------------------------------------------------- ''' class TestClass: def test_one(self): x = 'this' assert 'h' in x def test_two(self): x = 'hello' assert hasattr(x, 'check')
# AT Commands MAKE = 'at+cgmi' MODEL = 'at+cgmm' STATUS = 'at!gstatus?' BANDMASK = 'at!gband?' SIGNALQ = 'at+csq' PWRMODE = { 'reboot': 'at!reset', 'lowpower': 'at+cfun=4', 'fullpower': 'at+cfun=1'}
x=int(input("Enter a value for x: ")) y=int(input("Enter a value for y: ")) z=int(input("Enter a value for z: ")) if x<y<z: print("branch 1", end =' ') elif x>y>z: print("branch 2", end =' ') else: print("branch 3", end =' ') print("is the branch")
"""Pyvista specific errors.""" class MissingDataError(ValueError): """Exception when data is missing, e.g. no active scalars can be set.""" class AmbiguousDataError(ValueError): """Exception when data is ambiguous, e.g. multiple active scalars can be set."""
PORT=5050 HEADER=128 FORMAT='utf-8' HEADER=64 DISCONNECT_MESSAGE='bye_0x8x0_eyb' PING_MSG='I____NAME____I' CHANGE_BIT='I_____I'
""" @author: Andrea Domenico Giuliano @contact: andreadomenico.giuliano@studenti.unipd.it @organization: University of Padua """ #File contenente la funzione che ritorna quante volte compare un item tra le impression di una settimana # e la funzione che ritorna la lista degli items di un impressions def c_i(c, item_id, imp_id): c.execute('select count(item_id.%s) from imp_items where (imp_id = %s)'%(item_id,imp_id)); for r in c: n_i = int(r[0]); return n_i; def l_i(c,imp_id,item_list): c.execute('select item_id as id from imp_terms where imp_id = %s'%(imp_id)); for row in c: item_list.append(row['id']); return item_list;
def comp_surface_opening(self, Ndisc=200): """Compute the Slot opening surface (by numerical computation). Caution, the bottom of the Slot is an Arc Parameters ---------- self : Slot A Slot object Ndisc : int Number of point to discretize the lines Returns ------- S: float Slot opening surface [m**2] """ surf_list = self.get_surface_opening() S = 0 for surf in surf_list: S += surf.comp_surface(Ndisc=Ndisc) return S
#!/usr/bin/env python3 syscall_table = [ "ni_syscall", "console_putc", "console_puts", "process_create", "process_exit", "thread_create", "thread_exit", "vmo_create", "vmo_write", "vmo_read", "vmo_map", "register_server", "register_named_server", "register_client", "register_client_by_name", "ipc_call", "ipc_return", "nanosleep", "clock_get", "clock_get_monotonic", "ticks_get", "ticks_per_second", "deadline_after", "yield", "futex_wait", "futex_wake", # private syscall "block_read", "block_write", "block_capacity", "block_size", "block_count", "framebuffer_create", "framebuffer_get_info", "framebuffer_present", ] print("#pragma once") for k, v in enumerate(syscall_table): print(f"#define __NR_{v} {k}") print(f"#define __NR_syscalls {len(syscall_table)}") print() print("#ifdef SYSCALL_IMPL") print() for k, v in enumerate(syscall_table): print(f"extern void sys_{v}();") print() print("void *sys_call_table[__NR_syscalls] = {") for k, v in enumerate(syscall_table): print(f"\t[__NR_{v}] = sys_{v},") print("};") print("#endif")
def mensagem(texto): print('-' * 30) print('{:^30}'.format(texto)) print('-' * 30) mensagem('CURSO EM VIDEO') def mostrar_nome(nome): print(f'Meu nome é {nome}') mostrar_nome('Lucas') def contador(*num): print(num) contador(1, 2, 4, 7, 9) def dobra(lista): pos = 0 while pos < len(lista): lista[pos] *= 2 pos += 1 valores = [6, 3, 9, 1, 0, 2] dobra(valores) print(valores)
class CaesarEncryption: def __init__(self,input_message,shift): self.input_message = input_message self.shift=shift def get_shifted_message(self): alphabet_list_sequence = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] encrypted_alphabet_sequence =[] inx=0 for alphabet in alphabet_list_sequence : if (inx+int(self.shift)) == len(alphabet_list_sequence): inx = -1*(self.shift) encrypted_alphabet_sequence.append(alphabet_list_sequence[(inx+(self.shift))]) inx+=1 #This section handles creation of the encrypted message encrypted_message = "" for character in self.input_message : if character in alphabet_list_sequence : chindex = alphabet_list_sequence.index(character) encrypted_character = encrypted_alphabet_sequence[chindex] encrypted_message+=encrypted_character else : encrypted_message+=character print(" ") print("Shift "+str(self.shift),">>","Message: "+ encrypted_message) print(" ") print(" ") enc_dec = input("""For Encryption ,type "enc",for Brute-Force Decryption: type "dec" >> """).lower() print(" ") if enc_dec == "enc" : in_message = input("Enter text that needs encryption >> ").lower() print(" ") print("-Shift is the number of position to be shifted in the alphabet sequence") print("-For e.g. when shift value of 1 is applied ,car becomes dbs ") print("-Value of shift should fall between 1 and 25,both 1 & 25 inclusive") print(" ") sft = int(input("Enter the value for shift in alphabet >> ")) encryption = CaesarEncryption (input_message=in_message,shift=sft) encryption.get_shifted_message() elif enc_dec == "dec": in_message = input("Enter text that needs decryption >> ").lower() print("-Shift is the number of position to be shifted in the alphabet sequence") print("-For e.g. when shift value of 1 is applied ,car becomes dbs ") print("-Value of shift should falls between 1 and 25,both 1 & 25 inclusive") sft =1 while sft < 26 : decryption = CaesarEncryption (input_message=in_message,shift=sft) decryption.get_shifted_message() sft+=1
class InvalidRequest(Exception): def __init__(self, message='', status_code=403): super(InvalidRequest, self).__init__() self.message = message self.status_code = status_code @property def as_dict(self): return { 'error': 'Invalid Request', 'message': self.message }
#!/usr/bin/env python # coding: utf-8 # # BATCH 7 DAY 3 ASSIGNMENT # Question 1 # In[ ]: for altitude in range(1000,10000): altitude=int(input('enter altitude')) if altitude ==1000: print('plane is safe to land') elif altitude > 1000 and altitude < 5000: print('bring the plane down to 1000 ft') else: print('turn around and try later') # Question 2 # In[1]: num1 = 0 num2 = 200 for n in range(num1, num2 + 1): if n > 1: for i in range(2, n): if (n % i) == 0: break else: print(n) # In[ ]: