Best Python code snippet using localstack_python
precision.py
Source:precision.py
...21 return table22_code_table = _fill_table(typecodes)23class PrecisionError(Exception):24 pass25def _lookup(table, key, required_bits):26 lst = table[key]27 for bits, typecode in lst:28 if bits >= required_bits:29 return typecode30 raise PrecisionError(key + " of " + str(required_bits) +31 " bits not available on this system")32Character = 'c'33try:34 UnsignedInt8 = _lookup(_code_table, "UnsignedInteger", 8)35 UInt8 = UnsignedInt836 __all__.extend(['UnsignedInt8', 'UInt8'])37except(PrecisionError):38 pass39try:40 UnsignedInt16 = _lookup(_code_table, "UnsignedInteger", 16)41 UInt16 = UnsignedInt1642 __all__.extend(['UnsignedInt16', 'UInt16'])43except(PrecisionError):44 pass45try:46 UnsignedInt32 = _lookup(_code_table, "UnsignedInteger", 32)47 UInt32 = UnsignedInt3248 __all__.extend(['UnsignedInt32', 'UInt32'])49except(PrecisionError):50 pass51try:52 UnsignedInt64 = _lookup(_code_table, "UnsignedInteger", 64)53 UInt64 = UnsignedInt6454 __all__.extend(['UnsignedInt64', 'UInt64'])55except(PrecisionError):56 pass57try:58 UnsignedInt128 = _lookup(_code_table, "UnsignedInteger", 128)59 UInt128 = UnsignedInt12860 __all__.extend(['UnsignedInt128', 'UInt128'])61except(PrecisionError):62 pass63UInt = UnsignedInt = UnsignedInteger = 'u'64try:65 Int0 = _lookup(_code_table, 'Integer', 0)66 __all__.append('Int0')67except(PrecisionError):68 pass69try:70 Int8 = _lookup(_code_table, 'Integer', 8)71 __all__.append('Int8')72except(PrecisionError):73 pass74try:75 Int16 = _lookup(_code_table, 'Integer', 16)76 __all__.append('Int16')77except(PrecisionError):78 pass79try:80 Int32 = _lookup(_code_table, 'Integer', 32)81 __all__.append('Int32')82except(PrecisionError):83 pass84try:85 Int64 = _lookup(_code_table, 'Integer', 64)86 __all__.append('Int64')87except(PrecisionError):88 pass89try:90 Int128 = _lookup(_code_table, 'Integer', 128)91 __all__.append('Int128')92except(PrecisionError):93 pass94Int = 'l'95try:96 Float0 = _lookup(_code_table, 'Float', 0)97 __all__.append('Float0')98except(PrecisionError):99 pass100try:101 Float8 = _lookup(_code_table, 'Float', 8)102 __all__.append('Float8')103except(PrecisionError):104 pass105try:106 Float16 = _lookup(_code_table, 'Float', 16)107 __all__.append('Float16')108except(PrecisionError):109 pass110try:111 Float32 = _lookup(_code_table, 'Float', 32)112 __all__.append('Float32')113except(PrecisionError):114 pass115try:116 Float64 = _lookup(_code_table, 'Float', 64)117 __all__.append('Float64')118except(PrecisionError):119 pass120try:121 Float128 = _lookup(_code_table, 'Float', 128)122 __all__.append('Float128')123except(PrecisionError):124 pass125Float = 'd'126try:127 Complex0 = _lookup(_code_table, 'Complex', 0)128 __all__.append('Complex0')129except(PrecisionError):130 pass131try:132 Complex8 = _lookup(_code_table, 'Complex', 16)133 __all__.append('Complex8')134except(PrecisionError):135 pass136try:137 Complex16 = _lookup(_code_table, 'Complex', 32)138 __all__.append('Complex16')139except(PrecisionError):140 pass141try:142 Complex32 = _lookup(_code_table, 'Complex', 64)143 __all__.append('Complex32')144except(PrecisionError):145 pass146try:147 Complex64 = _lookup(_code_table, 'Complex', 128)148 __all__.append('Complex64')149except(PrecisionError):150 pass151try:152 Complex128 = _lookup(_code_table, 'Complex', 256)153 __all__.append('Complex128')154except(PrecisionError):155 pass156Complex = 'D'...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!