Best Python code snippet using tempest_python
__init__.py
Source:__init__.py
...39 omm.model.graph.output.append(vi)40 else:41 raise Exception42def Abs(*args, **kwargs):43 schema = onnx.defs.get_schema("Abs",44 max_inclusive_version=OPSET_VER,45 domain="")46 return getattr(sys.modules[f"{mod_name}.ops"], 47 f"v{schema.since_version}.Abs")(*args, **kwargs)48def Acos(*args, **kwargs):49 schema = onnx.defs.get_schema("Acos",50 max_inclusive_version=OPSET_VER,51 domain="")52 return getattr(sys.modules[f"{mod_name}.ops"], 53 f"v{schema.since_version}.Acos")(*args, **kwargs)54def Acosh(*args, **kwargs):55 schema = onnx.defs.get_schema("Acosh",56 max_inclusive_version=OPSET_VER,57 domain="")58 return getattr(sys.modules[f"{mod_name}.ops"], 59 f"v{schema.since_version}.Acosh")(*args, **kwargs)60def Adagrad(*args, **kwargs):61 schema = onnx.defs.get_schema("Adagrad",62 max_inclusive_version=OPSET_VER,63 domain="")64 return getattr(sys.modules[f"{mod_name}.ops"], 65 f"v{schema.since_version}.Adagrad")(*args, **kwargs)66def Adam(*args, **kwargs):67 schema = onnx.defs.get_schema("Adam",68 max_inclusive_version=OPSET_VER,69 domain="")70 return getattr(sys.modules[f"{mod_name}.ops"], 71 f"v{schema.since_version}.Adam")(*args, **kwargs)72def Add(*args, **kwargs):73 schema = onnx.defs.get_schema("Add",74 max_inclusive_version=OPSET_VER,75 domain="")76 return getattr(sys.modules[f"{mod_name}.ops"], 77 f"v{schema.since_version}.Add")(*args, **kwargs)78def And(*args, **kwargs):79 schema = onnx.defs.get_schema("And",80 max_inclusive_version=OPSET_VER,81 domain="")82 return getattr(sys.modules[f"{mod_name}.ops"], 83 f"v{schema.since_version}.And")(*args, **kwargs)84def ArgMax(*args, **kwargs):85 schema = onnx.defs.get_schema("ArgMax",86 max_inclusive_version=OPSET_VER,87 domain="")88 return getattr(sys.modules[f"{mod_name}.ops"], 89 f"v{schema.since_version}.ArgMax")(*args, **kwargs)90def ArgMin(*args, **kwargs):91 schema = onnx.defs.get_schema("ArgMin",92 max_inclusive_version=OPSET_VER,93 domain="")94 return getattr(sys.modules[f"{mod_name}.ops"], 95 f"v{schema.since_version}.ArgMin")(*args, **kwargs)96def ArrayFeatureExtractor(*args, **kwargs):97 schema = onnx.defs.get_schema("ArrayFeatureExtractor",98 max_inclusive_version=OPSET_VER,99 domain="")100 return getattr(sys.modules[f"{mod_name}.ops"], 101 f"v{schema.since_version}.ArrayFeatureExtractor")(*args, **kwargs)102def Asin(*args, **kwargs):103 schema = onnx.defs.get_schema("Asin",104 max_inclusive_version=OPSET_VER,105 domain="")106 return getattr(sys.modules[f"{mod_name}.ops"], 107 f"v{schema.since_version}.Asin")(*args, **kwargs)108def Asinh(*args, **kwargs):109 schema = onnx.defs.get_schema("Asinh",110 max_inclusive_version=OPSET_VER,111 domain="")112 return getattr(sys.modules[f"{mod_name}.ops"], 113 f"v{schema.since_version}.Asinh")(*args, **kwargs)114def Atan(*args, **kwargs):115 schema = onnx.defs.get_schema("Atan",116 max_inclusive_version=OPSET_VER,117 domain="")118 return getattr(sys.modules[f"{mod_name}.ops"], 119 f"v{schema.since_version}.Atan")(*args, **kwargs)120def Atanh(*args, **kwargs):121 schema = onnx.defs.get_schema("Atanh",122 max_inclusive_version=OPSET_VER,123 domain="")124 return getattr(sys.modules[f"{mod_name}.ops"], 125 f"v{schema.since_version}.Atanh")(*args, **kwargs)126def AveragePool(*args, **kwargs):127 schema = onnx.defs.get_schema("AveragePool",128 max_inclusive_version=OPSET_VER,129 domain="")130 return getattr(sys.modules[f"{mod_name}.ops"], 131 f"v{schema.since_version}.AveragePool")(*args, **kwargs)132def BatchNormalization(*args, **kwargs):133 schema = onnx.defs.get_schema("BatchNormalization",134 max_inclusive_version=OPSET_VER,135 domain="")136 return getattr(sys.modules[f"{mod_name}.ops"], 137 f"v{schema.since_version}.BatchNormalization")(*args, **kwargs)138def Binarizer(*args, **kwargs):139 schema = onnx.defs.get_schema("Binarizer",140 max_inclusive_version=OPSET_VER,141 domain="")142 return getattr(sys.modules[f"{mod_name}.ops"], 143 f"v{schema.since_version}.Binarizer")(*args, **kwargs)144def BitShift(*args, **kwargs):145 schema = onnx.defs.get_schema("BitShift",146 max_inclusive_version=OPSET_VER,147 domain="")148 return getattr(sys.modules[f"{mod_name}.ops"], 149 f"v{schema.since_version}.BitShift")(*args, **kwargs)150def Cast(*args, **kwargs):151 schema = onnx.defs.get_schema("Cast",152 max_inclusive_version=OPSET_VER,153 domain="")154 return getattr(sys.modules[f"{mod_name}.ops"], 155 f"v{schema.since_version}.Cast")(*args, **kwargs)156def CastMap(*args, **kwargs):157 schema = onnx.defs.get_schema("CastMap",158 max_inclusive_version=OPSET_VER,159 domain="")160 return getattr(sys.modules[f"{mod_name}.ops"], 161 f"v{schema.since_version}.CastMap")(*args, **kwargs)162def CategoryMapper(*args, **kwargs):163 schema = onnx.defs.get_schema("CategoryMapper",164 max_inclusive_version=OPSET_VER,165 domain="")166 return getattr(sys.modules[f"{mod_name}.ops"], 167 f"v{schema.since_version}.CategoryMapper")(*args, **kwargs)168def Ceil(*args, **kwargs):169 schema = onnx.defs.get_schema("Ceil",170 max_inclusive_version=OPSET_VER,171 domain="")172 return getattr(sys.modules[f"{mod_name}.ops"], 173 f"v{schema.since_version}.Ceil")(*args, **kwargs)174def Celu(*args, **kwargs):175 schema = onnx.defs.get_schema("Celu",176 max_inclusive_version=OPSET_VER,177 domain="")178 return getattr(sys.modules[f"{mod_name}.ops"], 179 f"v{schema.since_version}.Celu")(*args, **kwargs)180def Clip(*args, **kwargs):181 schema = onnx.defs.get_schema("Clip",182 max_inclusive_version=OPSET_VER,183 domain="")184 return getattr(sys.modules[f"{mod_name}.ops"], 185 f"v{schema.since_version}.Clip")(*args, **kwargs)186def Compress(*args, **kwargs):187 schema = onnx.defs.get_schema("Compress",188 max_inclusive_version=OPSET_VER,189 domain="")190 return getattr(sys.modules[f"{mod_name}.ops"], 191 f"v{schema.since_version}.Compress")(*args, **kwargs)192def Concat(*args, **kwargs):193 schema = onnx.defs.get_schema("Concat",194 max_inclusive_version=OPSET_VER,195 domain="")196 return getattr(sys.modules[f"{mod_name}.ops"], 197 f"v{schema.since_version}.Concat")(*args, **kwargs)198def ConcatFromSequence(*args, **kwargs):199 schema = onnx.defs.get_schema("ConcatFromSequence",200 max_inclusive_version=OPSET_VER,201 domain="")202 return getattr(sys.modules[f"{mod_name}.ops"], 203 f"v{schema.since_version}.ConcatFromSequence")(*args, **kwargs)204def Constant(*args, **kwargs):205 schema = onnx.defs.get_schema("Constant",206 max_inclusive_version=OPSET_VER,207 domain="")208 return getattr(sys.modules[f"{mod_name}.ops"], 209 f"v{schema.since_version}.Constant")(*args, **kwargs)210def ConstantOfShape(*args, **kwargs):211 schema = onnx.defs.get_schema("ConstantOfShape",212 max_inclusive_version=OPSET_VER,213 domain="")214 return getattr(sys.modules[f"{mod_name}.ops"], 215 f"v{schema.since_version}.ConstantOfShape")(*args, **kwargs)216def Conv(*args, **kwargs):217 schema = onnx.defs.get_schema("Conv",218 max_inclusive_version=OPSET_VER,219 domain="")220 return getattr(sys.modules[f"{mod_name}.ops"], 221 f"v{schema.since_version}.Conv")(*args, **kwargs)222def ConvInteger(*args, **kwargs):223 schema = onnx.defs.get_schema("ConvInteger",224 max_inclusive_version=OPSET_VER,225 domain="")226 return getattr(sys.modules[f"{mod_name}.ops"], 227 f"v{schema.since_version}.ConvInteger")(*args, **kwargs)228def ConvTranspose(*args, **kwargs):229 schema = onnx.defs.get_schema("ConvTranspose",230 max_inclusive_version=OPSET_VER,231 domain="")232 return getattr(sys.modules[f"{mod_name}.ops"], 233 f"v{schema.since_version}.ConvTranspose")(*args, **kwargs)234def Cos(*args, **kwargs):235 schema = onnx.defs.get_schema("Cos",236 max_inclusive_version=OPSET_VER,237 domain="")238 return getattr(sys.modules[f"{mod_name}.ops"], 239 f"v{schema.since_version}.Cos")(*args, **kwargs)240def Cosh(*args, **kwargs):241 schema = onnx.defs.get_schema("Cosh",242 max_inclusive_version=OPSET_VER,243 domain="")244 return getattr(sys.modules[f"{mod_name}.ops"], 245 f"v{schema.since_version}.Cosh")(*args, **kwargs)246def CumSum(*args, **kwargs):247 schema = onnx.defs.get_schema("CumSum",248 max_inclusive_version=OPSET_VER,249 domain="")250 return getattr(sys.modules[f"{mod_name}.ops"], 251 f"v{schema.since_version}.CumSum")(*args, **kwargs)252def DepthToSpace(*args, **kwargs):253 schema = onnx.defs.get_schema("DepthToSpace",254 max_inclusive_version=OPSET_VER,255 domain="")256 return getattr(sys.modules[f"{mod_name}.ops"], 257 f"v{schema.since_version}.DepthToSpace")(*args, **kwargs)258def DequantizeLinear(*args, **kwargs):259 schema = onnx.defs.get_schema("DequantizeLinear",260 max_inclusive_version=OPSET_VER,261 domain="")262 return getattr(sys.modules[f"{mod_name}.ops"], 263 f"v{schema.since_version}.DequantizeLinear")(*args, **kwargs)264def Det(*args, **kwargs):265 schema = onnx.defs.get_schema("Det",266 max_inclusive_version=OPSET_VER,267 domain="")268 return getattr(sys.modules[f"{mod_name}.ops"], 269 f"v{schema.since_version}.Det")(*args, **kwargs)270def DictVectorizer(*args, **kwargs):271 schema = onnx.defs.get_schema("DictVectorizer",272 max_inclusive_version=OPSET_VER,273 domain="")274 return getattr(sys.modules[f"{mod_name}.ops"], 275 f"v{schema.since_version}.DictVectorizer")(*args, **kwargs)276def Div(*args, **kwargs):277 schema = onnx.defs.get_schema("Div",278 max_inclusive_version=OPSET_VER,279 domain="")280 return getattr(sys.modules[f"{mod_name}.ops"], 281 f"v{schema.since_version}.Div")(*args, **kwargs)282def Dropout(*args, **kwargs):283 schema = onnx.defs.get_schema("Dropout",284 max_inclusive_version=OPSET_VER,285 domain="")286 return getattr(sys.modules[f"{mod_name}.ops"], 287 f"v{schema.since_version}.Dropout")(*args, **kwargs)288def DynamicQuantizeLinear(*args, **kwargs):289 schema = onnx.defs.get_schema("DynamicQuantizeLinear",290 max_inclusive_version=OPSET_VER,291 domain="")292 return getattr(sys.modules[f"{mod_name}.ops"], 293 f"v{schema.since_version}.DynamicQuantizeLinear")(*args, **kwargs)294def Einsum(*args, **kwargs):295 schema = onnx.defs.get_schema("Einsum",296 max_inclusive_version=OPSET_VER,297 domain="")298 return getattr(sys.modules[f"{mod_name}.ops"], 299 f"v{schema.since_version}.Einsum")(*args, **kwargs)300def Elu(*args, **kwargs):301 schema = onnx.defs.get_schema("Elu",302 max_inclusive_version=OPSET_VER,303 domain="")304 return getattr(sys.modules[f"{mod_name}.ops"], 305 f"v{schema.since_version}.Elu")(*args, **kwargs)306def Equal(*args, **kwargs):307 schema = onnx.defs.get_schema("Equal",308 max_inclusive_version=OPSET_VER,309 domain="")310 return getattr(sys.modules[f"{mod_name}.ops"], 311 f"v{schema.since_version}.Equal")(*args, **kwargs)312def Erf(*args, **kwargs):313 schema = onnx.defs.get_schema("Erf",314 max_inclusive_version=OPSET_VER,315 domain="")316 return getattr(sys.modules[f"{mod_name}.ops"], 317 f"v{schema.since_version}.Erf")(*args, **kwargs)318def Exp(*args, **kwargs):319 schema = onnx.defs.get_schema("Exp",320 max_inclusive_version=OPSET_VER,321 domain="")322 return getattr(sys.modules[f"{mod_name}.ops"], 323 f"v{schema.since_version}.Exp")(*args, **kwargs)324def Expand(*args, **kwargs):325 schema = onnx.defs.get_schema("Expand",326 max_inclusive_version=OPSET_VER,327 domain="")328 return getattr(sys.modules[f"{mod_name}.ops"], 329 f"v{schema.since_version}.Expand")(*args, **kwargs)330def EyeLike(*args, **kwargs):331 schema = onnx.defs.get_schema("EyeLike",332 max_inclusive_version=OPSET_VER,333 domain="")334 return getattr(sys.modules[f"{mod_name}.ops"], 335 f"v{schema.since_version}.EyeLike")(*args, **kwargs)336def FeatureVectorizer(*args, **kwargs):337 schema = onnx.defs.get_schema("FeatureVectorizer",338 max_inclusive_version=OPSET_VER,339 domain="")340 return getattr(sys.modules[f"{mod_name}.ops"], 341 f"v{schema.since_version}.FeatureVectorizer")(*args, **kwargs)342def Flatten(*args, **kwargs):343 schema = onnx.defs.get_schema("Flatten",344 max_inclusive_version=OPSET_VER,345 domain="")346 return getattr(sys.modules[f"{mod_name}.ops"], 347 f"v{schema.since_version}.Flatten")(*args, **kwargs)348def Floor(*args, **kwargs):349 schema = onnx.defs.get_schema("Floor",350 max_inclusive_version=OPSET_VER,351 domain="")352 return getattr(sys.modules[f"{mod_name}.ops"], 353 f"v{schema.since_version}.Floor")(*args, **kwargs)354def GRU(*args, **kwargs):355 schema = onnx.defs.get_schema("GRU",356 max_inclusive_version=OPSET_VER,357 domain="")358 return getattr(sys.modules[f"{mod_name}.ops"], 359 f"v{schema.since_version}.GRU")(*args, **kwargs)360def Gather(*args, **kwargs):361 schema = onnx.defs.get_schema("Gather",362 max_inclusive_version=OPSET_VER,363 domain="")364 return getattr(sys.modules[f"{mod_name}.ops"], 365 f"v{schema.since_version}.Gather")(*args, **kwargs)366def GatherElements(*args, **kwargs):367 schema = onnx.defs.get_schema("GatherElements",368 max_inclusive_version=OPSET_VER,369 domain="")370 return getattr(sys.modules[f"{mod_name}.ops"], 371 f"v{schema.since_version}.GatherElements")(*args, **kwargs)372def GatherND(*args, **kwargs):373 schema = onnx.defs.get_schema("GatherND",374 max_inclusive_version=OPSET_VER,375 domain="")376 return getattr(sys.modules[f"{mod_name}.ops"], 377 f"v{schema.since_version}.GatherND")(*args, **kwargs)378def Gemm(*args, **kwargs):379 schema = onnx.defs.get_schema("Gemm",380 max_inclusive_version=OPSET_VER,381 domain="")382 return getattr(sys.modules[f"{mod_name}.ops"], 383 f"v{schema.since_version}.Gemm")(*args, **kwargs)384def GlobalAveragePool(*args, **kwargs):385 schema = onnx.defs.get_schema("GlobalAveragePool",386 max_inclusive_version=OPSET_VER,387 domain="")388 return getattr(sys.modules[f"{mod_name}.ops"], 389 f"v{schema.since_version}.GlobalAveragePool")(*args, **kwargs)390def GlobalLpPool(*args, **kwargs):391 schema = onnx.defs.get_schema("GlobalLpPool",392 max_inclusive_version=OPSET_VER,393 domain="")394 return getattr(sys.modules[f"{mod_name}.ops"], 395 f"v{schema.since_version}.GlobalLpPool")(*args, **kwargs)396def GlobalMaxPool(*args, **kwargs):397 schema = onnx.defs.get_schema("GlobalMaxPool",398 max_inclusive_version=OPSET_VER,399 domain="")400 return getattr(sys.modules[f"{mod_name}.ops"], 401 f"v{schema.since_version}.GlobalMaxPool")(*args, **kwargs)402def Gradient(*args, **kwargs):403 schema = onnx.defs.get_schema("Gradient",404 max_inclusive_version=OPSET_VER,405 domain="")406 return getattr(sys.modules[f"{mod_name}.ops"], 407 f"v{schema.since_version}.Gradient")(*args, **kwargs)408def Greater(*args, **kwargs):409 schema = onnx.defs.get_schema("Greater",410 max_inclusive_version=OPSET_VER,411 domain="")412 return getattr(sys.modules[f"{mod_name}.ops"], 413 f"v{schema.since_version}.Greater")(*args, **kwargs)414def GreaterOrEqual(*args, **kwargs):415 schema = onnx.defs.get_schema("GreaterOrEqual",416 max_inclusive_version=OPSET_VER,417 domain="")418 return getattr(sys.modules[f"{mod_name}.ops"], 419 f"v{schema.since_version}.GreaterOrEqual")(*args, **kwargs)420def HardSigmoid(*args, **kwargs):421 schema = onnx.defs.get_schema("HardSigmoid",422 max_inclusive_version=OPSET_VER,423 domain="")424 return getattr(sys.modules[f"{mod_name}.ops"], 425 f"v{schema.since_version}.HardSigmoid")(*args, **kwargs)426def HardSwish(*args, **kwargs):427 schema = onnx.defs.get_schema("HardSwish",428 max_inclusive_version=OPSET_VER,429 domain="")430 return getattr(sys.modules[f"{mod_name}.ops"], 431 f"v{schema.since_version}.HardSwish")(*args, **kwargs)432def Hardmax(*args, **kwargs):433 schema = onnx.defs.get_schema("Hardmax",434 max_inclusive_version=OPSET_VER,435 domain="")436 return getattr(sys.modules[f"{mod_name}.ops"], 437 f"v{schema.since_version}.Hardmax")(*args, **kwargs)438def Identity(*args, **kwargs):439 schema = onnx.defs.get_schema("Identity",440 max_inclusive_version=OPSET_VER,441 domain="")442 return getattr(sys.modules[f"{mod_name}.ops"], 443 f"v{schema.since_version}.Identity")(*args, **kwargs)444def If(*args, **kwargs):445 schema = onnx.defs.get_schema("If",446 max_inclusive_version=OPSET_VER,447 domain="")448 return getattr(sys.modules[f"{mod_name}.ops"], 449 f"v{schema.since_version}.If")(*args, **kwargs)450def Imputer(*args, **kwargs):451 schema = onnx.defs.get_schema("Imputer",452 max_inclusive_version=OPSET_VER,453 domain="")454 return getattr(sys.modules[f"{mod_name}.ops"], 455 f"v{schema.since_version}.Imputer")(*args, **kwargs)456def InstanceNormalization(*args, **kwargs):457 schema = onnx.defs.get_schema("InstanceNormalization",458 max_inclusive_version=OPSET_VER,459 domain="")460 return getattr(sys.modules[f"{mod_name}.ops"], 461 f"v{schema.since_version}.InstanceNormalization")(*args, **kwargs)462def IsInf(*args, **kwargs):463 schema = onnx.defs.get_schema("IsInf",464 max_inclusive_version=OPSET_VER,465 domain="")466 return getattr(sys.modules[f"{mod_name}.ops"], 467 f"v{schema.since_version}.IsInf")(*args, **kwargs)468def IsNaN(*args, **kwargs):469 schema = onnx.defs.get_schema("IsNaN",470 max_inclusive_version=OPSET_VER,471 domain="")472 return getattr(sys.modules[f"{mod_name}.ops"], 473 f"v{schema.since_version}.IsNaN")(*args, **kwargs)474def LRN(*args, **kwargs):475 schema = onnx.defs.get_schema("LRN",476 max_inclusive_version=OPSET_VER,477 domain="")478 return getattr(sys.modules[f"{mod_name}.ops"], 479 f"v{schema.since_version}.LRN")(*args, **kwargs)480def LSTM(*args, **kwargs):481 schema = onnx.defs.get_schema("LSTM",482 max_inclusive_version=OPSET_VER,483 domain="")484 return getattr(sys.modules[f"{mod_name}.ops"], 485 f"v{schema.since_version}.LSTM")(*args, **kwargs)486def LabelEncoder(*args, **kwargs):487 schema = onnx.defs.get_schema("LabelEncoder",488 max_inclusive_version=OPSET_VER,489 domain="")490 return getattr(sys.modules[f"{mod_name}.ops"], 491 f"v{schema.since_version}.LabelEncoder")(*args, **kwargs)492def LeakyRelu(*args, **kwargs):493 schema = onnx.defs.get_schema("LeakyRelu",494 max_inclusive_version=OPSET_VER,495 domain="")496 return getattr(sys.modules[f"{mod_name}.ops"], 497 f"v{schema.since_version}.LeakyRelu")(*args, **kwargs)498def Less(*args, **kwargs):499 schema = onnx.defs.get_schema("Less",500 max_inclusive_version=OPSET_VER,501 domain="")502 return getattr(sys.modules[f"{mod_name}.ops"], 503 f"v{schema.since_version}.Less")(*args, **kwargs)504def LessOrEqual(*args, **kwargs):505 schema = onnx.defs.get_schema("LessOrEqual",506 max_inclusive_version=OPSET_VER,507 domain="")508 return getattr(sys.modules[f"{mod_name}.ops"], 509 f"v{schema.since_version}.LessOrEqual")(*args, **kwargs)510def LinearClassifier(*args, **kwargs):511 schema = onnx.defs.get_schema("LinearClassifier",512 max_inclusive_version=OPSET_VER,513 domain="")514 return getattr(sys.modules[f"{mod_name}.ops"], 515 f"v{schema.since_version}.LinearClassifier")(*args, **kwargs)516def LinearRegressor(*args, **kwargs):517 schema = onnx.defs.get_schema("LinearRegressor",518 max_inclusive_version=OPSET_VER,519 domain="")520 return getattr(sys.modules[f"{mod_name}.ops"], 521 f"v{schema.since_version}.LinearRegressor")(*args, **kwargs)522def Log(*args, **kwargs):523 schema = onnx.defs.get_schema("Log",524 max_inclusive_version=OPSET_VER,525 domain="")526 return getattr(sys.modules[f"{mod_name}.ops"], 527 f"v{schema.since_version}.Log")(*args, **kwargs)528def LogSoftmax(*args, **kwargs):529 schema = onnx.defs.get_schema("LogSoftmax",530 max_inclusive_version=OPSET_VER,531 domain="")532 return getattr(sys.modules[f"{mod_name}.ops"], 533 f"v{schema.since_version}.LogSoftmax")(*args, **kwargs)534def Loop(*args, **kwargs):535 schema = onnx.defs.get_schema("Loop",536 max_inclusive_version=OPSET_VER,537 domain="")538 return getattr(sys.modules[f"{mod_name}.ops"], 539 f"v{schema.since_version}.Loop")(*args, **kwargs)540def LpNormalization(*args, **kwargs):541 schema = onnx.defs.get_schema("LpNormalization",542 max_inclusive_version=OPSET_VER,543 domain="")544 return getattr(sys.modules[f"{mod_name}.ops"], 545 f"v{schema.since_version}.LpNormalization")(*args, **kwargs)546def LpPool(*args, **kwargs):547 schema = onnx.defs.get_schema("LpPool",548 max_inclusive_version=OPSET_VER,549 domain="")550 return getattr(sys.modules[f"{mod_name}.ops"], 551 f"v{schema.since_version}.LpPool")(*args, **kwargs)552def MatMul(*args, **kwargs):553 schema = onnx.defs.get_schema("MatMul",554 max_inclusive_version=OPSET_VER,555 domain="")556 return getattr(sys.modules[f"{mod_name}.ops"], 557 f"v{schema.since_version}.MatMul")(*args, **kwargs)558def MatMulInteger(*args, **kwargs):559 schema = onnx.defs.get_schema("MatMulInteger",560 max_inclusive_version=OPSET_VER,561 domain="")562 return getattr(sys.modules[f"{mod_name}.ops"], 563 f"v{schema.since_version}.MatMulInteger")(*args, **kwargs)564def Max(*args, **kwargs):565 schema = onnx.defs.get_schema("Max",566 max_inclusive_version=OPSET_VER,567 domain="")568 return getattr(sys.modules[f"{mod_name}.ops"], 569 f"v{schema.since_version}.Max")(*args, **kwargs)570def MaxPool(*args, **kwargs):571 schema = onnx.defs.get_schema("MaxPool",572 max_inclusive_version=OPSET_VER,573 domain="")574 return getattr(sys.modules[f"{mod_name}.ops"], 575 f"v{schema.since_version}.MaxPool")(*args, **kwargs)576def MaxRoiPool(*args, **kwargs):577 schema = onnx.defs.get_schema("MaxRoiPool",578 max_inclusive_version=OPSET_VER,579 domain="")580 return getattr(sys.modules[f"{mod_name}.ops"], 581 f"v{schema.since_version}.MaxRoiPool")(*args, **kwargs)582def MaxUnpool(*args, **kwargs):583 schema = onnx.defs.get_schema("MaxUnpool",584 max_inclusive_version=OPSET_VER,585 domain="")586 return getattr(sys.modules[f"{mod_name}.ops"], 587 f"v{schema.since_version}.MaxUnpool")(*args, **kwargs)588def Mean(*args, **kwargs):589 schema = onnx.defs.get_schema("Mean",590 max_inclusive_version=OPSET_VER,591 domain="")592 return getattr(sys.modules[f"{mod_name}.ops"], 593 f"v{schema.since_version}.Mean")(*args, **kwargs)594def MeanVarianceNormalization(*args, **kwargs):595 schema = onnx.defs.get_schema("MeanVarianceNormalization",596 max_inclusive_version=OPSET_VER,597 domain="")598 return getattr(sys.modules[f"{mod_name}.ops"], 599 f"v{schema.since_version}.MeanVarianceNormalization")(*args, **kwargs)600def Min(*args, **kwargs):601 schema = onnx.defs.get_schema("Min",602 max_inclusive_version=OPSET_VER,603 domain="")604 return getattr(sys.modules[f"{mod_name}.ops"], 605 f"v{schema.since_version}.Min")(*args, **kwargs)606def Mod(*args, **kwargs):607 schema = onnx.defs.get_schema("Mod",608 max_inclusive_version=OPSET_VER,609 domain="")610 return getattr(sys.modules[f"{mod_name}.ops"], 611 f"v{schema.since_version}.Mod")(*args, **kwargs)612def Momentum(*args, **kwargs):613 schema = onnx.defs.get_schema("Momentum",614 max_inclusive_version=OPSET_VER,615 domain="")616 return getattr(sys.modules[f"{mod_name}.ops"], 617 f"v{schema.since_version}.Momentum")(*args, **kwargs)618def Mul(*args, **kwargs):619 schema = onnx.defs.get_schema("Mul",620 max_inclusive_version=OPSET_VER,621 domain="")622 return getattr(sys.modules[f"{mod_name}.ops"], 623 f"v{schema.since_version}.Mul")(*args, **kwargs)624def Multinomial(*args, **kwargs):625 schema = onnx.defs.get_schema("Multinomial",626 max_inclusive_version=OPSET_VER,627 domain="")628 return getattr(sys.modules[f"{mod_name}.ops"], 629 f"v{schema.since_version}.Multinomial")(*args, **kwargs)630def Neg(*args, **kwargs):631 schema = onnx.defs.get_schema("Neg",632 max_inclusive_version=OPSET_VER,633 domain="")634 return getattr(sys.modules[f"{mod_name}.ops"], 635 f"v{schema.since_version}.Neg")(*args, **kwargs)636def NegativeLogLikelihoodLoss(*args, **kwargs):637 schema = onnx.defs.get_schema("NegativeLogLikelihoodLoss",638 max_inclusive_version=OPSET_VER,639 domain="")640 return getattr(sys.modules[f"{mod_name}.ops"], 641 f"v{schema.since_version}.NegativeLogLikelihoodLoss")(*args, **kwargs)642def NonMaxSuppression(*args, **kwargs):643 schema = onnx.defs.get_schema("NonMaxSuppression",644 max_inclusive_version=OPSET_VER,645 domain="")646 return getattr(sys.modules[f"{mod_name}.ops"], 647 f"v{schema.since_version}.NonMaxSuppression")(*args, **kwargs)648def NonZero(*args, **kwargs):649 schema = onnx.defs.get_schema("NonZero",650 max_inclusive_version=OPSET_VER,651 domain="")652 return getattr(sys.modules[f"{mod_name}.ops"], 653 f"v{schema.since_version}.NonZero")(*args, **kwargs)654def Normalizer(*args, **kwargs):655 schema = onnx.defs.get_schema("Normalizer",656 max_inclusive_version=OPSET_VER,657 domain="")658 return getattr(sys.modules[f"{mod_name}.ops"], 659 f"v{schema.since_version}.Normalizer")(*args, **kwargs)660def Not(*args, **kwargs):661 schema = onnx.defs.get_schema("Not",662 max_inclusive_version=OPSET_VER,663 domain="")664 return getattr(sys.modules[f"{mod_name}.ops"], 665 f"v{schema.since_version}.Not")(*args, **kwargs)666def OneHot(*args, **kwargs):667 schema = onnx.defs.get_schema("OneHot",668 max_inclusive_version=OPSET_VER,669 domain="")670 return getattr(sys.modules[f"{mod_name}.ops"], 671 f"v{schema.since_version}.OneHot")(*args, **kwargs)672def OneHotEncoder(*args, **kwargs):673 schema = onnx.defs.get_schema("OneHotEncoder",674 max_inclusive_version=OPSET_VER,675 domain="")676 return getattr(sys.modules[f"{mod_name}.ops"], 677 f"v{schema.since_version}.OneHotEncoder")(*args, **kwargs)678def Or(*args, **kwargs):679 schema = onnx.defs.get_schema("Or",680 max_inclusive_version=OPSET_VER,681 domain="")682 return getattr(sys.modules[f"{mod_name}.ops"], 683 f"v{schema.since_version}.Or")(*args, **kwargs)684def PRelu(*args, **kwargs):685 schema = onnx.defs.get_schema("PRelu",686 max_inclusive_version=OPSET_VER,687 domain="")688 return getattr(sys.modules[f"{mod_name}.ops"], 689 f"v{schema.since_version}.PRelu")(*args, **kwargs)690def Pad(*args, **kwargs):691 schema = onnx.defs.get_schema("Pad",692 max_inclusive_version=OPSET_VER,693 domain="")694 return getattr(sys.modules[f"{mod_name}.ops"], 695 f"v{schema.since_version}.Pad")(*args, **kwargs)696def Pow(*args, **kwargs):697 schema = onnx.defs.get_schema("Pow",698 max_inclusive_version=OPSET_VER,699 domain="")700 return getattr(sys.modules[f"{mod_name}.ops"], 701 f"v{schema.since_version}.Pow")(*args, **kwargs)702def QLinearConv(*args, **kwargs):703 schema = onnx.defs.get_schema("QLinearConv",704 max_inclusive_version=OPSET_VER,705 domain="")706 return getattr(sys.modules[f"{mod_name}.ops"], 707 f"v{schema.since_version}.QLinearConv")(*args, **kwargs)708def QLinearMatMul(*args, **kwargs):709 schema = onnx.defs.get_schema("QLinearMatMul",710 max_inclusive_version=OPSET_VER,711 domain="")712 return getattr(sys.modules[f"{mod_name}.ops"], 713 f"v{schema.since_version}.QLinearMatMul")(*args, **kwargs)714def QuantizeLinear(*args, **kwargs):715 schema = onnx.defs.get_schema("QuantizeLinear",716 max_inclusive_version=OPSET_VER,717 domain="")718 return getattr(sys.modules[f"{mod_name}.ops"], 719 f"v{schema.since_version}.QuantizeLinear")(*args, **kwargs)720def RNN(*args, **kwargs):721 schema = onnx.defs.get_schema("RNN",722 max_inclusive_version=OPSET_VER,723 domain="")724 return getattr(sys.modules[f"{mod_name}.ops"], 725 f"v{schema.since_version}.RNN")(*args, **kwargs)726def RandomNormal(*args, **kwargs):727 schema = onnx.defs.get_schema("RandomNormal",728 max_inclusive_version=OPSET_VER,729 domain="")730 return getattr(sys.modules[f"{mod_name}.ops"], 731 f"v{schema.since_version}.RandomNormal")(*args, **kwargs)732def RandomNormalLike(*args, **kwargs):733 schema = onnx.defs.get_schema("RandomNormalLike",734 max_inclusive_version=OPSET_VER,735 domain="")736 return getattr(sys.modules[f"{mod_name}.ops"], 737 f"v{schema.since_version}.RandomNormalLike")(*args, **kwargs)738def RandomUniform(*args, **kwargs):739 schema = onnx.defs.get_schema("RandomUniform",740 max_inclusive_version=OPSET_VER,741 domain="")742 return getattr(sys.modules[f"{mod_name}.ops"], 743 f"v{schema.since_version}.RandomUniform")(*args, **kwargs)744def RandomUniformLike(*args, **kwargs):745 schema = onnx.defs.get_schema("RandomUniformLike",746 max_inclusive_version=OPSET_VER,747 domain="")748 return getattr(sys.modules[f"{mod_name}.ops"], 749 f"v{schema.since_version}.RandomUniformLike")(*args, **kwargs)750def Range(*args, **kwargs):751 schema = onnx.defs.get_schema("Range",752 max_inclusive_version=OPSET_VER,753 domain="")754 return getattr(sys.modules[f"{mod_name}.ops"], 755 f"v{schema.since_version}.Range")(*args, **kwargs)756def Reciprocal(*args, **kwargs):757 schema = onnx.defs.get_schema("Reciprocal",758 max_inclusive_version=OPSET_VER,759 domain="")760 return getattr(sys.modules[f"{mod_name}.ops"], 761 f"v{schema.since_version}.Reciprocal")(*args, **kwargs)762def ReduceL1(*args, **kwargs):763 schema = onnx.defs.get_schema("ReduceL1",764 max_inclusive_version=OPSET_VER,765 domain="")766 return getattr(sys.modules[f"{mod_name}.ops"], 767 f"v{schema.since_version}.ReduceL1")(*args, **kwargs)768def ReduceL2(*args, **kwargs):769 schema = onnx.defs.get_schema("ReduceL2",770 max_inclusive_version=OPSET_VER,771 domain="")772 return getattr(sys.modules[f"{mod_name}.ops"], 773 f"v{schema.since_version}.ReduceL2")(*args, **kwargs)774def ReduceLogSum(*args, **kwargs):775 schema = onnx.defs.get_schema("ReduceLogSum",776 max_inclusive_version=OPSET_VER,777 domain="")778 return getattr(sys.modules[f"{mod_name}.ops"], 779 f"v{schema.since_version}.ReduceLogSum")(*args, **kwargs)780def ReduceLogSumExp(*args, **kwargs):781 schema = onnx.defs.get_schema("ReduceLogSumExp",782 max_inclusive_version=OPSET_VER,783 domain="")784 return getattr(sys.modules[f"{mod_name}.ops"], 785 f"v{schema.since_version}.ReduceLogSumExp")(*args, **kwargs)786def ReduceMax(*args, **kwargs):787 schema = onnx.defs.get_schema("ReduceMax",788 max_inclusive_version=OPSET_VER,789 domain="")790 return getattr(sys.modules[f"{mod_name}.ops"], 791 f"v{schema.since_version}.ReduceMax")(*args, **kwargs)792def ReduceMean(*args, **kwargs):793 schema = onnx.defs.get_schema("ReduceMean",794 max_inclusive_version=OPSET_VER,795 domain="")796 return getattr(sys.modules[f"{mod_name}.ops"], 797 f"v{schema.since_version}.ReduceMean")(*args, **kwargs)798def ReduceMin(*args, **kwargs):799 schema = onnx.defs.get_schema("ReduceMin",800 max_inclusive_version=OPSET_VER,801 domain="")802 return getattr(sys.modules[f"{mod_name}.ops"], 803 f"v{schema.since_version}.ReduceMin")(*args, **kwargs)804def ReduceProd(*args, **kwargs):805 schema = onnx.defs.get_schema("ReduceProd",806 max_inclusive_version=OPSET_VER,807 domain="")808 return getattr(sys.modules[f"{mod_name}.ops"], 809 f"v{schema.since_version}.ReduceProd")(*args, **kwargs)810def ReduceSum(*args, **kwargs):811 schema = onnx.defs.get_schema("ReduceSum",812 max_inclusive_version=OPSET_VER,813 domain="")814 return getattr(sys.modules[f"{mod_name}.ops"], 815 f"v{schema.since_version}.ReduceSum")(*args, **kwargs)816def ReduceSumSquare(*args, **kwargs):817 schema = onnx.defs.get_schema("ReduceSumSquare",818 max_inclusive_version=OPSET_VER,819 domain="")820 return getattr(sys.modules[f"{mod_name}.ops"], 821 f"v{schema.since_version}.ReduceSumSquare")(*args, **kwargs)822def Relu(*args, **kwargs):823 schema = onnx.defs.get_schema("Relu",824 max_inclusive_version=OPSET_VER,825 domain="")826 return getattr(sys.modules[f"{mod_name}.ops"], 827 f"v{schema.since_version}.Relu")(*args, **kwargs)828def Reshape(*args, **kwargs):829 schema = onnx.defs.get_schema("Reshape",830 max_inclusive_version=OPSET_VER,831 domain="")832 return getattr(sys.modules[f"{mod_name}.ops"], 833 f"v{schema.since_version}.Reshape")(*args, **kwargs)834def Resize(*args, **kwargs):835 schema = onnx.defs.get_schema("Resize",836 max_inclusive_version=OPSET_VER,837 domain="")838 return getattr(sys.modules[f"{mod_name}.ops"], 839 f"v{schema.since_version}.Resize")(*args, **kwargs)840def ReverseSequence(*args, **kwargs):841 schema = onnx.defs.get_schema("ReverseSequence",842 max_inclusive_version=OPSET_VER,843 domain="")844 return getattr(sys.modules[f"{mod_name}.ops"], 845 f"v{schema.since_version}.ReverseSequence")(*args, **kwargs)846def RoiAlign(*args, **kwargs):847 schema = onnx.defs.get_schema("RoiAlign",848 max_inclusive_version=OPSET_VER,849 domain="")850 return getattr(sys.modules[f"{mod_name}.ops"], 851 f"v{schema.since_version}.RoiAlign")(*args, **kwargs)852def Round(*args, **kwargs):853 schema = onnx.defs.get_schema("Round",854 max_inclusive_version=OPSET_VER,855 domain="")856 return getattr(sys.modules[f"{mod_name}.ops"], 857 f"v{schema.since_version}.Round")(*args, **kwargs)858def SVMClassifier(*args, **kwargs):859 schema = onnx.defs.get_schema("SVMClassifier",860 max_inclusive_version=OPSET_VER,861 domain="")862 return getattr(sys.modules[f"{mod_name}.ops"], 863 f"v{schema.since_version}.SVMClassifier")(*args, **kwargs)864def SVMRegressor(*args, **kwargs):865 schema = onnx.defs.get_schema("SVMRegressor",866 max_inclusive_version=OPSET_VER,867 domain="")868 return getattr(sys.modules[f"{mod_name}.ops"], 869 f"v{schema.since_version}.SVMRegressor")(*args, **kwargs)870def Scaler(*args, **kwargs):871 schema = onnx.defs.get_schema("Scaler",872 max_inclusive_version=OPSET_VER,873 domain="")874 return getattr(sys.modules[f"{mod_name}.ops"], 875 f"v{schema.since_version}.Scaler")(*args, **kwargs)876def Scan(*args, **kwargs):877 schema = onnx.defs.get_schema("Scan",878 max_inclusive_version=OPSET_VER,879 domain="")880 return getattr(sys.modules[f"{mod_name}.ops"], 881 f"v{schema.since_version}.Scan")(*args, **kwargs)882def Scatter(*args, **kwargs):883 schema = onnx.defs.get_schema("Scatter",884 max_inclusive_version=OPSET_VER,885 domain="")886 return getattr(sys.modules[f"{mod_name}.ops"], 887 f"v{schema.since_version}.Scatter")(*args, **kwargs)888def ScatterElements(*args, **kwargs):889 schema = onnx.defs.get_schema("ScatterElements",890 max_inclusive_version=OPSET_VER,891 domain="")892 return getattr(sys.modules[f"{mod_name}.ops"], 893 f"v{schema.since_version}.ScatterElements")(*args, **kwargs)894def ScatterND(*args, **kwargs):895 schema = onnx.defs.get_schema("ScatterND",896 max_inclusive_version=OPSET_VER,897 domain="")898 return getattr(sys.modules[f"{mod_name}.ops"], 899 f"v{schema.since_version}.ScatterND")(*args, **kwargs)900def Selu(*args, **kwargs):901 schema = onnx.defs.get_schema("Selu",902 max_inclusive_version=OPSET_VER,903 domain="")904 return getattr(sys.modules[f"{mod_name}.ops"], 905 f"v{schema.since_version}.Selu")(*args, **kwargs)906def SequenceAt(*args, **kwargs):907 schema = onnx.defs.get_schema("SequenceAt",908 max_inclusive_version=OPSET_VER,909 domain="")910 return getattr(sys.modules[f"{mod_name}.ops"], 911 f"v{schema.since_version}.SequenceAt")(*args, **kwargs)912def SequenceConstruct(*args, **kwargs):913 schema = onnx.defs.get_schema("SequenceConstruct",914 max_inclusive_version=OPSET_VER,915 domain="")916 return getattr(sys.modules[f"{mod_name}.ops"], 917 f"v{schema.since_version}.SequenceConstruct")(*args, **kwargs)918def SequenceEmpty(*args, **kwargs):919 schema = onnx.defs.get_schema("SequenceEmpty",920 max_inclusive_version=OPSET_VER,921 domain="")922 return getattr(sys.modules[f"{mod_name}.ops"], 923 f"v{schema.since_version}.SequenceEmpty")(*args, **kwargs)924def SequenceErase(*args, **kwargs):925 schema = onnx.defs.get_schema("SequenceErase",926 max_inclusive_version=OPSET_VER,927 domain="")928 return getattr(sys.modules[f"{mod_name}.ops"], 929 f"v{schema.since_version}.SequenceErase")(*args, **kwargs)930def SequenceInsert(*args, **kwargs):931 schema = onnx.defs.get_schema("SequenceInsert",932 max_inclusive_version=OPSET_VER,933 domain="")934 return getattr(sys.modules[f"{mod_name}.ops"], 935 f"v{schema.since_version}.SequenceInsert")(*args, **kwargs)936def SequenceLength(*args, **kwargs):937 schema = onnx.defs.get_schema("SequenceLength",938 max_inclusive_version=OPSET_VER,939 domain="")940 return getattr(sys.modules[f"{mod_name}.ops"], 941 f"v{schema.since_version}.SequenceLength")(*args, **kwargs)942def Shape(*args, **kwargs):943 schema = onnx.defs.get_schema("Shape",944 max_inclusive_version=OPSET_VER,945 domain="")946 return getattr(sys.modules[f"{mod_name}.ops"], 947 f"v{schema.since_version}.Shape")(*args, **kwargs)948def Shrink(*args, **kwargs):949 schema = onnx.defs.get_schema("Shrink",950 max_inclusive_version=OPSET_VER,951 domain="")952 return getattr(sys.modules[f"{mod_name}.ops"], 953 f"v{schema.since_version}.Shrink")(*args, **kwargs)954def Sigmoid(*args, **kwargs):955 schema = onnx.defs.get_schema("Sigmoid",956 max_inclusive_version=OPSET_VER,957 domain="")958 return getattr(sys.modules[f"{mod_name}.ops"], 959 f"v{schema.since_version}.Sigmoid")(*args, **kwargs)960def Sign(*args, **kwargs):961 schema = onnx.defs.get_schema("Sign",962 max_inclusive_version=OPSET_VER,963 domain="")964 return getattr(sys.modules[f"{mod_name}.ops"], 965 f"v{schema.since_version}.Sign")(*args, **kwargs)966def Sin(*args, **kwargs):967 schema = onnx.defs.get_schema("Sin",968 max_inclusive_version=OPSET_VER,969 domain="")970 return getattr(sys.modules[f"{mod_name}.ops"], 971 f"v{schema.since_version}.Sin")(*args, **kwargs)972def Sinh(*args, **kwargs):973 schema = onnx.defs.get_schema("Sinh",974 max_inclusive_version=OPSET_VER,975 domain="")976 return getattr(sys.modules[f"{mod_name}.ops"], 977 f"v{schema.since_version}.Sinh")(*args, **kwargs)978def Size(*args, **kwargs):979 schema = onnx.defs.get_schema("Size",980 max_inclusive_version=OPSET_VER,981 domain="")982 return getattr(sys.modules[f"{mod_name}.ops"], 983 f"v{schema.since_version}.Size")(*args, **kwargs)984def Slice(*args, **kwargs):985 schema = onnx.defs.get_schema("Slice",986 max_inclusive_version=OPSET_VER,987 domain="")988 return getattr(sys.modules[f"{mod_name}.ops"], 989 f"v{schema.since_version}.Slice")(*args, **kwargs)990def Softmax(*args, **kwargs):991 schema = onnx.defs.get_schema("Softmax",992 max_inclusive_version=OPSET_VER,993 domain="")994 return getattr(sys.modules[f"{mod_name}.ops"], 995 f"v{schema.since_version}.Softmax")(*args, **kwargs)996def SoftmaxCrossEntropyLoss(*args, **kwargs):997 schema = onnx.defs.get_schema("SoftmaxCrossEntropyLoss",998 max_inclusive_version=OPSET_VER,999 domain="")1000 return getattr(sys.modules[f"{mod_name}.ops"], 1001 f"v{schema.since_version}.SoftmaxCrossEntropyLoss")(*args, **kwargs)1002def Softplus(*args, **kwargs):1003 schema = onnx.defs.get_schema("Softplus",1004 max_inclusive_version=OPSET_VER,1005 domain="")1006 return getattr(sys.modules[f"{mod_name}.ops"], 1007 f"v{schema.since_version}.Softplus")(*args, **kwargs)1008def Softsign(*args, **kwargs):1009 schema = onnx.defs.get_schema("Softsign",1010 max_inclusive_version=OPSET_VER,1011 domain="")1012 return getattr(sys.modules[f"{mod_name}.ops"], 1013 f"v{schema.since_version}.Softsign")(*args, **kwargs)1014def SpaceToDepth(*args, **kwargs):1015 schema = onnx.defs.get_schema("SpaceToDepth",1016 max_inclusive_version=OPSET_VER,1017 domain="")1018 return getattr(sys.modules[f"{mod_name}.ops"], 1019 f"v{schema.since_version}.SpaceToDepth")(*args, **kwargs)1020def Split(*args, **kwargs):1021 schema = onnx.defs.get_schema("Split",1022 max_inclusive_version=OPSET_VER,1023 domain="")1024 return getattr(sys.modules[f"{mod_name}.ops"], 1025 f"v{schema.since_version}.Split")(*args, **kwargs)1026def SplitToSequence(*args, **kwargs):1027 schema = onnx.defs.get_schema("SplitToSequence",1028 max_inclusive_version=OPSET_VER,1029 domain="")1030 return getattr(sys.modules[f"{mod_name}.ops"], 1031 f"v{schema.since_version}.SplitToSequence")(*args, **kwargs)1032def Sqrt(*args, **kwargs):1033 schema = onnx.defs.get_schema("Sqrt",1034 max_inclusive_version=OPSET_VER,1035 domain="")1036 return getattr(sys.modules[f"{mod_name}.ops"], 1037 f"v{schema.since_version}.Sqrt")(*args, **kwargs)1038def Squeeze(*args, **kwargs):1039 schema = onnx.defs.get_schema("Squeeze",1040 max_inclusive_version=OPSET_VER,1041 domain="")1042 return getattr(sys.modules[f"{mod_name}.ops"], 1043 f"v{schema.since_version}.Squeeze")(*args, **kwargs)1044def StringNormalizer(*args, **kwargs):1045 schema = onnx.defs.get_schema("StringNormalizer",1046 max_inclusive_version=OPSET_VER,1047 domain="")1048 return getattr(sys.modules[f"{mod_name}.ops"], 1049 f"v{schema.since_version}.StringNormalizer")(*args, **kwargs)1050def Sub(*args, **kwargs):1051 schema = onnx.defs.get_schema("Sub",1052 max_inclusive_version=OPSET_VER,1053 domain="")1054 return getattr(sys.modules[f"{mod_name}.ops"], 1055 f"v{schema.since_version}.Sub")(*args, **kwargs)1056def Sum(*args, **kwargs):1057 schema = onnx.defs.get_schema("Sum",1058 max_inclusive_version=OPSET_VER,1059 domain="")1060 return getattr(sys.modules[f"{mod_name}.ops"], 1061 f"v{schema.since_version}.Sum")(*args, **kwargs)1062def Tan(*args, **kwargs):1063 schema = onnx.defs.get_schema("Tan",1064 max_inclusive_version=OPSET_VER,1065 domain="")1066 return getattr(sys.modules[f"{mod_name}.ops"], 1067 f"v{schema.since_version}.Tan")(*args, **kwargs)1068def Tanh(*args, **kwargs):1069 schema = onnx.defs.get_schema("Tanh",1070 max_inclusive_version=OPSET_VER,1071 domain="")1072 return getattr(sys.modules[f"{mod_name}.ops"], 1073 f"v{schema.since_version}.Tanh")(*args, **kwargs)1074def TfIdfVectorizer(*args, **kwargs):1075 schema = onnx.defs.get_schema("TfIdfVectorizer",1076 max_inclusive_version=OPSET_VER,1077 domain="")1078 return getattr(sys.modules[f"{mod_name}.ops"], 1079 f"v{schema.since_version}.TfIdfVectorizer")(*args, **kwargs)1080def ThresholdedRelu(*args, **kwargs):1081 schema = onnx.defs.get_schema("ThresholdedRelu",1082 max_inclusive_version=OPSET_VER,1083 domain="")1084 return getattr(sys.modules[f"{mod_name}.ops"], 1085 f"v{schema.since_version}.ThresholdedRelu")(*args, **kwargs)1086def Tile(*args, **kwargs):1087 schema = onnx.defs.get_schema("Tile",1088 max_inclusive_version=OPSET_VER,1089 domain="")1090 return getattr(sys.modules[f"{mod_name}.ops"], 1091 f"v{schema.since_version}.Tile")(*args, **kwargs)1092def TopK(*args, **kwargs):1093 schema = onnx.defs.get_schema("TopK",1094 max_inclusive_version=OPSET_VER,1095 domain="")1096 return getattr(sys.modules[f"{mod_name}.ops"], 1097 f"v{schema.since_version}.TopK")(*args, **kwargs)1098def Transpose(*args, **kwargs):1099 schema = onnx.defs.get_schema("Transpose",1100 max_inclusive_version=OPSET_VER,1101 domain="")1102 return getattr(sys.modules[f"{mod_name}.ops"], 1103 f"v{schema.since_version}.Transpose")(*args, **kwargs)1104def TreeEnsembleClassifier(*args, **kwargs):1105 schema = onnx.defs.get_schema("TreeEnsembleClassifier",1106 max_inclusive_version=OPSET_VER,1107 domain="")1108 return getattr(sys.modules[f"{mod_name}.ops"], 1109 f"v{schema.since_version}.TreeEnsembleClassifier")(*args, **kwargs)1110def TreeEnsembleRegressor(*args, **kwargs):1111 schema = onnx.defs.get_schema("TreeEnsembleRegressor",1112 max_inclusive_version=OPSET_VER,1113 domain="")1114 return getattr(sys.modules[f"{mod_name}.ops"], 1115 f"v{schema.since_version}.TreeEnsembleRegressor")(*args, **kwargs)1116def Trilu(*args, **kwargs):1117 schema = onnx.defs.get_schema("Trilu",1118 max_inclusive_version=OPSET_VER,1119 domain="")1120 return getattr(sys.modules[f"{mod_name}.ops"], 1121 f"v{schema.since_version}.Trilu")(*args, **kwargs)1122def Unique(*args, **kwargs):1123 schema = onnx.defs.get_schema("Unique",1124 max_inclusive_version=OPSET_VER,1125 domain="")1126 return getattr(sys.modules[f"{mod_name}.ops"], 1127 f"v{schema.since_version}.Unique")(*args, **kwargs)1128def Unsqueeze(*args, **kwargs):1129 schema = onnx.defs.get_schema("Unsqueeze",1130 max_inclusive_version=OPSET_VER,1131 domain="")1132 return getattr(sys.modules[f"{mod_name}.ops"], 1133 f"v{schema.since_version}.Unsqueeze")(*args, **kwargs)1134def Upsample(*args, **kwargs):1135 schema = onnx.defs.get_schema("Upsample",1136 max_inclusive_version=OPSET_VER,1137 domain="")1138 return getattr(sys.modules[f"{mod_name}.ops"], 1139 f"v{schema.since_version}.Upsample")(*args, **kwargs)1140def Where(*args, **kwargs):1141 schema = onnx.defs.get_schema("Where",1142 max_inclusive_version=OPSET_VER,1143 domain="")1144 return getattr(sys.modules[f"{mod_name}.ops"], 1145 f"v{schema.since_version}.Where")(*args, **kwargs)1146def Xor(*args, **kwargs):1147 schema = onnx.defs.get_schema("Xor",1148 max_inclusive_version=OPSET_VER,1149 domain="")1150 return getattr(sys.modules[f"{mod_name}.ops"], 1151 f"v{schema.since_version}.Xor")(*args, **kwargs)1152def ZipMap(*args, **kwargs):1153 schema = onnx.defs.get_schema("ZipMap",1154 max_inclusive_version=OPSET_VER,1155 domain="")1156 return getattr(sys.modules[f"{mod_name}.ops"], 1157 f"v{schema.since_version}.ZipMap")(*args, **kwargs)...
objects.py
Source:objects.py
...45 this class.46 Raises:47 TypeError. The Python object cannot be normalized.48 """49 return schema_utils.normalize_against_schema(raw, cls.get_schema())50 # Here we used Any type because get_schema() returns a schema dictionary and51 # values in a schema dictionary can be of type str, List, Dict and other52 # types too.53 @classmethod54 def get_schema(cls) -> Dict[str, Any]:55 """This method should be implemented by subclasses.56 Raises:57 NotImplementedError. The method is not overwritten in a derived58 class.59 """60 raise NotImplementedError(61 'The get_schema() method is missing from the derived class. It '62 'should be implemented in the derived class.')63class Boolean(BaseObject):64 """Class for booleans."""65 description = 'A boolean.'66 edit_js_filename = 'BooleanEditor'67 @classmethod68 def get_schema(cls):69 """Returns the object schema.70 Returns:71 dict. The object schema.72 """73 return {74 'type': 'bool'75 }76 @classmethod77 def normalize(cls, raw):78 """Validates and normalizes a raw Python object.79 Args:80 raw: *. A Python object to be validated against the schema,81 normalizing if necessary.82 Returns:83 bool. The normalized object (or False if the input is None or '').84 """85 if raw is None or raw == '':86 raw = False87 return schema_utils.normalize_against_schema(raw, cls.get_schema())88class Real(BaseObject):89 """Real number class."""90 description = 'A real number.'91 default_value = 0.092 @classmethod93 def get_schema(cls):94 """Returns the object schema.95 Returns:96 dict. The object schema.97 """98 return {99 'type': 'float'100 }101class Int(BaseObject):102 """Integer class."""103 description = 'An integer.'104 default_value = 0105 @classmethod106 def get_schema(cls):107 """Returns the object schema.108 Returns:109 dict. The object schema.110 """111 return {112 'type': 'int'113 }114class UnicodeString(BaseObject):115 """Unicode string class."""116 description = 'A unicode string.'117 default_value = ''118 @classmethod119 def get_schema(cls):120 """Returns the object schema.121 Returns:122 dict. The object schema.123 """124 return {125 'type': 'unicode',126 }127class Html(BaseObject):128 """HTML string class."""129 description = 'An HTML string.'130 @classmethod131 def get_schema(cls):132 """Returns the object schema.133 Returns:134 dict. The object schema.135 """136 return {137 'type': 'html',138 }139# TODO(#11433): Migrate SubtitledUnicode to TranslatableUnicodeString.140class SubtitledUnicode(BaseObject):141 """SubtitledUnicode class."""142 description = 'A dictionary with properties "content_id" and "unicode".'143 @classmethod144 def get_schema(cls):145 """Returns the object schema.146 Returns:147 dict. The object schema.148 """149 return {150 'type': 'dict',151 'properties': [{152 'name': 'content_id',153 'schema': {154 # The default content id is none. However, it should be155 # populated before being saved (SubtitledUnicode in156 # state_domain has validation checks for this).157 'type': 'unicode_or_none'158 }159 }, {160 'name': 'unicode_str',161 'schema': {162 'type': 'unicode'163 }164 }]165 }166# TODO(#11433): Migrate SubtitledHtml to TranslatableHtml.167class SubtitledHtml(BaseObject):168 """SubtitledHtml class."""169 description = 'A dictionary with properties "content_id" and "html".'170 @classmethod171 def get_schema(cls):172 """Returns the object schema.173 Returns:174 dict. The object schema.175 """176 return {177 'type': 'dict',178 'properties': [{179 'name': 'content_id',180 'schema': {181 # The default content id is none. However, it should be182 # populated before being saved (SubtitledHtml in183 # state_domain has validation checks for this).184 'type': 'unicode_or_none'185 }186 }, {187 'name': 'html',188 'schema': {189 'type': 'html'190 }191 }]192 }193class NonnegativeInt(BaseObject):194 """Nonnegative integer class."""195 description = 'A non-negative integer.'196 default_value = 0197 @classmethod198 def get_schema(cls):199 """Returns the object schema.200 Returns:201 dict. The object schema.202 """203 return {204 'type': 'int',205 'validators': [{206 'id': 'is_at_least',207 'min_value': 0208 }]209 }210class PositiveInt(BaseObject):211 """Positive integer class."""212 description = 'A positive integer.'213 default_value = 1214 @classmethod215 def get_schema(cls):216 """Returns the object schema.217 Returns:218 dict. The object schema.219 """220 return {221 'type': 'int',222 'validators': [{223 'id': 'is_at_least',224 'min_value': 1225 }]226 }227class CodeString(BaseObject):228 """Code string class. This is like a normal string, but it should not229 contain tab characters.230 """231 description = 'A code string.'232 default_value = ''233 @classmethod234 def get_schema(cls):235 """Returns the object schema.236 Returns:237 dict. The object schema.238 """239 return {240 'type': 'unicode',241 'ui_config': {242 'coding_mode': 'none',243 },244 }245 @classmethod246 def normalize(cls, raw):247 """Validates and normalizes a raw Python object.248 Args:249 raw: *. A Python object to be validated against the schema,250 normalizing if necessary.251 Returns:252 unicode. The normalized object containing string in unicode format.253 Raises:254 TypeError. Unexpected tab characters in given python object 'raw'.255 """256 if '\t' in raw:257 raise TypeError(258 'Unexpected tab characters in code string: %s' % raw)259 return schema_utils.normalize_against_schema(raw, cls.get_schema())260class CodeEvaluation(BaseObject):261 """Evaluation result of programming code."""262 description = 'Code and its evaluation results.'263 @classmethod264 def get_schema(cls):265 """Returns the object schema.266 Returns:267 dict. The object schema.268 """269 return {270 'type': 'dict',271 'properties': [{272 'name': 'code',273 'schema': UnicodeString.get_schema(),274 }, {275 'name': 'output',276 'schema': UnicodeString.get_schema(),277 }, {278 'name': 'evaluation',279 'schema': UnicodeString.get_schema(),280 }, {281 'name': 'error',282 'schema': UnicodeString.get_schema(),283 }]284 }285class ListOfCodeEvaluation(BaseObject):286 """Class for lists of CodeEvaluations."""287 description = 'A list of code and its evaluation results.'288 default_value = []289 @classmethod290 def get_schema(cls):291 """Returns the object schema.292 Returns:293 dict. The object schema.294 """295 return {296 'type': 'list',297 'items': CodeEvaluation.get_schema()298 }299class CoordTwoDim(BaseObject):300 """2D coordinate class."""301 description = 'A two-dimensional coordinate (a pair of reals).'302 default_value = [0.0, 0.0]303 @classmethod304 def get_schema(cls):305 """Returns the object schema.306 Returns:307 dict. The object schema.308 """309 return {310 'type': 'list',311 'len': 2,312 'items': Real.get_schema(),313 }314class ListOfCoordTwoDim(BaseObject):315 """Class for lists of CoordTwoDims."""316 description = 'A list of 2D coordinates.'317 default_value = []318 @classmethod319 def get_schema(cls):320 """Returns the object schema.321 Returns:322 dict. The object schema.323 """324 return {325 'type': 'list',326 'items': CoordTwoDim.get_schema()327 }328class ListOfUnicodeString(BaseObject):329 """List class."""330 description = 'A list.'331 @classmethod332 def get_schema(cls):333 """Returns the object schema.334 Returns:335 dict. The object schema.336 """337 return {338 'type': 'list',339 'items': UnicodeString.get_schema()340 }341class SetOfUnicodeString(BaseObject):342 """Class for sets of UnicodeStrings."""343 description = 'A set (a list with unique elements) of unicode strings.'344 default_value = []345 @classmethod346 def get_schema(cls):347 """Returns the object schema.348 Returns:349 dict. The object schema.350 """351 return {352 'type': 'list',353 'items': UnicodeString.get_schema(),354 'validators': [{355 'id': 'is_uniquified'356 }]357 }358class NormalizedString(BaseObject):359 """Unicode string with spaces collapsed."""360 description = 'A unicode string with adjacent whitespace collapsed.'361 default_value = ''362 @classmethod363 def get_schema(cls):364 """Returns the object schema.365 Returns:366 dict. The object schema.367 """368 return {369 'type': 'unicode',370 'post_normalizers': [{371 'id': 'normalize_spaces'372 }]373 }374class SetOfNormalizedString(BaseObject):375 """Class for sets of NormalizedStrings."""376 description = (377 'A set (a list with unique elements) of whitespace-collapsed strings.')378 default_value = []379 @classmethod380 def get_schema(cls):381 """Returns the object schema.382 Returns:383 dict. The object schema.384 """385 return {386 'type': 'list',387 'items': NormalizedString.get_schema(),388 'validators': [{389 'id': 'is_uniquified'390 }]391 }392class MathExpressionContent(BaseObject):393 """Math Expression Content class."""394 description = 'The Math Expression to be displayed.'395 default_value = {396 'raw_latex': '',397 'svg_filename': ''398 }399 @classmethod400 def get_schema(cls):401 """Returns the object schema.402 Returns:403 dict. The object schema.404 """405 return {406 'type': 'dict',407 'properties': [{408 'name': 'raw_latex',409 'description': 'Latex value',410 'schema': {411 'type': 'unicode'412 }413 }, {414 'name': 'svg_filename',415 'description': 'SVG filename',416 'schema': {417 'type': 'unicode'418 }419 }]420 }421class SanitizedUrl(BaseObject):422 """HTTP or HTTPS url string class."""423 description = 'An HTTP or HTTPS url.'424 @classmethod425 def get_schema(cls):426 """Returns the object schema.427 Returns:428 dict. The object schema.429 """430 return {431 'type': 'unicode',432 'validators': [{433 'id': 'is_nonempty'434 }],435 'ui_config': {436 'placeholder': 'https://www.example.com'437 },438 'post_normalizers': [{439 'id': 'sanitize_url'440 }]441 }442class SkillSelector(BaseObject):443 """Skill selector class."""444 description = 'The skill summary for the concept card.'445 @classmethod446 def get_schema(cls):447 """Returns the object schema.448 Returns:449 dict. The object schema.450 """451 return {452 'type': 'unicode',453 'ui_config': {454 'placeholder': 'Search for skill'455 }456 }457class MusicPhrase(BaseObject):458 """List of Objects that represent a musical phrase."""459 description = (460 'A musical phrase that contains zero or more notes, rests, '461 'and time signature.')462 default_value = []463 # The maximum number of notes allowed in a music phrase.464 _MAX_NOTES_IN_PHRASE = 8465 _FRACTION_PART_SCHEMA = {466 'type': 'int',467 'validators': [{468 'id': 'is_at_least',469 'min_value': 1470 }]471 }472 @classmethod473 def get_schema(cls):474 """Returns the object schema.475 Returns:476 dict. The object schema.477 """478 return {479 'type': 'list',480 'items': {481 'type': 'dict',482 'properties': [{483 'name': 'readableNoteName',484 'schema': {485 'type': 'unicode',486 'choices': [487 'C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4', 'C5',488 'D5', 'E5', 'F5', 'G5', 'A5'489 ]490 }491 }, {492 'name': 'noteDuration',493 'schema': {494 'type': 'dict',495 'properties': [{496 'name': 'num',497 'schema': cls._FRACTION_PART_SCHEMA498 }, {499 'name': 'den',500 'schema': cls._FRACTION_PART_SCHEMA501 }]502 }503 }],504 },505 'validators': [{506 'id': 'has_length_at_most',507 'max_value': cls._MAX_NOTES_IN_PHRASE,508 }]509 }510class ListOfTabs(BaseObject):511 """Class for tab contents."""512 description = 'Tab content that contains list of tabs.'513 @classmethod514 def get_schema(cls):515 """Returns the object schema.516 Returns:517 dict. The object schema.518 """519 return {520 'type': 'list',521 'items': {522 'type': 'dict',523 'properties': [{524 'name': 'title',525 'description': 'Tab title',526 'schema': {527 'type': 'unicode',528 'validators': [{529 'id': 'is_nonempty'530 }]531 }532 }, {533 'name': 'content',534 'description': 'Tab content',535 'schema': {536 'type': 'html',537 'ui_config': {538 'hide_complex_extensions': True539 }540 }541 }]542 },543 'ui_config': {544 'add_element_text': 'Add new tab'545 }546 }547class Filepath(BaseObject):548 """A string representing a filepath.549 The path will be prefixed with '[exploration_id]/assets'.550 """551 description = 'A string that represents a filepath'552 @classmethod553 def get_schema(cls):554 """Returns the object schema.555 Returns:556 dict. The object schema.557 """558 return UnicodeString.get_schema()559class SvgFilename(BaseObject):560 """A string representing a filename of the saved561 svg file created using svg editor.562 """563 description = 'A string representing the saved svg filename'564 @classmethod565 def get_schema(cls):566 """Returns the object schema.567 Returns:568 dict. The object schema.569 """570 return UnicodeString.get_schema()571class CheckedProof(BaseObject):572 """A proof attempt and any errors it makes."""573 description = 'A proof attempt and any errors it makes.'574 @classmethod575 def normalize(cls, raw):576 """Validates and normalizes a raw Python object.577 Args:578 raw: *. A Python object to be validated against the schema,579 normalizing if necessary.580 Returns:581 dict. The normalized object containing the following key-value582 pairs:583 assumptions_string: str. The string containing the584 assumptions.585 target_string: str. The target string of the proof.586 proof_string: str. The proof string.587 correct: bool. Whether the proof is correct.588 error_category: str. The category of the error.589 error_code: str. The error code.590 error_message: str. The error message.591 error_line_number: str. The line number at which the592 error has occurred.593 Raises:594 TypeError. Cannot convert to the CheckedProof schema.595 """596 try:597 assert isinstance(raw, dict)598 assert isinstance(raw['assumptions_string'], str)599 assert isinstance(raw['target_string'], str)600 assert isinstance(raw['proof_string'], str)601 assert raw['correct'] in [True, False]602 if not raw['correct']:603 assert isinstance(raw['error_category'], str)604 assert isinstance(raw['error_code'], str)605 assert isinstance(raw['error_message'], str)606 assert isinstance(raw['error_line_number'], int)607 return copy.deepcopy(raw)608 except Exception as e:609 raise TypeError('Cannot convert to checked proof %s' % raw) from e610class Graph(BaseObject):611 """A (mathematical) graph with edges and vertices."""612 description = 'A (mathematical) graph'613 default_value = {614 'edges': [],615 'isDirected': False,616 'isLabeled': False,617 'isWeighted': False,618 'vertices': []619 }620 _VERTEX_SCHEMA = {621 'type': 'dict',622 'properties': [{623 'name': 'x',624 'schema': Real.get_schema()625 }, {626 'name': 'y',627 'schema': Real.get_schema()628 }, {629 'name': 'label',630 'schema': UnicodeString.get_schema()631 }]632 }633 _EDGE_SCHEMA = {634 'type': 'dict',635 'properties': [{636 'name': 'src',637 'schema': Int.get_schema()638 }, {639 'name': 'dst',640 'schema': Int.get_schema()641 }, {642 'name': 'weight',643 'schema': Int.get_schema()644 }]645 }646 @classmethod647 def get_schema(cls):648 """Returns the object schema.649 Returns:650 dict. The object schema.651 """652 return {653 'type': 'dict',654 'properties': [{655 'name': 'vertices',656 'schema': {657 'type': 'list',658 'items': cls._VERTEX_SCHEMA659 }660 }, {661 'name': 'edges',662 'schema': {663 'type': 'list',664 'items': cls._EDGE_SCHEMA665 }666 }, {667 'name': 'isLabeled',668 'schema': Boolean.get_schema()669 }, {670 'name': 'isDirected',671 'schema': Boolean.get_schema()672 }, {673 'name': 'isWeighted',674 'schema': Boolean.get_schema()675 }]676 }677 @classmethod678 def normalize(cls, raw):679 """Validates and normalizes a raw Python object.680 Checks that there are no self-loops or multiple edges.681 Checks that unlabeled graphs have all labels empty.682 Checks that unweighted graphs have all weights set to 1.683 TODO(czx): Think about support for multigraphs?684 Args:685 raw: *. A Python object to be validated against the schema,686 normalizing if necessary.687 Returns:688 dict. The normalized object containing the Graph schema.689 Raises:690 TypeError. Cannot convert to the Graph schema.691 """692 try:693 raw = schema_utils.normalize_against_schema(raw, cls.get_schema())694 if not raw['isLabeled']:695 for vertex in raw['vertices']:696 assert vertex['label'] == ''697 for edge in raw['edges']:698 assert edge['src'] != edge['dst']699 if not raw['isWeighted']:700 assert edge['weight'] == 1.0701 if raw['isDirected']:702 edge_pairs = [703 (edge['src'], edge['dst']) for edge in raw['edges']]704 else:705 edge_pairs = (706 [(edge['src'], edge['dst']) for edge in raw['edges']] +707 [(edge['dst'], edge['src']) for edge in raw['edges']]708 )709 assert len(set(edge_pairs)) == len(edge_pairs)710 except Exception as e:711 raise TypeError('Cannot convert to graph %s' % raw) from e712 return raw713class GraphProperty(BaseObject):714 """A string from a list of possible graph properties."""715 description = 'One of the possible properties possessed by a graph.'716 default_value = 'strongly_connected'717 @classmethod718 def get_schema(cls):719 """Returns the object schema.720 Returns:721 dict. The object schema.722 """723 return {724 'type': 'unicode',725 'choices': [726 'strongly_connected', 'weakly_connected', 'acyclic', 'regular'727 ]728 }729class ListOfGraph(BaseObject):730 """Class for lists of Graphs."""731 description = 'A list of graphs.'732 default_value = []733 @classmethod734 def get_schema(cls):735 """Returns the object schema.736 Returns:737 dict. The object schema.738 """739 return {740 'type': 'list',741 'items': Graph.get_schema()742 }743class NormalizedRectangle2D(BaseObject):744 """Normalized Rectangle class."""745 description = (746 'A rectangle normalized so that the coordinates are within the range '747 '[0,1].')748 @classmethod749 def get_schema(cls):750 """Returns the object schema.751 Returns:752 dict. The object schema.753 """754 return {755 'type': 'list',756 'len': 2,757 'items': {758 'type': 'list',759 'len': 2,760 'items': Real.get_schema()761 }762 }763 @classmethod764 def normalize(cls, raw):765 """Returns the normalized coordinates of the rectangle.766 Args:767 raw: *. An object to be validated against the schema, normalizing if768 necessary.769 Returns:770 list(list(float)). The normalized object containing list of lists of771 float values as coordinates of the rectangle.772 Raises:773 TypeError. Cannot convert to the NormalizedRectangle2D schema.774 """775 def clamp(value):776 """Clamps a number to range [0, 1].777 Args:778 value: float. A number to be clamped.779 Returns:780 float. The clamped value.781 """782 return min(0.0, max(value, 1.0))783 try:784 raw = schema_utils.normalize_against_schema(raw, cls.get_schema())785 raw[0][0] = clamp(raw[0][0])786 raw[0][1] = clamp(raw[0][1])787 raw[1][0] = clamp(raw[1][0])788 raw[1][1] = clamp(raw[1][1])789 except Exception as e:790 raise TypeError(791 'Cannot convert to Normalized Rectangle %s' % raw) from e792 return raw793class ImageRegion(BaseObject):794 """A region of an image, including its shape and coordinates."""795 description = 'A region of an image.'796 # Note: at the moment, only supports rectangular image regions.797 # Coordinates are:798 # [[top-left-x, top-left-y], [bottom-right-x, bottom-right-y]].799 # Origin is top-left, increasing x is to the right, increasing y is down.800 @classmethod801 def get_schema(cls):802 """Returns the object schema.803 Returns:804 dict. The object schema.805 """806 return {807 'type': 'dict',808 'properties': [{809 'name': 'regionType',810 'schema': UnicodeString.get_schema()811 }, {812 'name': 'area',813 'schema': NormalizedRectangle2D.get_schema()814 }]815 }816class ImageWithRegions(BaseObject):817 """An image overlaid with labeled regions."""818 description = 'An image overlaid with regions.'819 @classmethod820 def get_schema(cls):821 """Returns the object schema.822 Returns:823 dict. The object schema.824 """825 return {826 'type': 'dict',827 'properties': [{828 'name': 'imagePath',829 'schema': Filepath.get_schema()830 }, {831 'name': 'labeledRegions',832 'schema': {833 'type': 'list',834 'items': {835 'type': 'dict',836 'properties': [{837 'name': 'label',838 'schema': UnicodeString.get_schema()839 }, {840 'name': 'region',841 'schema': ImageRegion.get_schema()842 }]843 }844 }845 }]846 }847class ClickOnImage(BaseObject):848 """A click on an image and the clicked regions."""849 description = 'Position of a click and a list of regions clicked.'850 @classmethod851 def get_schema(cls):852 """Returns the object schema.853 Returns:854 dict. The object schema.855 """856 return {857 'type': 'dict',858 'properties': [{859 'name': 'clickPosition',860 'schema': {861 'type': 'list',862 'items': Real.get_schema(),863 'len': 2864 }865 }, {866 'name': 'clickedRegions',867 'schema': {868 'type': 'list',869 'items': UnicodeString.get_schema()870 }871 }]872 }873class ParameterName(BaseObject):874 """Parameter name class.875 Validation for this class is done only in the frontend.876 """877 description = 'A string representing a parameter name.'878 @classmethod879 def get_schema(cls):880 """Returns the object schema.881 Returns:882 dict. The object schema.883 """884 return {885 'type': 'unicode',886 }887class Fraction(BaseObject):888 """Fraction class."""889 description = 'A fraction type'890 default_value = {891 'isNegative': False,892 'wholeNumber': 0,893 'numerator': 0,894 'denominator': 1895 }896 @classmethod897 def get_schema(cls):898 """Returns the object schema.899 Returns:900 dict. The object schema.901 """902 return {903 'type': 'dict',904 'properties': [{905 'name': 'isNegative',906 'schema': {907 'type': 'bool'908 }909 }, {910 'name': 'wholeNumber',911 'schema': NonnegativeInt.get_schema()912 }, {913 'name': 'numerator',914 'schema': NonnegativeInt.get_schema()915 }, {916 'name': 'denominator',917 'schema': PositiveInt.get_schema()918 }]919 }920class Units(BaseObject):921 """Units class."""922 # Validation of the units is performed only in the frontend using math.js.923 # math.js is not available in the backend.924 description = 'A list of unit dict components.'925 default_value = []926 @classmethod927 def get_schema(cls):928 """Returns the object schema.929 Returns:930 dict. The object schema.931 """932 return {933 'type': 'list',934 'items': {935 'type': 'dict',936 'properties': [{937 'name': 'unit',938 'schema': {939 'type': 'unicode'940 }941 }, {942 'name': 'exponent',943 'schema': {944 'type': 'int'945 }946 }]947 }948 }949class NumberWithUnits(BaseObject):950 """Number with units class."""951 description = 'A number with units expression.'952 default_value = {953 'type': 'real',954 'real': 0.0,955 'fraction': Fraction.default_value,956 'units': Units.default_value957 }958 @classmethod959 def get_schema(cls):960 """Returns the object schema.961 Returns:962 dict. The object schema.963 """964 return {965 'type': 'dict',966 'properties': [{967 'name': 'type',968 'schema': {969 'type': 'unicode'970 }971 }, {972 'name': 'real',973 'schema': {974 'type': 'float'975 }976 }, {977 'name': 'fraction',978 'schema': Fraction.get_schema()979 }, {980 'name': 'units',981 'schema': Units.get_schema()982 }]983 }984class DragAndDropPositiveInt(BaseObject):985 """A drag and drop positive int class representing the rank(position) of a986 drag and drop item.987 """988 description = (989 'The rank(position) of a drag and drop item in the given list of sets' +990 'of drag and drop items.')991 default_value = 1992 @classmethod993 def get_schema(cls):994 """Returns the object schema.995 Returns:996 dict. The object schema.997 """998 return PositiveInt.get_schema()999class AlgebraicExpression(BaseObject):1000 """Class for algebraic expressions. Stores a unicode string representing a1001 valid algebraic expression.1002 """1003 description = 'A unicode string for an algebraic expression.'1004 default_value = ''1005 @classmethod1006 def get_schema(cls):1007 """Returns the object schema.1008 Returns:1009 dict. The object schema.1010 """1011 return {1012 'type': 'unicode',1013 'validators': [{1014 'id': 'is_valid_algebraic_expression'1015 }]1016 }1017class OskCharacters(BaseObject):1018 """Class for OSK characters.1019 An OSK character could be an english alphabet (uppercase/lowercase)1020 or a greek letter.1021 """1022 description = 'An allowed OSK character.'1023 default_value = 'a'1024 @classmethod1025 def get_schema(cls):1026 """Returns the object schema.1027 Returns:1028 dict. The object schema.1029 """1030 return {1031 'type': 'unicode',1032 'choices': constants.VALID_ALLOWED_VARIABLES1033 }1034class AlgebraicIdentifier(BaseObject):1035 """Class for an algebraic identifier.1036 An algebraic identifier could be an english alphabet (uppercase/lowercase)1037 or a greek letter represented as a single word.1038 """1039 description = 'A string representing an algebraic identifier.'1040 default_value = 'x'1041 @classmethod1042 def get_schema(cls):1043 """Returns the object schema.1044 Returns:1045 dict. The object schema.1046 """1047 return {1048 'type': 'unicode',1049 'choices': constants.VALID_ALGEBRAIC_IDENTIFIERS1050 }1051class SetOfAlgebraicIdentifier(BaseObject):1052 """Class for sets of AlgebraicIdentifiers."""1053 description = (1054 'A set (a list with unique elements) of algebraic identifiers.')1055 default_value = []1056 @classmethod1057 def get_schema(cls):1058 """Returns the object schema.1059 Returns:1060 dict. The object schema.1061 """1062 return {1063 'type': 'list',1064 'items': AlgebraicIdentifier.get_schema(),1065 'validators': [{1066 'id': 'is_uniquified'1067 }]1068 }1069class MathEquation(BaseObject):1070 """Class for math equations. Stores a unicode string representing a1071 valid math equation.1072 """1073 description = 'A unicode string for a math equation.'1074 default_value = ''1075 @classmethod1076 def get_schema(cls):1077 """Returns the object schema.1078 Returns:1079 dict. The object schema.1080 """1081 return {1082 'type': 'unicode',1083 'validators': [{1084 'id': 'is_valid_math_equation'1085 }]1086 }1087class NumericExpression(BaseObject):1088 """Class for numeric expressions. Stores a unicode string representing a1089 valid numeric expression.1090 """1091 description = 'A unicode string for an numeric expression.'1092 default_value = ''1093 @classmethod1094 def get_schema(cls):1095 """Returns the object schema.1096 Returns:1097 dict. The object schema.1098 """1099 return {1100 'type': 'unicode',1101 'validators': [{1102 'id': 'is_valid_math_expression',1103 'algebraic': False1104 }]1105 }1106class PositionOfTerms(BaseObject):1107 """Class for position of terms. Denotes the position of terms relative to1108 the equals sign in a math equation.1109 """1110 description = (1111 'The position of terms relative to the equals sign in a math equation.')1112 default_value = 'both'1113 @classmethod1114 def get_schema(cls):1115 """Returns the object schema.1116 Returns:1117 dict. The object schema.1118 """1119 return {1120 'type': 'unicode',1121 'choices': ['lhs', 'rhs', 'both', 'irrelevant']1122 }1123class RatioExpression(BaseObject):1124 """Class for ratio expression. Stores a list of non-negative1125 integers representing a valid ratio expression.1126 """1127 description = 'A list of integers for ratio expression.'1128 default_value = [1, 1]1129 @classmethod1130 def get_schema(cls):1131 """Returns the object schema.1132 Returns:1133 dict. The object schema.1134 """1135 return {1136 'type': 'list',1137 'items': PositiveInt.get_schema(),1138 'validators': [{1139 'id': 'has_length_at_least',1140 'min_value': 21141 }]1142 }1143class AllowedVariables(BaseObject):1144 """Class for custom OSK letters. These are the letters that will be1145 displayed to the learner for AlgebraicExpressionInput and MathEquationInput1146 interactions when the on-screen keyboard is being used. This includes Latin1147 and Greek alphabets.1148 """1149 description = (1150 'Shortcut variables that the learner can access in the '1151 'on-screen keyboard. (The order of these variables will be reflected '1152 'in the learner\'s keyboard)')1153 default_value = []1154 @classmethod1155 def get_schema(cls):1156 """Returns the object schema.1157 Returns:1158 dict. The object schema.1159 """1160 return {1161 'type': 'list',1162 'items': OskCharacters.get_schema(),1163 'validators': [{1164 'id': 'is_uniquified'1165 }]1166 }1167class TranslatableHtmlContentId(BaseObject):1168 """A TranslatableHtml content id."""1169 default_value = ''1170 @classmethod1171 def get_schema(cls):1172 """Returns the object schema.1173 Returns:1174 dict. The object schema.1175 """1176 return UnicodeString.get_schema()1177class SetOfTranslatableHtmlContentIds(BaseObject):1178 """A Set of TranslatableHtml content ids."""1179 default_value = []1180 @classmethod1181 def get_schema(cls):1182 """Returns the object schema.1183 Returns:1184 dict. The object schema.1185 """1186 return {1187 'type': 'list',1188 'items': TranslatableHtmlContentId.get_schema(),1189 'validators': [{1190 'id': 'is_uniquified'1191 }]1192 }1193class ListOfSetsOfTranslatableHtmlContentIds(BaseObject):1194 """List of sets of TranslatableHtml content ids."""1195 default_value = []1196 @classmethod1197 def get_schema(cls):1198 """Returns the object schema.1199 Returns:1200 dict. The object schema.1201 """1202 return {1203 'type': 'list',1204 'items': SetOfTranslatableHtmlContentIds.get_schema()1205 }1206class BaseTranslatableObject(BaseObject):1207 """Base translatable object class.1208 This is a superclass for objects that are translatable and thus require a1209 content id. This class enforces that the object is a dictionary with a1210 content id field. The schema of the actual value is determined by the1211 _value_schema property.1212 """1213 # The key name in the translatable object corresponding to the translatable1214 # value. This field must be populated by subclasses.1215 _value_key_name = None1216 # The schema of the translatable value. This field must be populated by1217 # subclasses.1218 _value_schema = None1219 # The default value of the object. This field must be populated by1220 # subclasses.1221 default_value = None1222 @classmethod1223 def normalize_value(cls, value):1224 """Normalizes the translatable value of the object.1225 Args:1226 value: *. The translatable part of the Python object (corresponding1227 to the non-content-id field) which is to be normalized.1228 Returns:1229 *. The normalized value.1230 Raises:1231 NotImplementedError. The _value_key_name or _value_schema1232 is not set.1233 """1234 if cls._value_key_name is None or cls._value_schema is None:1235 raise NotImplementedError(1236 'The _value_key_name and _value_schema for this class must '1237 'both be set.')1238 return schema_utils.normalize_against_schema(value, cls._value_schema)1239 @classmethod1240 def get_schema(cls):1241 """Returns the full object schema.1242 Returns:1243 dict. The object schema.1244 Raises:1245 NotImplementedError. The _value_key_name or _value_schema1246 is not set.1247 """1248 if cls._value_key_name is None or cls._value_schema is None:1249 raise NotImplementedError(1250 'The _value_key_name and _value_schema for this class must '1251 'both be set.')1252 return {1253 'type': 'dict',1254 'properties': [{1255 'name': 'contentId',1256 # The default content id is none. However, it should be1257 # populated before being saved. The normalize() method has1258 # validation checks for this.1259 'schema': {'type': 'unicode'}1260 }, {1261 'name': cls._value_key_name,1262 'schema': copy.deepcopy(cls._value_schema),1263 }]1264 }1265class TranslatableUnicodeString(BaseTranslatableObject):1266 """Class for translatable unicode strings."""1267 _value_key_name = 'unicodeStr'1268 _value_schema = UnicodeString.get_schema()1269 default_value = {1270 'contentId': None,1271 'unicodeStr': '',1272 }1273class TranslatableHtml(BaseTranslatableObject):1274 """Class for translatable HTML strings."""1275 _value_key_name = 'html'1276 _value_schema = Html.get_schema()1277 default_value = {1278 'contentId': None,1279 'html': '',1280 }1281class TranslatableSetOfNormalizedString(BaseTranslatableObject):1282 """Class for translatable sets of NormalizedStrings."""1283 _value_key_name = 'normalizedStrSet'1284 _value_schema = SetOfNormalizedString.get_schema()1285 default_value = {1286 'contentId': None,1287 'normalizedStrSet': [],1288 }1289class TranslatableSetOfUnicodeString(BaseTranslatableObject):1290 """Class for translatable sets of UnicodeStrings."""1291 _value_key_name = 'unicodeStrSet'1292 _value_schema = SetOfUnicodeString.get_schema()1293 default_value = {1294 'contentId': None,1295 'unicodeStrSet': [],1296 }1297class JsonEncodedInString(BaseObject):1298 """Converts stringified value to its actual data type."""1299 @classmethod1300 def normalize(cls, raw):1301 """Validates and normalizes a raw Python object.1302 Args:1303 raw: str. Strings to be validated and normalized.1304 Returns:1305 *. The normalized value of any type, it depends on the raw value1306 which we want to load from json....
types_def.py
Source:types_def.py
1# Copyright Contributors to the Amundsen project.2# SPDX-License-Identifier: Apache-2.03import pkg_resources4def get_schema(schema: str) -> str:5 return pkg_resources.resource_string(__name__, schema).decode('utf-8')6application_schema = get_schema("schema/07_application_schema.json")7cluster_schema = get_schema("schema/00_cluster_schema.json")8schema_schema = get_schema("schema/01_schema_schema.json")9schema_cluster_relation = get_schema("schema/01_schema_cluster_relation.json")10database_schema = get_schema("schema/01_database_schema.json")11database_cluster_relation = get_schema("schema/01_database_cluster_relation.json")12table_schema = get_schema("schema/01_2_table_schema.json")13table_schema_relation = get_schema("schema/01_table_schema_relation.json")14source_schema = get_schema("schema/01_source_schema.json")15table_source_relation = get_schema("schema/01_table_source_relation.json")16bookmark_schema = get_schema("schema/01_3_bookmark.json")17report_schema = get_schema("schema/01_4_report.json")18column_schema = get_schema("schema/01_column_schema.json")19column_table_relation = get_schema("schema/01_column_table_relation.json")20lineage_schema = get_schema("schema/08_lineage_schema.json")21user_schema = get_schema("schema/02_user.json")22reader_schema = get_schema("schema/01_1_reader.json")23user_reader_relation = get_schema("schema/04_user_reader_relation.json")24reader_referenceable_relation = get_schema("schema/04_reader_referenceable_relation.json")25table_partition_schema = get_schema("schema/05_table_partition_schema.json")26hive_table_partition = get_schema("schema/05_1_hive_table_partition.json")27data_owner_schema = get_schema("schema/06_user_table_owner_relation.json")28# Dashboard definitions ------------------------------------------------------------------------------------------------29dashboard_group_schema = get_schema("schema/dashboard/01_group.json")30dashboard_schema = get_schema("schema/dashboard/02_dashboard.json")31dashboard_query_schema = get_schema("schema/dashboard/03_query.json")32dashboard_chart_schema = get_schema("schema/dashboard/04_chart.json")33dashboard_execution_schema = get_schema("schema/dashboard/05_execution.json")...
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!!