How to use _switch method in lisa

Best Python code snippet using lisa_python

repository_rules.bzl

Source:repository_rules.bzl Github

copy

Full Screen

...99 rules = {}100 #101 # Common102 #103 rules["proto_library_with_info"] = _switch(104 gapic,105 "@com_google_api_codegen//rules_gapic:gapic.bzl",106 )107 rules["moved_proto_library"] = _switch(108 gapic,109 "@com_google_api_codegen//rules_gapic:gapic.bzl",110 )111 #112 # Java113 #114 rules["java_proto_library"] = _switch(115 java,116 "native.java_proto_library",117 )118 rules["java_grpc_library"] = _switch(119 java and grpc,120 "@io_grpc_grpc_java//:java_grpc_library.bzl",121 )122 rules["java_gapic_library"] = _switch(123 java and grpc and gapic,124 "@com_google_api_codegen//rules_gapic/java:java_gapic.bzl",125 )126 rules["java_resource_name_proto_library"] = _switch(127 java and grpc and gapic,128 "@com_google_api_codegen//rules_gapic/java:java_gapic.bzl",129 )130 rules["java_gapic_test"] = _switch(131 java and grpc and gapic,132 "@com_google_api_codegen//rules_gapic/java:java_gapic.bzl",133 )134 rules["java_gapic_assembly_gradle_pkg"] = _switch(135 java and grpc and gapic,136 "@com_google_api_codegen//rules_gapic/java:java_gapic_pkg.bzl",137 )138 #139 # Python140 #141 rules["py_proto_library"] = _switch(142 python,143 "@com_github_grpc_grpc//bazel:python_rules.bzl",144 )145 rules["py_grpc_library"] = _switch(146 python and grpc,147 "@com_github_grpc_grpc//bazel:python_rules.bzl",148 )149 rules["py_gapic_library"] = _switch(150 python and grpc and gapic,151 "@com_google_api_codegen//rules_gapic/python:py_gapic.bzl",152 )153 rules["py_gapic_assembly_pkg"] = _switch(154 python and grpc and gapic,155 "@com_google_api_codegen//rules_gapic/python:py_gapic_pkg.bzl",156 )157 rules["py_gapic_library2"] = _switch(158 python and grpc and gapic,159 "@gapic_generator_python//rules_python_gapic:py_gapic.bzl",160 "py_gapic_library",161 )162 rules["py_gapic_assembly_pkg2"] = _switch(163 python and grpc and gapic,164 "@gapic_generator_python//rules_python_gapic:py_gapic_pkg.bzl",165 "py_gapic_assembly_pkg",166 )167 #168 # Go169 #170 rules["go_proto_library"] = _switch(171 go,172 "@io_bazel_rules_go//proto:def.bzl",173 )174 rules["go_library"] = _switch(175 go,176 "@io_bazel_rules_go//go:def.bzl",177 )178 rules["go_test"] = _switch(179 go and grpc and gapic,180 "@io_bazel_rules_go//go:def.bzl",181 )182 rules["go_gapic_library"] = _switch(183 go and grpc and gapic,184 "@com_googleapis_gapic_generator_go//rules_go_gapic:go_gapic.bzl",185 )186 rules["go_gapic_assembly_pkg"] = _switch(187 go and grpc and gapic,188 "@com_googleapis_gapic_generator_go//rules_go_gapic:go_gapic_pkg.bzl",189 )190 #191 # C++192 #193 rules["cc_proto_library"] = _switch(194 cc,195 "native.cc_proto_library",196 )197 rules["cc_grpc_library"] = _switch(198 cc and grpc,199 "@com_github_grpc_grpc//bazel:cc_grpc_library.bzl",200 )201 rules["cc_gapic_library"] = _switch(False)202 #203 # PHP204 #205 rules["php_proto_library"] = _switch(206 php,207 "@com_google_api_codegen//rules_gapic/php:php_gapic.bzl",208 )209 rules["php_grpc_library"] = _switch(210 php and grpc,211 "@com_google_api_codegen//rules_gapic/php:php_gapic.bzl",212 )213 rules["php_gapic_library"] = _switch(214 php and grpc and gapic,215 "@com_google_api_codegen//rules_gapic/php:php_gapic.bzl",216 )217 rules["php_gapic_assembly_pkg"] = _switch(218 php and grpc and gapic,219 "@com_google_api_codegen//rules_gapic/php:php_gapic_pkg.bzl",220 )221 #222 # Node.js223 #224 rules["nodejs_gapic_library"] = _switch(225 nodejs and grpc and gapic,226 "@gapic_generator_typescript//rules_typescript_gapic:typescript_gapic.bzl",227 "typescript_gapic_library",228 )229 rules["nodejs_gapic_assembly_pkg"] = _switch(230 nodejs and grpc and gapic,231 "@gapic_generator_typescript//rules_typescript_gapic:typescript_gapic_pkg.bzl",232 "typescript_gapic_assembly_pkg",233 )234 #235 # Ruby236 #237 rules["ruby_proto_library"] = _switch(238 ruby,239 "@gapic_generator_ruby//rules_ruby_gapic:ruby_gapic.bzl",240 )241 rules["ruby_grpc_library"] = _switch(242 ruby and grpc,243 "@gapic_generator_ruby//rules_ruby_gapic:ruby_gapic.bzl",244 )245 rules["ruby_gapic_library"] = _switch(246 ruby and grpc and gapic,247 "@com_google_api_codegen//rules_gapic/ruby:ruby_gapic.bzl",248 )249 rules["ruby_ads_gapic_library"] = _switch(250 ruby and grpc and gapic,251 "@gapic_generator_ruby//rules_ruby_gapic:ruby_gapic.bzl",252 )253 rules["ruby_cloud_gapic_library"] = _switch(254 ruby and grpc and gapic,255 "@gapic_generator_ruby//rules_ruby_gapic:ruby_gapic.bzl",256 )257 rules["ruby_gapic_assembly_pkg"] = _switch(258 ruby and grpc and gapic,259 "@com_google_api_codegen//rules_gapic/ruby:ruby_gapic_pkg.bzl",260 )261 #262 # C#263 #264 rules["csharp_proto_library"] = _switch(265 csharp,266 "@gapic_generator_csharp//rules_csharp_gapic:csharp_gapic.bzl",267 )268 rules["csharp_grpc_library"] = _switch(269 csharp and grpc,270 "@gapic_generator_csharp//rules_csharp_gapic:csharp_gapic.bzl",271 )272 rules["csharp_gapic_library"] = _switch(273 csharp and grpc and gapic,274 "@gapic_generator_csharp//rules_csharp_gapic:csharp_gapic.bzl",275 )276 rules["csharp_gapic_assembly_pkg"] = _switch(277 csharp and grpc and gapic,278 "@gapic_generator_csharp//rules_csharp_gapic:csharp_gapic_pkg.bzl",279 )280 rules.update(rules_override)281 switched_rules(282 name = name,283 rules = rules,284 )285def _switch(enabled, enabled_value = "", actual_name = ""):286 if enabled:287 return [enabled_value, actual_name]288 else:...

