Best Python code snippet using slash
constants.py
Source:constants.py
...44 s20 = 2045 #: Unknown46 x = None47#: Sugose alias of `sug`48SuperClass.sug.add_name("Sugose")49#: Triose alias of `tri`50SuperClass.tri.add_name("Triose")51#: Tetrose alias of `tet`52SuperClass.tet.add_name("Tetrose")53#: Pentose alias of `pen`54SuperClass.pen.add_name("Pentose")55#: Hexose alias of `hex`56SuperClass.hex.add_name("Hexose")57#: Heptose alias of `hep`58SuperClass.hep.add_name("Heptose")59#: Octose alias of `oct`60SuperClass.oct.add_name("Octose")61#: Nonose alias of `non`62SuperClass.non.add_name("Nonose")63#: Decose alias of `dec`64SuperClass.dec.add_name("Decose")65class Stem(Enum):66 '''Corresponds to the bond formation pattern between the carbon atoms in the67 carbohydrate backbone of the |Monosaccharide|68 Is an |Enum|69 '''70 #: Glyceraldehyde71 gro = 172 #: Erythrose73 ery = 274 #: Ribose75 rib = 376 #: Arabinose77 ara = 478 #: Allose79 all = 580 #: Altrose81 alt = 682 #: Glucose83 glc = 784 #: Mannose85 man = 886 #: Threose87 tre = 988 #: Xylose89 xyl = 1090 #: Lyxose91 lyx = 1192 #: Gulose93 gul = 1294 #: Idose95 ido = 1396 #: Galactose97 gal = 1498 #: Talose99 tal = 15100 #: Unknown101 x = None102 thr = 16103Stem.gro.add_name("Glyceraldehyde")104Stem.ery.add_name("Erythrose")105Stem.rib.add_name("Ribose")106Stem.ara.add_name("Arabinose")107Stem.all.add_name("Allose")108Stem.alt.add_name("Altose")109Stem.glc.add_name("Glucose")110Stem.man.add_name("Mannose")111Stem.tre.add_name("Threose")112Stem.xyl.add_name("Xylose")113Stem.lyx.add_name("Lyxose")114Stem.gul.add_name("Gulose")115Stem.ido.add_name("Idose")116Stem.gal.add_name("Galactose")117Stem.tal.add_name("Talose")118Stem.x.add_name("Unknown")119class Configuration(Enum):120 '''121 Corresponds to the optical stereomeric state of the |Monosaccharide|122 Is an |Enum|123 '''124 #: D Configuration125 d = 1126 #: L Configuration127 l = 2128 x = None129Configuration.d.add_name("Dextro")130Configuration.l.add_name("Levo")131Configuration.x.add_name("Unknown")132class Modification(Enum):133 '''134 Corresponds to discrete composition shifts of the |Monosaccharide| which135 are simple enough to not constitute a distinct object to represent like |Substituent|.136 Is an |Enum|137 '''138 #: Deoxygenated139 d = 1140 #: Ketone141 keto = 2142 #: DoubleBond143 en = 3144 #: Acidic145 a = 4146 #: Alditol147 aldi = 5148 #: SP2149 sp2 = 6150 #: SP151 sp = 7152 #: Geminal153 geminal = 8154#: alias of `aldi`155Modification.aldi.add_name("Alditol")156#: alias of `a`157Modification.a.add_name("Acidic")158#: alias of `d`159Modification.d.add_name("Deoxygenated")160#: alias of `keto`161Modification.keto.add_name("Ketone")162#: alias of `en`163Modification.en.add_name("DoubleBond")164#: alias of `geminal`165Modification.geminal.add_name("Geminal")166#: alias of `sp`167Modification.sp.add_name("SP")168#: alias of `sp2`169Modification.sp2.add_name("SP2")170class Anomer(Enum):171 '''172 Corresponds to the type of linkage found at the anomeric carbon of this |Monosaccharide|173 Is an |Enum|174 '''175 #: Alpha linkage176 alpha = 1177 #: Beta linkage178 beta = 2179 #: Uncyclized open chain180 uncyclized = 3181 #: Unknown182 x = None183Anomer.beta.add_name("b")184Anomer.alpha.add_name("a")185Anomer.uncyclized.add_name("o")186Anomer.uncyclized.add_name("open-chain")187class RingType(Enum):188 '''189 Corresponds to the type of ring structure of this |Monosaccharide|. Pyranose rings are190 five-member rings including one Oxygen and Furanose rings are four member rings including191 one Oxygen.192 Is an |Enum|193 '''194 #: Six member ring195 pyranose = 6196 #: Five member ring197 furanose = 5198 #: Open chain199 open = 0200 #: Unknown201 x = None202class Stereocoding(Enum):203 x = None204 h = 'h'205 L = '1'206 D = '2'207 LD = '3'208 DL = '4'209 d = 'd'210 m = 'm'211 a = 'a'212 o = 'o'213 k = 'k'214 e = 'e'215 n = 'n'216 E = 'E'217 y = 'y'218 s = 's'219 t = 't'220Stereocoding.h.add_name('0')221UnknownPosition = -1222NoPosition = None223class LinkageType(Enum):224 backbone_oxygen = 0225 backbone_hydrogen = 1226 other = 2227 unknown = None...
db_dimensiondata.py
Source:db_dimensiondata.py
1import scouting.db as db2from sqlalchemy.sql import text3def add_name(table, col, val):4 engine = db.getdbengine()5 conn = engine.connect()6 select = text(7 "INSERT INTO " + table + " (" + col + ") " +8 "VALUES (:val) "9 "ON CONFLICT " + "(" + col + ")" +10 " DO UPDATE "11 "SET " + col + " = :val RETURNING id; "12 )13 conn.execute(select, val=val)14 conn.close()15def add_many_names(table, col, n, template):16 engine = db.getdbengine()17 conn = engine.connect()18 for i in range(1, n):19 name = template.format(i)20 sql = text(21 "INSERT INTO " + table + " (" + col + ") " +22 "VALUES (:name) "23 "ON CONFLICT (" + col + ") " +24 "DO UPDATE "25 "SET " + col + " = :name RETURNING id; "26 )27 conn.execute(sql, name=name)28 conn.close()29def add_many_cols(table, data) :30 engine = db.getdbengine()31 conn = engine.connect()32 # Buld string containing column names33 col_names = ""34 val_data = ""35 set_data = ""36 for col, _ in data.iteritems():37 if col_names == "":38 col_names = col39 val_data = ':' + col40 set_data = col + '=:' + col41 else:42 col_names = col_names + ", " + col43 val_data = val_data + ", :" + col44 set_data = set_data + ", " + col + '=:' + col45 sql = text(46 "INSERT INTO " + table + " (" + col_names + ") " +47 "VALUES (" + val_data + ")"48 "ON CONFLICT (" + col_names + ") " +49 "DO UPDATE "50 "SET " + set_data + " ; "51 )52 conn.execute(sql, **data)53 conn.close()54def insert_data():55 add_name("levels", "name", "na")56 add_name("levels", "name", "qual")57 add_name("levels", "name", "playoff")58 add_many_names("matches", "name", 150, "{0:0>3}-q")59 add_name("matches", "name", "na")60 add_name("matches", "name", "q1.1")61 add_name("matches", "name", "q1.2")62 add_name("matches", "name", "q1.3")63 add_name("matches", "name", "q2.1")64 add_name("matches", "name", "q2.2")65 add_name("matches", "name", "q2.3")66 add_name("matches", "name", "q3.1")67 add_name("matches", "name", "q3.2")68 add_name("matches", "name", "q3.3")69 add_name("matches", "name", "s1.1")70 add_name("matches", "name", "s1.2")71 add_name("matches", "name", "s1.3")72 add_name("matches", "name", "s2.1")73 add_name("matches", "name", "s2.2")74 add_name("matches", "name", "s2.3")75 add_name("matches", "name", "f1")76 add_name("matches", "name", "f2")77 add_name("matches", "name", "f3")78 add_name("alliances", "name", "na")79 add_name("alliances", "name", "blue")80 add_name("alliances", "name", "red")81 add_name("dates", "name", "na")82 # teams imported from schedule83 add_name("teams", "name", 'na')84 add_name("stations", "name", "na")85 add_name("stations", "name", "1")86 add_name("stations", "name", "2")87 add_name("stations", "name", "3")88 add_name("actors", "name", "na")89 add_name("actors", "name", "drive_team")90 add_name("actors", "name", "robot")91 add_name("actors", "name", "pilot")92 add_name("actors", "name", "human_player")93 add_name("actors", "name", "alliance")94 add_name("actors", "name", "team")95 # tasks imported from game96 add_name("tasks", "name", 'na')97 add_name("measuretypes", "name", "na")98 add_name("measuretypes", "name", "count")99 add_name("measuretypes", "name", "percentage")100 add_name("measuretypes", "name", "boolean")101 add_name("measuretypes", "name", "enum")102 add_name("measuretypes", "name", "attempt")103 add_name("measuretypes", "name", "cycletime")104 add_name("phases", "name", "na")105 add_name("phases", "name", "claim")106 add_name("phases", "name", "auto")107 add_name("phases", "name", "teleop")108 add_name("phases", "name", "finish")109 add_name("attempts", "name", "summary")110 add_many_names("attempts", "name", 31, "{0:0>2}")111 add_name("reasons", "name", "na")112 add_name("reasons", "name", "dropped")113 add_name("reasons", "name", "blocked")...
descriptors.py
Source:descriptors.py
...4 n_term = -15 c_term = -26 protein_n_term = -37 protein_c_term = -48SequenceLocation.n_term.add_name("N-term")9SequenceLocation.n_term.add_name("N-Term")10SequenceLocation.n_term.add_name("n-term")11SequenceLocation.n_term.add_name("N_term")12SequenceLocation.c_term.add_name("C-term")13SequenceLocation.c_term.add_name("C-Term")14SequenceLocation.c_term.add_name("c-term")15SequenceLocation.c_term.add_name("C_term")16SequenceLocation.anywhere.add_name("Anywhere")17SequenceLocation.protein_n_term.add_name("Protein N-term")18SequenceLocation.protein_c_term.add_name("Protein C-term")19SequenceLocation.protein_n_term.add_name("Protein N-Term")20SequenceLocation.protein_c_term.add_name("Protein C-Term")21class ModificationCategory(Enum):22 unknown = None23 glycosylation = 124 artefact = 225 substitution = 326 chemical_derivative = 427 non_standard_residue = 528 isotopic_label = 629 post_translational = 730 other = 831 multiple = 1032 pre_translational = 1133 co_translational = 1234 synthetic_peptide_protect = 1335 cross_link = 1436 cid_cleavable_cross_link = 1537 other_cleavable_cross_link = 1638ModificationCategory.substitution.add_name("AA substitution")39ModificationCategory.glycosylation.add_name("other_glycosylation")40ModificationCategory.glycosylation.add_name("N-linked glycosylation")41ModificationCategory.glycosylation.add_name("O-linked glycosylation")42ModificationCategory.glycosylation.add_name("Other glycosylation")43ModificationCategory.chemical_derivative.add_name("Chemical derivative")44ModificationCategory.post_translational.add_name("Post-translational")45ModificationCategory.multiple.add_name("Multiple")46ModificationCategory.artefact.add_name("Artefact")47ModificationCategory.isotopic_label.add_name("Isotopic label")48ModificationCategory.other.add_name("Other")49ModificationCategory.pre_translational.add_name("Pre-translational")50ModificationCategory.non_standard_residue.add_name("Non-standard residue")51ModificationCategory.co_translational.add_name("Co-translational")52ModificationCategory.synthetic_peptide_protect.add_name("Synth. pep. protect. gp.")53ModificationCategory.cross_link.add_name("Cross-link")54ModificationCategory.cid_cleavable_cross_link.add_name("CID cleavable cross-link")...
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!!