How to use with_name method in testcontainers-python

Best Python code snippet using testcontainers-python_python

degree_table.py

Source:degree_table.py Github

copy

Full Screen

...69 self.cosl,70 # self.cos2b,71 self.cos2l72 )73 def with_name(self, row_type, column):74 return Deg(column=column,75 row_type=row_type,76 coeff=self.coeff,77 sinb=self.sinb,78 cosb=self.cosb,79 sinl=self.sinl,80 cosl=self.cosl,81 cos2b=self.cos2b,82 cos2l=self.cos2l)83 def apply(self, b, l):84 return self.coeff \85 * sin(l) ** self.sinl \86 * cos(l) ** self.cosl \87 * cos(2 * l) ** self.cos2l \88 * sin(b) ** self.sinb \89 * cos(b) ** self.cosb \90 * cos(2 * b) ** self.cos2b91 def __eq__(self, other):92 return self.key() == other.key()93R1 = Deg('R1', coeff=1, sinb=0, cosb=1, sinl=0, cosl=1)94R2 = Deg('R2', coeff=1, sinb=0, cosb=1, sinl=1, cosl=0)95R3 = Deg('R3', coeff=1, sinb=1, cosb=0, sinl=0, cosl=0)96la1 = Deg('la1', coeff=1, sinb=1, cosb=0, sinl=0, cosl=1)97la2 = Deg('la2', coeff=1, sinb=1, cosb=0, sinl=1, cosl=0)98la3 = Deg('la3', coeff=1, sinb=0, cosb=1, sinl=0, cosl=0)99ta1 = Deg('ta1', coeff=1, sinb=0, cosb=0, sinl=1, cosl=0)100ta2 = Deg('ta2', coeff=1, sinb=0, cosb=0, sinl=0, cosl=1)101p11 = Deg('p11', coeff=-1, sinb=0, cosb=1, sinl=1, cosl=1)102p12 = Deg('p12', coeff=1, sinb=0, cosb=1, sinl=0, cosl=0, cos2l=1) # !!!103# p12_cos2 = Deg('p12_cos2', sinb=0, cosb=1, sinl=0, cosl=2)104# p12_1 = Deg('p12_1', sinb=0, cosb=1, sinl=0, cosl=0)105p13 = Deg('p13', coeff=-1, sinb=1, cosb=0, sinl=1, cosl=0)106p22 = Deg('p22', coeff=1, sinb=0, cosb=1, sinl=1, cosl=1)107p23 = Deg('p23', coeff=1, sinb=1, cosb=0, sinl=0, cosl=1)108q11 = Deg('q11', coeff=-1, sinb=1, cosb=1, sinl=0, cosl=2)109q12 = Deg('q12', coeff=-2, sinb=1, cosb=1, sinl=1, cosl=1) # !!!110# q12_cos2 = Deg('q12_cos2', sinb=1, cosb=1, sinl=0, cosl=2)111# q12_1 = Deg('q12_1', sinb=1, cosb=1, sinl=0, cosl=0)112q13 = Deg('q13', coeff=1, sinb=0, cosb=0, sinl=0, cosl=1, cos2b=1)113# q13_cos2 = Deg('q13_cos2', sinb=0, cosb=2, sinl=0, cosl=1)114# q13_1 = Deg('q13_1', sinb=0, cosb=0, sinl=0, cosl=1)115q22 = Deg('q22', coeff=-1, sinb=1, cosb=1, sinl=2, cosl=0)116q23 = Deg('q23', coeff=1, sinb=0, cosb=0, sinl=1, cosl=0, cos2b=1)117# q23_cos2 = Deg('q23_cos2', sinb=0, cosb=2, sinl=1, cosl=0)118# q23_1 = Deg('q23_1', sinb=0, cosb=0, sinl=1, cosl=0)119q33 = Deg('q33', coeff=1, sinb=1, cosb=1, sinl=0, cosl=0)120mul_dw1dr1 = (R1 * la1).with_name('mul', 'dw1dr1')121mul_dw1dr2 = (R2 * la1).with_name('mul', 'dw1dr2')122mul_dw1dr3 = (R3 * la1).with_name('mul', 'dw1dr3')123mul_dw2dr1 = (R1 * la2).with_name('mul', 'dw2dr1')124mul_dw2dr2 = (R2 * la2).with_name('mul', 'dw2dr2')125mul_dw2dr3 = (R3 * la2).with_name('mul', 'dw2dr3')126mul_dw3dr1 = (R1 * la3).with_name('mul', 'dw3dr1')127mul_dw3dr2 = (R2 * la3).with_name('mul', 'dw3dr2')128mul_dw3dr3 = (R3 * la3).with_name('mul', 'dw3dr3')129mub_dw1dr1 = (R1 * ta1).with_name('mub', 'dw1dr1')130mub_dw1dr2 = (R2 * ta1).with_name('mub', 'dw1dr2')131mub_dw1dr3 = (R3 * ta1).with_name('mub', 'dw1dr3')132mub_dw2dr1 = (R1 * ta2).with_name('mub', 'dw2dr1')133mub_dw2dr2 = (R2 * ta2).with_name('mub', 'dw2dr2')134mub_dw2dr3 = (R3 * ta2).with_name('mub', 'dw2dr3')135mub_dM11dr1 = (R1 * q11).with_name('mub', 'dM11dr1')136mub_dM11dr2 = (R2 * q11).with_name('mub', 'dM11dr2')137mub_dM11dr3 = (R3 * q11).with_name('mub', 'dM11dr3')138mub_dM12dr1 = (R1 * q12).with_name('mub', 'dM12dr1') # !!!139mub_dM12dr2 = (R2 * q12).with_name('mub', 'dM12dr2') # !!!140mub_dM12dr3 = (R3 * q12).with_name('mub', 'dM12dr3') # !!!141# mub_dM12dr1_cos2 = (R1 * q12_cos2).with_name('mub_dM12dr1_cos2')142# mub_dM12dr2_cos2 = (R2 * q12_cos2).with_name('mub_dM12dr2_cos2')143# mub_dM12dr3_cos2 = (R3 * q12_cos2).with_name('mub_dM12dr3_cos2')144# mub_dM12dr1_1 = (R1 * q12_1).with_name('mub_dM12dr1_1')145# mub_dM12dr2_1 = (R2 * q12_1).with_name('mub_dM12dr2_1')146# mub_dM12dr3_1 = (R3 * q12_1).with_name('mub_dM12dr3_1')147mub_dM13dr1 = (R1 * q13).with_name('mub', 'dM13dr1')148mub_dM13dr2 = (R2 * q13).with_name('mub', 'dM13dr2')149mub_dM13dr3 = (R3 * q13).with_name('mub', 'dM13dr3')150mub_dM22dr1 = (R1 * q22).with_name('mub', 'dM22dr1')151mub_dM22dr2 = (R2 * q22).with_name('mub', 'dM22dr2')152mub_dM22dr3 = (R3 * q22).with_name('mub', 'dM22dr3')153mub_dM23dr1 = (R1 * q23).with_name('mub', 'dM23dr1')154mub_dM23dr2 = (R2 * q23).with_name('mub', 'dM23dr2')155mub_dM23dr3 = (R3 * q23).with_name('mub', 'dM23dr3')156mub_dM33dr1 = (R1 * q33).with_name('mub', 'dM33dr1')157mub_dM33dr2 = (R2 * q33).with_name('mub', 'dM33dr2')158mub_dM33dr3 = (R3 * q33).with_name('mub', 'dM33dr3')159mul_dM11dr1 = (R1 * p11).with_name('mul', 'dM11dr1')160mul_dM11dr2 = (R2 * p11).with_name('mul', 'dM11dr2')161mul_dM11dr3 = (R3 * p11).with_name('mul', 'dM11dr3')162mul_dM12dr1 = (R1 * p12).with_name('mul', 'dM12dr1') # !!!163mul_dM12dr2 = (R2 * p12).with_name('mul', 'dM12dr2') # !!!164mul_dM12dr3 = (R3 * p12).with_name('mul', 'dM12dr3') # !!!165# mul_dM12dr1_cos2 = (R1 * p12_cos2).with_name('mul_dM12dr1_cos2')166# mul_dM12dr2_cos2 = (R2 * p12_cos2).with_name('mul_dM12dr2_cos2')167# mul_dM12dr3_cos2 = (R3 * p12_cos2).with_name('mul_dM12dr3_cos2')168# mul_dM12dr1_1 = (R1 * p12_1).with_name('mul_dM12dr1_1')169# mul_dM12dr2_1 = (R2 * p12_1).with_name('mul_dM12dr2_1')170# mul_dM12dr3_1 = (R3 * p12_1).with_name('mul_dM12dr3_1')171mul_dM13dr1 = (R1 * p13).with_name('mul', 'dM13dr1')172mul_dM13dr2 = (R2 * p13).with_name('mul', 'dM13dr2')173mul_dM13dr3 = (R3 * p13).with_name('mul', 'dM13dr3')174mul_dM22dr1 = (R1 * p22).with_name('mul', 'dM22dr1')175mul_dM22dr2 = (R2 * p22).with_name('mul', 'dM22dr2')176mul_dM22dr3 = (R3 * p22).with_name('mul', 'dM22dr3')177mul_dM23dr1 = (R1 * p23).with_name('mul', 'dM23dr1')178mul_dM23dr2 = (R2 * p23).with_name('mul', 'dM23dr2')179mul_dM23dr3 = (R3 * p23).with_name('mul', 'dM23dr3')180vr_dM11dr1 = (R1 * R1 ** 2).with_name('vr', 'dM11dr1')181vr_dM11dr2 = (R2 * R1 ** 2).with_name('vr', 'dM11dr2')182vr_dM11dr3 = (R3 * R1 ** 2).with_name('vr', 'dM11dr3')183vr_dM22dr1 = (R1 * R2 ** 2).with_name('vr', 'dM22dr1')184vr_dM22dr2 = (R2 * R2 ** 2).with_name('vr', 'dM22dr2')185vr_dM22dr3 = (R3 * R2 ** 2).with_name('vr', 'dM22dr3')186vr_dM33dr1 = (R1 * R3 ** 2).with_name('vr', 'dM33dr1')187vr_dM33dr2 = (R2 * R3 ** 2).with_name('vr', 'dM33dr2')188vr_dM33dr3 = (R3 * R3 ** 2).with_name('vr', 'dM33dr3')189vr_dM12dr1 = (R1 * R1 * R2).with_name('vr', 'dM12dr1') # !!!190vr_dM12dr2 = (R2 * R1 * R2).with_name('vr', 'dM12dr2') # !!!191vr_dM12dr3 = (R3 * R1 * R2).with_name('vr', 'dM12dr3') # !!!192vr_dM13dr1 = (R1 * R1 * R3).with_name('vr', 'dM13dr1')193vr_dM13dr2 = (R2 * R1 * R3).with_name('vr', 'dM13dr2')194vr_dM13dr3 = (R3 * R1 * R3).with_name('vr', 'dM13dr3')195vr_dM23dr1 = (R1 * R2 * R3).with_name('vr', 'dM23dr1')196vr_dM23dr2 = (R2 * R2 * R3).with_name('vr', 'dM23dr2')197vr_dM23dr3 = (R3 * R2 * R3).with_name('vr', 'dM23dr3')198def main():199 all = [200 mul_dw1dr1,201 mul_dw1dr2,202 mul_dw1dr3,203 mul_dw2dr1,204 mul_dw2dr2,205 mul_dw2dr3,206 mul_dw3dr1,207 mul_dw3dr2,208 mul_dw3dr3,209 mub_dw1dr1,210 mub_dw1dr2,211 mub_dw1dr3,...

