Best Python code snippet using assertpy_python
dicts.py
Source:dicts.py  
1import numpy as np2from collections import OrderedDict3from enum import Enum4import logging5from hyo2.openbst.lib.models.jackson2.sediment_params import SedimentParams6logger = logging.getLogger(__name__)7class TestSediments(Enum):8    ROUGH_ROCK = 09    ROCK = 110    COBBLE = 211    SANDY_GRAVEL = 312    COARSE_SAND = 413    MEDIUM_SAND = 514    FINE_SAND = 615    SILT = 716def make_test_params_dict():17    test_dicts = OrderedDict()18    for sediment in TestSediments:19        test_dicts[sediment] = SedimentParams()20        if sediment == TestSediments.ROUGH_ROCK:21            test_dicts[sediment].name = 'Rough Rock'22            test_dicts[sediment].color = '#00CED1'23            test_dicts[sediment].a_rho = 2.524            test_dicts[sediment].nu_p = 2.325            test_dicts[sediment].delta_p = 0.0017426            test_dicts[sediment].nu_t = 1.327            test_dicts[sediment].delta_t = 0.08528            test_dicts[sediment].gamma_2 = 2.7529            test_dicts[sediment].w_2 = 0.000130            test_dicts[sediment].gamma_3 = 3.031            test_dicts[sediment].w_3 = 0.000232            test_dicts[sediment].aspect = 1.033            test_dicts[sediment].fluct = np.array([[1, 3, 4],34                                                   [3, 9, 12],35                                                   [4, 12, 16]])36        elif sediment == TestSediments.ROCK:37            test_dicts[sediment].name = 'Rock'38            test_dicts[sediment].color = '#696969'39            test_dicts[sediment].a_rho = 2.540            test_dicts[sediment].nu_p = 2.341            test_dicts[sediment].delta_p = 0.0017442            test_dicts[sediment].nu_t = 1.3143            test_dicts[sediment].delta_t = 0.08544            test_dicts[sediment].gamma_2 = 3.045            test_dicts[sediment].w_2 = 0.0002546            test_dicts[sediment].gamma_3 = 3.047            test_dicts[sediment].w_3 = 0.0000648            test_dicts[sediment].aspect = 1.049            test_dicts[sediment].fluct = np.array([[1, 3, 4],50                                                   [3, 9, 12],51                                                   [4, 12, 16]])52        elif sediment == TestSediments.COBBLE:53            test_dicts[sediment].name = 'Cobble'54            test_dicts[sediment].color = '#008B8B'55            test_dicts[sediment].a_rho = 2.556            test_dicts[sediment].nu_p = 1.857            test_dicts[sediment].delta_p = 0.0137458            test_dicts[sediment].nu_t = 1.0159            test_dicts[sediment].delta_t = 0.160            test_dicts[sediment].gamma_2 = 3.061            test_dicts[sediment].w_2 = 0.0002562            test_dicts[sediment].gamma_3 = 3.063            test_dicts[sediment].w_3 = 0.0015264            test_dicts[sediment].aspect = 1.065            test_dicts[sediment].fluct = np.array([[1, 0, 0],66                                                   [0, 0, 0],67                                                   [0, 0, 0]])68        elif sediment == TestSediments.SANDY_GRAVEL:69            test_dicts[sediment].name = 'Sandy Gravel'70            test_dicts[sediment].color = '#BDB76B'71            test_dicts[sediment].a_rho = 2.49272            test_dicts[sediment].nu_p = 1.33773            test_dicts[sediment].delta_p = 0.0170574            test_dicts[sediment].nu_t = 0.15675            test_dicts[sediment].delta_t = 0.276            test_dicts[sediment].gamma_2 = 3.077            test_dicts[sediment].w_2 = 0.0001878            test_dicts[sediment].gamma_3 = 3.079            test_dicts[sediment].w_3 = 0.00037780            test_dicts[sediment].aspect = 1.081            test_dicts[sediment].fluct = np.array([[1, 0, 0],82                                                   [0, 0, 0],83                                                   [0, 0, 0]])84        elif sediment == TestSediments.COARSE_SAND:85            test_dicts[sediment].name = 'Coarse Sand'86            test_dicts[sediment].color = '#FF8C00'87            test_dicts[sediment].a_rho = 2.23188            test_dicts[sediment].nu_p = 1.250389            test_dicts[sediment].delta_p = 0.0163890            test_dicts[sediment].nu_t = 0.13491            test_dicts[sediment].delta_t = 0.07592            test_dicts[sediment].gamma_2 = 3.2593            test_dicts[sediment].w_2 = 0.0002294            test_dicts[sediment].gamma_3 = 3.095            test_dicts[sediment].w_3 = 0.00036296            test_dicts[sediment].aspect = 1.097            test_dicts[sediment].fluct = np.array([[1, 0, 0],98                                                   [0, 0, 0],99                                                   [0, 0, 0]])100        elif sediment == TestSediments.MEDIUM_SAND:101            test_dicts[sediment].name = 'Medium Sand'102            test_dicts[sediment].color = '#FFD700'103            test_dicts[sediment].a_rho = 1.845104            test_dicts[sediment].nu_p = 1.1782105            test_dicts[sediment].delta_p = 0.01624106            test_dicts[sediment].nu_t = 0.002107            test_dicts[sediment].delta_t = 1.0108            test_dicts[sediment].gamma_2 = 3.25109            test_dicts[sediment].w_2 = 0.0001406110            test_dicts[sediment].gamma_3 = 3.0111            test_dicts[sediment].w_3 = 0.000359112            test_dicts[sediment].aspect = 1.0113            test_dicts[sediment].fluct = np.array([[1, 0, 0],114                                                   [0, 0, 0],115                                                   [0, 0, 0]])116        elif sediment == TestSediments.FINE_SAND:117            test_dicts[sediment].name = 'Fine Sand'118            test_dicts[sediment].color = '#FFA07A'119            test_dicts[sediment].a_rho = 1.451120            test_dicts[sediment].nu_p = 1.1072121            test_dicts[sediment].delta_p = 0.01602122            test_dicts[sediment].nu_t = 0.002123            test_dicts[sediment].delta_t = 1.0124            test_dicts[sediment].gamma_2 = 3.25125            test_dicts[sediment].w_2 = 0.000086126            test_dicts[sediment].gamma_3 = 3.0127            test_dicts[sediment].w_3 = 0.000354128            test_dicts[sediment].aspect = 1.0129            test_dicts[sediment].fluct = np.array([[1, 0, 0],130                                                   [0, 0, 0],131                                                   [0, 0, 0]])132        elif sediment == TestSediments.SILT:133            test_dicts[sediment].name = 'Silt'134            test_dicts[sediment].color = '#7FFF00'135            test_dicts[sediment].a_rho = 1.149136            test_dicts[sediment].nu_p = 0.9873137            test_dicts[sediment].delta_p = 0.00386138            test_dicts[sediment].nu_t = 0.002139            test_dicts[sediment].delta_t = 1.0140            test_dicts[sediment].gamma_2 = 3.25141            test_dicts[sediment].w_2 = 0.0000164142            test_dicts[sediment].gamma_3 = 3.0143            test_dicts[sediment].w_3 = 0.00004269144            test_dicts[sediment].aspect = 1.0145            test_dicts[sediment].fluct = np.array([[1, 0, 0],146                                                   [0, 0, 0],147                                                   [0, 0, 0]])148    return test_dicts...run_experiment_22_7.py
Source:run_experiment_22_7.py  
1from experiments.exp2_5_check_dire import run_experiment as run_experiment_2_52from experiments.exp3_check_dire_graph_on_top import run_experiment as run_experiment_33test_dicts = []4for seed in [45, 46, 47, 48, 49, 50, 51, 52, 53]:5    test_dicts.append(run_experiment_2_5(seed=seed, learning_rate=0.01, embedding_size=50))6    test_dicts.append(run_experiment_3(seed=seed, learning_rate=0.01, embedding_size=50))7    test_dicts.append(run_experiment_2_5(seed=seed, learning_rate=0.01, embedding_size=100))8    test_dicts.append(run_experiment_3(seed=seed, learning_rate=0.01, embedding_size=100))9    test_dicts.append(run_experiment_2_5(seed=seed, learning_rate=0.005, embedding_size=50))10    test_dicts.append(run_experiment_3(seed=seed, learning_rate=0.005, embedding_size=50))11    test_dicts.append(run_experiment_2_5(seed=seed, learning_rate=0.005, embedding_size=100))12    test_dicts.append(run_experiment_3(seed=seed, learning_rate=0.005, embedding_size=100))13    test_dicts.append(run_experiment_2_5(seed=seed, learning_rate=0.01, embedding_size=5))14    test_dicts.append(run_experiment_3(seed=seed, learning_rate=0.01, embedding_size=5))15    for em_size in [50, 100, 5]:16        for lr in [0.005, 0.01]:17            print('-----------------------')18            print(em_size)19            print(lr)20            for test_dict in test_dicts:21                if test_dict[-1]['embedding_size'] == em_size and test_dict[-1]['learning_rate'] == lr:...test_dict.py
Source:test_dict.py  
1test_dicts = {'List Smith':'521-8976','John Smith':'521-1234','Sandra Dee':'521-9655','Ted Baker':'418-4165','Sam Doe':'521-5030'}2print(test_dicts.values())3print(test_dicts.get('Ted Baker'))4print(test_dicts)5for x in test_dicts:6    print(x)7for x in test_dicts.values():8    print(x)9for x,y in test_dicts.items():...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!!