Full Screen

Full Screen

_Dialign.py

Source:_Dialign.py Github

copy

Full Screen

1# Copyright 2009 by Cymon J. Cox. All rights reserved.2# This code is part of the Biopython distribution and governed by its3# license. Please see the LICENSE file that should have been included4# as part of this package.5"""6Bio.Application command line for the multiple alignment program DIALIGN2-2.7http://bibiserv.techfak.uni-bielefeld.de/dialign/welcome.html8Citations:9B. Morgenstern (2004). DIALIGN: Multiple DNA and Protein Sequence Alignment10at BiBiServ. Nucleic Acids Research 32, W33-W36.11Last checked against version: 2.212"""13from Bio import Application14from Bio.Application import _Option, _Argument, _Switch, AbstractCommandline15class DialignCommandline(AbstractCommandline):16 """Command line wrapper for the multiple alignment program DIALIGN2-2."""17 def __init__(self, cmd="dialign2-2", **kwargs):18 self.program_name = cmd19 self.parameters = \20 [21 _Switch(["-afc", "afc"], ["input"],22 "Creates additional output file '*.afc' " + \23 "containing data of all fragments considered " + \24 "for alignment WARNING: this file can be HUGE !"),25 _Switch(["-afc_v", "afc_v"], ["input"],26 "Like '-afc' but verbose: fragments are explicitly " + \27 "printed. WARNING: this file can be EVEN BIGGER !"),28 _Switch(["-anc", "anc"], ["input"],29 "Anchored alignment. Requires a file <seq_file>.anc " + \30 "containing anchor points."),31 _Switch(["-cs", "cs"], ["input"],32 "If segments are translated, not only the `Watson " + \33 "strand' but also the `Crick strand' is looked at."),34 _Switch(["-cw", "cw"], ["input"],35 "Additional output file in CLUSTAL W format."),36 _Switch(["-ds", "ds"], ["input"],37 "`dna alignment speed up' - non-translated nucleic acid " + \38 "fragments are taken into account only if they start " + \39 "with at least two matches. Speeds up DNA alignment at " + \40 "the expense of sensitivity."),41 _Switch(["-fa", "fa"], ["input"],42 "Additional output file in FASTA format."),43 _Switch(["-ff", "ff"], ["input"],44 "Creates file *.frg containing information about all " + \45 "fragments that are part of the respective optimal " + \46 "pairwise alignmnets plus information about " + \47 "consistency in the multiple alignment"),48 _Option(["-fn", "fn"], ["input"],49 None,50 0,51 "Output files are named <out_file>.<extension>.",52 0),53 _Switch(["-fop", "fop"], ["input"],54 "Creates file *.fop containing coordinates of all " + \55 "fragments that are part of the respective pairwise alignments."),56 _Switch(["-fsm", "fsm"], ["input"],57 "Creates file *.fsm containing coordinates of all " + \58 "fragments that are part of the final alignment"),59 _Switch(["-iw", "iw"], ["input"],60 "Overlap weights switched off (by default, overlap " + \61 "weights are used if up to 35 sequences are aligned). " + \62 "This option speeds up the alignment but may lead " + \63 "to reduced alignment quality."),64 _Switch(["-lgs", "lgs"], ["input"],65 "`long genomic sequences' - combines the following " + \66 "options: -ma, -thr 2, -lmax 30, -smin 8, -nta, -ff, " + \67 "-fop, -ff, -cs, -ds, -pst "),68 _Switch(["-lgs_t", "lgs_t"], ["input"],69 "Like '-lgs' but with all segment pairs assessed " + \70 "at the peptide level (rather than 'mixed alignments' " + \71 "as with the '-lgs' option). Therefore faster than " + \72 "-lgs but not very sensitive for non-coding regions."),73 _Option(["-lmax", "lmax"], ["input"],74 lambda x: isinstance(x, int),75 0,76 "Maximum fragment length = x (default: x = 40 or " + \77 "x = 120 for `translated' fragments). Shorter x " + \78 "speeds up the program but may affect alignment quality.",79 0),80 _Switch(["-lo", "lo"], ["input"],81 "(Long Output) Additional file *.log with information " + \82 "about fragments selected for pairwise alignment and " + \83 "about consistency in multi-alignment proceedure."),84 _Switch(["-ma", "ma"], ["input"],85 "`mixed alignments' consisting of P-fragments and " + \86 "N-fragments if nucleic acid sequences are aligned."),87 _Switch(["-mask", "mask"], ["input"],88 "Residues not belonging to selected fragments are " + \89 "replaced by `*' characters in output alignment " + \90 "(rather than being printed in lower-case characters)"),91 _Switch(["-mat", "mat"], ["input"],92 "Creates file *mat with substitution counts derived " + \93 "from the fragments that have been selected for alignment."),94 _Switch(["-mat_thr", "mat_thr"], ["input"],95 "Like '-mat' but only fragments with weight score " + \96 "> t are considered"),97 _Switch(["-max_link", "max_link"], ["input"],98 "'maximum linkage' clustering used to construct " + \99 "sequence tree (instead of UPGMA)."),100 _Switch(["-min_link", "min_link"], ["input"],101 "'minimum linkage' clustering used."),102 _Option(["-mot", "mot"], ["input"],103 None, 104 0,105 "'motif' option.",106 0),107 _Switch(["-msf", "msf"], ["input"],108 "Separate output file in MSF format."),109 _Switch(["-n", "n"], ["input"],110 "Input sequences are nucleic acid sequences. " + \111 "No translation of fragments."),112 _Switch(["-nt", "nt"], ["input"],113 "Input sequences are nucleic acid sequences and " + \114 "`nucleic acid segments' are translated to `peptide " + \115 "segments'."),116 _Switch(["-nta", "nta"], ["input"],117 "`no textual alignment' - textual alignment suppressed. " + \118 "This option makes sense if other output files are of " + \119 "intrest -- e.g. the fragment files created with -ff, " + \120 "-fop, -fsm or -lo."),121 _Switch(["-o", "o"], ["input"],122 "Fast version, resulting alignments may be slightly " + \123 "different."),124 _Switch(["-ow", "ow"], ["input"],125 "Overlap weights enforced (By default, overlap weights " + \126 "are used only if up to 35 sequences are aligned since " + \127 "calculating overlap weights is time consuming)."),128 _Switch(["-pst", "pst"], ["input"],129 "'print status'. Creates and updates a file *.sta with " + \130 "information about the current status of the program " + \131 "run. This option is recommended if large data sets " + \132 "are aligned since it allows the user to estimate the " + \133 "remaining running time."),134 _Switch(["-smin", "smin"], ["input"],135 "Minimum similarity value for first residue pair " + \136 "(or codon pair) in fragments. Speeds up protein " + \137 "alignment or alignment of translated DNA fragments " + \138 "at the expense of sensitivity."),139 _Option(["-stars", "stars"], ["input"],140 lambda x: x in range(0,10),141 0,142 "Maximum number of `*' characters indicating degree " + \143 "of local similarity among sequences. By default, no " + \144 "stars are used but numbers between 0 and 9, instead.",145 0),146 _Switch(["-stdo", "stdo"], ["input"],147 "Results written to standard output."),148 _Switch(["-ta", "ta"], ["input"],149 "Standard textual alignment printed (overrides " + \150 "suppression of textual alignments in special " + \151 "options, e.g. -lgs)"),152 _Option(["-thr", "thr"], ["input"],153 lambda x: isinstance(x, int),154 0,155 "Threshold T = x.",156 0),157 _Switch(["-xfr", "xfr"], ["input"],158 "'exclude fragments' - list of fragments can be " + \159 "specified that are NOT considered for pairwise alignment"),160 _Argument(["input"], ["input", "file"], None, 1,161 "Input file name. Must be FASTA format")162 ]...

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 lisa 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