query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
find id of node which has minimum energy in network | def find_min_node(self):
min_energy = 10 ** 10
min_id = -1
for node in self.node:
if node.energy < min_energy:
min_energy = node.energy
min_id = node.id
return min_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nodes_min_energy_index(self, node):\n idx = -1\n curr_energy = np.inf\n for i in range(self.cost_matrix.shape[1]):\n new_energy = self.cost_matrix[node][i]\n if new_energy < curr_energy:\n curr_energy = new_energy\n idx = i\n retur... | [
"0.7396237",
"0.71087605",
"0.7081908",
"0.68451405",
"0.6838723",
"0.68083143",
"0.67169255",
"0.66216576",
"0.65200025",
"0.6480664",
"0.64050573",
"0.63789004",
"0.6304069",
"0.62081707",
"0.6197132",
"0.6182314",
"0.6174042",
"0.6165677",
"0.61640227",
"0.6138184",
"0.613... | 0.8771858 | 0 |
count the number of node which dead | def count_dead_node(self):
count = 0
for node in self.node:
if node.energy < 0:
count += 1
return count | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count_nodes(self):\n\t\treturn self.__count_nodes(self)",
"def node_count(self) -> int:\n return int(self.graph_tuple_stats.node_count or 0)",
"def count(self):\n\t\treturn len(list(self.nodes))",
"def node_count(self) -> int:\n return pulumi.get(self, \"node_count\")",
"def count(self):\r\n ... | [
"0.7125391",
"0.6945358",
"0.69259226",
"0.6693112",
"0.6552952",
"0.6552791",
"0.6487903",
"0.6487903",
"0.64291143",
"0.63761985",
"0.6362383",
"0.6315824",
"0.6268437",
"0.6249699",
"0.62463915",
"0.6244831",
"0.62133324",
"0.6209777",
"0.6209777",
"0.6179638",
"0.6162683"... | 0.8394237 | 0 |
count the number of package which can go to base | def count_package(self, count_func=count_package_function):
count = count_func(self)
return count | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count():",
"def module_count(self):\n return self._module_count",
"def Count(self) -> int:",
"def Count(self) -> int:",
"def Count(self) -> int:",
"def Count(self) -> int:",
"def count() -> int:\n pass",
"def getNumberOfBaseDistinctionsNeeded():\n\n raise AbstractMethodException(Dist... | [
"0.6704275",
"0.64923215",
"0.63881475",
"0.63881475",
"0.63881475",
"0.63881475",
"0.6274115",
"0.6260407",
"0.6155167",
"0.61025584",
"0.6084709",
"0.6030732",
"0.60017556",
"0.591506",
"0.5900493",
"0.58908993",
"0.58853924",
"0.5859293",
"0.5854474",
"0.5759834",
"0.57458... | 0.67829573 | 0 |
Geeft het dictionary van alle features toegepast in een text. | def feat_dict(pos_feat,text):
dict = {}
bigrams = ngrams(word_tokenize(text),2)
trigrams = ngrams(word_tokenize(text),3)
for feat in pos_feat:
dict[feat]=features(feat,text,bigrams,[],[])
return dict | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_text_features(text, word_features):\n words = word_tokenize(text)\n features = {}\n for w in word_features:\n features[w] = (w in words)\n\n return features",
"def extract_features(tlc):\n text = clean_text(tlc['body'])\n fields = dict()\n # add features here #\n fields['To... | [
"0.7215098",
"0.67771536",
"0.67375463",
"0.67137593",
"0.6648944",
"0.6520209",
"0.6505095",
"0.64898634",
"0.6461924",
"0.6396132",
"0.6343878",
"0.6253007",
"0.6237187",
"0.62213826",
"0.621592",
"0.61952716",
"0.61777264",
"0.6162049",
"0.6139519",
"0.613468",
"0.61342484... | 0.70925313 | 1 |
Log any task failures. We will also get email notifications which is handled directly by celery and setup in the workers module. | def on_task_failure(task, exc, task_id, args, kwargs, einfo):
message = 'Task {} failed w/ args: {}, {}\n{}'
log.error(message.format(task.name, args, kwargs, einfo.traceback)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mark_as_failure(self, task_id, exc, *args, **kwargs):\n django_logger.exception('Celery task failed: %s' % exc, exc_info=exc)\n super().mark_as_failure(task_id, exc, *args, **kwargs)",
"def log_failures(self):\n for exception in self.queue_manager.failure_descriptions():\n sel... | [
"0.72823054",
"0.7093471",
"0.7081574",
"0.6898542",
"0.6688016",
"0.65413904",
"0.65282834",
"0.64489216",
"0.64056957",
"0.6326251",
"0.62930536",
"0.62771326",
"0.624711",
"0.61860746",
"0.61768883",
"0.61491835",
"0.61087006",
"0.6020257",
"0.5955348",
"0.59316206",
"0.59... | 0.7698419 | 0 |
Grab a single image out of a larger spritesheet Pass in the x, y location of the sprite and the width and height of the sprite. | def get_image(self, x, y, width, height):
# Create a new blank image
image = pygame.Surface([width, height]).convert()
# Copy the sprite from the large sheet onto the smaller image
image.blit(self.sheet, (0, 0), (x, y, width, height))
# Assuming black works as the transparent ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_image(self,x,y,width,height):\n \n #Create a new blank image\n image = pygame.Surface([width,height]).convert()\n \n #Copy the sprite from the large sheet onto the smaller image\n image.blit(self.sprite_sheet,(0,0),(x,y,width,height))\n \n #Assuming b... | [
"0.7584314",
"0.69360065",
"0.68307346",
"0.67480826",
"0.6609378",
"0.65678054",
"0.64892626",
"0.63600266",
"0.633547",
"0.63114095",
"0.63114095",
"0.61107117",
"0.60996205",
"0.6088744",
"0.60758215",
"0.60381824",
"0.60381824",
"0.60333663",
"0.6007332",
"0.59897244",
"0... | 0.7408439 | 1 |
When the URL doesn't match an institution, don't write a row. | def test_no_match(add_doc, add_institution):
doc = add_doc(log={
'url': 'http://yale.edu/syllabus.pdf'
})
harvard = add_institution(
name='Harvard University',
domain='harvard.edu',
)
doc_to_inst(doc.id)
# Shouldn't write a link.
assert Institution_Document.select... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _insert_url_to_db(self, url=None):\n if url and len(url) < 4096 and not self.server.hostname.lower() in url.lower():\n\n # Now check, whether some protocol prefix is\n # available. If not, assume http:// was intended to put\n # there.\n if not '://' in url:\n ... | [
"0.54531634",
"0.5396973",
"0.53746945",
"0.5358978",
"0.53171813",
"0.5269254",
"0.52184016",
"0.5213905",
"0.519592",
"0.51939833",
"0.51761603",
"0.51088977",
"0.5104085",
"0.50946593",
"0.50839853",
"0.5082207",
"0.50601023",
"0.49646336",
"0.4956452",
"0.4948917",
"0.493... | 0.6034239 | 0 |
r""" Build the category_lines dictionary, a list of names per language Returns the dataset dict, list of languages, and number of classes | def build_category_lines(all_filenames, all_letters):
category_lines = {}
all_categories = []
for filename in all_filenames:
category = filename.stem
all_categories.append(category)
lines = read_lines(filename, all_letters)
category_lines[category] = lines
n_categories ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_data():\n category_lines = {}\n all_categories = []\n\n def find_files(path):\n return glob.glob(path)\n\n def read_lines(filename):\n # read a file and split into lines\n return [unicode_to_ascii(line.strip()) for line in open(filename)]\n\n for filename in find_files(... | [
"0.7017928",
"0.6212996",
"0.6193639",
"0.59245217",
"0.589548",
"0.58445334",
"0.57357925",
"0.5727608",
"0.5726647",
"0.56966764",
"0.5640349",
"0.56029814",
"0.558959",
"0.55837005",
"0.5563686",
"0.55628353",
"0.5555482",
"0.55463177",
"0.5529203",
"0.54998827",
"0.548961... | 0.69182324 | 1 |
r""" Turn a list of batch_size lines into a tensor where each element of tensor is index of corresponding letter in all_letters | def line_to_tensor(batch_size, max_seq_length, lines, all_letters, n_letters):
tensor = torch.zeros(max_seq_length, batch_size).type(torch.LongTensor)
for batch_idx, line in enumerate(lines):
# Pad/truncate line to fit to max_seq_length
padded_line = line[0:max_seq_length] + "#" * (max_seq_lengt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def line_to_tensor(line):\n tensor = torch.zeros(len(line), 1, N_LETTERS)\n for i, letter in enumerate(line):\n tensor[i][0][letter_to_index(letter)] = 1\n return tensor",
"def lineToTensor(line):\n tensor = torch.zeros(len(line), 1, n_letters)\n for li, letter in enumerate(line):\n ... | [
"0.6472327",
"0.6370242",
"0.6287842",
"0.60797554",
"0.5904318",
"0.5901345",
"0.58888185",
"0.58888185",
"0.58405876",
"0.5839657",
"0.5623645",
"0.5613586",
"0.56058943",
"0.5604532",
"0.5592153",
"0.5570251",
"0.55604583",
"0.5545675",
"0.5545618",
"0.5541155",
"0.5525334... | 0.750674 | 0 |
Prints results of a fulfilled request. | def print_results(request, response, procedure_name) -> None:
procedure_names_dict = {
'SquareRoot': calculator_pb2_grpc.CalculatorServicer.SquareRoot.__name__,
'Square': calculator_pb2_grpc.CalculatorServicer.Square.__name__,
}
print_string = f"Request: {procedure_names_dict[procedure_name]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_results(self):\n pass",
"def show_results(self):\n print(\"Survey results:\")\n for response in self.responses:\n print('- ' + response)",
"def print_request_response(request_response: json):\n print(\"Printing response:\")\n print(json.dumps(request_response, in... | [
"0.6621169",
"0.64510244",
"0.64043176",
"0.635576",
"0.6300837",
"0.62248003",
"0.62159395",
"0.61789405",
"0.61486757",
"0.6092963",
"0.60600275",
"0.6031695",
"0.60048807",
"0.60032344",
"0.59531057",
"0.5932396",
"0.58660716",
"0.58641034",
"0.5851343",
"0.582681",
"0.581... | 0.64641154 | 1 |
Checks if hash has expected difficulty. | def validate_hash_difficulty(bhash: str, difficulty: int) -> bool:
b = hex_to_bin(bhash)
print(b[:4], type(b))
return hex_to_bin(bhash).startswith('0' * difficulty) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_accepted_by_difficulty(self, hash):\n first_charac = hash[:Miner.DIFFICULTY]\n return first_charac == \"0\" * Miner.DIFFICULTY",
"def is_valid_proof(self, block, block_hash): \n return (block_hash.startswith('0' * Blockchain.difficulty) and block_hash == compute_hash())",
"def valid... | [
"0.71169883",
"0.68231845",
"0.6481691",
"0.6464592",
"0.6385664",
"0.6385664",
"0.63508815",
"0.63411605",
"0.6133641",
"0.60745907",
"0.60510916",
"0.60419613",
"0.60187304",
"0.6012318",
"0.6004063",
"0.5998862",
"0.59904885",
"0.5988398",
"0.5985985",
"0.59322274",
"0.592... | 0.7153951 | 0 |
Reduce the number of SNPs of the samples in a given VCF file. | def reduce_snps(vcf_file: str, n_snps: [int], working_folder=None, feedback=True, msg_help=True):
if type(n_snps) is str:
n_snps = ast.literal_eval(n_snps)
if type(feedback) is str:
if feedback == '1':
feedback = True
else:
feedback = False
if type(msg_help... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_VCF(input_vcf, targets_file, out_vcf = None) :\n\n\tfVCF_OUT = None\n\tif out_vcf is not None :\n\t\tfVCF_OUT = open(out_vcf, 'w')\n\tfDUP_OUT = open(targets_file, 'w')\n\n\tvariants_dict = {}\n\tvariants_list = []\n\tnum_redundant, num_kept = 0, 0\n\tfINVCF = open(input_vcf, 'r')\n\tfor line in fINVCF... | [
"0.5879611",
"0.5453179",
"0.5395944",
"0.53834826",
"0.5372507",
"0.5218238",
"0.5190204",
"0.5171821",
"0.51644194",
"0.5141128",
"0.51252735",
"0.5119161",
"0.51153845",
"0.5086749",
"0.50765336",
"0.5056503",
"0.50279975",
"0.5009096",
"0.5002888",
"0.49826005",
"0.496129... | 0.643459 | 0 |
adp('`X',['x',...]) is same as addProduction(Symbol('X',terminal=False),[Symbol('x'),...]) | def adp(lhs,rhs):
test=lambda s: s[0]=='`'
assert test(lhs)==True,'error: lhs should be non-terminal'
lhs=so.getSymbol(lhs[1:],terminal=False,autocreate=True)
rhs=[so.getSymbol(s[1:],False,True) if test(s) else so.getSymbol(s,True,True) for s in rhs]
return addProduction(lhs,rhs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addExpr( ):\n\n\ttok = tokens.peek( )\n\tif debug: print (\"addExpr: \", tok)\n\tleft = term( )\n\ttok = tokens.peek( )\n\twhile tok == \"+\" or tok == \"-\":\n\t\ttokens.next()\n\t\tright = term( )\n\t\tleft = BinaryExpr( tok, left, right )\n\t\ttok = tokens.peek( )\n\treturn left",
"def _build_add(self) ->... | [
"0.53211373",
"0.5213531",
"0.52038974",
"0.51842767",
"0.5165663",
"0.5130774",
"0.5128089",
"0.5127615",
"0.506485",
"0.5035706",
"0.50176924",
"0.4997648",
"0.49656022",
"0.49554846",
"0.4948152",
"0.49359265",
"0.49359265",
"0.49344784",
"0.48985192",
"0.48803717",
"0.487... | 0.760157 | 0 |
Return the shared inorder letters between self and idprofiler | def sharedletters(self, idprofiler: "IDProfiler") -> str:
shared: str = ""
for i in range(len(self.rawstr)):
if self.rawstr[i] is idprofiler.rawstr[i]:
shared += self.rawstr[i]
return shared | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def part2(data: str = None) -> str:\n idlist: List[IDProfiler] = getidlist(data)\n for i in range(len(idlist)):\n for j in range(i + 1, len(idlist)):\n shared: str = idlist[i].sharedletters(idlist[j])\n if len(shared) is len(idlist[i].rawstr) - 1:\n return shared",... | [
"0.69032687",
"0.579191",
"0.5755242",
"0.57497144",
"0.5641839",
"0.5590979",
"0.5574784",
"0.55738485",
"0.5503892",
"0.54723656",
"0.5418838",
"0.5271615",
"0.5259801",
"0.5253427",
"0.5248375",
"0.52411884",
"0.5232712",
"0.5222338",
"0.51719314",
"0.5158009",
"0.5135456"... | 0.7927267 | 0 |
Return a list of IDProfilers from provided data or input.txt | def getidlist(data: str = None) -> List[IDProfiler]:
boxids: str = getinput(directory=DIR) if data is None else data
idlist: List[IDProfiler] = list(map(IDProfiler, boxids.split("\n")))
return idlist | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getPersonIDs(cohort, **kargs):\n def read_ids(fpath):\n fname = os.path.basename(fpath) \n assert fname.find('.id') > 0\n assert os.path.exists(fpath), 'Invalid input: %s' % fpath\n df = pd.read_csv(fpath, sep=sep, header=0, index_col=False, error_bad_lines=True)\n assert ... | [
"0.60351557",
"0.59531057",
"0.564482",
"0.56374866",
"0.5565823",
"0.55531996",
"0.5445085",
"0.5440398",
"0.54309076",
"0.5418754",
"0.5414296",
"0.53937966",
"0.5392015",
"0.5390735",
"0.53459585",
"0.5345483",
"0.53425115",
"0.5330593",
"0.5323932",
"0.5259268",
"0.524186... | 0.65949506 | 0 |
Get info of the feature. | def _getInfo(self):
# args for Vimba call
featureInfo = structs.VimbaFeatureInfo()
# Vimba DLL will return an error code
errorCode = VimbaDLL.featureInfoQuery(self._handle,
self._name,
byref(feat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getFeatureInfo(self,feature):\n geomRef = feature.GetGeometryRef()\n nameIndex = feature.GetFieldIndex(\"OBJNAM\")\n featureName = \"NO OBJNAM\"\n if(nameIndex != -1 and feature.GetFieldAsString(nameIndex) != \"\" ):\n featureName = feature.GetFieldAsString(nameIndex)\n ... | [
"0.77952844",
"0.7338353",
"0.7338353",
"0.73264754",
"0.71192324",
"0.7104929",
"0.7033937",
"0.7033937",
"0.70284635",
"0.69975716",
"0.69948894",
"0.691539",
"0.6896134",
"0.68808943",
"0.68717897",
"0.6869056",
"0.68512195",
"0.68512195",
"0.68241596",
"0.67875725",
"0.67... | 0.7563548 | 1 |
Get the value of an integer feature. | def _getIntFeature(self):
# create args
valueToGet = c_int64()
errorCode = VimbaDLL.featureIntGet(self._handle,
self._name,
byref(valueToGet))
if errorCode != 0:
raise VimbaException(error... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _int64_feature(value: int) -> tf.train.Features.FeatureEntry:\n return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))",
"def getInteger(self):\n assert self._is_int is True\n return self._value",
"def add_int_feature(val):\n return tf.train.Feature(int64_list=tf.trai... | [
"0.672759",
"0.66647327",
"0.66474193",
"0.66276187",
"0.6574157",
"0.6570221",
"0.6570221",
"0.65543306",
"0.65543306",
"0.65271926",
"0.64737827",
"0.64691883",
"0.6461899",
"0.645338",
"0.645338",
"0.645338",
"0.645338",
"0.644898",
"0.6433643",
"0.6433643",
"0.6433643",
... | 0.8220187 | 0 |
Set the value of a float feature. | def _setFloatFeature(self, valueToSet):
errorCode = VimbaDLL.featureFloatSet(self._handle,
self._name,
valueToSet)
if errorCode != 0:
raise VimbaException(errorCode) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setFloat(self, address: ghidra.program.model.address.Address, value: float) -> None:\n ...",
"def float_value(self, float_value):\n\n self._float_value = float_value",
"def set_value(self,x):\n self._value = float(x)",
"def set_value(\n self,\n value: float,\n ) -> N... | [
"0.8105979",
"0.7941928",
"0.7625806",
"0.745135",
"0.73927075",
"0.7379258",
"0.72378516",
"0.72378516",
"0.7216444",
"0.72149116",
"0.7168589",
"0.7087714",
"0.7074912",
"0.7006613",
"0.69980156",
"0.69209445",
"0.6915617",
"0.689783",
"0.6855783",
"0.6832386",
"0.68233764"... | 0.8416743 | 0 |
Get the value of an enum feature. | def _getEnumFeature(self):
# create args
valueToGet = c_char_p()
errorCode = VimbaDLL.featureEnumGet(self._handle,
self._name,
byref(valueToGet))
if errorCode != 0:
raise VimbaException(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, name):\n try:\n return(self._d_features[name])\n except:\n log.error(\"Can't get feature '%s'\" % name)\n return",
"def get(self, feature_name):\n return getattr(self, feature_name)",
"def enum_value(self):\r\n if not hasattr(self, '_en... | [
"0.66345906",
"0.6406848",
"0.634711",
"0.6305955",
"0.6301024",
"0.62608886",
"0.62331575",
"0.6215211",
"0.61976826",
"0.60234237",
"0.60234237",
"0.6007193",
"0.5925025",
"0.59248245",
"0.5919176",
"0.59181356",
"0.59082144",
"0.59082144",
"0.59082144",
"0.59082144",
"0.59... | 0.7804253 | 0 |
Set the value of an enum feature. | def _setEnumFeature(self, valueToSet):
errorCode = VimbaDLL.featureEnumSet(self._handle,
self._name,
valueToSet)
if errorCode != 0:
raise VimbaException(errorCode) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setFeature(self, name, value=1):\n self.features[self.featureSet.getId(self.tag+name)] = value",
"def _setIntFeature(self, valueToSet):\n\n errorCode = VimbaDLL.featureIntSet(self._handle,\n self._name,\n valueT... | [
"0.7072896",
"0.69582057",
"0.6572887",
"0.64444786",
"0.63036376",
"0.603457",
"0.59537154",
"0.59340835",
"0.59340835",
"0.58949846",
"0.58860826",
"0.5826669",
"0.57795626",
"0.5778369",
"0.570978",
"0.56838685",
"0.5652622",
"0.5634893",
"0.5625225",
"0.5603832",
"0.56038... | 0.815652 | 0 |
Get the value of a string feature. | def _getStringFeature(self):
# create args
bufferSize = 256
valueToGet = create_string_buffer('\000' * bufferSize)
sizeFilled = c_uint32()
errorCode = VimbaDLL.featureStringGet(self._handle,
self._name,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def string_value(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"string_value\")",
"def getValue(splits, featureName):\n for split in splits:\n if split.startswith(featureName):\n return split[split.find(\"=\")+1:]\n \n return None",
"def string_value(self) -... | [
"0.6776024",
"0.6690042",
"0.65111685",
"0.6464237",
"0.62510973",
"0.62354434",
"0.61648715",
"0.61648715",
"0.6115535",
"0.6067185",
"0.6049477",
"0.6038091",
"0.6023029",
"0.5936854",
"0.5907873",
"0.5881148",
"0.5874317",
"0.5874317",
"0.5874317",
"0.5874317",
"0.5858565"... | 0.8016949 | 0 |
Set the value of a string feature. | def _setStringFeature(self, valueToSet):
errorCode = VimbaDLL.featureStringSet(self._handle,
self._name,
valueToSet)
if errorCode != 0:
raise VimbaException(errorCode) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setString(self, name: unicode, value: unicode) -> None:\n ...",
"def string_value(self, string_value):\n\n self._string_value = string_value",
"def __setattr__(self, feature, value):\n feature = feature.lower()\n if value is not None:\n value = value.lower()\n ... | [
"0.78397673",
"0.70593643",
"0.6828136",
"0.68227994",
"0.6736695",
"0.6736695",
"0.6492761",
"0.63266855",
"0.61277264",
"0.60715926",
"0.6048867",
"0.6041346",
"0.6008343",
"0.59197426",
"0.5909076",
"0.58860743",
"0.5861473",
"0.5856557",
"0.58533967",
"0.583827",
"0.58203... | 0.7648896 | 1 |
Get the value of a bool feature. | def _getBoolFeature(self):
# create args
valueToGet = c_bool()
errorCode = VimbaDLL.featureBoolGet(self._handle,
self._name,
byref(valueToGet))
if errorCode != 0:
raise VimbaException(er... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bool_value(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"bool_value\")",
"def get_boolean_attribute_value(attrs, attr_name):\n return 1 if attrs.get(attr_name, 0) in [\"True\", \"1\"] else 0",
"def get_bool(self, name, default=False):\n return self.get_as(self.pars... | [
"0.7729402",
"0.7618366",
"0.7454953",
"0.7254668",
"0.7229301",
"0.7223453",
"0.7150544",
"0.71196085",
"0.7082593",
"0.70133543",
"0.6996652",
"0.69669336",
"0.69622105",
"0.6961866",
"0.6952031",
"0.69502825",
"0.6942672",
"0.6941855",
"0.69337785",
"0.6923182",
"0.6884514... | 0.8372769 | 0 |
Set the value of a bool feature. | def _setBoolFeature(self, valueToSet):
errorCode = VimbaDLL.featureBoolSet(self._handle,
self._name,
valueToSet)
if errorCode != 0:
raise VimbaException(errorCode) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set(self, attr, value=True):\n if type(value) == bool:\n self.__dict__['_'+attr] = value\n print attr, \"set to\", value\n else:\n print 'Value must be a bool, either \"True\" or \"False\" (no quotes)!'",
"def setBoolValue(self, *args):\n return _libsbml.... | [
"0.756912",
"0.73604316",
"0.7211295",
"0.7194638",
"0.7193076",
"0.7192581",
"0.71430075",
"0.714128",
"0.7122906",
"0.71188855",
"0.70165265",
"0.695807",
"0.6878619",
"0.6807227",
"0.6768986",
"0.6721229",
"0.6712732",
"0.66599387",
"0.6630182",
"0.6579652",
"0.6578408",
... | 0.8115863 | 0 |
Returns empty for ranges that have not been implemented. | def _unknownRange(self):
return '' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def empty(self):\n return _uhd_swig.range_vector_t_empty(self)",
"def f_has_range(self):\n raise NotImplementedError(\"Should have implemented this.\")",
"def test_get_range_empty(self):\n\n queryset = mock.Mock()\n queryset.aggregate.return_value = None\n\n dimension = model... | [
"0.71819514",
"0.66047865",
"0.651441",
"0.6411219",
"0.6360979",
"0.62924176",
"0.6288037",
"0.6265082",
"0.6256847",
"0.6256847",
"0.62275016",
"0.62275016",
"0.62275016",
"0.62275016",
"0.6227381",
"0.61757463",
"0.6163439",
"0.6156944",
"0.6149955",
"0.6149955",
"0.614995... | 0.6635337 | 1 |
Get the range of an int feature. | def _rangeQueryIntFeature(self):
# create args
minToGet = c_int64()
maxToGet = c_int64()
errorCode = VimbaDLL.featureIntRangeQuery(self._handle,
self._name,
byref(minToGet),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_featureRange(self):\n\n return self.featureRange",
"def getRange(self, p_int): # real signature unknown; restored from __doc__\n pass",
"def get_range(self) -> tuple[int, int]:\n return self.range_from, self.range_to",
"def range(self) -> Tuple[Union[int, float], Union[int, f... | [
"0.74241173",
"0.7299423",
"0.68280005",
"0.6801315",
"0.67704093",
"0.672605",
"0.672605",
"0.665289",
"0.6651656",
"0.6609777",
"0.6609777",
"0.65832365",
"0.657758",
"0.6542998",
"0.6391507",
"0.63786834",
"0.6377611",
"0.6337651",
"0.63187337",
"0.6313497",
"0.6292073",
... | 0.8041224 | 0 |
Get the range of a float feature. | def _rangeQueryFloatFeature(self):
# create args
minToGet = c_double()
maxToGet = c_double()
errorCode = VimbaDLL.featureFloatRangeQuery(self._handle,
self._name,
byref(minToGet),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_featureRange(self):\n\n return self.featureRange",
"def range(self):\n lower, upper = sorted((self.y1, self.y2))\n return FloatRange(lower=lower, upper=upper)",
"def range(self) -> NDArrayFloat: # noqa: A003\n\n return ndarray_copy(self._range)",
"def detect_range(self) -... | [
"0.76419353",
"0.7165611",
"0.70312136",
"0.6874846",
"0.68018043",
"0.67596096",
"0.67596096",
"0.6740091",
"0.67377317",
"0.6641654",
"0.65516376",
"0.6498652",
"0.6467492",
"0.6423521",
"0.635193",
"0.63143927",
"0.6293651",
"0.6278658",
"0.62073356",
"0.61934584",
"0.6186... | 0.793461 | 0 |
Update all adapter surrogates locally. | def _updateAdaptersFromLocalData(self, adapters):
for registration in self._registrations:
required = registration.required
if required is None:
required = zope.interface.adapter.Default
radapters = adapters.get(required)
if not radapters:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _update_all_devices(self):\n self.all_devices = []\n self.all_devices.extend(self.keyboards)\n self.all_devices.extend(self.mice)\n self.all_devices.extend(self.gamepads)\n self.all_devices.extend(self.other_devices)",
"def _update_per_namespace():\n\n for acc in account.A... | [
"0.5886374",
"0.5882517",
"0.5830913",
"0.57841337",
"0.5778375",
"0.57454544",
"0.5739356",
"0.56642085",
"0.56396925",
"0.55935043",
"0.5586517",
"0.5578695",
"0.55530035",
"0.5501601",
"0.5496673",
"0.5473838",
"0.5466549",
"0.5447251",
"0.54318815",
"0.542934",
"0.5428961... | 0.63519293 | 0 |
Fixture to mock the terrain.world.config object with some default fake data. | def mock_world_config():
# default command line arguments
arguments = {
"--basedir": ["$PWD/radish"],
"--bdd-xml": None,
"--cover-append": False,
"--cover-branches": False,
"--cover-config-file": ".coveragerc",
"--cover-erase": False,
"--cover-html": None,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def world_config(mock_world_config):\n yield mock_world_config",
"def core_config_mock(request):\n from unittest import mock\n from sqlalchemy import Column\n from rucio.common.utils import generate_uuid\n from rucio.db.sqla.models import String, PrimaryKeyConstraint\n from rucio.db.sqla.sessio... | [
"0.71262115",
"0.6735638",
"0.65443784",
"0.6376274",
"0.6354067",
"0.61806947",
"0.6171466",
"0.6104853",
"0.60738695",
"0.5988738",
"0.59752107",
"0.5967683",
"0.59232837",
"0.58301735",
"0.58166265",
"0.5813548",
"0.5796242",
"0.57959473",
"0.5779379",
"0.57694286",
"0.573... | 0.6861745 | 1 |
Fixture to work with world.config object | def world_config(mock_world_config):
yield mock_world_config | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def config(self, **kw):\n self.cfg_fixture.config(**kw)",
"def config_fixture():\n CONFIG_FILE = \"secrets/config.json\"\n with open(CONFIG_FILE, \"r\") as f:\n return json.loads(f.read())",
"def fixtures():",
"def setUpFixture(self):\n pass",
"def setUpConfig(self):\n pas... | [
"0.73451746",
"0.69397956",
"0.69215024",
"0.6845227",
"0.68289393",
"0.6789474",
"0.6658537",
"0.66522616",
"0.66522616",
"0.6571711",
"0.65668935",
"0.65408546",
"0.6524837",
"0.6508922",
"0.6478866",
"0.642619",
"0.6418452",
"0.63815314",
"0.63641834",
"0.6334099",
"0.6324... | 0.7323214 | 1 |
Fixture to mock the pdf Python debugger | def mock_utils_debugger(mocker):
def call_orig_func(func, *args, **kwargs):
"""
Helper to mock pdf.runcall interface
"""
return func(*args, **kwargs)
debugger_mock = mocker.patch("radish.utils.get_debugger")
debugger_mock.return_value.runcall = mocker.MagicMock(side_effect=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_invoice_pdf(mocker, expected_response, expected_data, client) -> None:\n\n mocker.patch(\"requests.Session.request\", return_value=expected_response)\n actual_data = client.get_invoice_pdf(invoice_id=1)\n\n assert actual_data == expected_data",
"def test_loading_document(self):",
"def set... | [
"0.59752095",
"0.59440666",
"0.59412533",
"0.5920023",
"0.5864499",
"0.58640754",
"0.58629096",
"0.5803908",
"0.5748375",
"0.5713757",
"0.57106936",
"0.56960166",
"0.56550497",
"0.5653119",
"0.5650326",
"0.5643613",
"0.56434506",
"0.56237906",
"0.5613619",
"0.56096685",
"0.55... | 0.59881413 | 0 |
Fixture to create a Feature Parser ready to parse the given Feature File | def parser(request, core):
featurename = request.param[0]
# get parser positional arguments
try:
parser_args = request.param[1]
except IndexError:
parser_args = []
# get parser keyword arguments
try:
parser_kwargs = request.param[2]
except IndexError:
parser_k... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_features(self, skip=...):\n ...",
"def parse_features(self, skip=...):\n ...",
"def test_parse_file(self, tmpdir):\n filename = tmpdir.join(\"test.xbb\")\n\n with open(filename, \"w\") as f:\n f.write(test_file)\n\n bb = parse(antlr4.FileStream(filename))... | [
"0.661449",
"0.661449",
"0.6347992",
"0.6301569",
"0.6295282",
"0.6164806",
"0.6143963",
"0.6094834",
"0.6082286",
"0.60205173",
"0.599795",
"0.5967828",
"0.5967828",
"0.59427243",
"0.58851427",
"0.5881324",
"0.5879359",
"0.5872452",
"0.5861687",
"0.5853542",
"0.5829984",
"... | 0.69177526 | 0 |
Fixture to create and get a clean StepRegistry instance. | def stepregistry():
registry = StepRegistry()
yield registry | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_stepregistry_module_should_have_global_registry_instance():\n # given & when\n from radish.stepregistry import registry\n\n # then\n assert isinstance(registry, StepRegistry)",
"def setUp(self):\n super(Registry, self).setUp()\n\n self._initialize_all() # Make doubly certain w... | [
"0.6493184",
"0.63226885",
"0.6133354",
"0.60968745",
"0.6035522",
"0.5985886",
"0.59379774",
"0.58468026",
"0.556584",
"0.548685",
"0.54800725",
"0.54093635",
"0.5369746",
"0.5364977",
"0.5364205",
"0.5364205",
"0.5364205",
"0.5364205",
"0.5364205",
"0.5364205",
"0.53527546"... | 0.6464308 | 1 |
Fixture to create and get a clean HookRegistry instance. | def hookregistry():
registry = HookRegistry()
yield registry | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_hookregistry_module_should_have_global_registry_instance():\n # given & when\n from radish.hookregistry import registry\n\n # then\n assert isinstance(registry, HookRegistry)",
"def test_hook_unregister(self):\n self.assertEqual(list(self.registry), [])\n item = self.DummyItem(... | [
"0.6789386",
"0.663347",
"0.6569584",
"0.63065684",
"0.61380243",
"0.6118393",
"0.6077459",
"0.59525895",
"0.5915827",
"0.59062624",
"0.58078444",
"0.578708",
"0.5780031",
"0.57374454",
"0.57210904",
"0.5708919",
"0.56971335",
"0.5650739",
"0.5624414",
"0.558384",
"0.5524423"... | 0.67180276 | 1 |
Fixture to create and get a clean ExtensionRegistry instance. | def extensionregistry():
registry = ExtensionRegistry()
yield registry | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entity_reg(hass):\n return mock_registry(hass)",
"def test_load(self):\n class TestExtension(Extension):\n pass\n\n self.setup_extension(TestExtension, enable=False)\n\n self.assertEqual(self.manager.get_installed_extensions(),\n [TestExtension])\n ... | [
"0.6481339",
"0.62893534",
"0.62163985",
"0.6204019",
"0.6150869",
"0.6122794",
"0.5982793",
"0.5973814",
"0.5909268",
"0.58975804",
"0.5873562",
"0.5721294",
"0.57034093",
"0.5674275",
"0.56719947",
"0.5649816",
"0.56431127",
"0.56345135",
"0.55886596",
"0.5569486",
"0.55099... | 0.62969834 | 1 |
Test case for confirm_customization_details | def test_confirm_customization_details(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_confirm_order_details(self):\n pass",
"def test_create_confirm_service_details(self):\n pass",
"def confirmed(self):",
"def test_customize_post_form(self):\n\n data = {\"hunger-visible\": None}\n result = self.client.post(\"/patient/1/account/customize-posts\", \n ... | [
"0.63994956",
"0.62716687",
"0.6235483",
"0.61765957",
"0.60763",
"0.59859174",
"0.59702325",
"0.5817304",
"0.579864",
"0.57847893",
"0.5778402",
"0.5756497",
"0.56931937",
"0.5691051",
"0.5660928",
"0.56419134",
"0.56297714",
"0.56297714",
"0.55971074",
"0.55842805",
"0.5579... | 0.9188642 | 0 |
Test case for create_amazon_motors | def test_create_amazon_motors(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def amazonEc2_create(amazonEc2):\n\treturn amazonEc2",
"def mock_amazon():\n amazon = Amazon()\n amazon.carrot1 = 'cenoura normal'\n amazon.carrot2 = 'cenoura radioativa'\n amazon.carrot_number = 575\n return amazon",
"def test_create_movie(self):\n # this functionality requires the execu... | [
"0.6004615",
"0.59952515",
"0.59320563",
"0.58824253",
"0.5861294",
"0.56729203",
"0.5625542",
"0.56113994",
"0.5557505",
"0.5493651",
"0.5467974",
"0.5458791",
"0.5425849",
"0.5424168",
"0.54225487",
"0.53579265",
"0.53572255",
"0.5353584",
"0.5322697",
"0.5316942",
"0.53111... | 0.94862324 | 0 |
Test case for create_confirm_delivery_details | def test_create_confirm_delivery_details(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_confirm_order_details(self):\n pass",
"def test_create_confirm_service_details(self):\n pass",
"def test_create_shipment(self):\n pass",
"def test_make_delivery_report_with_delivery_statuss(self):\n msg_helper = MessageHelper()\n event = msg_helper.make_deli... | [
"0.8063497",
"0.741652",
"0.6949322",
"0.68846625",
"0.6538186",
"0.6409082",
"0.63801414",
"0.6360841",
"0.6337912",
"0.63328016",
"0.6314138",
"0.6289702",
"0.6286013",
"0.62671053",
"0.62243766",
"0.62224865",
"0.6213607",
"0.61862016",
"0.61653024",
"0.6161842",
"0.615876... | 0.93474555 | 0 |
Test case for create_confirm_order_details | def test_create_confirm_order_details(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_confirm_delivery_details(self):\n pass",
"def test_create_confirm_service_details(self):\n pass",
"def test_create_order(self):\n # Test with valid data format and right auth token\n response = self.client.post('/api/v1/parcels',\n ... | [
"0.8029555",
"0.74379414",
"0.73018694",
"0.7284983",
"0.71554196",
"0.69098264",
"0.6893032",
"0.6883635",
"0.68448156",
"0.6797034",
"0.67798847",
"0.67763186",
"0.67524546",
"0.6683365",
"0.6681166",
"0.66542894",
"0.66261655",
"0.6619778",
"0.66148573",
"0.6599742",
"0.65... | 0.93426853 | 0 |
Test case for create_confirm_service_details | def test_create_confirm_service_details(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_confirm_order_details(self):\n pass",
"def test_create_confirm_delivery_details(self):\n pass",
"def test_ipam_services_create(self):\n pass",
"def test_client_verification_create(self):\n pass",
"def test_successful_creation_of_service(self):\n create_sto... | [
"0.7370256",
"0.73508745",
"0.69296545",
"0.67743",
"0.664319",
"0.65620166",
"0.6485933",
"0.64775825",
"0.6470324",
"0.6396608",
"0.63834745",
"0.6369165",
"0.63591933",
"0.6337496",
"0.6315886",
"0.6289603",
"0.6289357",
"0.61944467",
"0.61824435",
"0.6176871",
"0.6171527"... | 0.92412716 | 0 |
Test case for create_digital_access_key | def test_create_digital_access_key(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_api_key(self):\n pass",
"def create_key ():",
"def test_create_key():\n\n assert symmetric.create_key() != \"\"",
"def test_aws_service_api_keypair_generate_post(self):\n pass",
"def test_generate_api_key():\n\n key = auth.generate_api_key() # returns a NamedTuple with ... | [
"0.75193626",
"0.7269658",
"0.72610784",
"0.70168823",
"0.65952003",
"0.6470047",
"0.6310984",
"0.6301704",
"0.62734145",
"0.6140198",
"0.6091839",
"0.6090564",
"0.60858876",
"0.5997245",
"0.59572667",
"0.5947866",
"0.5928639",
"0.5927247",
"0.58920157",
"0.5881578",
"0.58809... | 0.9512067 | 0 |
Test case for create_legal_disclosure | def test_create_legal_disclosure(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_disclosure_proof(\n pk: PublicKey,\n credential: AnonymousCredential,\n disclosed_attributes: List[str],\n message: bytes\n ) -> DisclosureProof:\n # Randomize signature\n r = G1.order().random()\n t = G1.order().random()\n signature = Signature... | [
"0.612353",
"0.5776409",
"0.54054403",
"0.5356659",
"0.531903",
"0.5311535",
"0.5274433",
"0.5203422",
"0.51766014",
"0.516375",
"0.51597756",
"0.51216894",
"0.5115925",
"0.5112671",
"0.5101581",
"0.509846",
"0.5093916",
"0.5073344",
"0.5058993",
"0.50416017",
"0.50329405",
... | 0.93440866 | 0 |
Test case for create_negative_feedback_removal | def test_create_negative_feedback_removal(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_negation_lib(self):\n\t\tobj_ut = sentiment.create_negation_lib(\n\t\t\t{'good': (1, 0), 'bad': (-1, 1)})\n\t\tself.assertEqual(obj_ut, \n\t\t\t{'(not|dont|cant|wont|couldnt|shouldnt|never) (\\w+ ){0,2} ?good': (-1, 0),\n\t\t\t'(not|dont|cant|wont|couldnt|shouldnt|never) (\\w+ ){0,2} ?bad': (1, 1)}... | [
"0.61743224",
"0.613169",
"0.59002346",
"0.5882625",
"0.5860437",
"0.5758887",
"0.5735645",
"0.5587674",
"0.55328214",
"0.5497151",
"0.54908735",
"0.54870784",
"0.5481976",
"0.5478671",
"0.5476341",
"0.5464087",
"0.545074",
"0.54471904",
"0.542729",
"0.5426669",
"0.5418637",
... | 0.9478464 | 0 |
Test case for create_unexpected_problem | def test_create_unexpected_problem(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def experiment3():\n raise FAKE_ERROR",
"def test_new_invalid(self) -> None:\n with pytest.raises(TypeError) as excinfo:\n RunwayTestDefinition({}) # type: ignore\n assert str(excinfo.value).startswith(\"expected data of type\")",
"def test_sudoku_solver_handles_non_unique():\n ... | [
"0.6768565",
"0.6656664",
"0.6578734",
"0.63179374",
"0.63022935",
"0.62959737",
"0.6288068",
"0.6240219",
"0.6213391",
"0.6197061",
"0.618583",
"0.61632514",
"0.61621207",
"0.6159961",
"0.6150027",
"0.6137859",
"0.6130107",
"0.6105219",
"0.6092331",
"0.6080698",
"0.6080514",... | 0.85026824 | 0 |
Test case for create_warranty | def test_create_warranty(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_virtual_account_beneficiary(self):\n pass",
"def test_create_virtual_account_pay_out(self):\n pass",
"def test_client_bank_account_create(self):\n pass",
"def test_client_risk_assessment_create(self):\n pass",
"def action_budget_create(self, cr, uid, ids, context... | [
"0.68548644",
"0.6341823",
"0.62204736",
"0.618944",
"0.61823493",
"0.61186576",
"0.61127836",
"0.6051724",
"0.594849",
"0.5898062",
"0.58835584",
"0.58772254",
"0.5816538",
"0.5808806",
"0.58075273",
"0.57813096",
"0.578003",
"0.5768906",
"0.57654166",
"0.57476926",
"0.57473... | 0.94164 | 0 |
Test case for get_attributes | def test_get_attributes(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_attribute_data(self):\n pass",
"def test_attributes(self):\n attributes = storage.attributes()[\"Review\"]\n b = Review()\n for k, v in attributes.items():\n self.assertTrue(hasattr(b, k))\n self.assertEqual(type(getattr(b, k, None)), v)",
"def get... | [
"0.79600513",
"0.73164415",
"0.71118635",
"0.71058667",
"0.7071223",
"0.7024316",
"0.6984096",
"0.6911866",
"0.6721754",
"0.65957254",
"0.655783",
"0.6552561",
"0.6538842",
"0.65320754",
"0.6513027",
"0.65050244",
"0.64938843",
"0.64866674",
"0.64771456",
"0.64756924",
"0.643... | 0.89939904 | 0 |
Test case for get_messaging_actions_for_order | def test_get_messaging_actions_for_order(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_actions(self, custom_move_ordering = False) :\n raise NotImplementedError",
"def test_message_list():",
"def test_messaging_list(self):\n response = self.client.get(reverse('messaging'))\n self.assertEqual(response.status_code, 200)",
"def test_get_order(self):\n pass"... | [
"0.6305948",
"0.62650424",
"0.61977506",
"0.612485",
"0.60426164",
"0.60245794",
"0.60190266",
"0.58549047",
"0.5824185",
"0.57388324",
"0.57066274",
"0.57002103",
"0.5670553",
"0.5667317",
"0.5646568",
"0.56447494",
"0.5596364",
"0.558604",
"0.5584028",
"0.55675095",
"0.5537... | 0.9587571 | 0 |
Returns the list of jobs corresponding to the given expression. | def get_jobs(self, expression):
return list(parse_job_list(expression, context=self.cc)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_jobs():\n\n name_to_job_details = redis_controller.get_name_to_job_details()\n return list(name_to_job_details.values())",
"def ListJobs(self, token=None):\n return aff4.FACTORY.Open(self.CRON_JOBS_PATH, token=token).ListChildren()",
"def get_job_list(self):\n job_list = []\n if... | [
"0.63745576",
"0.6350254",
"0.62808925",
"0.6213336",
"0.62003636",
"0.62003636",
"0.6188813",
"0.61206335",
"0.60789293",
"0.60668397",
"0.60516423",
"0.6040251",
"0.59888",
"0.5985822",
"0.5974521",
"0.5972032",
"0.59603536",
"0.59588015",
"0.5945055",
"0.5938119",
"0.59339... | 0.88570905 | 0 |
Retrieve the balance, as a float, for the card provided or None | def get_balance(card):
data = {
"Card.Number": card[0],
"Card.Pin": card[1],
}
response = requests.post(BALANCE_URL, data=data, headers=HEADERS)
if response.status_code == 200:
match = BALANCE_RE.search(response.text)
if match:
return float(match.group(1)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def balance(self, card_number):\n database_cursor.execute(f\"SELECT balance FROM card WHERE number = {card_number};\")\n return database_cursor.fetchone()[0]",
"def card_balance(self):\n return self._card_balance",
"def getBalance(self):\n connection = sqlite3.connect('/home/BorneAg... | [
"0.7621741",
"0.736081",
"0.71972495",
"0.7103851",
"0.7061253",
"0.70391446",
"0.70315486",
"0.7010028",
"0.69707686",
"0.6940693",
"0.6891209",
"0.68894285",
"0.68894285",
"0.686916",
"0.685889",
"0.68527913",
"0.68486357",
"0.6829318",
"0.68197906",
"0.681679",
"0.6802157"... | 0.85184824 | 0 |
Load the annotations of a TSV by `query_name` (contig name at the moment) | def load_annotation(file, klass, annotations):
with open(file, "rt") as ann_file:
for line in ann_file:
if "#" in line:
continue
parsed_line = klass(line)
if parsed_line.query_name in annotations:
annotations[parsed_line.query_name].append(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def access(self, queryName):\n self.fileHandle = open(self.fileName, 'r+b')\n self.mm = mmap.mmap(self.fileHandle.fileno(), 0)\n self.mm.seek(self.records[queryName])\n row = self.mm.readline().decode('utf-8').rstrip().split(\"\\t\")\n self.fileHandle.close()\n\n return se... | [
"0.5162822",
"0.5127797",
"0.5112118",
"0.5076921",
"0.5061441",
"0.49029863",
"0.4870618",
"0.48400995",
"0.47855732",
"0.4773302",
"0.4660398",
"0.46560547",
"0.45823792",
"0.4564221",
"0.45556876",
"0.45431504",
"0.45234275",
"0.45217073",
"0.4521247",
"0.4512112",
"0.4503... | 0.5610313 | 0 |
This function converts the KTENSOR M to a double array. | def double(M):
sz = M.Size
nn = [str(x) for x in reversed(range(0, M.Dimensions))]
A = np.dot(M.Weights.T, khatrirao(M, nn).T)
A = np.reshape(A, sz)
return A | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convertToDoubleArray(discreteFunction: cern.japc.value.DiscreteFunction) -> typing.List[float]:\n ...",
"def getDoubleArray2D(self) -> typing.List[typing.List[float]]:\n ...",
"def th_to_arr(tens: torch.Tensor) -> np.ndarray:\n return check_tensor(tens).cpu().detach().numpy()",
"def _ser... | [
"0.5950423",
"0.59152734",
"0.58426774",
"0.5804454",
"0.5633202",
"0.545425",
"0.5440536",
"0.54348665",
"0.5419167",
"0.5377191",
"0.5351686",
"0.5334607",
"0.5324618",
"0.53046805",
"0.52865154",
"0.52590835",
"0.5242718",
"0.5196191",
"0.5186069",
"0.5183295",
"0.51718336... | 0.6548286 | 0 |
Counts the maximum height from the given parent | def __count_height(parent=self.root, height=0):
if height > self.max_height:
self.max_height = height
for child in parent.children:
__count_height(parent=child, height=height+1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def height(self):\n if self.children == []:\n return 1 \n else:\n arr = []\n for child in self.children:\n result = 1 + child.height()\n arr.append(result)\n return max(arr)",
"def height(self):\n return 0 if not self.parent else 1 + self.parent.height",
"def heig... | [
"0.78083163",
"0.7467634",
"0.74064803",
"0.7357773",
"0.7225404",
"0.72117424",
"0.7203888",
"0.7012539",
"0.68966454",
"0.68615556",
"0.6778054",
"0.67602813",
"0.67007595",
"0.66994387",
"0.66337556",
"0.66325307",
"0.66325307",
"0.66325307",
"0.6628902",
"0.6613264",
"0.6... | 0.7863243 | 0 |
Traverse the tree, keeping record of what height we're at. Also add each node at the current level in the appropriate key in the dictionary | def __fill_levels_dict(parent=self.root, height=1):
if not parent.children:
return # we've already added the parent to the appropriate level
elif height not in levels_dict:
levels_dict[height] = []
for child in parent.children:
levels_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_heights(self):\n #print self.node.left\n if self.node:\n if self.node.left: \n self.node.left.update_heights()\n if self.node.right:\n self.node.right.update_heights()\n \n self.height = 1 + max(self.node.left.height... | [
"0.6084814",
"0.59537274",
"0.5946816",
"0.5931445",
"0.5929069",
"0.5909718",
"0.59062064",
"0.5880288",
"0.58626086",
"0.5786759",
"0.5778405",
"0.5774232",
"0.5741274",
"0.57304734",
"0.5718705",
"0.57156336",
"0.5692919",
"0.568957",
"0.5681424",
"0.56808627",
"0.5674986"... | 0.6810274 | 0 |
Fills a list of consecutive connections in it, in other words, traverses a tree from left to right | def __fill_consecutive_tree_levels(parent=self.root):
for child in parent.children:
lst.append(child.value)
__fill_consecutive_tree_levels(parent=child) # call recursively | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_looped(self) -> None:\n self.most_right.right_node = self.most_left\n self.most_left.left_node = self.most_right",
"def set_connection_between_nodes(self):\n\n for i, node in enumerate(self.list_empty_nodes):\n line = node.labyrinth_position[0]\n column = node.... | [
"0.6386683",
"0.6300159",
"0.61331606",
"0.59561944",
"0.59499395",
"0.5913652",
"0.59133846",
"0.5887606",
"0.58289546",
"0.58144665",
"0.58100575",
"0.5808032",
"0.57770234",
"0.57761735",
"0.57743025",
"0.57691723",
"0.57605404",
"0.5743278",
"0.57191104",
"0.5712075",
"0.... | 0.64723986 | 0 |
Subclasses could use `inputs` to determine the cachekey | def _get_cache_key(self, inputs: Dict[str, Tensor], prefix: str) -> Optional[str]:
if self.time_varying_kwargs is not None:
if len(set(inputs).intersection(self.time_varying_kwargs)) > 0:
return None
return f'{prefix}_static' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cache_key(self):",
"def _cache_key(self, *args):\n return hash(tuple(hash(arg.data.tobytes()) if isinstance(arg, np.ndarray) else arg for arg in args))",
"def get_cache_key(self, *args, **kwargs):\n key = self._key(*self._inject_obj(args), **kwargs)\n\n if self._hash_algorithm:\n ... | [
"0.71281177",
"0.68226266",
"0.6291418",
"0.6221216",
"0.58811414",
"0.5832397",
"0.5830708",
"0.5823913",
"0.5798889",
"0.5796075",
"0.5785081",
"0.57735",
"0.57368803",
"0.5733657",
"0.57050365",
"0.5658425",
"0.5642542",
"0.561851",
"0.5599898",
"0.5582295",
"0.55810314",
... | 0.7215682 | 0 |
Tests the CharacterFromHexID() method. | def testGetCharacterFromHexID(self):
db = beerlogdb.BeerLogDB(self.DB_PATH)
db.known_tags_list = {
'charX': {'name': 'toto', 'glass': 33},
'charY': {'name': 'toto', 'glass': 45}
}
db.AddEntry('charX', 'picX')
self.assertEqual(db.GetCharacterFromHexID('non-ex'), None)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_is_valid_hex(self):\n self.assertTrue(is_valid_hex('#aabb11'))\n self.assertTrue(is_valid_hex('#000'))\n self.assertTrue(is_valid_hex('#aaa'))\n self.assertFalse(is_valid_hex('black'))\n self.assertFalse(is_valid_hex('bl(ack'))",
"def ishex(char: chr) -> bool:\n ret... | [
"0.65897",
"0.6329143",
"0.6178433",
"0.6149218",
"0.6033612",
"0.60086083",
"0.5973618",
"0.59157634",
"0.5910799",
"0.590169",
"0.5821076",
"0.5811689",
"0.5796738",
"0.57467216",
"0.57467055",
"0.57400167",
"0.5735188",
"0.57143587",
"0.5650564",
"0.56218284",
"0.55968213"... | 0.83986276 | 0 |
Calculates reward, applies chosen move to board, then returns board. | def simulate(board, move):
reward = 0
board.apply_white_move(move)
if board.cur_player_won() == 1:
reward = 1
elif board.cur_player_won() == 2:
reward = -1
elif board.cur_player_won() == 0:
reward = -.25
return board, reward | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reward_move(self, col):\n \n reward_valid_move = 1\n \n reward = reward_valid_move\n \n if not self.game.valid_move(col):\n next_state, reward, done = self.game.board, -10, True\n return(next_state, reward, done)\n \n #Make move and ... | [
"0.75850725",
"0.7187767",
"0.7040105",
"0.69829214",
"0.6854276",
"0.68425983",
"0.68306786",
"0.6815861",
"0.6813692",
"0.6796891",
"0.673084",
"0.67247397",
"0.6711518",
"0.67039233",
"0.6698455",
"0.6675449",
"0.66680753",
"0.66291106",
"0.66188776",
"0.6594422",
"0.65935... | 0.7562942 | 1 |
Returns next item in the work list. Skips items of value 'None'. If no items remain and the nomore flag is True, raises StopIteration. Otherwise, waits and tries again. If told no new items will be added and the work list has been exhausted, then will stop waiting for new items and will raise a StopIteration. | def next(self):
while True: # waiting
item = self.get_next_if_any()
if item is not None: # feature: value None is filtered out
return item
if self.nomore: # if nothing else is coming
break # stop waiting
time.sleep(0.1) # wai... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_next_if_any(self):\n try:\n ret = self.work[deepcopy(self.i)]\n self.i += 1\n # print \"Trickling item\", self.i\n return ret\n except Exception:\n return None",
"async def next(self, default=NO_ITEM) -> typing.Any:\n try:\n ... | [
"0.74655056",
"0.64955515",
"0.6442161",
"0.6432927",
"0.6400945",
"0.6329992",
"0.6270726",
"0.6256504",
"0.62543",
"0.62171865",
"0.6211819",
"0.6162988",
"0.61603415",
"0.6150767",
"0.61029524",
"0.6100559",
"0.60471797",
"0.59945554",
"0.59578407",
"0.59394425",
"0.593227... | 0.81400174 | 0 |
Appends this worker (or these workers) at the end of the stream. If worker variable is not already a worker, wraps with this stream's default worker (as specified during __init__) Returns this stream. | def then(self, worker, **worker_overrides):
if hasattr(worker, "__iter__"):
map(self.then, worker)
else:
if not isinstance(worker, workers.Worker):
worker_args = deepcopy(self.defaults)
worker_args.update(worker_overrides)
worker = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def worker(self, worker):\n\n self._worker = worker",
"def __next__(self) -> type:\n\n return self._next_worker()",
"def setWorker(self, worker):\n pass",
"def worker(self):\n return self._worker",
"def add_worker(\n self, worker: Worker, start: bool = True, exclusive: bo... | [
"0.5504909",
"0.53708434",
"0.52602273",
"0.5217667",
"0.5182951",
"0.5018664",
"0.5003659",
"0.5001556",
"0.49047694",
"0.49025312",
"0.4883978",
"0.4803629",
"0.47905362",
"0.47161427",
"0.4699171",
"0.46758205",
"0.46617612",
"0.46419507",
"0.46381506",
"0.4584612",
"0.457... | 0.65711105 | 0 |
Check that the computation of the surface is correct | def test_comp_surface(self, test_dict):
test_obj = test_dict["test_obj"]
result = test_obj.slot.comp_surface()
a = result
b = test_dict["S_exp"]
msg = "Return " + str(a) + " expected " + str(b)
self.assertAlmostEqual((a - b) / a, 0, delta=DELTA, msg=msg)
b = com... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_surface_normal(self):\n vertices = np.array([[0, 1, 0], [0, 0, 0], [1, 0, 0]])\n expected = np.array([0, 0, 1])\n np.testing.assert_almost_equal(surface_normal(vertices), expected)\n\n # Test against multiple triangles\n vertices = np.r_[vertices[np.newaxis, :, :], [[[0,... | [
"0.648434",
"0.64014995",
"0.6387045",
"0.63502777",
"0.63365895",
"0.6276382",
"0.6201413",
"0.61749774",
"0.6148766",
"0.611976",
"0.60990405",
"0.60089684",
"0.5972668",
"0.59563845",
"0.59302884",
"0.5928751",
"0.5910537",
"0.58909357",
"0.58875406",
"0.5886219",
"0.58782... | 0.6950613 | 0 |
Check that the computation of the winding surface is correct | def test_comp_surface_wind(self, test_dict):
test_obj = test_dict["test_obj"]
result = test_obj.slot.comp_surface_wind()
a = result
b = test_dict["SW_exp"]
msg = "Return " + str(a) + " expected " + str(b)
self.assertAlmostEqual((a - b) / a, 0, delta=DELTA, msg=msg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_mesh(self):\n if not (np.abs(self.axis_u.dot(self.axis_v) < 1e-6) and #pylint: disable=no-member\n np.abs(self.axis_v.dot(self.axis_w) < 1e-6) and #pylint: disable=no-member\n np.abs(self.axis_w.dot(self.axis_u) < 1e-6)): ... | [
"0.61422455",
"0.60772735",
"0.6065987",
"0.6016259",
"0.59614533",
"0.59376514",
"0.5924527",
"0.59147125",
"0.59133303",
"0.5885209",
"0.58814895",
"0.5834012",
"0.5814362",
"0.5814126",
"0.580965",
"0.5792613",
"0.57859355",
"0.57595336",
"0.57427466",
"0.5728838",
"0.5710... | 0.7414952 | 0 |
Check that the computation of the average opening angle iscorrect | def test_comp_angle_opening(self, test_dict):
test_obj = test_dict["test_obj"]
a = test_obj.slot.comp_angle_opening()
self.assertEqual(a, 2 * pi / test_obj.slot.Zs)
b = comp_angle_opening(test_obj.slot)
msg = "Return " + str(a) + " expected " + str(b)
self.assertAlmostEq... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_angle(self):\n self.find_pixels()\n alpha_theta=np.deg2rad(70)\n alpha_phi=np.deg2rad(70)\n extreme_values=self.compute_extreme_values(alpha_phi, alpha_theta)\n x=np.linspace(extreme_values[0], extreme_values[1], self.number_of_pix[1])\n y=np.linspace(extreme_val... | [
"0.6744508",
"0.64489716",
"0.6211558",
"0.6163213",
"0.60393167",
"0.60264164",
"0.59936404",
"0.5992981",
"0.5992811",
"0.5881047",
"0.58440727",
"0.5830698",
"0.58250314",
"0.57599205",
"0.5752049",
"0.5744293",
"0.57281536",
"0.57260376",
"0.5700456",
"0.5696015",
"0.5691... | 0.65879107 | 1 |
Elementwise product of two vectors plus a third one, with the application of an activation function when it is specified. | def xewy_plus_z(x, y, z, activation=None):
R = tf.add(tf.multiply(x, y), z)
if activation:
return activation(R)
else:
return R | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _forward(z: np.array, W: np.array, b: np.array,\n activation: str) -> np.array:\n a = np.dot(z, W) + b\n if activation == 'sigmoid':\n return sigmoid(a)\n elif activation == 'identity':\n return identity(a)",
"def activate(self, inputs: Tuple[float, ...]) -> Tuple[float, ..... | [
"0.66088736",
"0.6501206",
"0.6463272",
"0.6433553",
"0.64194316",
"0.636197",
"0.6361468",
"0.6323663",
"0.6321082",
"0.6295754",
"0.6272025",
"0.6267631",
"0.62512195",
"0.6249915",
"0.62197006",
"0.62100524",
"0.62039775",
"0.62010866",
"0.61958027",
"0.6163765",
"0.616268... | 0.66119117 | 0 |
Multiply a vector by a scalar and add it to a second vector, with the application of an activation function when it is specified. | def xscalary_plus_z(scalar, x, y, activation=None):
R = tf.add(tf.scalar_mul(scalar,x), y)
if activation:
return activation(R)
else:
return R | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xewy_plus_z(x, y, z, activation=None):\n R = tf.add(tf.multiply(x, y), z)\n if activation:\n return activation(R)\n else: \n return R",
"def _forward(z: np.array, W: np.array, b: np.array,\n activation: str) -> np.array:\n a = np.dot(z, W) + b\n if activation == 'sigm... | [
"0.67259",
"0.67085737",
"0.6587271",
"0.65872025",
"0.64035785",
"0.6347857",
"0.6258598",
"0.62472576",
"0.62441075",
"0.62427694",
"0.6239453",
"0.61397773",
"0.6062691",
"0.60594213",
"0.60591257",
"0.6036085",
"0.5991605",
"0.5979216",
"0.59601164",
"0.59566545",
"0.5956... | 0.705384 | 0 |
Override the method to change the form attribute empty_permitted | def _construct_form(self, i, **kwargs):
form = super(RequiredInlineFormSet, self)._construct_form(i, **kwargs)
form.empty_permitted = False
return form | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _construct_form(self, i, **kwargs):\n form = super(NestedFormSet, self)._construct_form(i, **kwargs)\n form.empty_permitted = False\n return form",
"def __init__(self, *args, **kwargs):\n super(CategoryForm, self).__init__(*args, **kwargs)\n\n if self.initial.get('protected... | [
"0.6425543",
"0.61998117",
"0.59238124",
"0.5922123",
"0.58086765",
"0.57932514",
"0.574003",
"0.57353485",
"0.56570464",
"0.55905885",
"0.5523937",
"0.5512182",
"0.5509741",
"0.54385287",
"0.54385287",
"0.54242945",
"0.54011256",
"0.5375523",
"0.5362281",
"0.53096277",
"0.53... | 0.6683277 | 0 |
Saves resized image after face detected on webcam. | def detect_from_video_save_resized_face(path_output_folder="facedetect",
path_cascade="../haarcascades/haarcascade_frontalface_default.xml"):
face_cascade = cv2.CascadeClassifier(path_cascade)
cap = cv2.VideoCapture(0)
while True:
ret, img = cap.read()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def capture():\n stream = BytesIO()\n cam.capture(stream, 'jpeg')\n data = np.fromstring(stream.getvalue(), dtype=np.uint8)\n # \"Decode\" the image preserving color\n img = cv2.imdecode(data, 1)\n # switch BGR order to RGB order\n img = img[:, :, ::-1]\n\n # resize image to match training ... | [
"0.6644161",
"0.6604761",
"0.64253324",
"0.6417712",
"0.63785136",
"0.6338119",
"0.6315748",
"0.6297782",
"0.6282529",
"0.6270014",
"0.6198473",
"0.61769366",
"0.61699426",
"0.61313194",
"0.60818434",
"0.60727125",
"0.6056001",
"0.6041248",
"0.60264856",
"0.5993192",
"0.59128... | 0.7036274 | 0 |
Create the tracer and set a handler for trace events. | def setUp(self):
self.tracer = Tracer()
self.function_events = []
self.variable_events = []
def handler(changed):
event = changed['new']
if self.filter_trace_function_event(event):
self.function_events.append(event)
elif self.fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_tracing(tracer=None, start_span_cb=None):\n if start_span_cb is not None and not callable(start_span_cb):\n raise ValueError('start_span_cb is not callable')\n\n global _g_tracer, _g_start_span_cb\n if hasattr(tracer, '_tracer'):\n tracer = tracer._tracer\n\n _g_tracer = tracer\n... | [
"0.62816995",
"0.5782908",
"0.5774504",
"0.5713972",
"0.56444633",
"0.544514",
"0.54251957",
"0.54084814",
"0.53963363",
"0.5328712",
"0.52960986",
"0.5233753",
"0.5204562",
"0.5182187",
"0.5182001",
"0.5154557",
"0.51509136",
"0.51241714",
"0.51182264",
"0.51073396",
"0.5104... | 0.63813096 | 0 |
Whether to save trace event related to variables. | def filter_trace_variable_event(self, event):
return isinstance(event, (TraceAccess, TraceAssign, TraceDelete)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def recordVariable(self, variableName, data):\n if str(variableName) in self.currentLog:\n # if self.currentLog[str(variableName)] != None:\n # raise Warning(f'data point {str(variableName)} is being overwritten!')\n self.currentLog[str(variableName)] = data\n els... | [
"0.59064573",
"0.5631601",
"0.5485308",
"0.5481387",
"0.5456615",
"0.54522204",
"0.5402356",
"0.53983414",
"0.53939956",
"0.5386686",
"0.53377587",
"0.5326128",
"0.53120804",
"0.5308535",
"0.5286376",
"0.52801",
"0.5273852",
"0.52278304",
"0.5220722",
"0.5219512",
"0.52100044... | 0.6527303 | 0 |
Trace code in environment with test objects. | def trace(self, code, env=None):
env = env or {}
env.update(dict(objects=objects))
return self.tracer.trace(dedent(code), env=env) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trace(self, trace=...):\n ...",
"def debug(self):\r\n for test in self:\r\n test.debug()",
"def startTestHook(self):",
"def run(self, test, env):\n\n raise NotImplementedError",
"def test_debug_context_construction():\n sl = _ir.SourceLocation(\"foo\", \"bar.py\", 10)\n ... | [
"0.63645566",
"0.6071628",
"0.6060924",
"0.594382",
"0.5856838",
"0.5848957",
"0.5842562",
"0.5816537",
"0.5784281",
"0.57832336",
"0.5777108",
"0.57752305",
"0.5766327",
"0.5742422",
"0.57191175",
"0.57191175",
"0.5703751",
"0.5692103",
"0.5691544",
"0.5686181",
"0.56779915"... | 0.7158912 | 0 |
Test that the bodies of atomic functions are not traced. | def test_atomic_nested_return(self):
env = self.trace("""
foo = objects.nested_create_foo()
""")
events = self.function_events
self.assertEqual(len(events), 2)
self.assertIsInstance(events[0], TraceCall)
self.assertIsInstance(events[1], TraceReturn)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_empty_functions():",
"def test_barrier():\n parrent_test_barrier(UseSpinLock=False)",
"def test_noWorkDoneWhenConcurrentlyDeleted(self):\n # Provide access to a method called \"concurrently\" everything using\n original = self.store.newTransaction\n\n def decorate(*a, **k):\n ... | [
"0.5827671",
"0.5805278",
"0.5745873",
"0.5713005",
"0.5700248",
"0.56656265",
"0.55476797",
"0.5522474",
"0.5498406",
"0.5471013",
"0.54631686",
"0.5461315",
"0.5450431",
"0.54263794",
"0.5403638",
"0.5399862",
"0.5358972",
"0.53576165",
"0.5352254",
"0.5341456",
"0.5318877"... | 0.59146017 | 0 |
Can the tracer pass boxed values from a function return? | def test_boxed_return(self):
self.trace("objects.bar_from_foo(objects.Foo())")
events = self.function_events
self.assertEqual(len(events), 4)
self.assertEqual(events[2].qual_name, 'bar_from_foo')
self.assertIsInstance(events[2].arguments['foo'], objects.Foo)
eve... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_returned_tracer(return_val):\n if (isinstance(return_val, int)):\n check(return_val)\n tr = None\n else:\n tr, _ = return_val\n return tr",
"def call_tracing(func, args): # real signature unknown; restored from __doc__\n return object()",
"def test_variable_assign_bo... | [
"0.6028828",
"0.5836437",
"0.5826082",
"0.5518435",
"0.542912",
"0.53613496",
"0.5357364",
"0.5342223",
"0.530123",
"0.52407235",
"0.5239991",
"0.52350456",
"0.5193536",
"0.51898247",
"0.5162487",
"0.5157347",
"0.51545703",
"0.51384735",
"0.51367134",
"0.5121965",
"0.5100509"... | 0.65397644 | 0 |
Are variable assignments traced? | def test_variable_assign(self):
self.trace('x = 1')
events = self.variable_events
self.assertEqual(len(events), 1)
event = events[0]
self.assertIsInstance(event, TraceAssign)
self.assertEqual(event.name, 'x')
self.assertEqual(event.value, 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_variable_assign_boxed_access(self):\n self.trace('y = x', env={'x': 1})\n\n events = self.variable_events\n self.assertEqual(len(events), 2)\n self.assertIsInstance(events[0], TraceAccess)\n self.assertIsInstance(events[1], TraceAssign)\n self.assertEqual(events[1... | [
"0.6159906",
"0.60442746",
"0.59948504",
"0.5929431",
"0.5843179",
"0.57362336",
"0.573428",
"0.5690166",
"0.5617923",
"0.5531957",
"0.5517882",
"0.54328513",
"0.54155266",
"0.53267574",
"0.53241843",
"0.53067744",
"0.53018683",
"0.5297927",
"0.5279224",
"0.5276886",
"0.52709... | 0.6320988 | 0 |
Can the tracer pass boxed return values to variable assignments? | def test_variable_assign_boxed_return(self):
env = self.trace('foo = objects.Foo()')
events = self.variable_events
event = next(evt for evt in events if isinstance(evt, TraceAssign))
self.assertEqual(event.name, 'foo')
self.assertEqual(event.value, env['foo'])
self.asser... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_variable_compound_assign_boxed_return(self):\n env = self.trace('foo, bar = objects.create_foo_and_bar()')\n\n events = self.variable_events\n event = next(evt for evt in events if isinstance(evt, TraceAssign))\n self.assertEqual(event.name, ('foo','bar'))\n self.assertE... | [
"0.65105355",
"0.61445034",
"0.60747725",
"0.59841084",
"0.5958843",
"0.559325",
"0.5456712",
"0.54126793",
"0.5376374",
"0.5308123",
"0.52532095",
"0.5235374",
"0.51305974",
"0.51108074",
"0.5094886",
"0.5094862",
"0.50777066",
"0.5070217",
"0.49944",
"0.49849743",
"0.498490... | 0.7044405 | 0 |
Can the tracer pass boxed return values to a compound assignment? | def test_variable_compound_assign_boxed_return(self):
env = self.trace('foo, bar = objects.create_foo_and_bar()')
events = self.variable_events
event = next(evt for evt in events if isinstance(evt, TraceAssign))
self.assertEqual(event.name, ('foo','bar'))
self.assertEqual(event.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_variable_assign_boxed_return(self):\n env = self.trace('foo = objects.Foo()')\n\n events = self.variable_events\n event = next(evt for evt in events if isinstance(evt, TraceAssign))\n self.assertEqual(event.name, 'foo')\n self.assertEqual(event.value, env['foo'])\n ... | [
"0.6564246",
"0.5951312",
"0.5496067",
"0.5466746",
"0.54447424",
"0.54364455",
"0.54172575",
"0.54036856",
"0.53467405",
"0.5336638",
"0.5309598",
"0.52944237",
"0.52943116",
"0.5257302",
"0.5189688",
"0.516366",
"0.51517004",
"0.51401836",
"0.51346964",
"0.5134258",
"0.5133... | 0.67143565 | 0 |
Can the tracer pass boxed variable values to variable assignments? | def test_variable_assign_boxed_access(self):
self.trace('y = x', env={'x': 1})
events = self.variable_events
self.assertEqual(len(events), 2)
self.assertIsInstance(events[0], TraceAccess)
self.assertIsInstance(events[1], TraceAssign)
self.assertEqual(events[1].value_even... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_variable_assign_boxed_return(self):\n env = self.trace('foo = objects.Foo()')\n\n events = self.variable_events\n event = next(evt for evt in events if isinstance(evt, TraceAssign))\n self.assertEqual(event.name, 'foo')\n self.assertEqual(event.value, env['foo'])\n ... | [
"0.64886576",
"0.60425764",
"0.5838622",
"0.57287914",
"0.55100805",
"0.54749477",
"0.50861436",
"0.50760114",
"0.5012188",
"0.4972683",
"0.4969698",
"0.4969698",
"0.4969698",
"0.4969698",
"0.4969698",
"0.49633616",
"0.49473312",
"0.49262488",
"0.49213117",
"0.48820713",
"0.4... | 0.65229994 | 0 |
Are variable deletions traced? | def test_variable_delete(self):
self.trace('del x', env={'x': 1})
events = self.variable_events
self.assertEqual(len(events), 1)
event = events[0]
self.assertIsInstance(event, TraceDelete)
self.assertEqual(event.name, 'x') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_ordered_refcount_after_del(cls):\n obj = cls(0)\n rc = sys.getrefcount(obj)\n sl = orderedstructs.SkipList(object)\n sl.insert(obj)\n del sl\n assert sys.getrefcount(obj) == rc",
"def check_for_deletion(self, track, **kwargs):\n\n track_covar_trace = np.trace(track.state.covar)\... | [
"0.62971085",
"0.61925054",
"0.6032208",
"0.60001224",
"0.5861373",
"0.5775734",
"0.57498837",
"0.5727776",
"0.5710851",
"0.56335485",
"0.56288576",
"0.5595604",
"0.55872583",
"0.55780077",
"0.5574445",
"0.5542232",
"0.55183065",
"0.54611284",
"0.54586977",
"0.5450595",
"0.54... | 0.6428408 | 0 |
Return cdll ref of xclib. | def lib(cls):
if not cls._lib:
cls._lib.append(cygnet4k._xclib())
return cls._lib[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_libc():\n libc = ctypes.CDLL(ctypes.util.find_library('c'))\n if not libc:\n raise Exception('Could not load libc.')\n return libc",
"def _ask_ctypes(self):\n if os.name == 'nt':\n libpath = find_library(self._libname)\n libpath = libpath if libpath is not No... | [
"0.61826015",
"0.598829",
"0.56921107",
"0.55715835",
"0.53403175",
"0.5210613",
"0.5181612",
"0.51067203",
"0.5103992",
"0.5090214",
"0.49877876",
"0.49640614",
"0.49640614",
"0.49612552",
"0.49477884",
"0.49316347",
"0.49316347",
"0.49168888",
"0.48858187",
"0.4870333",
"0.... | 0.6610011 | 0 |
Get system state byte. | def system_state(self):
byte = ord(self._serial_io(b'\x49', 1))
self._serial_ack = bool(byte & (1 << 4))
self._serial_chk = bool(byte & (1 << 6))
return byte | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_system_state(self):\n byte = self.system_state\n return {\n 'chksum': bool(byte & (1 << 6)),\n 'ack': bool(byte & (1 << 4)),\n 'FPGAboot': bool(byte & (1 << 2)),\n 'FPGArun': bool(byte & (1 << 1)),\n 'FPGAcom': bool(byte & (1 << 0)),\n ... | [
"0.67487335",
"0.64340913",
"0.64086384",
"0.64025",
"0.6344891",
"0.63243854",
"0.6297151",
"0.6252535",
"0.6189081",
"0.6182659",
"0.6146663",
"0.6107864",
"0.6105023",
"0.6100191",
"0.6091442",
"0.6071827",
"0.6046282",
"0.6033162",
"0.5989367",
"0.598059",
"0.59798235",
... | 0.7707723 | 0 |
Get system state as dict. | def get_system_state(self):
byte = self.system_state
return {
'chksum': bool(byte & (1 << 6)),
'ack': bool(byte & (1 << 4)),
'FPGAboot': bool(byte & (1 << 2)),
'FPGArun': bool(byte & (1 << 1)),
'FPGAcom': bool(byte & (1 << 0)),
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_system_status(self):\n sysinfo_strings = self._command(self.commands[\"SYSTEM_STATUS\"])\n sysinfo_dict = {\"name\": sysinfo_strings[0]}\n for line in sysinfo_strings:\n if \":\" in line:\n key, value = line.split(\":\", 1)\n sysinfo_dict[key.lower()] = value.strip()\n\n ret... | [
"0.7515893",
"0.7410481",
"0.7376937",
"0.6977521",
"0.69204897",
"0.6875799",
"0.68692017",
"0.68692017",
"0.68475926",
"0.6825295",
"0.6821998",
"0.6787987",
"0.67565614",
"0.6732666",
"0.6720148",
"0.67135334",
"0.6681324",
"0.6673802",
"0.66601515",
"0.66599125",
"0.66428... | 0.75304043 | 0 |
Set system_state with chksum, ack, FPGAhold, and FPGAcomms. chksum Bit 6 = 1 to enable check sum mode ack Bit 4 = 1 to enable command ack FPGAhold Bit 1 = 0 to Hold FPGA in RESET; do not boot FPGAcom Bit 0 = 1 to enable comms to FPGA EPROM | def set_system_state(self, chksum, ack, FPGAhold, FPGAcom):
byte = 0
if chksum:
byte |= (1 << 6)
if ack:
byte |= (1 << 4)
if FPGAhold:
byte |= (1 << 1)
if FPGAcom:
byte |= (1 << 0)
self.system_state = byte | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def system_state(self):\n byte = ord(self._serial_io(b'\\x49', 1))\n self._serial_ack = bool(byte & (1 << 4))\n self._serial_chk = bool(byte & (1 << 6))\n return byte",
"def get_system_state(self):\n byte = self.system_state\n return {\n 'chksum': bool(byte & ... | [
"0.62094074",
"0.61402756",
"0.5307103",
"0.5257595",
"0.5230486",
"0.52102596",
"0.5192672",
"0.51521516",
"0.5147584",
"0.51462907",
"0.51456213",
"0.505391",
"0.5032786",
"0.5025016",
"0.5023751",
"0.5018762",
"0.500987",
"0.50043887",
"0.49984348",
"0.49979195",
"0.498900... | 0.8857549 | 0 |
Set trigger mode with rising, ext, abort, cont, fixed, and snap. | def set_trig_mode(self, rising, ext, abort, cont, fixed, snap):
byte = 0
if rising:
byte |= (1 << 7)
if ext:
byte |= (1 << 6)
if abort:
byte |= (1 << 3)
if cont:
byte |= (1 << 2)
if fixed:
byte |= (1 << 1)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trig_mode(self,trig_mode):\n if not trig_mode.lower()=='soft' and not trig_mode.lower()=='hard' :\n raise ValueError(\"trig_mode input must either be the string, 'soft', or 'hard' -- you entered {}\".format(trig_mode))\n else :\n self._trig_mode=trig_mode",
"def configure_... | [
"0.6766078",
"0.66396666",
"0.648441",
"0.64437246",
"0.64361656",
"0.6352157",
"0.61473644",
"0.6086386",
"0.6045014",
"0.6009757",
"0.5983806",
"0.5919349",
"0.5912908",
"0.58771074",
"0.5806764",
"0.5798711",
"0.5782155",
"0.5779745",
"0.57736355",
"0.57442796",
"0.5729154... | 0.78464127 | 0 |
ROI X size as 12bit value. | def roi_x_size():
def r(x):
return x & 0xFFF
def w(x):
return min(x, 0xFFF)
return r, w | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def x_size(self):\n pass",
"def XSize(self):\n return self.dataset.RasterXSize if self.dataset else None",
"def w(self):\r\n return self.size.x",
"def roi_y_size():\n def r(x):\n return x & 0xFFF\n\n def w(x):\n return min(x, 0xFFF)\n return r, w",
... | [
"0.666128",
"0.6323086",
"0.6269746",
"0.62463564",
"0.6062009",
"0.6027064",
"0.60231125",
"0.60221714",
"0.6022051",
"0.59965384",
"0.5989413",
"0.59768695",
"0.59735644",
"0.5950493",
"0.5938393",
"0.5892152",
"0.5873352",
"0.5873352",
"0.5873352",
"0.58702356",
"0.5863775... | 0.71416 | 0 |
ROI X offset as 12bit value. | def roi_x_offset():
def r(x):
return x & 0xFFF
def w(x):
return min(x, 0xFFF)
return r, w | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mni2vxl(coord):\n i = int((90.0 - coord[0]) / 2)\n j = int((coord[1] + 126) / 2)\n k = int((coord[2] + 72) / 2)\n return (i, j, k)",
"def roi_y_offset():\n def r(x):\n return x & 0xFFF\n\n def w(x):\n return min(x, 0xFFF)\n return r, w",
"def offset_pa... | [
"0.61680675",
"0.5955681",
"0.5947679",
"0.58671176",
"0.58583474",
"0.5791727",
"0.5740025",
"0.5726844",
"0.5724206",
"0.5684832",
"0.56541085",
"0.5617782",
"0.55670685",
"0.55592185",
"0.5547851",
"0.55270535",
"0.5526839",
"0.5521451",
"0.55198675",
"0.55198675",
"0.5519... | 0.72116363 | 0 |
Return fpga major version. | def fpga_major():
return int, None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def major_version(self) -> str:\n return pulumi.get(self, \"major_version\")",
"def major_version(self):\n return self.unpack_dword(0x14)",
"def major_version(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"major_version\")",
"def _major_version(self):\n version_tuple = S... | [
"0.7850918",
"0.7764115",
"0.769119",
"0.76065844",
"0.753991",
"0.7473961",
"0.74011755",
"0.72502184",
"0.7080827",
"0.704663",
"0.69637275",
"0.6929146",
"0.68896425",
"0.6808114",
"0.6804152",
"0.67754674",
"0.6768359",
"0.6768359",
"0.67522293",
"0.6729274",
"0.66481507"... | 0.7993317 | 0 |
ROI Y size as 12bit value. | def roi_y_size():
def r(x):
return x & 0xFFF
def w(x):
return min(x, 0xFFF)
return r, w | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def y_size(self):\n pass",
"def YSize(self):\n return self.dataset.RasterYSize if self.dataset else None",
"def ysize(self):\n bbox = self.bbox\n return bbox[1][1] - bbox[0][1]",
"def pixelsizey(self) -> ErrorValue:\n return ErrorValue(self._data['YPixel'], self._data.setde... | [
"0.7231735",
"0.7217034",
"0.6938226",
"0.6515881",
"0.626858",
"0.62373894",
"0.6220134",
"0.61887306",
"0.6144492",
"0.61231464",
"0.6120322",
"0.60751384",
"0.6070948",
"0.60636616",
"0.60208815",
"0.59778655",
"0.5946349",
"0.59352785",
"0.59248877",
"0.59144896",
"0.5904... | 0.74730587 | 0 |
ROI Y offset as 12bit value. | def roi_y_offset():
def r(x):
return x & 0xFFF
def w(x):
return min(x, 0xFFF)
return r, w | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def OffsetY(*args, **kwargs):\n return _gdi_.NativePixelData_Accessor_OffsetY(*args, **kwargs)",
"def OffsetY(*args, **kwargs):\n return _gdi_.AlphaPixelData_Accessor_OffsetY(*args, **kwargs)",
"def y(self):\n return self._reg2val(MMA7660_Y_ADDR)",
"def Get_RawOutY_Value(self):\r\n ... | [
"0.6575033",
"0.65668434",
"0.65213394",
"0.65005755",
"0.647236",
"0.621364",
"0.6211337",
"0.61470556",
"0.6121638",
"0.60891026",
"0.60891026",
"0.6081298",
"0.6070879",
"0.60560113",
"0.6021842",
"0.6018426",
"0.59647435",
"0.5944422",
"0.5892085",
"0.58908266",
"0.587133... | 0.7467001 | 0 |
Return True if device is open. | def dev_open(self):
return (self._dev_open & self.um) != 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_open(self):\n return self.__port.isOpen()",
"def _isopen(self):\n return self.dp.state()==PyTango.DevState.OPEN",
"def is_open(self):\n return (not self.interface.is_open)",
"def IsOpen(self):\n return self._is_open",
"def is_opening(self):\n if (\n self... | [
"0.83011603",
"0.8021129",
"0.7993215",
"0.7800356",
"0.7770285",
"0.7729628",
"0.7689912",
"0.7683751",
"0.7682355",
"0.76315796",
"0.75966465",
"0.75953656",
"0.7572194",
"0.7569632",
"0.75685227",
"0.7475662",
"0.7451086",
"0.7423746",
"0.7416068",
"0.7408924",
"0.73935896... | 0.81600344 | 1 |
Return True if capture is active. | def capture_is_active(self):
return self.um in self._streams | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_StartCapture_allowed(self):\n handler = self.get_command_object(\"StartCapture\")\n return handler.check_allowed()",
"def is_active(self) -> bool:\n return self._stream.active",
"def is_active(self):\n\t\tself.stream.is_active()",
"def is_active(self) -> bool:\n return self... | [
"0.73299444",
"0.6957818",
"0.69290864",
"0.69247603",
"0.690348",
"0.6901982",
"0.68615264",
"0.6809064",
"0.67720824",
"0.6687182",
"0.6648305",
"0.66287947",
"0.6614334",
"0.6614334",
"0.6614334",
"0.6614334",
"0.6614334",
"0.6614334",
"0.6614334",
"0.6614334",
"0.6614334"... | 0.8506218 | 0 |
Stop capture stream thread and return temperatures. | def stop_capture_stream(self, timeout=1):
if self.capture_is_active:
reader, writer = self._streams[self.um]
if timeout > 0 and not reader.nframes < 0:
timeout += time.time()
while reader.is_alive():
if time.time() > timeout:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_capture(self):\n super(Stenograph, self).stop_capture()\n self._machine = None\n self._stopped()",
"def stopit(self):\n\n self.stop.stop()\n self.stream.close()\n self.p.terminate()\n self.p = None\n\n print(\"Recording terminated!\")",
"def capt... | [
"0.6680677",
"0.6638463",
"0.65717655",
"0.65267825",
"0.6519306",
"0.6488697",
"0.64720607",
"0.6425576",
"0.6373947",
"0.63334817",
"0.6283778",
"0.6267373",
"0.62286115",
"0.62058985",
"0.62058985",
"0.62058985",
"0.62058985",
"0.6126386",
"0.61154115",
"0.61111766",
"0.60... | 0.7510811 | 0 |
Compute generic Repr for |obj| based on the attributes in |names|. | def GenericRepr(obj, names):
def ReprIndent(name, as_ref):
return ' %s=%s' % (name, Repr(getattr(obj, name), as_ref).replace(
'\n', '\n '))
return '%s(\n%s\n)' % (obj.__class__.__name__, ',\n'.join(
ReprIndent(name, as_ref) for (name, as_ref) in names.items())) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Str4R(obj):\n # for objects known by PypeR\n if type(obj) in str_func:\n return(str_func[type(obj)](obj))\n # for objects derived from basic data types\n for tp in base_tps:\n if isinstance(obj, tp):\n return(str_func[tp](obj))\n # for any other objects\n return(Other... | [
"0.59946764",
"0.591277",
"0.55515486",
"0.55214936",
"0.5360764",
"0.5230381",
"0.52042377",
"0.51961964",
"0.5188951",
"0.51823044",
"0.51361996",
"0.5128759",
"0.51116914",
"0.507108",
"0.5060306",
"0.50448316",
"0.502227",
"0.50202113",
"0.50147814",
"0.5008684",
"0.49876... | 0.7030446 | 0 |
Adds a property |name| to |cls|, which accesses the corresponding item in |shared_definition|. The reason of adding such indirection is to enable sharing definition | def AddSharedProperty(cls, name):
def Get(self):
try:
return self.shared_definition[name]
except KeyError: # Must raise AttributeError if property doesn't exist.
raise AttributeError
def Set(self, value):
self.shared_definition[name] = value
setattr(cls, name, property(G... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def declare_class_property(self, name):\n\n self.objc_class.forced_properties.add(name)",
"def create_property_on_class(self, cls, internal_name):\n if not self._use_custom_properties:\n if self._is_mutable:\n setter = partial(_setattr, internal_name)\n else:\n ... | [
"0.6280442",
"0.61499363",
"0.57264715",
"0.56344944",
"0.5550256",
"0.5474845",
"0.54550177",
"0.5367994",
"0.5221429",
"0.5173408",
"0.5036434",
"0.50268376",
"0.4992637",
"0.49715632",
"0.49208504",
"0.49060777",
"0.48774987",
"0.48417166",
"0.48385215",
"0.48377407",
"0.4... | 0.80107814 | 0 |
This struct is backwardcompatible with rhs (older_struct) if and only if | def IsBackwardCompatible(self, rhs, checker):
def buildOrdinalFieldMap(struct):
fields_by_ordinal = {}
for field in struct.fields:
if field.ordinal in fields_by_ordinal:
raise Exception('Multiple fields with ordinal %s in struct %s.' %
(field.ordinal, struct.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IsBackwardCompatible(self, rhs, checker):\n\n def buildVersionFieldMap(enum):\n fields_by_min_version = {}\n for field in enum.fields:\n if field.min_version not in fields_by_min_version:\n fields_by_min_version[field.min_version] = set()\n fields_by_min_version[field.min_ve... | [
"0.62898964",
"0.6216423",
"0.58415604",
"0.58266854",
"0.58205014",
"0.5773871",
"0.5571555",
"0.552816",
"0.54949903",
"0.54335356",
"0.5374461",
"0.5374461",
"0.53576714",
"0.5354171",
"0.5316855",
"0.5281696",
"0.5268299",
"0.52394736",
"0.52310854",
"0.52211916",
"0.5217... | 0.6935083 | 0 |
Check if the kind contains any handles. This check is recursive so it checks all struct fields, containers elements, etc. | def ContainsHandlesOrInterfaces(kind):
# We remember the types we already checked to avoid infinite recursion when
# checking recursive (or mutually recursive) types:
checked = set()
def Check(kind):
if kind.spec in checked:
return False
checked.add(kind.spec)
if IsStructKind(kind):
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ContainsNativeTypes(kind):\n # We remember the types we already checked to avoid infinite recursion when\n # checking recursive (or mutually recursive) types:\n checked = set()\n\n def Check(kind):\n if kind.spec in checked:\n return False\n checked.add(kind.spec)\n if IsEnumKind(kind):\n ... | [
"0.6222739",
"0.58711123",
"0.5368002",
"0.5323521",
"0.5293184",
"0.5293184",
"0.5247045",
"0.51481265",
"0.5106658",
"0.5061573",
"0.5048643",
"0.5044434",
"0.5029543",
"0.5012954",
"0.50115156",
"0.50096506",
"0.4986221",
"0.49582237",
"0.4882496",
"0.4868038",
"0.48618558... | 0.7486737 | 0 |
Check if the kind contains any native type (struct or enum). This check is recursive so it checks all struct fields, scoped interface enums, etc. | def ContainsNativeTypes(kind):
# We remember the types we already checked to avoid infinite recursion when
# checking recursive (or mutually recursive) types:
checked = set()
def Check(kind):
if kind.spec in checked:
return False
checked.add(kind.spec)
if IsEnumKind(kind):
return kind.n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ContainsHandlesOrInterfaces(kind):\n # We remember the types we already checked to avoid infinite recursion when\n # checking recursive (or mutually recursive) types:\n checked = set()\n\n def Check(kind):\n if kind.spec in checked:\n return False\n checked.add(kind.spec)\n if IsStructKind(ki... | [
"0.72254103",
"0.61171633",
"0.58185405",
"0.5535777",
"0.55214554",
"0.5477587",
"0.5418707",
"0.54124457",
"0.53940755",
"0.535638",
"0.5315527",
"0.522809",
"0.5207957",
"0.5207909",
"0.5201473",
"0.5198814",
"0.5192182",
"0.5192182",
"0.51751685",
"0.5155406",
"0.51364475... | 0.81297976 | 0 |
Instantiate a new compose promoter. | def __init__(self, client, working_dir, compose_url=None):
super(ComposePromoter, self).__init__(client, working_dir)
self.compose_url = compose_url
# Current supported promotions for CentOS compose
self.supported_promotions = [
{'candidate': 'latest-compose', 'target': 'cent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_instance(c_instance):\n return MonoPedal(c_instance)",
"def compose(\n context, command, user=get_local_user(), remote=False, instance=None, stack=None\n):\n run_command(context, user, remote, instance, stack, command)",
"def composition(request):\n result = Composition(request, 'mapserv... | [
"0.53089076",
"0.530249",
"0.5278884",
"0.52515864",
"0.52414966",
"0.4907694",
"0.49061665",
"0.48827615",
"0.4876873",
"0.4858719",
"0.48207074",
"0.48193344",
"0.47997853",
"0.47669575",
"0.47531116",
"0.4745054",
"0.4735285",
"0.46958497",
"0.46923736",
"0.46901327",
"0.4... | 0.6625531 | 0 |
Retrieves the latest compose from centos url. | def retrieve_latest_compose(self):
try:
latest_compose_id = urllib.request.urlopen(
self.compose_url).readline().decode('utf-8')
except Exception:
msg = ("Failed to retrieve latest compose from url: %s"
% self.compose_url)
self.log.e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_rest_url(self, url):\n print(\"This is a Capella run. Finding the srv domain for {}\".format(url))\n srv_info = {}\n srv_records = dns.resolver.resolve('_couchbases._tcp.' + url, 'SRV')\n for srv in srv_records:\n srv_info['host'] = str(srv.target).rstrip('.')\n ... | [
"0.570704",
"0.5418897",
"0.53101856",
"0.5219973",
"0.5211237",
"0.5200204",
"0.51801026",
"0.51608914",
"0.5113058",
"0.51005405",
"0.50899076",
"0.50899076",
"0.5073472",
"0.5052529",
"0.50345",
"0.5005683",
"0.4983731",
"0.49273744",
"0.4926152",
"0.4915466",
"0.49146825"... | 0.6985737 | 0 |
Retrieves promotion file name and content for latestcompose. | def get_promotion_content(self, target_label, candidate_label=None):
if candidate_label != 'latest-compose':
msg = ("Candidate label '%s' not supported." % candidate_label)
self.log.error(msg)
raise PromoterError(details=msg)
latest_compose_id = self.retrieve_latest_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieve_latest_compose(self):\n try:\n latest_compose_id = urllib.request.urlopen(\n self.compose_url).readline().decode('utf-8')\n except Exception:\n msg = (\"Failed to retrieve latest compose from url: %s\"\n % self.compose_url)\n ... | [
"0.58836114",
"0.535186",
"0.5285397",
"0.5242794",
"0.5240712",
"0.52304906",
"0.51407814",
"0.50846195",
"0.50437033",
"0.50355476",
"0.50059104",
"0.4927652",
"0.49218184",
"0.489893",
"0.48858878",
"0.48804277",
"0.48465237",
"0.4819735",
"0.48075333",
"0.48035833",
"0.48... | 0.64572775 | 0 |
get_individual_posterior(index) Find the posteriors for a data point as a Gaussian mixture, with each component in he mixture corresponding to a node that the data point appears in. | def get_individual_posterior(self, index):
# initialise a GMM
post_GMM = gmm.GMM()
# Check if posteriors have been found for cluster_bhc
if self.cluster_bhc.post_GMMs is None:
self.cluster_bhc.get_single_posteriors()
# get required posterior dist
if self.ass... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def grd_posterior_gaussian(self, ) -> Tuple[np.ndarray, np.ndarray]:\n xmin, xmax = self.x_range\n ymin, ymax = self.y_range\n\n mu = np.array([0, 0])\n sigma = np.zeros((2, 2))\n\n _sample = self._sample\n _prior = self.prior\n\n def mean_x(x: float, y: float):\n ... | [
"0.578395",
"0.5758919",
"0.5523767",
"0.550721",
"0.5488414",
"0.54657024",
"0.5463652",
"0.5445946",
"0.5437523",
"0.54295987",
"0.5425724",
"0.5374235",
"0.53417593",
"0.5323803",
"0.52547276",
"0.524621",
"0.52413446",
"0.5234175",
"0.5112358",
"0.5106631",
"0.50925744",
... | 0.77027166 | 0 |
get_global_posteriors() Find the posterior implied by the clustering as a Gaussian mixture, with each component in he mixture corresponding to a node in the clustering. | def get_global_posterior(self):
self.cluster_bhc.get_global_posterior()
return (self.cluster_bhc.global_GMM,
self.cluster_bhc.global_posterior_preds) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_individual_posterior(self, index):\n # initialise a GMM\n post_GMM = gmm.GMM()\n\n # Check if posteriors have been found for cluster_bhc\n if self.cluster_bhc.post_GMMs is None:\n self.cluster_bhc.get_single_posteriors()\n\n # get required posterior dist\n ... | [
"0.54337704",
"0.53381294",
"0.53279245",
"0.5290654",
"0.5176975",
"0.51665384",
"0.5163027",
"0.5108447",
"0.4993341",
"0.49895194",
"0.4943088",
"0.49378467",
"0.49147692",
"0.4895067",
"0.4886014",
"0.48775706",
"0.4856773",
"0.48330763",
"0.48249644",
"0.48101455",
"0.48... | 0.74335134 | 0 |
Return normalized dict from metric line. | def line_to_metric(line):
# convert line of csv to list
# sigh, the first field is not quoted
(date, time, fields) = line.split(' ', 2)
metric = {'timestamp':" ".join((date, time))}
fields = fields.split(',')
fields = [field.strip() for field in fields]
# convert list of k=v to dict
fiel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_line(line):\n parts = line.strip().split('\\t')\n\n output = {}\n\n if len(parts) != len(COLUMNS):\n raise Exception('Incorrect number of columns in line.', parts, COLUMNS)\n\n for key, value in zip(COLUMNS, parts):\n if key == 'attributes':\n output[key] = parse_attr... | [
"0.6188634",
"0.6158021",
"0.61129725",
"0.607342",
"0.60034114",
"0.5977945",
"0.5881318",
"0.584924",
"0.5830612",
"0.58026487",
"0.5797469",
"0.574246",
"0.57335615",
"0.56946725",
"0.5634946",
"0.5583854",
"0.55590755",
"0.5549246",
"0.5543671",
"0.54342407",
"0.54342407"... | 0.6824323 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.