Full Screen

Full Screen

Color.py

Source:Color.py Github

copy

Full Screen

...9 self.a = a_int10 self.name = None11 def get(self) -> (int, int, int, int):12 return self.r, self.g, self.b, self.a13 def with_name(self, name: str):14 self.name = name15 return self16 def to_string(self) -> str:17 if self.name is None:18 return str(self.get())19 else:20 return self.name21class rgba(Color):22 pass23class Colors:24 transparent = Color(255, 255, 255).with_name("transparent")25 black = Color(0, 0, 0).with_name("black")26 white = Color(255, 255, 255).with_name("white")27 red = Color(255, 0, 0).with_name("red")28 green = Color(0, 255, 0).with_name("green")29 blue = Color(0, 0, 255).with_name("blue")30 # American flat color palette31 flat_light_aqua = rgba(85, 239, 196, 1.0).with_name("flat_light_aqua")32 flat_light_sea_blue = rgba(129, 236, 236, 1.0).with_name("flat_light_sea_blue")33 flat_light_blue = rgba(116, 185, 255, 1.0).with_name("flat_light_blue")34 flat_light_purple = rgba(162, 155, 254, 1.0).with_name("flat_light_purple")35 flat_light_white_gray = rgba(223, 230, 233, 1.0).with_name("flat_light_white_gray")36 flat_dark_aqua = rgba(0, 184, 148, 1.0).with_name("flat_dark_aqua")37 flat_aqua = rgba(0, 206, 201, 1.0).with_name("flat_aqua")38 flat_blue = rgba(9, 132, 227, 1.0).with_name("flat_blue")39 flat_purple = rgba(108, 92, 231, 1.0).with_name("flat_purple")40 flat_light_gray = rgba(178, 190, 195, 1.0).with_name("flat_light_gray")41 flat_cream = rgba(255, 234, 167, 1.0).with_name("flat_cream")42 flat_light_salmon = rgba(250, 177, 160, 1.0).with_name("flat_light_salmon")43 flat_salmon_red = rgba(255, 118, 117, 1.0).with_name("flat_salmon_red")44 flat_light_pink = rgba(253, 121, 168, 1.0).with_name("flat_light_pink")45 flat_gray = rgba(99, 110, 114, 1.0).with_name("flat_gray")46 flat_cream_yellow = rgba(253, 203, 110, 1.0).with_name("flat_cream_yellow")47 flat_brown = rgba(225, 112, 85, 1.0).with_name("flat_brown")48 flat_red = rgba(214, 48, 49, 1.0).with_name("flat_red")49 flat_pink = rgba(232, 67, 147, 1.0).with_name("flat_pink")...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run testcontainers-python automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful