index int64 0 731k | package stringlengths 2 98 ⌀ | name stringlengths 1 76 | docstring stringlengths 0 281k ⌀ | code stringlengths 4 8.19k | signature stringlengths 2 42.8k ⌀ | embed_func_code listlengths 768 768 |
|---|---|---|---|---|---|---|
729,748 | minidir | write | null | def write(self, content: bytes) -> None:
pass
| (self, content: bytes) -> NoneType | [
-0.010260481387376785,
-0.03971155360341072,
-0.03374151885509491,
0.0555429607629776,
0.022483257576823235,
-0.01021890714764595,
-0.08101955056190491,
0.10589747875928879,
0.029334666207432747,
-0.05101970210671425,
0.06056511029601097,
0.0017772916471585631,
0.026707183569669724,
-0.000... |
729,749 | minidir | NameCollision | NameCollision is the error that try to create a file with invalid path. | class NameCollision(Exception):
"""NameCollision is the error that try to create a file with invalid path."""
pass
| null | [
-0.011248397640883923,
0.008205373771488667,
-0.007022695150226355,
0.052314113825559616,
-0.041436921805143356,
-0.0874319076538086,
-0.017299914732575417,
0.0682673305273056,
0.032027289271354675,
-0.03491060808300972,
0.0675421804189682,
0.009375103749334812,
0.028280699625611305,
-0.01... |
729,750 | minidir | NotFound | NotFound is the error that there is no file for some path. | class NotFound(Exception):
"""NotFound is the error that there is no file for some path."""
pass
| null | [
0.028416410088539124,
-0.02623053267598152,
0.0036165949422866106,
0.03261604905128479,
0.007870020344853401,
-0.05683282017707825,
0.022736569866538048,
0.040516190230846405,
0.033476632088422775,
-0.009423370473086834,
0.06660903245210648,
0.01109289936721325,
0.047745078802108765,
-0.04... |
729,751 | minidir | Path | Path is a interface that represent the path and name of some file. | class Path(typing.Protocol):
"""Path is a interface that represent the path and name of some file."""
def __hash__(self) -> int:
pass
def __eq__(self, other) -> bool:
pass
def __str__(self) -> str:
pass
def parent(self) -> str:
pass
def base(self) -> str:
... | (*args, **kwargs) | [
0.016606425866484642,
-0.023231422528624535,
-0.04871218279004097,
-0.006739221513271332,
-0.010227449238300323,
-0.03540946915745735,
-0.024935998022556305,
0.011914451606571674,
0.00818459503352642,
-0.007125826086848974,
0.07879704982042313,
-0.03389819711446762,
0.009603610262274742,
0... |
729,752 | minidir | __eq__ | null | def __eq__(self, other) -> bool:
pass
| (self, other) -> bool | [
0.02826537936925888,
-0.026954369619488716,
-0.003039358649402857,
0.0323207713663578,
-0.05726492404937744,
-0.06051623076200485,
-0.05464290454983711,
0.03873598203063011,
0.015129057690501213,
-0.0004126950807403773,
-0.00817196350544691,
-0.05030783265829086,
0.06866197288036346,
0.084... |
729,753 | minidir | __hash__ | null | def __hash__(self) -> int:
pass
| (self) -> int | [
0.01973026432096958,
-0.038706086575984955,
0.0023432765156030655,
0.06291379034519196,
-0.010816383175551891,
-0.044216785579919815,
-0.044840019196271896,
-0.001831773784942925,
-0.012276061810553074,
-0.03811565786600113,
-0.017253730446100235,
-0.020107485353946686,
0.025388570502400398,... |
729,755 | minidir | __str__ | null | def __str__(self) -> str:
pass
| (self) -> str | [
-0.01911344937980175,
-0.02867017313838005,
0.015382973477244377,
-0.011585432104766369,
0.00010884920629905537,
-0.0732346847653389,
0.022282257676124573,
0.020505042746663094,
0.09858515858650208,
-0.07095448672771454,
-0.04013824090361595,
-0.005268773064017296,
-0.009933963418006897,
0... |
729,757 | minidir | base | null | def base(self) -> str:
pass
| (self) -> str | [
-0.032789550721645355,
-0.036780331283807755,
0.04368682578206062,
0.06502527743577957,
0.0019475413719192147,
-0.0501372292637825,
-0.008624971844255924,
0.02037741057574749,
0.02927115000784397,
-0.08307337760925293,
0.02464510314166546,
0.05864003300666809,
0.01850418746471405,
0.054372... |
729,758 | minidir | parent | null | def parent(self) -> str:
pass
| (self) -> str | [
0.004633381497114897,
0.009716363623738289,
0.05345248803496361,
0.04016429930925369,
-0.02644316293299198,
-0.014711922965943813,
0.04609236493706703,
0.0785968080163002,
0.11083481460809708,
-0.027109237387776375,
-0.01512821950018406,
-0.07246892154216766,
0.009641430340707302,
0.015477... |
729,759 | minidir | SomePath | null | class SomePath:
_path: pathlib.PurePath
def __init__(self, path: str) -> None:
self._path = pathlib.PurePath(path)
self._path.__hash__
def __hash__(self) -> int:
return hash(self._path)
def __eq__(self, other) -> bool:
if not isinstance(other, SomePath):
re... | (path: str) -> None | [
0.06001768261194229,
-0.0076023004949092865,
-0.01555036660283804,
0.045968666672706604,
-0.011319284327328205,
-0.05510416626930237,
0.002884415676817298,
0.04105515033006668,
0.026387399062514305,
-0.007470363285392523,
0.07435786724090576,
0.02183784730732441,
0.028061633929610252,
0.03... |
729,760 | minidir | __eq__ | null | def __eq__(self, other) -> bool:
if not isinstance(other, SomePath):
return NotImplemented
return self._path == other._path
| (self, other) -> bool | [
0.04621302708983421,
-0.03454555571079254,
-0.007876422256231308,
0.065787672996521,
-0.05127361789345741,
-0.06817739456892014,
-0.008908746764063835,
0.03299926593899727,
0.014680982567369938,
0.02034778892993927,
0.06294108927249908,
-0.04326101765036583,
0.07025083154439926,
0.05665049... |
729,761 | minidir | __hash__ | null | def __hash__(self) -> int:
return hash(self._path)
| (self) -> int | [
0.042984552681446075,
-0.021903062239289284,
-0.000027567532015382312,
0.07256108522415161,
0.005935844965279102,
-0.04364180937409401,
-0.03238629922270775,
0.015371578745543957,
-0.033158574253320694,
-0.011584140360355377,
0.020194195210933685,
-0.0178773682564497,
0.021459413692355156,
... |
729,762 | minidir | __init__ | null | def __init__(self, path: str) -> None:
self._path = pathlib.PurePath(path)
self._path.__hash__
| (self, path: str) -> NoneType | [
0.03191598504781723,
0.004148476757109165,
-0.0005086234305053949,
0.05970712751150131,
-0.020177366212010384,
-0.0387391671538353,
-0.004045355599373579,
0.07362847775220871,
0.0001521305093774572,
0.008086414076387882,
0.06197579205036163,
0.07465969026088715,
-0.0010774008696898818,
0.0... |
729,763 | minidir | __str__ | null | def __str__(self) -> str:
return str(self._path)
| (self) -> str | [
0.0056920829229056835,
-0.00715778348967433,
0.004238873720169067,
0.019853584468364716,
0.034144166857004166,
-0.07221908122301102,
0.03161250427365303,
0.030962930992245674,
0.06585660576820374,
-0.03620947524905205,
0.015148351900279522,
-0.03267846629023552,
-0.0071286363527178764,
0.0... |
729,764 | minidir | base | null | def base(self) -> str:
return self._path.name
| (self) -> str | [
0.011178653687238693,
0.0013752850936725736,
0.035207297652959824,
0.06396440416574478,
0.005471745040267706,
-0.04689827188849449,
0.03826441988348961,
0.04763735830783844,
0.006101646926254034,
-0.03342677652835846,
0.019703321158885956,
0.008701040409505367,
0.006781940348446369,
0.0297... |
729,765 | minidir | parent | null | def parent(self) -> str:
return str(self._path.parent)
| (self) -> str | [
0.016968555748462677,
0.030346151441335678,
0.04892474040389061,
0.06561512500047684,
0.0006522315088659525,
-0.020551087334752083,
0.06322114914655685,
0.0664580687880516,
0.06733474135398865,
-0.004052475560456514,
-0.010705447755753994,
-0.09360101819038391,
-0.004551922902464867,
0.009... |
729,766 | minidir | SystemDirectory | SystemDirectory is a Directory implementation for real file system. | class SystemDirectory:
"""SystemDirectory is a Directory implementation for real file system."""
_root: str
_file_paths: typing.Set[str]
def __init__(self, root: str):
self._root = root
self._file_paths = set()
for dir_path, _, files in os.walk(root):
for file in fi... | (root: str) | [
0.03790740296244621,
-0.005838633980602026,
-0.07519305497407913,
0.03104870766401291,
0.03623644635081291,
-0.017321603372693062,
-0.014873458072543144,
0.0402972586452961,
-0.01567007787525654,
-0.029105735942721367,
0.06481757760047913,
0.00433525862172246,
-0.015077470801770687,
0.0044... |
729,767 | minidir | __init__ | null | def __init__(self, root: str):
self._root = root
self._file_paths = set()
for dir_path, _, files in os.walk(root):
for file in files:
self._file_paths.add(os.path.join(dir_path, file))
| (self, root: str) | [
-0.02581723779439926,
-0.016305120661854744,
-0.03734244778752327,
0.046482473611831665,
-0.02085605263710022,
0.036636434495449066,
0.01760266162455082,
0.018194187432527542,
0.011372559703886509,
0.04175027087330818,
0.027878036722540855,
-0.000977329327724874,
0.005214013159275055,
0.02... |
729,768 | minidir | __iter__ | null | def __iter__(self) -> typing.Iterator[Path]:
paths: typing.List[Path] = []
for file_path in self._file_paths:
relative = pathlib.PurePath(file_path).relative_to(self._root)
paths.append(SomePath(str(relative)))
return iter(paths)
| (self) -> Iterator[minidir.Path] | [
-0.012900847010314465,
-0.06607377529144287,
-0.08054415881633759,
0.0346829891204834,
-0.031237658113241196,
0.00874252524226904,
0.004318625200539827,
0.04609085991978645,
0.05324948951601982,
0.027620062232017517,
0.048579152673482895,
-0.009101413190364838,
-0.0035386409144848585,
0.06... |
729,769 | minidir | _ensure_folder | null | def _ensure_folder(self, path: Path) -> None:
path_object = pathlib.PurePath(os.path.join(self._root, str(path)))
os.makedirs(path_object.parent, exist_ok=True)
| (self, path: minidir.Path) -> NoneType | [
-0.02042831853032112,
0.07583756744861603,
-0.01465509831905365,
0.004199676215648651,
0.058893680572509766,
-0.021350666880607605,
0.0317014716565609,
0.05933777615427971,
-0.001344024552963674,
-0.007421492133289576,
0.07986857742071152,
0.04078831523656845,
0.05520428344607353,
-0.04758... |
729,770 | minidir | _to_full_path | null | def _to_full_path(self, path: Path) -> str:
return os.path.join(self._root, str(path))
| (self, path: minidir.Path) -> str | [
-0.011175030842423439,
0.017532799392938614,
0.024767205119132996,
0.05859018862247467,
0.001933076186105609,
-0.06928008794784546,
0.0324101448059082,
0.02638430893421173,
0.03482728824019432,
-0.01340493094176054,
0.058283787220716476,
-0.036869943141937256,
-0.006876942235976458,
0.0222... |
729,771 | minidir | create | null | def create(self, path: Path) -> File:
self._ensure_folder(path)
try:
with open(self._to_full_path(path), "xb") as _:
pass
except FileExistsError:
raise NameCollision()
if self._to_full_path(path) in self._file_paths:
raise NameCollision()
self._file_paths.add(self... | (self, path: minidir.Path) -> minidir.File | [
0.028920477256178856,
0.003484258893877268,
-0.03575819358229637,
0.023778658360242844,
0.006553564220666885,
-0.07649583369493484,
-0.012665112502872944,
0.06296472996473312,
-0.02125285193324089,
-0.004176600370556116,
0.10312504321336746,
0.0445263497531414,
-0.012863568030297756,
-0.02... |
729,772 | minidir | get | null | def get(self, path: Path) -> File:
if self._to_full_path(path) not in self._file_paths:
raise NotFound()
self._file_paths.add(self._to_full_path(path))
return _SystemFile(self._to_full_path(path))
| (self, path: minidir.Path) -> minidir.File | [
0.07975193858146667,
-0.027702732011675835,
-0.05174079164862633,
0.04727787896990776,
0.022822551429271698,
-0.059904661029577255,
0.032401490956544876,
0.04484685882925987,
0.01108472142368555,
0.011901107616722584,
0.08846006542444229,
0.014586114324629307,
-0.04731415957212448,
-0.0185... |
729,773 | minidir | remove | null | def remove(self, path: Path) -> None:
try:
os.remove(self._to_full_path(path))
except FileNotFoundError:
raise NotFound()
self._file_paths.remove(self._to_full_path(path))
| (self, path: minidir.Path) -> NoneType | [
0.05626419931650162,
0.024459639564156532,
-0.011263382621109486,
0.001237698132172227,
0.003061847761273384,
-0.040133487433195114,
-0.0182920154184103,
0.07351949065923691,
-0.00888682622462511,
0.0451941043138504,
0.04501838982105255,
0.03233170881867409,
0.03900890797376633,
-0.0377788... |
729,774 | minidir | _FakeDirectoryFile | null | class _FakeDirectoryFile:
_dir: typing.Dict[str, bytes]
_path: str
def __init__(self, dir: typing.Dict[str, bytes], path: str) -> None:
self._dir = dir
self._path = path
def read(self) -> bytes:
return self._dir[self._path]
def write(self, content: bytes) -> None:
... | (dir: Dict[str, bytes], path: str) -> None | [
-0.0012403978034853935,
0.000978071242570877,
-0.06661286950111389,
0.016029059886932373,
0.009624673053622246,
-0.00674812588840723,
-0.044287968426942825,
0.11346983164548874,
0.011270998977124691,
-0.02331993170082569,
0.060570310801267624,
0.05308043211698532,
-0.02245154045522213,
0.0... |
729,775 | minidir | __init__ | null | def __init__(self, dir: typing.Dict[str, bytes], path: str) -> None:
self._dir = dir
self._path = path
| (self, dir: Dict[str, bytes], path: str) -> NoneType | [
0.023702986538410187,
0.018606139346957207,
-0.03294432908296585,
-0.008831302635371685,
-0.018376870080828667,
-0.011595768854022026,
0.011860311031341553,
0.1048998236656189,
0.005828747991472483,
-0.004395810421556234,
0.04010460898280144,
0.08211392164230347,
-0.01732751913368702,
0.07... |
729,776 | minidir | read | null | def read(self) -> bytes:
return self._dir[self._path]
| (self) -> bytes | [
0.01700901985168457,
-0.009404591284692287,
-0.06029706075787544,
0.04640047252178192,
0.0610036663711071,
-0.032924484461545944,
0.004979891236871481,
0.02898767776787281,
0.039872776716947556,
-0.03418628126382828,
0.056528493762016296,
0.006910440046340227,
-0.0027065540198236704,
0.078... |
729,777 | minidir | write | null | def write(self, content: bytes) -> None:
self._dir[self._path] = content
| (self, content: bytes) -> NoneType | [
0.012054196558892727,
0.009049160405993462,
-0.04416466876864433,
0.037558697164058685,
0.046412061899900436,
-0.010870910249650478,
-0.054209835827350616,
0.10235852003097534,
-0.00950885470956564,
-0.0021016099490225315,
0.05318829044699669,
-0.018506938591599464,
0.03372791409492493,
0.... |
729,778 | minidir | _SystemFile | null | class _SystemFile:
_path: str
def __init__(self, path: str):
self._path = path
def read(self) -> bytes:
with open(self._path, "rb") as file_:
return file_.read()
def write(self, content: bytes) -> None:
with open(self._path, "wb") as file_:
file_.write(... | (path: str) | [
0.05929981917142868,
-0.057330451905727386,
-0.05784102901816368,
0.036323875188827515,
0.02893874980509281,
-0.05474109947681427,
-0.04861418157815933,
0.09730130434036255,
0.020751290023326874,
-0.03612329065799713,
0.07585708796977997,
0.014141147024929523,
-0.020915403962135315,
0.0061... |
729,780 | minidir | read | null | def read(self) -> bytes:
with open(self._path, "rb") as file_:
return file_.read()
| (self) -> bytes | [
0.024929791688919067,
-0.048999935388565063,
-0.04604274407029152,
0.07276060432195663,
0.028230838477611542,
-0.05175080895423889,
-0.0038727140054106712,
0.05126940459012985,
0.056014660745859146,
-0.029692240059375763,
0.06327009201049805,
0.016126995906233788,
0.0010439349571242929,
0.... |
729,781 | minidir | write | null | def write(self, content: bytes) -> None:
with open(self._path, "wb") as file_:
file_.write(content)
| (self, content: bytes) -> NoneType | [
0.029648950323462486,
-0.03702196851372719,
-0.03723113238811493,
0.07404393702745438,
0.016445493325591087,
-0.050269000232219696,
-0.07017441093921661,
0.11294838041067123,
0.021352125331759453,
-0.02300800383090973,
0.05243036150932312,
-0.007499388884752989,
0.02468131296336651,
-0.002... |
729,785 | yake.yake | KeywordExtractor | null | class KeywordExtractor(object):
def __init__(self, lan="en", n=3, dedupLim=0.9, dedupFunc='seqm', windowsSize=1, top=20, features=None, stopwords=None):
self.lan = lan
dir_path = os.path.dirname(os.path.realpath(__file__))
local_path = os.path.join("StopwordsList", "stopwords_%s.txt" % la... | (lan='en', n=3, dedupLim=0.9, dedupFunc='seqm', windowsSize=1, top=20, features=None, stopwords=None) | [
0.03786851465702057,
-0.029079779982566833,
-0.04791278764605522,
0.03225911408662796,
0.0006359936087392271,
-0.014418386854231358,
0.0011239051818847656,
0.009001366794109344,
0.03740275278687477,
0.00044361347681842744,
-0.05990110710263252,
0.05475746840238571,
-0.05058585852384567,
-0... |
729,786 | yake.yake | __init__ | null | def __init__(self, lan="en", n=3, dedupLim=0.9, dedupFunc='seqm', windowsSize=1, top=20, features=None, stopwords=None):
self.lan = lan
dir_path = os.path.dirname(os.path.realpath(__file__))
local_path = os.path.join("StopwordsList", "stopwords_%s.txt" % lan[:2].lower())
if os.path.exists(os.path.join(d... | (self, lan='en', n=3, dedupLim=0.9, dedupFunc='seqm', windowsSize=1, top=20, features=None, stopwords=None) | [
0.010115227662026882,
-0.009424271062016487,
-0.026528971269726753,
0.00603529391810298,
-0.030684111639857292,
-0.005659263115376234,
-0.017109399661421776,
0.019515996798872948,
-0.021678173914551735,
0.014044749550521374,
-0.0643012598156929,
0.07708630710840225,
-0.04486047104001045,
-... |
729,787 | yake.yake | extract_keywords | null | def extract_keywords(self, text):
try:
if not(len(text) > 0):
return []
text = text.replace('\n\t',' ')
dc = DataCore(text=text, stopword_set=self.stopword_set, windowsSize=self.windowsSize, n=self.n)
dc.build_single_terms_features(features=self.features)
dc.build... | (self, text) | [
0.0178636834025383,
-0.0034760877024382353,
-0.02138412557542324,
0.007694550324231386,
0.00934271514415741,
0.00605105422437191,
0.0229902695864439,
-0.022075140848755836,
0.09397809952497482,
-0.021682944148778915,
-0.038435399532318115,
0.04542025551199913,
-0.08620884269475937,
-0.0556... |
729,788 | yake.yake | jaro | null | def jaro(self, cand1, cand2):
return jellyfish.jaro_winkler(cand1, cand2 )
| (self, cand1, cand2) | [
0.04291708022356033,
-0.0471578948199749,
0.05916789174079895,
0.031534723937511444,
-0.04491874575614929,
-0.08060947060585022,
-0.05068625882267952,
0.08983749151229858,
0.018286406993865967,
0.02602165937423706,
0.00554274907335639,
0.07518122345209122,
-0.01962650567293167,
0.061440970... |
729,789 | yake.yake | levs | null | def levs(self, cand1, cand2):
return 1.-jellyfish.levenshtein_distance(cand1, cand2 ) / max(len(cand1),len(cand2))
| (self, cand1, cand2) | [
0.01780187524855137,
-0.023355379700660706,
0.08272335678339005,
0.03344026952981949,
0.0013787936186417937,
-0.0281422957777977,
0.0012776466319337487,
0.019437262788414955,
0.0242752842605114,
0.05151471123099327,
-0.02941994182765484,
0.01678827591240406,
-0.02062973380088806,
0.0359444... |
729,790 | yake.yake | seqm | null | def seqm(self, cand1, cand2):
return Levenshtein.ratio(cand1, cand2)
| (self, cand1, cand2) | [
0.026118170469999313,
-0.005916224792599678,
0.0716288760304451,
0.03638186305761337,
0.001970336539670825,
-0.029205622151494026,
0.012441595084965229,
0.012992329895496368,
0.02865488827228546,
0.053337812423706055,
-0.030390536412596703,
0.04796397686004639,
0.020477313548326492,
0.0976... |
729,794 | touca._client | Client | class Client:
""" """
@classmethod
def instance(cls):
if not hasattr(cls, "_instance"):
cls._instance = cls()
return cls._instance
def __init__(self) -> None:
self._cases: Dict[str, Case] = dict()
self._configured = False
self._configuration_error = ... | () -> None | [
-0.005366245284676552,
0.008952195756137371,
-0.05124814808368683,
-0.025340039283037186,
0.005411893595010042,
-0.02495456114411354,
-0.059931524097919464,
-0.011777335777878761,
-0.031142480671405792,
-0.05530580133199692,
-0.005356100853532553,
0.020115811377763748,
-0.012396127916872501,... | |
729,795 | touca._client | __init__ | null | def __init__(self) -> None:
self._cases: Dict[str, Case] = dict()
self._configured = False
self._configuration_error = str()
self._options: Dict[str, Any] = dict()
self._threads_case = str()
self._threads_cases: Dict[int, str] = dict()
self._transport = Transport()
self._type_handler = T... | (self) -> NoneType | [
0.01509022992104292,
0.012412481009960175,
-0.007396351080387831,
-0.028172148391604424,
-0.042843982577323914,
-0.033304501324892044,
-0.02508530020713806,
0.004400155041366816,
-0.026461364701390266,
-0.037730224430561066,
-0.02058519423007965,
0.0936468243598938,
-0.053554974496364594,
... |
729,796 | touca._client | _active_testcase_name | null | def _active_testcase_name(self) -> Optional[str]:
if not self._configured:
return None
if self._options.get("concurrency"):
return self._threads_case
return self._threads_cases.get(get_ident())
| (self) -> Optional[str] | [
0.046822212636470795,
0.01330559328198433,
-0.0011926611186936498,
0.006126467604190111,
0.0037706198636442423,
-0.03691881150007248,
0.03590825945138931,
-0.00011671341781038791,
0.014341408386826515,
-0.07976619154214859,
-0.010711845010519028,
0.039748355746269226,
-0.05355922132730484,
... |
729,797 | touca._client | _post | null | def _post(self, path: str, body, headers: Dict[str, str] = {}):
response = self._transport.request(
method="POST",
path=path,
body=body,
content_type="application/octet-stream",
extra_headers=headers,
)
if response.status == 204:
return
if response.status ... | (self, path: str, body, headers: Dict[str, str] = {}) | [
0.011839545331895351,
0.0011945596197620034,
-0.1233905553817749,
0.02160097286105156,
-0.08236205577850342,
-0.08937808126211166,
-0.03162931650876999,
0.03410780429840088,
-0.0019208280136808753,
0.009361057542264462,
0.03586180880665779,
-0.005714820697903633,
-0.026824863627552986,
-0.... |
729,798 | touca._client | _prepare_save | null | def _prepare_save(self, path: str, cases) -> List[Case]:
from pathlib import Path
Path(path).parent.mkdir(parents=True, exist_ok=True)
if cases:
return [self._cases[x] for x in self._cases if x in cases]
return list(self._cases.values())
| (self, path: str, cases) -> List[touca._case.Case] | [
-0.01267384085804224,
0.08707840740680695,
-0.05944571644067764,
0.0022650836035609245,
-0.009848575107753277,
-0.016101356595754623,
0.044991690665483475,
0.014152898453176022,
0.07234097272157669,
-0.003354449523612857,
0.006598190870136023,
0.08006395399570465,
-0.02958115190267563,
-0.... |
729,799 | touca._client | add_array_element | Adds a given value to a list of results for the declared
test case which is associated with the specified key.
Could be considered as a helper utility function.
This method is particularly helpful to log a list of items as they
are found:
.. code-block:: python
for number in numbers:
if is_prime(number):... | def casemethod(func):
""" """
import inspect
from functools import wraps
func.__doc__ = inspect.getdoc(getattr(Case, func.__name__))
@wraps(func)
def wrapper(self, *args, **kwargs):
element = self._active_testcase_name()
if not element:
return
testcase = sel... | (self, key: str, value: Any) | [
0.03547179698944092,
-0.012696382589638233,
0.0619647353887558,
0.0016147741116583347,
-0.03213577717542648,
-0.06860128045082092,
0.020193548873066902,
-0.005039514508098364,
0.004560405854135752,
-0.008881257846951485,
-0.06931107491254807,
0.01815290004014969,
0.025126595050096512,
-0.0... |
729,800 | touca._client | add_hit_count | Increments value of key every time it is executed.
creates the key with initial value of one if it does not exist.
Could be considered as a helper utility function.
This method is particularly helpful to track variables whose values
are determined in loops with indeterminate execution cycles:
.. code-block:: python
... | def casemethod(func):
""" """
import inspect
from functools import wraps
func.__doc__ = inspect.getdoc(getattr(Case, func.__name__))
@wraps(func)
def wrapper(self, *args, **kwargs):
element = self._active_testcase_name()
if not element:
return
testcase = sel... | (self, key: str) | [
0.03547179698944092,
-0.012696382589638233,
0.0619647353887558,
0.0016147741116583347,
-0.03213577717542648,
-0.06860128045082092,
0.020193548873066902,
-0.005039514508098364,
0.004560405854135752,
-0.008881257846951485,
-0.06931107491254807,
0.01815290004014969,
0.025126595050096512,
-0.0... |
729,801 | touca._client | add_metric | Adds an already obtained measurements to the list of captured
performance benchmarks.
Useful for logging a metric that is measured without using this SDK.
:param key: name to be associated with this performance benchmark
:param milliseconds: duration of this measurement in milliseconds | def casemethod(func):
""" """
import inspect
from functools import wraps
func.__doc__ = inspect.getdoc(getattr(Case, func.__name__))
@wraps(func)
def wrapper(self, *args, **kwargs):
element = self._active_testcase_name()
if not element:
return
testcase = sel... | (self, key: str, milliseconds: int) | [
0.03547179698944092,
-0.012696382589638233,
0.0619647353887558,
0.0016147741116583347,
-0.03213577717542648,
-0.06860128045082092,
0.020193548873066902,
-0.005039514508098364,
0.004560405854135752,
-0.008881257846951485,
-0.06931107491254807,
0.01815290004014969,
0.025126595050096512,
-0.0... |
729,802 | touca._client | add_serializer |
Registers custom serialization logic for a given custom data type.
Calling this function is rarely needed. The library already handles
all custom data types by serializing all their properties. Custom
serializers allow you to exclude a subset of an object properties
during seri... | def add_serializer(self, datatype: Type, serializer: Callable[[Any], Dict]):
"""
Registers custom serialization logic for a given custom data type.
Calling this function is rarely needed. The library already handles
all custom data types by serializing all their properties. Custom
serializers allow ... | (self, datatype: Type, serializer: Callable[[Any], Dict]) | [
-0.000029163367798901163,
0.006563758477568626,
0.05686173215508461,
0.04297267273068428,
0.041630908846855164,
0.01983633078634739,
-0.04674411565065384,
-0.00024010641209315509,
-0.0350852832198143,
-0.0476144477725029,
0.017723960801959038,
0.02003578282892704,
-0.0050134784542024136,
-... |
729,803 | touca._client | assume | Logs a given value as an assertion for the declared test case
and associates it with the specified key.
:param key: name to be associated with the logged test result
:param value: value to be logged as a test result | def casemethod(func):
""" """
import inspect
from functools import wraps
func.__doc__ = inspect.getdoc(getattr(Case, func.__name__))
@wraps(func)
def wrapper(self, *args, **kwargs):
element = self._active_testcase_name()
if not element:
return
testcase = sel... | (self, key: str, value: Any) | [
0.03547179698944092,
-0.012696382589638233,
0.0619647353887558,
0.0016147741116583347,
-0.03213577717542648,
-0.06860128045082092,
0.020193548873066902,
-0.005039514508098364,
0.004560405854135752,
-0.008881257846951485,
-0.06931107491254807,
0.01815290004014969,
0.025126595050096512,
-0.0... |
729,804 | touca._client | check | Captures the value of a given variable as a data point for the declared
test case and associates it with the specified key.
:param key: name to be associated with the captured data point
:param value: value to be captured as a test result
:param rule: comparison rule for this test result | def casemethod(func):
""" """
import inspect
from functools import wraps
func.__doc__ = inspect.getdoc(getattr(Case, func.__name__))
@wraps(func)
def wrapper(self, *args, **kwargs):
element = self._active_testcase_name()
if not element:
return
testcase = sel... | (self, key: str, value: Any, *, rule: Optional[touca._rules.ComparisonRule] = None) | [
0.03547179698944092,
-0.012696382589638233,
0.0619647353887558,
0.0016147741116583347,
-0.03213577717542648,
-0.06860128045082092,
0.020193548873066902,
-0.005039514508098364,
0.004560405854135752,
-0.008881257846951485,
-0.06931107491254807,
0.01815290004014969,
0.025126595050096512,
-0.0... |
729,805 | touca._client | check_file | Captures an external file as a data point for the declared test case
and associates it with the specified key.
:param key: name to be associated with captured file
:param path: path to the external file to be captured | def casemethod(func):
""" """
import inspect
from functools import wraps
func.__doc__ = inspect.getdoc(getattr(Case, func.__name__))
@wraps(func)
def wrapper(self, *args, **kwargs):
element = self._active_testcase_name()
if not element:
return
testcase = sel... | (self, key: str, file) | [
0.03547179698944092,
-0.012696382589638233,
0.0619647353887558,
0.0016147741116583347,
-0.03213577717542648,
-0.06860128045082092,
0.020193548873066902,
-0.005039514508098364,
0.004560405854135752,
-0.008881257846951485,
-0.06931107491254807,
0.01815290004014969,
0.025126595050096512,
-0.0... |
729,806 | touca._client | configuration_error |
Provides the most recent error, if any, that is encountered during
client configuration.
:return: short description of the most recent configuration error
:rtype: str
| def configuration_error(self) -> str:
"""
Provides the most recent error, if any, that is encountered during
client configuration.
:return: short description of the most recent configuration error
:rtype: str
"""
return self._configuration_error
| (self) -> str | [
0.00030967252678237855,
-0.04286188259720802,
0.06227795034646988,
-0.01205261517316103,
0.035883091390132904,
-0.04220246896147728,
-0.020936381071805954,
-0.0061728437431156635,
0.06480570137500763,
-0.07356125116348267,
-0.010339971631765366,
-0.02791517600417137,
0.002685736631974578,
... |
729,807 | touca._client | configure |
Configures the Touca client. Must be called before declaring test cases
and adding results to the client. Should be regarded as a potentially
expensive operation. Should be called only from your test environment.
:py:meth:`~configure` takes a variety of configuration parameters
... | def configure(self, **kwargs) -> bool:
"""
Configures the Touca client. Must be called before declaring test cases
and adding results to the client. Should be regarded as a potentially
expensive operation. Should be called only from your test environment.
:py:meth:`~configure` takes a variety of con... | (self, **kwargs) -> bool | [
-0.03958286717534065,
0.0007182375411503017,
0.00662616454064846,
-0.017537571489810944,
-0.010360032320022583,
-0.0014546123566105962,
-0.05498265475034714,
0.017237700521945953,
-0.0221903957426548,
-0.030412644147872925,
0.006853485479950905,
-0.0031607288401573896,
0.0026843221858143806,... |
729,808 | touca._client | declare_testcase |
Declares name of the test case to which all subsequent results will be
submitted until a new test case is declared.
If configuration parameter ``concurrency`` is set to ``"enabled"``, when
a thread calls `declare_testcase` all other threads also have their most
recent testcase ... | def declare_testcase(self, name: str):
"""
Declares name of the test case to which all subsequent results will be
submitted until a new test case is declared.
If configuration parameter ``concurrency`` is set to ``"enabled"``, when
a thread calls `declare_testcase` all other threads also have their ... | (self, name: str) | [
-0.010000732727348804,
0.04196314886212349,
-0.06341663002967834,
-0.017433220520615578,
-0.03488459065556526,
0.00783179048448801,
-0.009583279490470886,
-0.03052855283021927,
-0.014238793402910233,
-0.04591988027095795,
-0.008330918848514557,
0.048424601554870605,
-0.06051260232925415,
0... |
729,809 | touca._client | forget_testcase |
Removes all logged information associated with a given test case.
This information is removed from memory, such that switching back to
an already-declared or already-submitted test case would behave similar
to when that test case was first declared. This information is removed,
... | def forget_testcase(self, name: str):
"""
Removes all logged information associated with a given test case.
This information is removed from memory, such that switching back to
an already-declared or already-submitted test case would behave similar
to when that test case was first declared. This inf... | (self, name: str) | [
-0.025474952533841133,
0.04223385825753212,
0.014473600313067436,
0.0045706103555858135,
-0.01795470528304577,
-0.039115920662879944,
-0.08078288286924362,
0.01943395286798477,
0.038088422268629074,
-0.03226000815629959,
-0.016652612015604973,
0.0626421645283699,
-0.029071208089590073,
0.0... |
729,810 | touca._client | is_configured |
Checks if previous call(s) to :py:meth:`~configure` have set the right
combination of configuration parameters to enable the client to perform
expected tasks.
We recommend that you perform this check after client configuration and
before calling other functions of the library::... | def is_configured(self) -> bool:
"""
Checks if previous call(s) to :py:meth:`~configure` have set the right
combination of configuration parameters to enable the client to perform
expected tasks.
We recommend that you perform this check after client configuration and
before calling other functio... | (self) -> bool | [
0.008357170969247818,
-0.021598106250166893,
0.01990019902586937,
0.00021708790154661983,
0.018266191706061363,
0.019845427945256233,
-0.026856141164898872,
-0.01578323170542717,
-0.024701807647943497,
-0.0013567280257120728,
0.004041657317429781,
-0.034250251948833466,
0.02342381328344345,
... |
729,811 | touca._client | post |
Submits all test results recorded so far to Touca server.
It is possible to call :py:meth:`~post` multiple times during runtime
of the regression test tool. Test cases already submitted to the server
whose test results have not changed, will not be resubmitted.
It is also possi... | def post(self, *, submit_async=False):
"""
Submits all test results recorded so far to Touca server.
It is possible to call :py:meth:`~post` multiple times during runtime
of the regression test tool. Test cases already submitted to the server
whose test results have not changed, will not be resubmit... | (self, *, submit_async=False) | [
-0.017069818452000618,
-0.008457235991954803,
-0.08531253784894943,
0.044118352234363556,
-0.030265117064118385,
-0.04711562395095825,
-0.07463933527469635,
-0.042656268924474716,
0.029150279238820076,
-0.03889140859246254,
0.008950688876211643,
0.03823347017168999,
0.001939544454216957,
-... |
729,812 | touca._client | save_binary |
Stores test results and performance benchmarks in binary format
in a file of specified path.
Touca binary files can be submitted at a later time to the Touca
server.
We do not recommend as a general practice for regression test tools
to locally store their test results... | def save_binary(self, path: str, cases: list):
"""
Stores test results and performance benchmarks in binary format
in a file of specified path.
Touca binary files can be submitted at a later time to the Touca
server.
We do not recommend as a general practice for regression test tools
to loca... | (self, path: str, cases: list) | [
-0.02569066733121872,
0.04488809034228325,
-0.041465017944574356,
0.04982860013842583,
0.0024040888529270887,
-0.07354306429624557,
-0.10890302062034607,
0.02540835179388523,
0.0016354421386495233,
-0.04513511434197426,
0.031883951276540756,
0.0726255401968956,
-0.017097704112529755,
-0.01... |
729,813 | touca._client | save_json |
Stores test results and performance benchmarks in JSON format
in a file of specified path.
This feature may be helpful during development of regression tests
tools for quick inspection of the test results and performance metrics
being captured.
:param path: path to fil... | def save_json(self, path: str, cases: list):
"""
Stores test results and performance benchmarks in JSON format
in a file of specified path.
This feature may be helpful during development of regression tests
tools for quick inspection of the test results and performance metrics
being captured.
... | (self, path: str, cases: list) | [
-0.03025449626147747,
0.026431221514940262,
-0.0594964362680912,
0.02555832825601101,
0.025191713124513626,
-0.00142281677108258,
-0.0759766697883606,
0.013442562893033028,
0.0031184128019958735,
0.002343719592317939,
0.03351911902427673,
0.04472707584500313,
-0.028421418741345406,
-0.0083... |
729,814 | touca._client | seal |
Notifies the Touca server that all test cases were executed for this
version and no further test result is expected to be submitted.
Expected to be called by the test tool once all test cases are executed
and all test results are posted.
Sealing the version is optional. The Tou... | def seal(self):
"""
Notifies the Touca server that all test cases were executed for this
version and no further test result is expected to be submitted.
Expected to be called by the test tool once all test cases are executed
and all test results are posted.
Sealing the version is optional. The T... | (self) | [
-0.014263929799199104,
0.0034776257816702127,
-0.04958845302462578,
0.02914408966898918,
0.027349770069122314,
-0.041178714483976364,
-0.08206743746995926,
-0.04233867675065994,
-0.020915597677230835,
0.06307303160429001,
-0.05140089616179466,
-0.017861628904938698,
-0.01733602024614811,
-... |
729,815 | touca._client | start_timer | Starts timing an event with the specified name.
Measurement of the event is only complete when function
:py:meth:`~stop_timer` is later called for the specified name.
:param key: name to be associated with the performance metric | def casemethod(func):
""" """
import inspect
from functools import wraps
func.__doc__ = inspect.getdoc(getattr(Case, func.__name__))
@wraps(func)
def wrapper(self, *args, **kwargs):
element = self._active_testcase_name()
if not element:
return
testcase = sel... | (self, key: str) | [
0.03547179698944092,
-0.012696382589638233,
0.0619647353887558,
0.0016147741116583347,
-0.03213577717542648,
-0.06860128045082092,
0.020193548873066902,
-0.005039514508098364,
0.004560405854135752,
-0.008881257846951485,
-0.06931107491254807,
0.01815290004014969,
0.025126595050096512,
-0.0... |
729,816 | touca._client | stop_timer | Stops timing an event with the specified name.
Expects function :py:meth:`~start_timer` to have been called previously
with the specified name.
:param key: name to be associated with the performance metric | def casemethod(func):
""" """
import inspect
from functools import wraps
func.__doc__ = inspect.getdoc(getattr(Case, func.__name__))
@wraps(func)
def wrapper(self, *args, **kwargs):
element = self._active_testcase_name()
if not element:
return
testcase = sel... | (self, key: str) | [
0.03547179698944092,
-0.012696382589638233,
0.0619647353887558,
0.0016147741116583347,
-0.03213577717542648,
-0.06860128045082092,
0.020193548873066902,
-0.005039514508098364,
0.004560405854135752,
-0.008881257846951485,
-0.06931107491254807,
0.01815290004014969,
0.025126595050096512,
-0.0... |
729,817 | touca._rules | ComparisonRule | null | class ComparisonRule(ABC):
@abstractmethod
def json(self):
pass
@abstractmethod
def serialize(self, builder: Builder):
pass
| () | [
-0.018464013934135437,
-0.05211950093507767,
-0.03484393656253815,
0.004228465724736452,
-0.046263378113508224,
-0.04054504632949829,
-0.045884452760219574,
0.003401719033718109,
-0.006394370459020138,
-0.02893614023923874,
0.07371826469898224,
0.03189865127205849,
0.012435651384294033,
0.... |
729,818 | touca._rules | json | null | @abstractmethod
def json(self):
pass
| (self) | [
-0.03788404539227486,
-0.06749531626701355,
-0.004440049175173044,
-0.005749084055423737,
-0.024506445974111557,
-0.031055724248290062,
-0.0550861582159996,
0.04687904193997383,
0.062111448496580124,
-0.018301866948604584,
0.06690440326929092,
0.01549503393471241,
0.0012956983409821987,
0.... |
729,819 | touca._rules | serialize | null | @abstractmethod
def serialize(self, builder: Builder):
pass
| (self, builder: flatbuffers.builder.Builder) | [
-0.016096187755465508,
-0.03848087787628174,
-0.040696341544389725,
0.026142457500100136,
-0.057806529104709625,
-0.03936706483364105,
-0.043423064053058624,
0.014434590004384518,
0.011656741611659527,
-0.020280003547668457,
0.031408440321683884,
0.010335984639823437,
-0.013088271021842957,
... |
729,820 | touca._runner | Workflow | null | class Workflow:
def __init__(self, func):
from functools import update_wrapper
update_wrapper(self, func)
_workflows.append({"callback": func, "suite": func.__name__})
| (func) | [
0.02375483512878418,
-0.00294097070582211,
-0.02162388525903225,
0.04936114698648453,
-0.033117033541202545,
0.01839252933859825,
-0.039754413068294525,
0.0554046593606472,
0.023912034928798676,
0.0223749577999115,
0.006135209929198027,
0.0149777727201581,
0.009921136312186718,
-0.01820039... |
729,821 | touca._runner | __init__ | null | def __init__(self, func):
from functools import update_wrapper
update_wrapper(self, func)
_workflows.append({"callback": func, "suite": func.__name__})
| (self, func) | [
0.010470878332853317,
-0.006593248341232538,
-0.01646396704018116,
0.05138392001390457,
-0.030799705535173416,
0.01579144597053528,
-0.03800162672996521,
0.055878736078739166,
0.018541116267442703,
0.017434438690543175,
-0.004203248769044876,
0.02465338446199894,
0.011134885251522064,
-0.0... |
729,831 | touca | add_array_element | Adds a given value to a list of results for the declared
test case which is associated with the specified key.
Could be considered as a helper utility function.
This method is particularly helpful to log a list of items as they
are found:
.. code-block:: python
for number in numbers:
if is_prime(number):... | @clientmethod
def add_array_element(key: str, value: Any):
Client.instance().add_array_element(key, value)
| (key: str, value: Any) | [
-0.01575785130262375,
-0.04467536136507988,
-0.0998784527182579,
0.012864412739872932,
-0.02017814666032791,
-0.008865900337696075,
-0.050310395658016205,
0.025661339983344078,
0.03974892571568489,
-0.017107559368014336,
-0.017951127141714096,
-0.013530830852687359,
0.014391270466148853,
-... |
729,832 | touca | add_hit_count | Increments value of key every time it is executed.
creates the key with initial value of one if it does not exist.
Could be considered as a helper utility function.
This method is particularly helpful to track variables whose values
are determined in loops with indeterminate execution cycles:
.. code-block:: python
... | @clientmethod
def add_hit_count(key: str):
Client.instance().add_hit_count(key)
| (key: str) | [
-0.031446244567632675,
-0.08922114968299866,
-0.09366536885499954,
0.0611080676317215,
0.0025398568250238895,
0.006594789680093527,
-0.031126396730542183,
0.034089211374521255,
0.02585729956626892,
-0.022995488718152046,
-0.024948252364993095,
-0.0036488082259893417,
0.0021947561763226986,
... |
729,833 | touca | add_metric | Adds an already obtained measurements to the list of captured
performance benchmarks.
Useful for logging a metric that is measured without using this SDK.
:param key: name to be associated with this performance benchmark
:param milliseconds: duration of this measurement in milliseconds | @clientmethod
def add_metric(key: str, milliseconds: int):
Client.instance().add_metric(key, milliseconds)
| (key: str, milliseconds: int) | [
-0.004162910860031843,
-0.04575064033269882,
-0.032293595373630524,
0.08017948269844055,
0.02446434274315834,
-0.029198309406638145,
-0.0373089499771595,
0.06826180964708328,
-0.010378310456871986,
-0.008723077364265919,
-0.023587070405483246,
0.02532506361603737,
0.03684548661112785,
-0.0... |
729,834 | touca | add_serializer | Registers custom serialization logic for a given custom data type.
Calling this function is rarely needed. The library already handles
all custom data types by serializing all their properties. Custom
serializers allow you to exclude a subset of an object properties
during serialization.
:param datattype: type to be ... | @clientmethod
def add_serializer(datatype: Type, serializer: Callable[[Any], Dict]):
Client.instance().add_serializer(datatype, serializer)
| (datatype: Type, serializer: Callable[[Any], Dict]) | [
-0.0313638336956501,
-0.016549279913306236,
0.0026562982238829136,
0.011561945080757141,
0.005256217904388905,
0.02709641121327877,
-0.020747315138578415,
0.03389653563499451,
-0.016852857545018196,
-0.038476210087537766,
0.02824132889509201,
0.021510595455765724,
-0.012316550128161907,
-0... |
729,835 | touca | assume | Logs a given value as an assertion for the declared test case
and associates it with the specified key.
:param key: name to be associated with the logged test result
:param value: value to be logged as a test result | @clientmethod
def assume(key: str, value: Any):
Client.instance().assume(key, value)
| (key: str, value: Any) | [
0.05364972725510597,
-0.060734283179044724,
-0.032096706330776215,
-0.015441342256963253,
0.006893307901918888,
-0.05002429708838463,
-0.010294228792190552,
0.007787193171679974,
0.06998080015182495,
-0.029568882659077644,
-0.01585710234940052,
0.03731865808367729,
-0.004089003894478083,
-... |
729,836 | touca | check | Captures the value of a given variable as a data point for the declared
test case and associates it with the specified key.
:param key: name to be associated with the captured data point
:param value: value to be captured as a test result
:param rule: comparison rule for this test result | @clientmethod
def check(key: str, value: Any, *, rule: Optional[ComparisonRule] = None):
Client.instance().check(key, value, rule=rule)
| (key: str, value: Any, *, rule: Optional[touca._rules.ComparisonRule] = None) | [
0.05087975040078163,
-0.05692452937364578,
-0.0585479810833931,
0.012901281006634235,
-0.028427721932530403,
-0.03414435312151909,
0.0062606618739664555,
-0.008367698639631271,
0.04728742688894272,
-0.08372879773378372,
0.00032760531757958233,
0.05091429129242897,
0.06241663917899132,
-0.0... |
729,837 | touca | check_file | Captures an external file as a data point for the declared test case
and associates it with the specified key.
:param key: name to be associated with captured file
:param path: path to the external file to be captured | @clientmethod
def check_file(key: str, value: Any):
Client.instance().check_file(key, value)
| (key: str, value: Any) | [
0.05795224383473396,
-0.07974009215831757,
-0.06388814747333527,
0.04831068962812424,
-0.007891661487519741,
-0.044810909777879715,
0.014007698744535446,
0.04391881078481674,
0.03309350833296776,
-0.025219004601240158,
0.0267458688467741,
0.025544963777065277,
0.009075410664081573,
-0.0412... |
729,838 | touca | clientmethod | null | def clientmethod(f):
import inspect
f.__doc__ = inspect.getdoc(getattr(Client, f.__name__))
return f
| (f) | [
0.02209305204451084,
-0.06328966468572617,
0.026012198999524117,
-0.0012213155860081315,
-0.020033221691846848,
-0.02878294512629509,
0.05475868657231331,
0.03543638065457344,
0.04024872928857803,
0.008180079981684685,
-0.045061077922582626,
0.002008562907576561,
-0.025993971154093742,
-0.... |
729,839 | touca | configuration_error | Provides the most recent error, if any, that is encountered during
client configuration.
:return: short description of the most recent configuration error
:rtype: str | @clientmethod
def configuration_error() -> str:
return Client.instance().configuration_error()
| () -> str | [
0.01555655337870121,
-0.08173515647649765,
0.036993708461523056,
-0.01190953142940998,
0.012659875676035881,
-0.06781017035245895,
-0.005322208162397146,
0.008188348263502121,
0.059469133615493774,
-0.03247419744729996,
0.023644564673304558,
-0.007010482717305422,
0.027448635548353195,
-0.... |
729,840 | touca | configure | Configures the Touca client. Must be called before declaring test cases
and adding results to the client. Should be regarded as a potentially
expensive operation. Should be called only from your test environment.
:py:meth:`~configure` takes a variety of configuration parameters
documented below. All of these parameter... | @clientmethod
def configure(**kwargs) -> bool:
return Client.instance().configure(**kwargs)
| (**kwargs) -> bool | [
0.03270900994539261,
-0.08429118245840073,
0.012148341163992882,
-0.019729509949684143,
-0.00930225383490324,
-0.012920730747282505,
-0.01041046530008316,
0.008832104504108429,
0.01632092334330082,
0.0008694627322256565,
0.0002964673622045666,
-0.0006679698708467185,
-0.002464090008288622,
... |
729,841 | touca._rules | decimal_rule | null | class decimal_rule(ComparisonRule):
@classmethod
def absolute(cls, *, min=None, max=None):
return cls(
mode=schema.ComparisonRuleMode.Absolute,
min=min,
max=max,
)
@classmethod
def relative(cls, *, max=None, percent=False):
return cls(
... | (*, mode: Optional[touca_fbs.ComparisonRuleMode] = None, min=None, max=None, percent=None) | [
0.022484835237264633,
-0.028402844443917274,
0.013266053050756454,
0.01715143211185932,
0.007851704955101013,
-0.03946538269519806,
-0.034320853650569916,
-0.03333152085542679,
-0.07015268504619598,
-0.053711775690317154,
0.038889773190021515,
0.04622882232069969,
0.06813804805278778,
-0.0... |
729,842 | touca._rules | __init__ | null | def __init__(
self,
*,
mode: Optional[schema.ComparisonRuleMode] = None,
min=None,
max=None,
percent=None
):
self._mode = mode
self._min = min
self._max = max
self._percent = percent
| (self, *, mode: Optional[touca_fbs.ComparisonRuleMode] = None, min=None, max=None, percent=None) | [
0.040591172873973846,
0.00030331924790516496,
0.02286013402044773,
-0.04935479164123535,
-0.005328652914613485,
-0.014436190947890282,
0.018359437584877014,
-0.05210615694522858,
-0.04731673747301102,
-0.04782625287771225,
-0.011311179958283901,
0.04881130903959274,
0.0434444434940815,
0.0... |
729,843 | touca._rules | json | null | def json(self):
mode = (
"absolute"
if self._mode == schema.ComparisonRuleMode.Absolute
else "relative"
)
out = {
"type": "number",
"mode": mode,
"min": self._min,
"max": self._max,
"percent": self._percent,
}
return {k: v for k, v in o... | (self) | [
0.04134630411863327,
-0.023155413568019867,
0.05071961507201195,
-0.03706718608736992,
0.04127220809459686,
0.029194343835115433,
-0.020784297958016396,
-0.06802134215831757,
-0.028397798538208008,
-0.05083076283335686,
0.03197299316525459,
-0.015532650984823704,
0.004086930304765701,
-0.0... |
729,844 | touca._rules | serialize | null | def serialize(self, builder: Builder):
schema.ComparisonRuleDoubleStart(builder)
schema.ComparisonRuleDoubleAddMode(builder, self._mode)
if self._min is not None:
schema.ComparisonRuleDoubleAddMin(builder, self._min)
if self._max is not None:
schema.ComparisonRuleDoubleAddMax(builder, se... | (self, builder: flatbuffers.builder.Builder) | [
0.03277076780796051,
0.004442229401320219,
0.013844383880496025,
0.0023872745223343372,
-0.017506679520010948,
-0.0474199540913105,
-0.03110690973699093,
-0.05284557864069939,
-0.08138436079025269,
-0.010941674932837486,
0.005393974483013153,
-0.012940113432705402,
0.013337992131710052,
0.... |
729,845 | touca | declare_testcase | Declares name of the test case to which all subsequent results will be
submitted until a new test case is declared.
If configuration parameter ``concurrency`` is set to ``"enabled"``, when
a thread calls `declare_testcase` all other threads also have their most
recent testcase changed to the newly declared one. Otherw... | @clientmethod
def declare_testcase(name: str):
Client.instance().declare_testcase(name)
| (name: str) | [
-0.013626350089907646,
-0.022989241406321526,
-0.03399064019322395,
-0.04129703715443611,
-0.02013021521270275,
-0.032469168305397034,
-0.0027231802232563496,
0.05888589844107628,
0.014520840719342232,
-0.015440410934388638,
-0.012873975560069084,
0.05794960632920265,
-0.039859164506196976,
... |
729,846 | touca | forget_testcase | Removes all logged information associated with a given test case.
This information is removed from memory, such that switching back to
an already-declared or already-submitted test case would behave similar
to when that test case was first declared. This information is removed,
for all threads, regardless of the confi... | @clientmethod
def forget_testcase(name: str):
Client.instance().forget_testcase(name)
| (name: str) | [
0.014258463867008686,
-0.0235062874853611,
-0.008608883246779442,
-0.02021070010960102,
-0.03823554888367653,
-0.06648344546556473,
-0.03477181866765022,
0.07109054923057556,
0.06355777382850647,
0.01514121051877737,
-0.0016257254173979163,
0.023405402898788452,
-0.0401187427341938,
-0.023... |
729,847 | touca | is_configured | Checks if previous call(s) to :py:meth:`~configure` have set the right
combination of configuration parameters to enable the client to perform
expected tasks.
We recommend that you perform this check after client configuration and
before calling other functions of the library::
if not touca.is_configured():
... | @clientmethod
def is_configured() -> bool:
return Client.instance().is_configured()
| () -> bool | [
0.05710076168179512,
-0.08316177874803543,
0.023468652740120888,
-0.028378700837492943,
0.02985514886677265,
-0.005562431178987026,
0.006729855202138424,
-0.020189564675092697,
-0.014652886427938938,
0.009141959249973297,
-0.007051755208522081,
-0.017803214490413666,
0.019262494519352913,
... |
729,848 | touca | post | Submits all test results recorded so far to Touca server.
It is possible to call :py:meth:`~post` multiple times during runtime
of the regression test tool. Test cases already submitted to the server
whose test results have not changed, will not be resubmitted.
It is also possible to add test results to a testcase aft... | @clientmethod
def post():
Client.instance().post()
| () | [
0.0020086742006242275,
-0.02895061857998371,
-0.05635857582092285,
0.016249369829893112,
-0.020208869129419327,
-0.022420017048716545,
-0.00899885967373848,
0.044188689440488815,
0.033647164702415466,
0.025556761771440506,
0.0007782942848280072,
0.007996129803359509,
-0.025968139991164207,
... |
729,849 | touca._runner | run |
Runs registered workflows, one by one, for available test cases.
This function is intended to be called once from the main module as
shown in the example below::
if __name__ == "__main__":
touca.run()
:raises SystemExit:
When configuration options specified as command lin... | def run(**options):
"""
Runs registered workflows, one by one, for available test cases.
This function is intended to be called once from the main module as
shown in the example below::
if __name__ == "__main__":
touca.run()
:raises SystemExit:
When configuration optio... | (**options) | [
0.008874915540218353,
0.009045070968568325,
-0.02376793883740902,
-0.03515935316681862,
-0.010934684425592422,
0.0032575686927884817,
-0.07121425867080688,
-0.04825231805443764,
0.03118310496211052,
0.023696294054389,
0.006515137385576963,
0.0014440768864005804,
0.005767351947724819,
0.038... |
729,850 | touca | save_binary | Stores test results and performance benchmarks in binary format
in a file of specified path.
Touca binary files can be submitted at a later time to the Touca
server.
We do not recommend as a general practice for regression test tools
to locally store their test results. This feature may be helpful for
special cases s... | @clientmethod
def save_binary(key: str, cases: List[str] = []):
Client.instance().save_binary(key, cases)
| (key: str, cases: List[str] = []) | [
-0.015419591218233109,
-0.013440514914691448,
-0.0823984444141388,
0.04002898558974266,
-0.02342194691300392,
-0.07255468517541885,
-0.06911281496286392,
0.04415923357009888,
0.06143743544816971,
-0.05007925257086754,
-0.013053303584456444,
0.07024863362312317,
-0.048151805996894836,
-0.01... |
729,851 | touca | save_json | Stores test results and performance benchmarks in JSON format
in a file of specified path.
This feature may be helpful during development of regression tests
tools for quick inspection of the test results and performance metrics
being captured.
:param path: path to file in which test results and performance
bench... | @clientmethod
def save_json(key: str, cases: List[str] = []):
Client.instance().save_json(key, cases)
| (key: str, cases: List[str] = []) | [
-0.04002244397997856,
-0.0162208192050457,
-0.08697790652513504,
0.0006554418941959739,
-0.027732085436582565,
-0.02009875886142254,
-0.04264858737587929,
0.03592565655708313,
0.0776638463139534,
-0.021236754953861237,
-0.019731098785996437,
0.037746451795101166,
-0.06015621870756149,
-0.0... |
729,852 | touca._utils | scoped_timer | null | class scoped_timer:
def __init__(self, name):
"""
Creates a timer object that captures its own lifetime and associates it
with a given name.
:param name: name to be associated with the captured runtime
"""
self._name = name
def __enter__(self):
Client.in... | (name) | [
0.06212702393531799,
-0.01848015747964382,
-0.03629341349005699,
0.010837129317224026,
-0.005019302014261484,
-0.003411282552406192,
-0.02167425863444805,
0.046507518738508224,
-0.020463308319449425,
-0.034959614276885986,
-0.005045626778155565,
0.01816425658762455,
0.013338005170226097,
-... |
729,853 | touca._utils | __enter__ | null | def __enter__(self):
Client.instance().start_timer(self._name)
| (self) | [
0.04760846868157387,
-0.02229742333292961,
-0.041919831186532974,
0.03897393122315407,
0.014729505404829979,
0.0032548820599913597,
-0.00987046118825674,
0.0685683861374855,
-0.013493580743670464,
-0.010852428153157234,
-0.029492871835827827,
-0.015694541856646538,
0.020502794533967972,
0.... |
729,854 | touca._utils | __exit__ | null | def __exit__(self, exc_type, exc_value, traceback):
Client.instance().stop_timer(self._name)
| (self, exc_type, exc_value, traceback) | [
0.03639844432473183,
0.003729207906872034,
-0.0026766089722514153,
0.05227765068411827,
-0.057055164128541946,
-0.05578345060348511,
-0.033356647938489914,
0.08063337951898575,
-0.0004911233554594219,
-0.00845945905894041,
-0.04038543254137039,
0.00969250313937664,
0.02428281493484974,
-0.... |
729,855 | touca._utils | __init__ |
Creates a timer object that captures its own lifetime and associates it
with a given name.
:param name: name to be associated with the captured runtime
| def __init__(self, name):
"""
Creates a timer object that captures its own lifetime and associates it
with a given name.
:param name: name to be associated with the captured runtime
"""
self._name = name
| (self, name) | [
0.04725596308708191,
-0.025118034332990646,
-0.014297411777079105,
0.013880551792681217,
-0.024266574531793594,
0.0011641037417575717,
-0.0022949473932385445,
0.03682558983564377,
-0.01783628761768341,
-0.020718829706311226,
0.0023015993647277355,
0.05332260578870773,
0.03563709557056427,
... |
729,856 | touca | seal | Notifies the Touca server that all test cases were executed for this
version and no further test result is expected to be submitted.
Expected to be called by the test tool once all test cases are executed
and all test results are posted.
Sealing the version is optional. The Touca server automatically
performs this ope... | @clientmethod
def seal():
Client.instance().seal()
| () | [
-0.008566667325794697,
-0.06711654365062714,
-0.00777589762583375,
0.03037871979176998,
0.008031249977648258,
-0.06691884994506836,
-0.021416667848825455,
0.003002451965585351,
0.027726346626877785,
0.026754360646009445,
-0.039110131561756134,
-0.018187692388892174,
-0.028237052261829376,
... |
729,857 | touca | start_timer | Starts timing an event with the specified name.
Measurement of the event is only complete when function
:py:meth:`~stop_timer` is later called for the specified name.
:param key: name to be associated with the performance metric | @clientmethod
def start_timer(key: str):
Client.instance().start_timer(key)
| (key: str) | [
0.035236623138189316,
-0.04601173847913742,
-0.03150549158453941,
0.02713855914771557,
0.015066752210259438,
-0.016882125288248062,
-0.010055655613541603,
0.0954367071390152,
-0.0002899262181017548,
-0.01490780245512724,
-0.020044386386871338,
0.00499436492100358,
0.02402649261057377,
-0.0... |
729,858 | touca | stop_timer | Stops timing an event with the specified name.
Expects function :py:meth:`~start_timer` to have been called previously
with the specified name.
:param key: name to be associated with the performance metric | @clientmethod
def stop_timer(key: str):
Client.instance().stop_timer(key)
| (key: str) | [
0.05042121559381485,
-0.020871490240097046,
-0.024521058425307274,
0.01846647635102272,
-0.0439629964530468,
-0.050353944301605225,
-0.025916974991559982,
0.10481154918670654,
0.019626937806606293,
-0.0017837892519310117,
-0.043290264904499054,
-0.007488341070711613,
0.007652319502085447,
... |
729,859 | touca._runner | workflow |
Registers the decorated function as a regression test workflow to be
executed, once, for each test case.
The following example demonstrates how to use this decorator::
@touca.workflow
def test_students(testcase: str):
student = find_student(testcase)
touca.assume("... | def workflow(method=None, testcases=None):
"""
Registers the decorated function as a regression test workflow to be
executed, once, for each test case.
The following example demonstrates how to use this decorator::
@touca.workflow
def test_students(testcase: str):
student =... | (method=None, testcases=None) | [
0.028841285035014153,
0.021305829286575317,
0.03660624474287033,
0.010566850192844868,
-0.003514314303174615,
-0.003621895331889391,
-0.056382033973932266,
-0.012297709472477436,
0.04605425149202347,
0.03327840566635132,
0.02077031508088112,
0.0036768813151866198,
0.045174479484558105,
-0.... |
729,861 | marshmallow_enum | EnumField | null | class EnumField(Field):
VALUE = LoadDumpOptions.value
NAME = LoadDumpOptions.name
default_error_messages = {
'by_name': 'Invalid enum member {input}',
'by_value': 'Invalid enum value {input}',
'must_be_string': 'Enum name must be string'
}
def __init__(
self, en... | (enum, by_value=False, load_by=None, dump_by=None, error='', *args, **kwargs) | [
0.04510102793574333,
-0.026369398459792137,
-0.0778670608997345,
-0.013681153766810894,
-0.015380557626485825,
-0.04101482033729553,
0.06812889873981476,
-0.028641635552048683,
-0.04311520606279373,
-0.08707056939601898,
0.008582943119108677,
0.044566381722688675,
0.01503685861825943,
0.00... |
729,863 | marshmallow_enum | __init__ | null | def __init__(
self, enum, by_value=False, load_by=None, dump_by=None, error='', *args, **kwargs
):
self.enum = enum
self.by_value = by_value
if error and any(old in error for old in ('name}', 'value}', 'choices}')):
warnings.warn(
"'name', 'value', and 'choices' fail inputs are d... | (self, enum, by_value=False, load_by=None, dump_by=None, error='', *args, **kwargs) | [
0.023196231573820114,
-0.015545808710157871,
-0.04122937098145485,
0.010109486989676952,
-0.023912280797958374,
-0.03945808857679367,
0.06753476709127426,
-0.03246718645095825,
-0.07616504281759262,
-0.06753476709127426,
-0.015960363671183586,
0.060374271124601364,
-0.010863223113119602,
0... |
729,866 | marshmallow_enum | _deserialize | null | def _deserialize(self, value, attr, data, **kwargs):
if value is None:
return None
elif self.load_by == LoadDumpOptions.value:
return self._deserialize_by_value(value, attr, data)
else:
return self._deserialize_by_name(value, attr, data)
| (self, value, attr, data, **kwargs) | [
0.06390129029750824,
0.020892150700092316,
-0.01758510246872902,
-0.00901127140969038,
-0.02292187511920929,
-0.01886242814362049,
0.062116529792547226,
0.02379675582051277,
-0.04241421818733215,
-0.05231786519289017,
-0.01709516905248165,
0.06852065771818161,
-0.007038415409624577,
-0.011... |
729,867 | marshmallow_enum | _deserialize_by_name | null | def _deserialize_by_name(self, value, attr, data):
if not isinstance(value, string_types):
self.fail('must_be_string', input=value, name=value)
try:
return getattr(self.enum, value)
except AttributeError:
self.fail('by_name', input=value, name=value)
| (self, value, attr, data) | [
0.07933951914310455,
-0.01911235973238945,
-0.042594242841005325,
-0.03082749806344509,
-0.02255292981863022,
-0.04118360951542854,
0.07287124544382095,
0.01813179813325405,
0.012945140711963177,
-0.03736457973718643,
0.016015848144888878,
0.09165675193071365,
0.015241719782352448,
-0.0250... |
729,868 | marshmallow_enum | _deserialize_by_value | null | def _deserialize_by_value(self, value, attr, data):
try:
return self.enum(value)
except ValueError:
self.fail('by_value', input=value, value=value)
| (self, value, attr, data) | [
0.09353111684322357,
-0.02144695073366165,
-0.043844833970069885,
-0.023569568991661072,
-0.008728212676942348,
-0.023314855992794037,
0.05712394416332245,
0.01155554223805666,
-0.009848956018686295,
-0.0419769287109375,
0.0364411361515522,
0.10772719979286194,
0.021599778905510902,
-0.034... |
729,869 | marshmallow_enum | _serialize | null | def _serialize(self, value, attr, obj):
if value is None:
return None
elif self.dump_by == LoadDumpOptions.value:
return value.value
else:
return value.name
| (self, value, attr, obj) | [
0.05304873362183571,
0.01844409666955471,
0.009424054995179176,
-0.004562718328088522,
0.011962314136326313,
-0.03688819333910942,
0.051748864352703094,
0.008093445561826229,
-0.02662976272404194,
-0.08586166054010391,
-0.02712160535156727,
0.04113911837339401,
-0.018321136012673378,
-0.03... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.