query stringlengths 9 3.4k | document stringlengths 9 87.4k | metadata dict | negatives listlengths 4 101 | negative_scores listlengths 4 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Computes an aggregate error metric based on confidence estimates. Computes the MAE at 90% availability. | def AggregateErrorMetric(pr_errors, confidence_est):
# Higher confidence means a better estimate. The best 90% of the estimates
# are above the 10th percentile confidence.
percentile90_confidence = np.percentile(confidence_est, 10)
# Find the errors of the best pulse rate estimates
best_estimate... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_error(self):\n \n self.error = pd.DataFrame()\n \n for name in self.conf[\"w_sizes\"].keys():\n \n self.error[f\"mae {name}\"] = self.predict[[name, \"test\"]].apply(lambda x: mae(x), axis=1)\n self.error[f\"mape {name}\"] = self.predict[[nam... | [
"0.6846825",
"0.6784502",
"0.6691996",
"0.66328645",
"0.66278464",
"0.65877265",
"0.6529492",
"0.651819",
"0.6424918",
"0.6344316",
"0.6279603",
"0.61959624",
"0.6158423",
"0.61428404",
"0.6133848",
"0.61282474",
"0.61120087",
"0.61074203",
"0.6101849",
"0.61003274",
"0.60925... | 0.6756101 | 2 |
This function creates features | def FeatureExtraction(ppg, accx, accy, accz):
fs = 125
n = len(ppg) * 4
# applying fast Fourier transform
freqs = np.fft.rfftfreq(n, 1/fs)
fft = np.abs(np.fft.rfft(ppg,n))
fft[freqs <= 40/60.0] = 0.0
fft[freqs >= 240/60.0] = 0.0
## calculating L2 norm
acc_mag = np.sqrt(accx**2 ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generateFeatures(self, data):\n pass",
"def create_new_features(self):\n train = self.train\n \n train['is_context'] = train['context_type'].isin(CONTEXT_TYPE_TEST)\n train['is_context_flow'] = train['listen_type'] * train['is_context']\n \n train['is_listened... | [
"0.802994",
"0.7679294",
"0.7240807",
"0.7137049",
"0.69869363",
"0.6960422",
"0.685403",
"0.6842293",
"0.6839199",
"0.6791475",
"0.6776369",
"0.6693866",
"0.6646715",
"0.6645286",
"0.66402787",
"0.663474",
"0.6619721",
"0.66104823",
"0.6597922",
"0.65949726",
"0.6586962",
... | 0.0 | -1 |
Toplevel function evaluation function. Runs the pulse rate algorithm on the Troika dataset and returns an aggregate error metric. | def Evaluate():
global reg
reg = ModelRegression()
# Retrieve dataset files
data_fls, ref_fls = LoadTroikaDataset()
errs, confs = [], []
for data_fl, ref_fl in zip(data_fls, ref_fls):
# Run the pulse rate algorithm on each trial in the dataset
errors, confidence = RunPulseRa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_aggregated_error_rate(self):\n estimates = np.mat([0.8, 0.4, 0.8, 0.4])\n m = np.shape(self.data_matrix)[0]\n returned = ada_boost.aggregated_error_rate(estimates, self.labels, m)\n self.assertEqual(returned, 2.0)",
"def run(self):\n self.evaluate()\n self.accum... | [
"0.5552829",
"0.54419374",
"0.5426438",
"0.53882104",
"0.53734046",
"0.52837074",
"0.5248022",
"0.5202013",
"0.5199766",
"0.51779705",
"0.51705366",
"0.51694053",
"0.5148345",
"0.514448",
"0.51326084",
"0.5094116",
"0.5040183",
"0.50327647",
"0.5014488",
"0.5009077",
"0.50053... | 0.7705827 | 0 |
Find start and end index to iterate over a set of signals | def get_indxs(sig_len, ref_len, fs=125, win_len_s=10, win_shift_s=2):
if ref_len < sig_len:
n = ref_len
else:
n = sig_len
start_indxs = (np.cumsum(np.ones(n) * fs * win_shift_s) - fs * win_shift_s).astype(int)
end_indxs = start_indxs + win_len_s * fs
return (start_indxs, end_ind... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def base_to_signal_mapping(grp):\n\n position_in_signal = [0 for _ in range(5)]\n for i in range(1, len(grp)):\n position_in_signal += [i for _ in range(grp[i][5])]\n # position_in_signal += [grp[i][0] for _ in range(grp[i][5])]\n\n # print(position_in_signal)\n return position_in_signal"... | [
"0.5879149",
"0.5820784",
"0.5816419",
"0.57421803",
"0.57333845",
"0.57280195",
"0.56767493",
"0.56669295",
"0.56656456",
"0.56474495",
"0.56112677",
"0.55753714",
"0.55520076",
"0.5549232",
"0.5547756",
"0.5540108",
"0.5535159",
"0.5524846",
"0.5499244",
"0.54932624",
"0.54... | 0.54915035 | 20 |
This function trains a model based upon Random Forest Regression algorithm | def ModelRegression():
fs=125
win_len = 10
win_shift = 2
# load the data file
data_fls, ref_fls = LoadTroikaDataset()
targets, features, sigs, subs = [], [], [], []
for data_fl, ref_fl in (zip(data_fls, ref_fls)):
# load the signal
sig = LoadTroikaDataFile(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def train_random_forest():\n train_model(RandomForestRegressor(max_depth=4, random_state=42),\n dataset_file_name=RANDOM_FOREST_DEFAULT_DATASET,\n model_file_name=RANDOM_FOREST_DEFAULT_MODEL)",
"def train_ML_model(self, **kwargs):\n if self.ML_method == 'RandomForest':\n ... | [
"0.79522717",
"0.7493701",
"0.73008835",
"0.72498524",
"0.7163427",
"0.71086013",
"0.7082103",
"0.70661044",
"0.70173144",
"0.6904053",
"0.6848234",
"0.6839263",
"0.6791471",
"0.6775483",
"0.6769784",
"0.67150676",
"0.6687376",
"0.6682406",
"0.66772544",
"0.66516054",
"0.6623... | 0.6803433 | 12 |
Given the string representation of a tagged token, return the corresponding tuple representation. The rightmost occurence of C{sep} in C{s} will be used to divide C{s} into a word string and a tag string. If C{sep} does not occur in C{s}, return C{(s, None)}. | def str2tuple(s, sep='/'):
loc = s.rfind(sep)
if loc >= 0:
return (s[:loc], s[loc+1:].upper())
else:
return (s, None) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tuple2str(tagged_token, sep='/'):\n word, tag = tagged_token\n if tag is None:\n return word\n else:\n assert sep not in tag, 'tag may not contain sep!'\n return '%s%s%s' % (word, sep, tag)",
"def split(value: str, sep: str = \":\") -> Tuple:\n left, _, right = value.partitio... | [
"0.6646102",
"0.612387",
"0.60105777",
"0.5899971",
"0.56244576",
"0.5581877",
"0.556164",
"0.54761165",
"0.5448013",
"0.5431246",
"0.54079366",
"0.5345186",
"0.5311481",
"0.52914494",
"0.5287557",
"0.5282446",
"0.5266853",
"0.52644396",
"0.52302814",
"0.52152735",
"0.5200624... | 0.682012 | 0 |
Given the tuple representation of a tagged token, return the corresponding string representation. This representation is formed by concatenating the token's word string, followed by the separator, followed by the token's tag. (If the tag is None, then just return the bare word string.) | def tuple2str(tagged_token, sep='/'):
word, tag = tagged_token
if tag is None:
return word
else:
assert sep not in tag, 'tag may not contain sep!'
return '%s%s%s' % (word, sep, tag) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tagify(parsedtag):\n tag = \"\"\n for t in parsedtag:\n if t == '':\n t = '_'\n tag = tag+t\n return tag",
"def tuple_to_string(letter_word_pair):\n letter, word = letter_word_pair\n return '{letter}: {word}'.format(letter=letter, word=word)",
"def _preproces... | [
"0.65129",
"0.6197551",
"0.6189595",
"0.603213",
"0.59723246",
"0.5791183",
"0.56370145",
"0.56172186",
"0.5614327",
"0.55962265",
"0.5587963",
"0.55618066",
"0.5522836",
"0.5503617",
"0.5499369",
"0.5470717",
"0.5397113",
"0.5374059",
"0.5342552",
"0.5339643",
"0.53354275",
... | 0.8627057 | 0 |
Given a tagged sentence, return an untagged version of that sentence. I.e., return a list containing the first element of each tuple in C{tagged_sentence}. >>> untag([('John', 'NNP'), ('saw', 'VBD'), ('Mary', 'NNP')] ['John', 'saw', 'mary'] | def untag(tagged_sentence):
return [w for (w, t) in tagged_sentence] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def untag(tagged_sentence):\n return [w for w, _ in tagged_sentence]",
"def untag(self, tagged_sent, strict=True, verbose=False):\n word = \"\"\n for char, tag in tagged_sent:\n if verbose:\n print char, tag\n if tag in self.itags:\n if word:\n... | [
"0.8872581",
"0.688079",
"0.6484743",
"0.5917314",
"0.58630955",
"0.5849702",
"0.5814519",
"0.57450205",
"0.565951",
"0.5595256",
"0.55470544",
"0.55409217",
"0.5509677",
"0.54981333",
"0.5497102",
"0.54217565",
"0.5420616",
"0.5420616",
"0.5396361",
"0.5392199",
"0.53684276"... | 0.8875718 | 0 |
Set expected values in entry so test code can work consistently. | def set_test_property_values(self):
self.set_single_value(self._ok_wrapper.entry,
jwrap._JOB_ID, EXPECTED_ID)
self.set_single_value(self._request_wrapper.entry,
jwrap._JOB_GROUP_NAME,
EXPECTED_GROUP_NAME)
s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUp(self):\n self.ec = EntryChanger()\n self.ec.first_name = 'Bob'\n self.ec.last_name = 'Harvey'\n self.ec.all_names = True",
"def setUp(self):\n self.ec = EntryChanger()\n self.ecm = EntryChangeMock()\n self.db = DatabaseIntermediary()\n\n entry_lis... | [
"0.6609507",
"0.61973774",
"0.6033012",
"0.595843",
"0.5954806",
"0.5895544",
"0.58735335",
"0.5870027",
"0.586207",
"0.5859691",
"0.5822206",
"0.580699",
"0.575562",
"0.57501954",
"0.57485825",
"0.57273716",
"0.57201666",
"0.56902695",
"0.56876385",
"0.56862414",
"0.56670094... | 0.5878401 | 6 |
sorts the array by dividing array into two halves iteratively | def binary_search_iterative(arr, x):
if len(arr) > 1:
mid = len(arr) // 2
first_half = arr[: mid]
second_half = arr[mid :]
if x == arr[mid]:
return True
elif x < arr[mid]:
i = 0
while i <= len(first_half):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge_sort(arr):\n if len(arr) <= 1:\n # nothing to sort\n return arr\n\n # split into left and right half\n left = arr[:len(arr) // 2]\n right = arr[len(arr) // 2:]\n\n # recursively sort each half\n left = merge_sort(left)\n right = merge_sort(right)\n\n # merge both sor... | [
"0.7229713",
"0.7167099",
"0.7066389",
"0.6959616",
"0.6918712",
"0.68067336",
"0.6769414",
"0.66702294",
"0.6645796",
"0.6637218",
"0.6526148",
"0.65154",
"0.650118",
"0.64913446",
"0.64332694",
"0.64111054",
"0.64070016",
"0.64047295",
"0.64039284",
"0.638985",
"0.6375003",... | 0.0 | -1 |
Remove rows representing extended sources from a catalog table | def mask_extended(cat_table):
return np.invert(select_extended(cat_table)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_empty_sources(self):\n for source in [\"dxf\", \"edilizia\", \"easyroom\", \"merged\"]:\n if source in self and not self[source]:\n del self[source]",
"def select_extended(cat_table):\n try:\n l = [len(row.strip()) > 0 for row in cat_table['Extended_Source_Name'].data... | [
"0.61367214",
"0.54964155",
"0.538498",
"0.5374552",
"0.5283313",
"0.52446914",
"0.5217077",
"0.52094305",
"0.5104261",
"0.51015073",
"0.50704175",
"0.5060616",
"0.5008298",
"0.49753708",
"0.49695686",
"0.4964147",
"0.4958396",
"0.4940276",
"0.49186522",
"0.4916551",
"0.49040... | 0.45401332 | 83 |
Select only rows representing extended sources from a catalog table | def select_extended(cat_table):
try:
l = [len(row.strip()) > 0 for row in cat_table['Extended_Source_Name'].data]
return np.array(l, bool)
except KeyError:
return cat_table['Extended'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_sources(cat_table, cuts):\n nsrc = len(cat_table)\n full_mask = np.ones((nsrc), bool)\n for cut in cuts:\n if cut == 'mask_extended':\n full_mask *= mask_extended(cat_table)\n elif cut == 'select_extended':\n full_mask *= select_extended(cat_table)\n e... | [
"0.60211074",
"0.5248736",
"0.5232373",
"0.5228239",
"0.5216698",
"0.514871",
"0.51264745",
"0.5091105",
"0.50576377",
"0.50509965",
"0.500945",
"0.50049895",
"0.49812737",
"0.49577492",
"0.4953649",
"0.49411482",
"0.49411097",
"0.49344343",
"0.4923671",
"0.4913756",
"0.49132... | 0.67723024 | 0 |
Mask a bit mask selecting the rows that pass a selection | def make_mask(cat_table, cut):
cut_var = cut['cut_var']
min_val = cut.get('min_val', None)
max_val = cut.get('max_val', None)
nsrc = len(cat_table)
if min_val is None:
min_mask = np.ones((nsrc), bool)
else:
min_mask = cat_table[cut_var] >= min_val
if max_val is None:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_mask(cls, dataset, selection):\n mask = np.ones(len(dataset), dtype=np.bool_)\n for dim, sel in selection.items():\n if isinstance(sel, tuple):\n sel = slice(*sel)\n arr = cls.values(dataset, dim)\n if util.isdatetime(arr):\n t... | [
"0.70586246",
"0.68732816",
"0.6862783",
"0.67690736",
"0.64145035",
"0.63621366",
"0.62914354",
"0.61257136",
"0.6123307",
"0.6098292",
"0.60847986",
"0.6062939",
"0.6045705",
"0.6023199",
"0.6006165",
"0.599157",
"0.596266",
"0.5953985",
"0.5925014",
"0.59093094",
"0.590719... | 0.0 | -1 |
Select only rows passing a set of cuts from catalog table | def select_sources(cat_table, cuts):
nsrc = len(cat_table)
full_mask = np.ones((nsrc), bool)
for cut in cuts:
if cut == 'mask_extended':
full_mask *= mask_extended(cat_table)
elif cut == 'select_extended':
full_mask *= select_extended(cat_table)
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_subset(df, constraints):\n for constraint in constraints:\n subset = df.loc[df[constraint[0]].isin(constraint[1])]\n df = subset\n return subset",
"def get_table_subset(table, batches):\n idxs = np.array([])\n for batch in batches:\n idxs = np.append(idxs, np.where(table[... | [
"0.5679256",
"0.54460526",
"0.5423245",
"0.54030055",
"0.5230312",
"0.5216821",
"0.5212075",
"0.5188647",
"0.51706034",
"0.5072302",
"0.5045124",
"0.5038879",
"0.5030005",
"0.50211084",
"0.50056404",
"0.49777895",
"0.49624884",
"0.4951754",
"0.4933273",
"0.4932415",
"0.490916... | 0.6428772 | 0 |
Read the yaml file for a particular split key | def read_catalog_info_yaml(self, splitkey):
catalog_info_yaml = self._name_factory.catalog_split_yaml(sourcekey=splitkey,
fullpath=True)
yaml_dict = yaml.safe_load(open(catalog_info_yaml))
# resolve env vars
yaml_dict['cat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __getitem__(self, item):\n try:\n if \".\" in item:\n keys = item.split(\".\")\n else:\n return self.data[item]\n element = self.data[keys[0]]\n for key in keys[1:]:\n element = element[key]\n except KeyError... | [
"0.59335405",
"0.5843199",
"0.5721483",
"0.56454915",
"0.5619514",
"0.56168664",
"0.5573831",
"0.55296016",
"0.5514136",
"0.54911107",
"0.54887116",
"0.5482527",
"0.5466847",
"0.54572874",
"0.5439963",
"0.54187524",
"0.5408526",
"0.540396",
"0.5391459",
"0.53888166",
"0.53775... | 0.6570766 | 0 |
Build a CatalogInfo object | def build_catalog_info(self, catalog_info):
cat = SourceFactory.build_catalog(**catalog_info)
catalog_info['catalog'] = cat
# catalog_info['catalog_table'] =
# Table.read(catalog_info['catalog_file'])
catalog_info['catalog_table'] = cat.table
catalog_info['roi_model'] ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_catalog_comp_info(self, full_cat_info, split_key, rule_key, rule_val, sources):\n merge = rule_val.get('merge', True)\n sourcekey = \"%s_%s_%s\" % (\n full_cat_info.catalog_name, split_key, rule_key)\n srcmdl_name = self._name_factory.srcmdl_xml(sourcekey=sourcekey)\n ... | [
"0.6588303",
"0.61483276",
"0.5996167",
"0.5996167",
"0.5996167",
"0.59377766",
"0.5853027",
"0.58457947",
"0.5777897",
"0.57669896",
"0.5660952",
"0.56151086",
"0.5586599",
"0.5576048",
"0.55725324",
"0.55642617",
"0.5543427",
"0.5534594",
"0.55312943",
"0.5503297",
"0.54956... | 0.8214636 | 0 |
Return the list of full catalogs used | def catalogs(self):
return sorted(self._catalog_comp_info_dicts.keys()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getCatalogs():",
"def get(self):\n return GenericGet().get_catalogs()",
"def get_catalogs(self):\n # Implemented from kitosid template for -\n # osid.resource.BinLookupSession.get_bins_template\n catalogs = self._get_provider_session('catalog_lookup_session').get_catalogs()\n ... | [
"0.8308617",
"0.7364706",
"0.7295699",
"0.7183018",
"0.7094484",
"0.7065019",
"0.68383414",
"0.66891736",
"0.65169674",
"0.6516233",
"0.6503805",
"0.64863735",
"0.64859456",
"0.6473658",
"0.6427194",
"0.64163595",
"0.6385455",
"0.63072556",
"0.6240876",
"0.623814",
"0.6236926... | 0.79021573 | 1 |
Return the list of catalog split keys used | def splitkeys(self):
return sorted(self._split_comp_info_dicts.keys()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def keys(self) -> List[str]:\n raise NotImplementedError",
"def catalog_components(self, catalog_name, split_ver):\n return sorted(self._split_comp_info_dicts[\"%s_%s\" % (catalog_name, split_ver)].keys())",
"def keys(self) -> List:\n pass",
"def get_keys(self):\r\n\r\n #using databas... | [
"0.6911",
"0.69100714",
"0.6819517",
"0.68116844",
"0.67278045",
"0.6701149",
"0.6674959",
"0.6631823",
"0.6594297",
"0.65199286",
"0.651894",
"0.65150744",
"0.65001196",
"0.65000886",
"0.6440549",
"0.64391464",
"0.6426035",
"0.6371353",
"0.6365058",
"0.6354946",
"0.6335533",... | 0.7640336 | 0 |
Return the roi_model for an entire catalog | def catalog_comp_info_dict(self, catkey):
return self._catalog_comp_info_dicts[catkey] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_roi(self):\n roi_opts = opts.Curve(frame_width=275, frame_height=125, framewise=True,\n xlabel='Wavelength (nm)', ylabel='Intensity',\n show_grid=True, gridstyle = {'minor_xgrid_line_color': 'lightgray'}, \n ... | [
"0.6121707",
"0.5683139",
"0.5526194",
"0.5503409",
"0.5428888",
"0.53777355",
"0.5328027",
"0.5326816",
"0.5274593",
"0.5259493",
"0.5193246",
"0.51734364",
"0.51602846",
"0.51602846",
"0.51602846",
"0.51536644",
"0.5135253",
"0.5134825",
"0.5125258",
"0.5115316",
"0.5108956... | 0.0 | -1 |
Return the information about a particular scheme for how to handle catalog sources | def split_comp_info_dict(self, catalog_name, split_ver):
return self._split_comp_info_dicts["%s_%s" % (catalog_name, split_ver)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scheme(self):\n return self._scheme",
"def getScheme(self):\n return self._scheme",
"def scheme(self):",
"def describe_analysis_schemes(DomainName=None, AnalysisSchemeNames=None, Deployed=None):\n pass",
"def getCatalogs():",
"def getScheme(self):\n return _libsbml.SBMLUri_get... | [
"0.62385446",
"0.6177194",
"0.6007747",
"0.58928746",
"0.5873942",
"0.5706533",
"0.5701918",
"0.5701002",
"0.5672133",
"0.56460476",
"0.56456566",
"0.564547",
"0.563253",
"0.5597016",
"0.5558933",
"0.546177",
"0.5431914",
"0.5394164",
"0.53496623",
"0.5334219",
"0.5327447",
... | 0.0 | -1 |
Return the set of merged components for a particular split key | def catalog_components(self, catalog_name, split_ver):
return sorted(self._split_comp_info_dicts["%s_%s" % (catalog_name, split_ver)].keys()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def splitkeys(self):\n return sorted(self._split_comp_info_dicts.keys())",
"def split_comp_info(self, catalog_name, split_ver, split_key):\n return self._split_comp_info_dicts[\"%s_%s\" % (catalog_name, split_ver)][split_key]",
"def get_components(self, key, analyte=None):\n out = {}\n ... | [
"0.6064545",
"0.5819847",
"0.55886126",
"0.5580432",
"0.5499435",
"0.54860723",
"0.5451514",
"0.5388257",
"0.53568655",
"0.5302102",
"0.5301424",
"0.52120155",
"0.5208997",
"0.5179624",
"0.5167828",
"0.51633817",
"0.51470166",
"0.5113891",
"0.50276667",
"0.5007151",
"0.497686... | 0.54674715 | 6 |
Return the info for a particular split key | def split_comp_info(self, catalog_name, split_ver, split_key):
return self._split_comp_info_dicts["%s_%s" % (catalog_name, split_ver)][split_key] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getsplitinfo():\n \n splitvarlist = spss.GetSplitVariableNames()\n if len(splitvarlist) == 0:\n return [], None\n else:\n splittype = spssaux.getShow(\"split\", olang=\"english\")\n if splittype.lower().startswith(\"layer\"):\n splittype=\"layered\"\n else:\n ... | [
"0.6543608",
"0.6113423",
"0.5998565",
"0.5991682",
"0.5982638",
"0.59728223",
"0.59677356",
"0.58936083",
"0.5857385",
"0.576732",
"0.57553214",
"0.5689077",
"0.56885535",
"0.5674944",
"0.5661469",
"0.56329924",
"0.5598245",
"0.55969393",
"0.5588592",
"0.5572412",
"0.5545308... | 0.73933583 | 0 |
Make the information about a single merged component | def make_catalog_comp_info(self, full_cat_info, split_key, rule_key, rule_val, sources):
merge = rule_val.get('merge', True)
sourcekey = "%s_%s_%s" % (
full_cat_info.catalog_name, split_key, rule_key)
srcmdl_name = self._name_factory.srcmdl_xml(sourcekey=sourcekey)
srcmdl_nam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def MergeLogic(self) -> str:",
"def merge(): #Status: WIP\r\n pass",
"def change_merged(self, event):\n pass",
"def svn_client_mergeinfo_get_merged(apr_hash_t_mergeinfo, char_path_or_url, svn_opt_revision_t_peg_revision, svn_client_ctx_t_ctx, apr_pool_t_pool): # real signature unknown; restored ... | [
"0.61121345",
"0.5763827",
"0.57227093",
"0.55272865",
"0.54901904",
"0.52821136",
"0.5277541",
"0.5243985",
"0.51912767",
"0.51800364",
"0.51655006",
"0.51487416",
"0.5147551",
"0.51312757",
"0.513068",
"0.5122051",
"0.5106422",
"0.5096374",
"0.5055805",
"0.50510687",
"0.501... | 0.50710857 | 18 |
Make the information about the catalog components | def make_catalog_comp_info_dict(self, catalog_sources):
catalog_ret_dict = {}
split_ret_dict = {}
for key, value in catalog_sources.items():
if value is None:
continue
if value['model_type'] != 'catalog':
continue
versions = val... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_catalog_info(self, catalog_info):\n cat = SourceFactory.build_catalog(**catalog_info)\n catalog_info['catalog'] = cat\n # catalog_info['catalog_table'] =\n # Table.read(catalog_info['catalog_file'])\n catalog_info['catalog_table'] = cat.table\n catalog_info['r... | [
"0.71844083",
"0.66670614",
"0.64781564",
"0.6428661",
"0.64268214",
"0.63804585",
"0.62797934",
"0.62745386",
"0.62745386",
"0.62745386",
"0.6248693",
"0.6248693",
"0.6248693",
"0.6248693",
"0.6248693",
"0.61603093",
"0.6047397",
"0.598664",
"0.5971429",
"0.5940149",
"0.5919... | 0.60234475 | 17 |
Build and return the information about the catalog components | def make_catalog_comp_dict(**kwargs):
library_yamlfile = kwargs.pop('library', 'models/library.yaml')
csm = kwargs.pop('CatalogSourceManager', CatalogSourceManager(**kwargs))
if library_yamlfile is None or library_yamlfile == 'None':
yamldict = {}
else:
yamldict = yaml.safe_load(open(lib... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_catalog_info(self, catalog_info):\n cat = SourceFactory.build_catalog(**catalog_info)\n catalog_info['catalog'] = cat\n # catalog_info['catalog_table'] =\n # Table.read(catalog_info['catalog_file'])\n catalog_info['catalog_table'] = cat.table\n catalog_info['r... | [
"0.7328733",
"0.65988064",
"0.63273966",
"0.6297096",
"0.62196356",
"0.6197402",
"0.6186491",
"0.61801744",
"0.61344385",
"0.61199206",
"0.6049798",
"0.6048612",
"0.5913311",
"0.589488",
"0.5874206",
"0.5836773",
"0.5835498",
"0.5815232",
"0.5815232",
"0.5815232",
"0.5751508"... | 0.5738577 | 22 |
Etape 3 Renvoie Objet Individu | def reconstruireGrapheChemins(self, edgesACPM, paths):
# Recuperer l'ensemble de noeuds de l'ACPM
set_Nodes = set()
for stpath in edgesACPM:
node1, node2 = self.getIdVerticesOfEdge(stpath)
l = [node1, node2]
l.sort()
path = paths[tuple(l)]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def object(self):",
"def get(self, obj):",
"def __init__(self,obj):\n self.nature_libelle = obj['NatureLibelle']\n self.ins_nom = obj['InsNom']\n self.ins_numero_install = obj['InsNumeroInstall']\n self.equipement_id = obj['EquipementId']",
"def obj(self) -> object:\n pass"... | [
"0.6910618",
"0.62747633",
"0.61631703",
"0.614376",
"0.6103492",
"0.5976021",
"0.58699137",
"0.58596456",
"0.5822488",
"0.5807523",
"0.58042055",
"0.5795736",
"0.57795066",
"0.5649518",
"0.5640854",
"0.5623222",
"0.5607757",
"0.56006867",
"0.5569092",
"0.5569092",
"0.5569092... | 0.0 | -1 |
Etape 5 Renvoie un dictionnaire contenant les noeuds de steiner | def eliminationFeuilles(self,edges,vertices):
dictAdjacenceACPM = {n : set() for n in vertices}
for edge in edges:
s,t = self.getIdVerticesOfEdge(edge)
if not(s in self.setTerminals) :
dictAdjacenceACPM[s].add(t)
if not(t in self.setTerminals):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def creer_dictionnaire_vide():\n dico = {}\n return dico",
"def kluisInfo():\r\n kluisDict = dictionary()\r\n beginSchermTerug.grid(pady=3, padx=(10, 10), sticky='w', row=1)\r\n\r\n for kluis in kluisDict:\r\n try:\r\n if kluisDict[kluis] is not None and int(beginSchermEntry.get(... | [
"0.6173704",
"0.6094236",
"0.608045",
"0.5959373",
"0.5868874",
"0.5859086",
"0.5764783",
"0.5748099",
"0.57286215",
"0.57125324",
"0.568358",
"0.56821114",
"0.5591537",
"0.5585317",
"0.55656147",
"0.5563696",
"0.5556112",
"0.55398303",
"0.552565",
"0.5524623",
"0.5516208",
... | 0.0 | -1 |
Renvoie un dictionnaire contenant les noeuds de steiner | def heuristique_PCM(self,draw=False):
if draw:
try:
os.makedirs(self.dirname+"/H_ShortestPath")
except:
pass
#Graphe de depart contenant tout les noeuds
# Individu = Graphe_Individu(self,self.wholeGraphDict)
# G = Individu.get_grap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def creer_dictionnaire_vide():\n dico = {}\n return dico",
"def get_dictionary(self):\n dct = super(ReportMalnutrition, self).get_dictionary()\n dct.update({\"oedema\":\"no\", \"diarrhea\":\"no\"})\n if self.observed.filter(name=\"Oedema\"):\n dct[\"oedema\"] = \"yes\"\n ... | [
"0.6221054",
"0.59172213",
"0.5856794",
"0.5808893",
"0.57970524",
"0.5759881",
"0.572829",
"0.56703657",
"0.56652915",
"0.564972",
"0.562634",
"0.56240404",
"0.56221503",
"0.56216323",
"0.5609806",
"0.55826163",
"0.5527054",
"0.55207396",
"0.55091435",
"0.55068797",
"0.54817... | 0.0 | -1 |
Renvoie un dictionnaire contenant les noeuds de steiner | def heuristique_ACPM(self,draw=False):
def getVertricesOfPath(edges):
set_node = set()
for e in edges:
id1,id2 = self.getIdVerticesOfEdge(e)
set_node.add(id1)
set_node.add(id2)
return set_node
if draw:
try... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def creer_dictionnaire_vide():\n dico = {}\n return dico",
"def get_dictionary(self):\n dct = super(ReportMalnutrition, self).get_dictionary()\n dct.update({\"oedema\":\"no\", \"diarrhea\":\"no\"})\n if self.observed.filter(name=\"Oedema\"):\n dct[\"oedema\"] = \"yes\"\n ... | [
"0.6221054",
"0.59172213",
"0.5856794",
"0.5808893",
"0.57970524",
"0.5759881",
"0.572829",
"0.56703657",
"0.56652915",
"0.564972",
"0.562634",
"0.56240404",
"0.56221503",
"0.56216323",
"0.5609806",
"0.55826163",
"0.5527054",
"0.55207396",
"0.55091435",
"0.55068797",
"0.54817... | 0.0 | -1 |
Retrieves a model from the database. | def retrieve_model(self, user_name, model_name):
serialized_model = self.dao.retrieve_serialized_model(user_name, model_name)
print(f"ret {user_name}\n{model_name}\n{serialized_model}")
if serialized_model is None:
return None
return deserialize_from_bytes(serialized_model) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieve_model(self, model_name):\n\t\tmodel_detail = dbop.get_model(self, model_name)\n\t\t#since the 'owner' field of model_detail is only owner's username,\n\t\t#we have to change it to a User object\n\t\t#In this case, the owner of this model is the user itself\n\t\tmodel_detail['owner'] = self\n\t\tif mod... | [
"0.720412",
"0.7172293",
"0.7137139",
"0.70235085",
"0.7018168",
"0.6998311",
"0.6939786",
"0.6886814",
"0.6828344",
"0.67983484",
"0.67940336",
"0.67940336",
"0.67940336",
"0.67940336",
"0.67940336",
"0.67940336",
"0.67940336",
"0.67940336",
"0.67940336",
"0.67940336",
"0.67... | 0.7024001 | 3 |
Stores the given model. | def store_model(self, user_name, model_name, model):
print(f"sto {user_name}\n{model_name}\n{serialize(model)}")
return self.dao.store_serialized_model(user_name, model_name, serialize(model)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_model(self):\n pass",
"def save_model(self, *args, **kwargs):\n raise NotImplementedError",
"def save_model(self):\n if self.model:\n self.model.save(self.config[\"model_path\"])",
"def _save_model(self):\n save_generic(self.model, self.model_pkl_fname)",
"de... | [
"0.77885836",
"0.7711191",
"0.755239",
"0.75421274",
"0.7444351",
"0.7415339",
"0.7415298",
"0.7396812",
"0.73743224",
"0.7329616",
"0.72817063",
"0.71172756",
"0.7011479",
"0.6994045",
"0.6933486",
"0.68591076",
"0.6839708",
"0.68030614",
"0.6796083",
"0.67817974",
"0.676047... | 0.84057695 | 0 |
Retrieves the serialized model from the database. | def retrieve_serialized_model(self, user_name, model_name):
try:
return self.rconn.get(redis_keys.for_model(user_name, model_name))
except redis.RedisError as e:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieve_model(self, user_name, model_name):\n serialized_model = self.dao.retrieve_serialized_model(user_name, model_name)\n print(f\"ret {user_name}\\n{model_name}\\n{serialized_model}\")\n if serialized_model is None:\n return None\n return deserialize_from_bytes(seria... | [
"0.71331686",
"0.7095699",
"0.7072433",
"0.6582029",
"0.65656173",
"0.6381637",
"0.6338786",
"0.6324594",
"0.6321106",
"0.63124496",
"0.63124496",
"0.62772065",
"0.62607",
"0.62290335",
"0.62264925",
"0.6211902",
"0.6202731",
"0.6202731",
"0.6202731",
"0.6202731",
"0.6202731"... | 0.6831061 | 3 |
Stores the given model in redis. | def store_serialized_model(self, user_name, model_name, serialized_model):
try:
self.rconn.set(redis_keys.for_model(user_name, model_name), json.dumps(serialized_model))
return True
except redis.RedisError as e:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def store_model(self, user_name, model_name, model):\n print(f\"sto {user_name}\\n{model_name}\\n{serialize(model)}\")\n return self.dao.store_serialized_model(user_name, model_name, serialize(model))",
"def redis_save(key: object, value: object) -> object:\n if key is not None and value is not ... | [
"0.6808482",
"0.6612063",
"0.6367931",
"0.60557693",
"0.5940292",
"0.5915331",
"0.58338416",
"0.58175427",
"0.580114",
"0.5768876",
"0.57467467",
"0.57321674",
"0.5718583",
"0.5714915",
"0.5696914",
"0.5685338",
"0.56384814",
"0.5590227",
"0.5558572",
"0.5553382",
"0.55394566... | 0.75235426 | 0 |
Creates a decision tree. | def __init__(self, data):
self.data = data
self.model_func = DecisionTree._deserialize_decision_tree_from_json(data["model"]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_decision_tree():\n\n decision_tree_root = None\n decision_tree_root = DecisionNode(None,None,lambda feature:feature[0]==1)\n decision_tree_root.left = DecisionNode(None,None,None,1)\n decision_tree_root.right = DecisionNode(None,None,lambda feature:feature[3]==1)\n decision_tree_root.right... | [
"0.7961751",
"0.739867",
"0.7236439",
"0.7165569",
"0.71585566",
"0.7068312",
"0.70220697",
"0.6973402",
"0.6953935",
"0.6867949",
"0.6864834",
"0.6661646",
"0.66027963",
"0.6587869",
"0.6559681",
"0.65589637",
"0.6436368",
"0.64149475",
"0.6362775",
"0.6308696",
"0.62361836"... | 0.5444926 | 92 |
Data is expected to be a list of dictionaries, each parseable as a DecisionTree | def __init__(self, data):
self.data = data
self.func = RandomForest._read_func_from_data(data["model"]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def classifier(decision_tree,data):\n dt = copy.deepcopy(decision_tree) # copy to maintain original decision tree\n cur_attr = list(dt)[0] # 'cur_attr' is first selected attribute\n \n while True:\n dt = dt[cur_attr] # 'dt' is sub decision tree \n value = data[c... | [
"0.6370536",
"0.63079613",
"0.6180251",
"0.606978",
"0.58008164",
"0.56769216",
"0.5639699",
"0.5583167",
"0.55640674",
"0.55638003",
"0.5550819",
"0.5524384",
"0.5454961",
"0.545173",
"0.5448299",
"0.5446184",
"0.54412216",
"0.5432953",
"0.543024",
"0.54173386",
"0.54105616"... | 0.0 | -1 |
Pass a filename that exists in a directory an unknown number of levels higher. Return the string absolute path of said file. | def get_absolute_fpath(target_fname: str = 'README.md', levels_to_check: int = 10, verbose: int = 0) -> str:
original_wd = os.getcwd()
for x in range(0, levels_to_check):
# If reached the max number of directory levels change to original wd and print message
if x + 1 == levels_to_check:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_file(path, filename, max_depth=5):\n for root, dirs, files in os.walk(path):\n if filename in files:\n return os.path.join(root, filename)\n\n # Don't search past max_depth\n depth = root[len(path) + 1:].count(os.sep)\n if depth > max_depth:\n del dirs[:] # Clear dirs\n return Non... | [
"0.6981196",
"0.6922369",
"0.6839886",
"0.6829782",
"0.6817035",
"0.6743519",
"0.6742999",
"0.66747177",
"0.6664707",
"0.6648529",
"0.6644351",
"0.6640273",
"0.6634731",
"0.66253436",
"0.66126144",
"0.6600698",
"0.6593449",
"0.6592454",
"0.6559336",
"0.6540417",
"0.6491568",
... | 0.6376153 | 30 |
Sends a 401 response that enables basic auth | def authenticate(self):
return Response(
'Could not verify your access level for that URL.\nYou have to login with proper credentials',
401,
{'WWW-Authenticate': 'Basic realm="Login Required"'}
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authenticate():\n return Response('Not Authorized', 401, {'WWW-Authenticate': 'Basic realm=\"api\"'})",
"def authenticate():\n return Response(\n '', 401, {'WWW-Authenticate': 'Basic realm=\"Login Required\"'}\n )",
"def authenticate():\n return Response(\n 'You have to login with pro... | [
"0.8093736",
"0.80926424",
"0.7958403",
"0.7852648",
"0.7843114",
"0.7824419",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
"0.7810746",
... | 0.74499536 | 44 |
Read the timestamps and sort them to permit simple concurrency tests. | def read_timestamps(self, tasks):
from reframe.core.deferrable import evaluate
self.begin_stamps = []
self.end_stamps = []
for t in tasks:
with open(evaluate(t.check.stdout), 'r') as f:
self.begin_stamps.append(float(f.readline().strip()))
sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sort_data_by_time():\n data = race.read_file_to_list()\n sorted_data = race.sort_data_by_time(data)\n assert data != sorted_data\n assert len(data) == len(sorted_data)\n assert type(sorted_data) == list\n for lines in sorted_data:\n assert type(lines) == dict",
"def batch_uses_p... | [
"0.70775634",
"0.7044557",
"0.6865213",
"0.6789583",
"0.6551319",
"0.65016",
"0.64157754",
"0.63982505",
"0.6367806",
"0.6276606",
"0.6226092",
"0.619473",
"0.6178502",
"0.60988915",
"0.60325676",
"0.6003747",
"0.59616065",
"0.5910013",
"0.5909187",
"0.581583",
"0.58126765",
... | 0.73157066 | 0 |
Return asciiart image of the array. | def display(self):
lines = []
for y in range(1, self.height+1):
line = ["."] * self.width
for x in range(1, self.width+1):
if self.array[y][x]:
line[x-1] = "#"
lines.append("".join(line))
return "\n".join(lines) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toASCII(self, *args, **kwargs):\n return _image.image_toASCII(self, *args, **kwargs)",
"def img_to_ascii(**kwargs):\n ascii_chars = [ u'Z', u'Q', u'T', u'W', u'E', u'K', u'P', u'L', u'I', u'C', u'Y']\n \n width = kwargs.get('width',200)\n path = kwargs.get('path',None)\n\n\n\n im = Image.... | [
"0.7000944",
"0.6942817",
"0.6474204",
"0.6094718",
"0.60284454",
"0.60112226",
"0.59736586",
"0.5963689",
"0.5945713",
"0.59445333",
"0.59232247",
"0.59199506",
"0.59162813",
"0.59038264",
"0.5883985",
"0.58464783",
"0.58402985",
"0.5838864",
"0.5830699",
"0.58216614",
"0.58... | 0.53720576 | 61 |
Advance array to next step in animtion sequaence | def advance(self):
count = [[0 for col in range(self.width+2)] for row in range(self.height+2)]
for y in range(1, self.height+1):
for x in range(1, self.width+1):
if self.array[y][x]:
count[y][x-1] += 1
count[y][x+1] += 1
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_step(self):\n\n y_next = []\n y_next.append(0)\n for i in range(1, len(self.x) - 1):\n x = self.x[i]\n\n y = self.constant* (self.y_current[i + 1] + self.y_current[i - 1] - 2 * self.y_current[i])\\\n + 2 * self.y_current[i] - self.y_previous[i]\n\n... | [
"0.68066925",
"0.67790365",
"0.67436737",
"0.6670089",
"0.65288496",
"0.65284175",
"0.65054536",
"0.6494049",
"0.64669734",
"0.64110255",
"0.63890827",
"0.6286528",
"0.6242851",
"0.6237323",
"0.6187218",
"0.61808854",
"0.61659634",
"0.6145023",
"0.6142784",
"0.6140603",
"0.61... | 0.57792157 | 56 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75212413",
"0.74254465",
"0.7227017",
"0.7224189",
"0.7096888",
"0.7096888",
"0.7059055",
"0.70071834",
"0.69155335",
"0.68690395",
"0.6814675",
"0.6812803",
"0.6802038",
"0.66921675",
"0.6628809",
"0.6586155",
"0.6570953",
"0.6558287",
"0.6547422",
"0.65455115",
"0.654116... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75213",
"0.74258864",
"0.7226946",
"0.7224665",
"0.7096967",
"0.7096967",
"0.7059375",
"0.7007428",
"0.6915441",
"0.68688554",
"0.68153423",
"0.6813235",
"0.68021035",
"0.6691957",
"0.66290957",
"0.6586394",
"0.6571268",
"0.655839",
"0.65477526",
"0.6545693",
"0.65405715",... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75212413",
"0.74254465",
"0.7227017",
"0.7224189",
"0.7096888",
"0.7096888",
"0.7059055",
"0.70071834",
"0.69155335",
"0.68690395",
"0.6814675",
"0.6812803",
"0.6802038",
"0.66921675",
"0.6628809",
"0.6586155",
"0.6570953",
"0.6558287",
"0.6547422",
"0.65455115",
"0.654116... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75213",
"0.74258864",
"0.7226946",
"0.7224665",
"0.7096967",
"0.7096967",
"0.7059375",
"0.7007428",
"0.6915441",
"0.68688554",
"0.68153423",
"0.6813235",
"0.68021035",
"0.6691957",
"0.66290957",
"0.6586394",
"0.6571268",
"0.655839",
"0.65477526",
"0.6545693",
"0.65405715",... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75212413",
"0.74254465",
"0.7227017",
"0.7224189",
"0.7096888",
"0.7096888",
"0.7059055",
"0.70071834",
"0.69155335",
"0.68690395",
"0.6814675",
"0.6812803",
"0.6802038",
"0.66921675",
"0.6628809",
"0.6586155",
"0.6570953",
"0.6558287",
"0.6547422",
"0.65455115",
"0.654116... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75213",
"0.74258864",
"0.7226946",
"0.7224665",
"0.7096967",
"0.7096967",
"0.7059375",
"0.7007428",
"0.6915441",
"0.68688554",
"0.68153423",
"0.6813235",
"0.68021035",
"0.6691957",
"0.66290957",
"0.6586394",
"0.6571268",
"0.655839",
"0.65477526",
"0.6545693",
"0.65405715",... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75212413",
"0.74254465",
"0.7227017",
"0.7224189",
"0.7096888",
"0.7096888",
"0.7059055",
"0.70071834",
"0.69155335",
"0.68690395",
"0.6814675",
"0.6812803",
"0.6802038",
"0.66921675",
"0.6628809",
"0.6586155",
"0.6570953",
"0.6558287",
"0.6547422",
"0.65455115",
"0.654116... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75213",
"0.74258864",
"0.7226946",
"0.7224665",
"0.7096967",
"0.7096967",
"0.7059375",
"0.7007428",
"0.6915441",
"0.68688554",
"0.68153423",
"0.6813235",
"0.68021035",
"0.6691957",
"0.66290957",
"0.6586394",
"0.6571268",
"0.655839",
"0.65477526",
"0.6545693",
"0.65405715",... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75212413",
"0.74254465",
"0.7227017",
"0.7224189",
"0.7096888",
"0.7096888",
"0.7059055",
"0.70071834",
"0.69155335",
"0.68690395",
"0.6814675",
"0.6812803",
"0.6802038",
"0.66921675",
"0.6628809",
"0.6586155",
"0.6570953",
"0.6558287",
"0.6547422",
"0.65455115",
"0.654116... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75213",
"0.74258864",
"0.7226946",
"0.7224665",
"0.7096967",
"0.7096967",
"0.7059375",
"0.7007428",
"0.6915441",
"0.68688554",
"0.68153423",
"0.6813235",
"0.68021035",
"0.6691957",
"0.66290957",
"0.6586394",
"0.6571268",
"0.655839",
"0.65477526",
"0.6545693",
"0.65405715",... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75212413",
"0.74254465",
"0.7227017",
"0.7224189",
"0.7096888",
"0.7096888",
"0.7059055",
"0.70071834",
"0.69155335",
"0.68690395",
"0.6814675",
"0.6812803",
"0.6802038",
"0.66921675",
"0.6628809",
"0.6586155",
"0.6570953",
"0.6558287",
"0.6547422",
"0.65455115",
"0.654116... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75213",
"0.74258864",
"0.7226946",
"0.7224665",
"0.7096967",
"0.7096967",
"0.7059375",
"0.7007428",
"0.6915441",
"0.68688554",
"0.68153423",
"0.6813235",
"0.68021035",
"0.6691957",
"0.66290957",
"0.6586394",
"0.6571268",
"0.655839",
"0.65477526",
"0.6545693",
"0.65405715",... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75212413",
"0.74254465",
"0.7227017",
"0.7224189",
"0.7096888",
"0.7096888",
"0.7059055",
"0.70071834",
"0.69155335",
"0.68690395",
"0.6814675",
"0.6812803",
"0.6802038",
"0.66921675",
"0.6628809",
"0.6586155",
"0.6570953",
"0.6558287",
"0.6547422",
"0.65455115",
"0.654116... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75213",
"0.74258864",
"0.7226946",
"0.7224665",
"0.7096967",
"0.7096967",
"0.7059375",
"0.7007428",
"0.6915441",
"0.68688554",
"0.68153423",
"0.6813235",
"0.68021035",
"0.6691957",
"0.66290957",
"0.6586394",
"0.6571268",
"0.655839",
"0.65477526",
"0.6545693",
"0.65405715",... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create and return a new object. See help(type) for accurate signature. | def __new__(*args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_object():\n return object()",
"def create(cls, _):\n return cls",
"def __newobj__(cls, *args):\n return cls.__new__(cls, *args)",
"def create(cls):\n pass\n return cls()",
"def __new__(cls):\n return object.__new__(cls)",
"def __new__(cls):\n return objec... | [
"0.75212413",
"0.74254465",
"0.7227017",
"0.7224189",
"0.7096888",
"0.7096888",
"0.7059055",
"0.70071834",
"0.69155335",
"0.68690395",
"0.6814675",
"0.6812803",
"0.6802038",
"0.66921675",
"0.6628809",
"0.6586155",
"0.6570953",
"0.6558287",
"0.6547422",
"0.65455115",
"0.654116... | 0.0 | -1 |
Implement setattr(self, name, value). | def __setattr__(self, *args, **kwargs):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setattr__(self, name, value):\n self.set(**{name: value})",
"def set_attr(self, name, value):\n setattr(self, name, value)",
"def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name... | [
"0.868889",
"0.8361373",
"0.8290292",
"0.8283524",
"0.82243794",
"0.8204499",
"0.8099823",
"0.8099823",
"0.8071226",
"0.80402154",
"0.8024459",
"0.79978293",
"0.79883593",
"0.7987577",
"0.79493016",
"0.7936443",
"0.79316676",
"0.7890851",
"0.78896946",
"0.78018266",
"0.775468... | 0.0 | -1 |
Create a link list with value specified in `args` and return the head node | def create_list(cls, *args):
return _create_list(cls, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def python_2_linked(python_list):\n head = None\n for i in range(len(python_list) - 1, -1, -1):\n head = Node(python_list[i], head)\n return head",
"def create_linked_list(input_list):\n head=None\n for value in input_list:\n if head is None:\n head=Node(value)\n el... | [
"0.63600534",
"0.6298656",
"0.6104955",
"0.6104354",
"0.6044044",
"0.5946568",
"0.5946568",
"0.5946568",
"0.5946568",
"0.5946568",
"0.5940156",
"0.59143734",
"0.58970946",
"0.5891157",
"0.58886445",
"0.58886445",
"0.58886445",
"0.58886445",
"0.5869393",
"0.58602107",
"0.58546... | 0.0 | -1 |
Create a link list with value specified in `args` and return the head node | def create_list(cls, *args):
return _create_list(cls, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def python_2_linked(python_list):\n head = None\n for i in range(len(python_list) - 1, -1, -1):\n head = Node(python_list[i], head)\n return head",
"def create_linked_list(input_list):\n head=None\n for value in input_list:\n if head is None:\n head=Node(value)\n el... | [
"0.63590133",
"0.6297935",
"0.6103776",
"0.6103441",
"0.6042742",
"0.59459645",
"0.59459645",
"0.59459645",
"0.59459645",
"0.59459645",
"0.59379864",
"0.5912185",
"0.58948976",
"0.5888993",
"0.5887565",
"0.5887565",
"0.5887565",
"0.5887565",
"0.5867898",
"0.5860273",
"0.58540... | 0.0 | -1 |
creates a vao if the instance has a shape where we did not create an vao yet | def update_shape_vaos(self, instance, show):
shape = self._shape(instance)
shape_object_id = id(shape)
if not shape_object_id in self._shape_vaos:
self._shape_vaos[shape_object_id] = VertexArray({
'vertex_position': VertexBuffer.from_numpy(shape.verticies),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def agregar_arista(self, v, w, peso=1):\n if not v in self.vertices or not w in self.vertices:\n return False\n self.vertices[v][w]= peso\n if not self.dirigido: self.vertices[w][v] = peso",
"def test_creation(self):\n\n assert self.test_shape.solid is not None\n ass... | [
"0.5730283",
"0.5638069",
"0.5638069",
"0.56318754",
"0.56318754",
"0.5603204",
"0.5560593",
"0.54646444",
"0.5322073",
"0.5228889",
"0.5199293",
"0.5199293",
"0.5173173",
"0.516719",
"0.51552814",
"0.5147659",
"0.51269144",
"0.5120981",
"0.5112034",
"0.5101421",
"0.51001644"... | 0.6779693 | 0 |
renders a texture containing the borders of all shapes. | def _render_borders(self):
# XXX
# - read the old glBlendFunc value and restore it if neccessary.
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
self.border_program.use()
for shape_object_id, instances in self._instances.items():
self._shape_vaos[shape_object_id]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tile_border(draw, r_s, r_e, c_s, c_e, color, border_size=TILE_BORDER_SIZE):\n for x in range(0, border_size):\n draw.rectangle([(c_s + x, r_s + x), (c_e - 1 - x, r_e - 1 - x)], outline=color)",
"def borders(self):\n border_left = pm.Segment(self.space.static_body, (-5, 0), (-5, self.screen_height)... | [
"0.61772597",
"0.604624",
"0.5954987",
"0.59350353",
"0.58965117",
"0.58747965",
"0.5859048",
"0.58586574",
"0.5853385",
"0.5800375",
"0.5792888",
"0.5761924",
"0.5725997",
"0.5725489",
"0.5707735",
"0.56973356",
"0.56697094",
"0.56612206",
"0.5657879",
"0.56512725",
"0.55952... | 0.6801152 | 0 |
Hack due since the field 'type' is not defined with the new api. | def _setup_fields(self, partial):
cls = type(self)
type_selection = cls._fields['type'].selection
if GEO_VIEW not in type_selection:
tmp = list(type_selection)
tmp.append(GEO_VIEW)
cls._fields['type'].selection = tuple(set(tmp))
super(IrUIView, self)._... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _type(self) -> str:\n ...",
"def data_types(self):",
"def target_type(self):",
"def type(self):\n pass",
"def type(self):\n pass",
"def type(self):\n pass",
"def _assign_type(self, type):\n if self.is_input:\n return 'data'\n else:\n r... | [
"0.7302931",
"0.678518",
"0.6770575",
"0.6756729",
"0.6756729",
"0.6756729",
"0.6682159",
"0.66806513",
"0.6652041",
"0.6635127",
"0.66314536",
"0.66299766",
"0.6628445",
"0.6628445",
"0.6628445",
"0.6628445",
"0.6628445",
"0.6628445",
"0.6628445",
"0.6628445",
"0.6628445",
... | 0.0 | -1 |
Timeout Webdriver and NoSuchElementException | def timeout_element_error(self, selector, name):
BasePage.LOGGER.error("Timeout - < {1} > element not found: {0} \n".format(selector, name))
raise Exception("Timeout - < {1} > element not found: {0}".format(selector, name)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _selenium_wait_for(fn):\n start_time = time.time()\n while True:\n try:\n return fn()\n except (AssertionError, WebDriverException) as e:\n if time.time() - start_time > 10:\n raise e\n time.sleep(0.5)",
"def wait_for_element_XPATH(driver, l... | [
"0.6906246",
"0.65946335",
"0.6539996",
"0.6489523",
"0.6438544",
"0.6437793",
"0.64108276",
"0.63448566",
"0.6307142",
"0.62821215",
"0.62623805",
"0.62145853",
"0.6207715",
"0.6197207",
"0.61932975",
"0.614702",
"0.60980797",
"0.60979617",
"0.6093095",
"0.60426414",
"0.6032... | 0.60042745 | 22 |
fibonacci number generator Fn = Fn1 + Fn2 | def get_fibonacci(a: int = 0, b: int = 1):
values = [a, b]
result = 0
def inner():
nonlocal result
if not result:
result = 1
return result
result = values[0] + values[1]
values[0] = values[1]
values[1] = result
return result
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fibonacci(n):",
"def fibonacci_gen(n=1):\n a, b = 0, 1\n while True:\n yield a\n a, b = b, (a + b) * n",
"def fibonacci():\n\ta, b = 0, 1\n\tyield 0\n\twhile True:\n\t\ta, b = b, a + b\n\t\tyield a",
"def fibonacci():\n return sum_series(a=0, b=1)",
"def yieldFibonacci():\n yi... | [
"0.8263126",
"0.82361346",
"0.8028872",
"0.79518986",
"0.79381496",
"0.7924277",
"0.79158354",
"0.7894281",
"0.78822285",
"0.7874261",
"0.78438854",
"0.7771744",
"0.77353585",
"0.773498",
"0.7734652",
"0.7725709",
"0.7691626",
"0.76762664",
"0.76594216",
"0.76485354",
"0.7647... | 0.76631224 | 18 |
(pygame.Surface) surface surface to draw on | def __init__(self, dim):
self.surface = pygame.Surface(dim)
self.p_array = pygame.PixelArray(self.surface)
self.p_array[0, 0] = (255, 255, 255)
print(self.p_array.shape)
# set some values
self.width = self.surface.get_width()
self.height = self.surface.get_height(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw(self, surface):\r\n surface.blit(self.image, self.rect)",
"def draw(self, surface):\n surface.blit(self.image, self.rect)",
"def draw(self, surface):\n surface.blit(self.image, self.rect)",
"def draw(self, surface):\n\n\t\tsurface.blit(self.image, self.rect.topleft)",
"def dra... | [
"0.82529837",
"0.8231386",
"0.8231386",
"0.8224753",
"0.7889775",
"0.77768934",
"0.76928973",
"0.76249444",
"0.75943315",
"0.7543004",
"0.743196",
"0.74313164",
"0.740035",
"0.73939043",
"0.73500395",
"0.7344025",
"0.7303909",
"0.7301306",
"0.7264715",
"0.7157861",
"0.7149983... | 0.0 | -1 |
Initialize a player at `(100, 100)`. | def __init__(self):
self._pos = Vector2(250, 250)
self._color = (randint(0, 255), randint(0, 255), randint(0, 255), 255)
self._ticks_alive = 0
self._dead = False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n pos = _get_mc().player.getTilePos() + Vec3(2, 0, 0)\n pos = _Vec3(pos.x, pos.y, pos.z)\n _GenericBot.__init__(self, pos)\n self._pos = pos\n self._move(self._pos)",
"def __init__(self, player_name, player_number, player_position):\n self.name = play... | [
"0.6536687",
"0.6488673",
"0.6478369",
"0.63680834",
"0.63346314",
"0.63192993",
"0.6318841",
"0.62750936",
"0.62334204",
"0.62303233",
"0.62238264",
"0.6221478",
"0.62190807",
"0.6183001",
"0.61749464",
"0.61681664",
"0.615738",
"0.61351466",
"0.6121116",
"0.61058784",
"0.61... | 0.0 | -1 |
Copy the score to the NN after each tick. | def update(self, game):
super().update(game)
self.nn_def.set_score(self.score) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updateScore(self, score):\n self.__score += score",
"def update_score():\n pass",
"def update_score(self):\n self.score = TurboMQ.calculate_fitness(self.result, self.graph)",
"def update_score(self, board):\n self._score += 1",
"def update_score(self):\n td = self.cre... | [
"0.64578915",
"0.6423904",
"0.6408726",
"0.62740093",
"0.61973757",
"0.6169047",
"0.6169047",
"0.6169047",
"0.60679024",
"0.60264367",
"0.6015221",
"0.59940284",
"0.5993987",
"0.5973198",
"0.59721255",
"0.5949299",
"0.5942236",
"0.5902771",
"0.58866864",
"0.5841765",
"0.58369... | 0.7277563 | 0 |
Initialize the game and stuff. | def __init__(self):
super().__init__()
self.reset() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n\n self.frameCount = 0\n self._initScreen()\n self._initObjects()\n self._initControls()\n self._initLevel()\n self._start()\n print \"DEBUG: Initializing Game\"\n pass",
"def initialize(self):\n result = pygame.init()\n p... | [
"0.81970125",
"0.7818936",
"0.7808666",
"0.771461",
"0.77053165",
"0.7600043",
"0.7544645",
"0.75240386",
"0.7482506",
"0.7453608",
"0.73644614",
"0.73479956",
"0.73381686",
"0.72727126",
"0.7229876",
"0.72232723",
"0.7213134",
"0.7209848",
"0.7179606",
"0.7177788",
"0.716152... | 0.0 | -1 |
Reset the circle position. | def reset(self):
self.obstacles = []
self._tick = 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset(self):\n self._x = 0\n self._y = 0",
"def reset(self):\n if self.num == 1:\n self.rect.centerx = 320\n elif self.num == 2:\n self.rect.centerx = 341\n elif self.num == 3:\n self.rect.centerx = 362\n elif self.num == 4:\n ... | [
"0.72993195",
"0.7255826",
"0.715092",
"0.69972944",
"0.69937557",
"0.6893382",
"0.6882351",
"0.6868341",
"0.6845411",
"0.6835266",
"0.67488813",
"0.6746005",
"0.6730143",
"0.6719677",
"0.6673677",
"0.6648419",
"0.6637243",
"0.6601557",
"0.65476596",
"0.65166193",
"0.6475932"... | 0.0 | -1 |
Check if players are in circle and move circle. | def update(self, players):
# if self._tick % 75 == 0:
# pos = Vector2(100 + self._tick % 1240, -200)
# radius = 50 + self._tick % 200
# dir = Vector2(-5.5 + self._tick % 9, 2 + self._tick % 5)
if self._tick % 25 == 0:
pos = Vector2(((self._tick / 25) * 100... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def moveCirc(self):\n\t\tfor circle in self.circles:\n\t\t\tcircle.moveStep()",
"def __circle_collision(self, circle):\n raise Exception('--- This methods have not been implemented yet! Use circle_collider instead ---')",
"def isInCircle(self,x1,y1,radius1):\r\n if(distance(self.x,x1,self.y,y1) <... | [
"0.6577817",
"0.65163505",
"0.64082247",
"0.6372123",
"0.6278907",
"0.62529737",
"0.62500507",
"0.61733204",
"0.6145526",
"0.6112506",
"0.6024558",
"0.5974018",
"0.5972571",
"0.594659",
"0.59201765",
"0.5910622",
"0.5869203",
"0.5865629",
"0.58057946",
"0.5794347",
"0.5783794... | 0.0 | -1 |
Render the player's score in the topright corner. | def render(self, players):
color = (50, 50, 50, 255)
for obstacle in self.obstacles:
pos = (int(obstacle.pos.x), int(obstacle.pos.y))
pygame.draw.circle(self.screen, color, pos, obstacle.radius)
# lines = [
# (f"{player.score:.2f} {player._last_inputs}", pla... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_score(self):\n score_text = \"Score: {}\".format(self.score)\n start_x = 10\n start_y = SCREEN_HEIGHT - 20\n arcade.draw_text(score_text, start_x=start_x, start_y=start_y, font_size=12, color=arcade.color.NAVY_BLUE)",
"def draw_score(self):\r\n score_text = \"Score: {}... | [
"0.6668652",
"0.66665083",
"0.66568977",
"0.6585997",
"0.6574961",
"0.6547004",
"0.65277916",
"0.6438168",
"0.6286203",
"0.625644",
"0.6196247",
"0.6176804",
"0.61113346",
"0.61046463",
"0.6091204",
"0.6089902",
"0.60842437",
"0.6050146",
"0.60490125",
"0.60254073",
"0.602245... | 0.0 | -1 |
Set suffixes if they begin with a + | def set_suffixes(args):
return [arg[1:] for arg in args if arg[0] == '+'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def removesuffix(self, x) -> String:\n pass",
"def suffix_replace(original, old, new):\n ...",
"def add_suffix(word, suffix):\n suffix, sep, rest = suffix.partition(' ')\n expanded = _add_suffix(word, suffix)\n return expanded + sep + rest",
"def setSuffixes(self, s):\n return self._set... | [
"0.6363864",
"0.6346127",
"0.6332669",
"0.61678916",
"0.6081603",
"0.59654105",
"0.59258044",
"0.5911821",
"0.586002",
"0.585793",
"0.58109426",
"0.57019335",
"0.56996137",
"0.5689837",
"0.5645532",
"0.5638323",
"0.56038296",
"0.5587256",
"0.5583112",
"0.5580947",
"0.5578123"... | 0.75712377 | 0 |
Takes a bounding box in the form [x1,y1,x2,y2] and returns z in the form [x,y,s,r] where x,y is the centre of the box and s is the scale/area and r is the aspect ratio | def convert_bbox_to_z(bbox):
w = bbox[2] - bbox[0]
h = bbox[3] - bbox[1]
x = bbox[0] + w / 2.
y = bbox[1] + h / 2.
s = w * h # scale is just area
r = w / float(h)
return np.array([x, y, s, r]).reshape((4, 1)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_bbox_to_z(bbox):\n w = bbox[2] - bbox[0]\n h = bbox[3] - bbox[1]\n x = bbox[0] + w/2.\n y = bbox[1] + h/2.\n s = w * h #scale is just area\n r = w / float(h)\n return np.array([x, y, s, r]).reshape((4, 1))",
"def convert_bbox_to_z(bbox):\n w = bbox[2] - bbox[0]\n h = bbox[3] - bbox[1]... | [
"0.70684916",
"0.6832517",
"0.67437243",
"0.67029804",
"0.667289",
"0.65944505",
"0.6579306",
"0.63725936",
"0.63596195",
"0.63322043",
"0.6323071",
"0.62650836",
"0.6200155",
"0.6196621",
"0.6168873",
"0.6150329",
"0.6144695",
"0.6138646",
"0.61194324",
"0.61101246",
"0.6088... | 0.6905524 | 1 |
Takes a bounding box in the centre form [x,y,s,r] and returns it in the form [x1,y1,x2,y2] where x1,y1 is the top left and x2,y2 is the bottom right | def convert_x_to_bbox(x, score=None):
w = np.sqrt(x[2] * x[3])
h = x[2] / w
if (score == None):
return np.array([x[0] - w / 2., x[1] - h / 2., x[0] + w / 2., x[1] + h / 2.]).reshape((1, 4))
else:
return np.array([x[0] - w / 2., x[1] - h / 2., x[0] + w / 2., x[1] + h / 2., score]).reshape... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bounding_box(self):\n latlon00 = self.ij_to_latlon(-1,-1)\n latlon01 = self.ij_to_latlon(-1,self.domain_size[1]+1)\n latlon11 = self.ij_to_latlon(self.domain_size[0]+1,self.domain_size[1]+1)\n latlon10 = self.ij_to_latlon(self.domain_size[0]+1,-1)\n return (latlon00,latlon01,... | [
"0.7336241",
"0.7303076",
"0.72468996",
"0.6998003",
"0.69910204",
"0.6945646",
"0.6941397",
"0.6926572",
"0.691243",
"0.689995",
"0.68915945",
"0.68854016",
"0.68658006",
"0.68334496",
"0.6831805",
"0.68313426",
"0.6828961",
"0.68198115",
"0.68122274",
"0.6802447",
"0.679994... | 0.0 | -1 |
Initialises a tracker using initial bounding box. | def __init__(self, bbox, init_time, point_of_interest="centroid"):
# define constant velocity model
self.kf = KalmanFilter(dim_x=7, dim_z=4)
self.kf.F = np.array(
[[1, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 1, 0], [0, 0, 1, 0, 0, 0, 1], [0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 0, 1,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, ini_image, object_bound_rect = (0,0,0,0)):\r\n \r\n self.ini_image = ini_image\r\n \r\n # if the bounding rectangle of the object is not set, than chose it manually\r\n if (object_bound_rect == (0,0,0,0)):\r\n print('Select object to track on the ima... | [
"0.6416394",
"0.6144388",
"0.6087813",
"0.60802984",
"0.60503703",
"0.6035247",
"0.60268754",
"0.59979475",
"0.59900707",
"0.5933507",
"0.57222086",
"0.5720171",
"0.57074535",
"0.570139",
"0.5682709",
"0.56483907",
"0.56464523",
"0.5633736",
"0.561775",
"0.5614379",
"0.561291... | 0.0 | -1 |
Realiza la prediccion de la siguiente posicion del filtro. | def predict(self):
if ((self.kf.x[6] + self.kf.x[2]) <= 0):
self.kf.x[6] *= 0.0
self.kf.predict()
self.age += 1
if (self.time_since_update > 0):
self.hit_streak = 0
self.time_since_update += 1
self.history.append(convert_x_to_bbox(self.kf.x))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter(self, filters):",
"def filter(self, *args, **kwargs):",
"def _filterfunc(self,*args,**kwargs):\n self._filterfunc = self.f\n return self.f(*args,**kwargs)",
"def aplicar_filtro(self, nome_filtro, mascara=None, tecnica=None):\n if tecnica:\n self.imagem_core.aplicar_... | [
"0.6326641",
"0.6284709",
"0.61063915",
"0.61041886",
"0.60180736",
"0.5921878",
"0.5900954",
"0.58621126",
"0.58244914",
"0.58086395",
"0.5734422",
"0.5730966",
"0.5679648",
"0.5614816",
"0.5606188",
"0.55680424",
"0.55649614",
"0.5559107",
"0.555382",
"0.5552491",
"0.555077... | 0.0 | -1 |
retorna la caja de deteccion estimada. | def get_state(self):
return convert_x_to_bbox(self.kf.x) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Cima(self):\n if(self.Pila_Vacia()=='true'):\n return \"Pila Vacia\"\n else:\n return self.pila[self.puntero]",
"def getFactura(self): \n return self.caja",
"def getFactura(self): \n return self.caja",
"def custo(EstadoRestaUm, resultante):\... | [
"0.6676887",
"0.65989596",
"0.65989596",
"0.6179071",
"0.5784997",
"0.57558566",
"0.57162106",
"0.5690865",
"0.56256",
"0.5600928",
"0.55917364",
"0.5530381",
"0.5516032",
"0.5458207",
"0.5392833",
"0.53876114",
"0.53480095",
"0.53460985",
"0.5339537",
"0.5338082",
"0.5335797... | 0.0 | -1 |
Retorna el punto de interes a medir | def get_point_of_interest(self):
if self.point_of_interest == "centroid":
return (round(float(self.kf.x[0][0]), 2), round(float(self.kf.x[1][0]), 2))
elif self.point_of_interest == "botmid":
x1, y1, x2, y2 = convert_x_to_bbox(self.kf.x)[0]
x = (x2 + x1) / 2
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tilt(self) -> int:",
"def get_orientation(sstart, send):\n\n return (send - sstart) // np.abs((send - sstart))",
"def comp_rot_dir(self):\n\n MMF = self.comp_mmf_unit()\n p = self.get_pole_pair_number()\n\n # Compute rotation direction from unit mmf\n results = MMF.get_harmonics(1, \"freqs\"... | [
"0.6276441",
"0.5695991",
"0.56245315",
"0.56154054",
"0.5554108",
"0.548792",
"0.5482889",
"0.5477319",
"0.5464951",
"0.5464305",
"0.5406001",
"0.5404115",
"0.5368255",
"0.52930975",
"0.5276927",
"0.5269638",
"0.5267524",
"0.5254308",
"0.5213053",
"0.5204432",
"0.51818806",
... | 0.0 | -1 |
Decorator for exposing a method as an RPC call with the given signature. | def expose_rpc(permission, return_type, *arg_types):
def decorator(func):
if not hasattr(func, '_xmlrpc_signatures'):
func._xmlrpc_signatures = []
func._xml_rpc_permission = permission
func._xmlrpc_signatures.append((return_type,) + tuple(arg_types))
return func
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rpc_call(func):\n @wraps(func)\n def decorator(*args, **kwargs):\n return func(*args, **kwargs)\n decorator.rpc_call = True\n return decorator",
"def rpc_method(func):\n func.rpc_callable = True\n return func",
"def rpcmethod(func):\n func.rpcmethod = True\n return fu... | [
"0.72693485",
"0.7231531",
"0.6921579",
"0.6753611",
"0.6449031",
"0.6424492",
"0.6306513",
"0.614029",
"0.6127533",
"0.598983",
"0.5951367",
"0.5933623",
"0.58960724",
"0.58644986",
"0.581652",
"0.5811746",
"0.58007073",
"0.5770051",
"0.57460624",
"0.57426834",
"0.5732241",
... | 0.7436393 | 0 |
Returns a tuple of (name, docs). Method provides general information about the protocol used for the RPC HTML view. | def rpc_info(): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def protocol_details(self) -> pulumi.Output['outputs.ServerProtocolDetails']:\n return pulumi.get(self, \"protocol_details\")",
"def getProtocol(self) -> str:\n ...",
"def ProtocolInformation(self) -> _n_0_t_7[_n_0_t_6]:",
"def protocol_details(self) -> Optional[pulumi.Input['ServerProtocolDeta... | [
"0.63214266",
"0.62781686",
"0.6262785",
"0.6157618",
"0.6157618",
"0.59904015",
"0.59434193",
"0.59365165",
"0.59026176",
"0.59026176",
"0.5755433",
"0.5737627",
"0.5737061",
"0.5725151",
"0.5674545",
"0.56743675",
"0.56536806",
"0.5648387",
"0.56417984",
"0.5625215",
"0.556... | 0.6150077 | 5 |
Return an iterable of (path_item, content_type) combinations that will be handled by the protocol. | def rpc_match(): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def content_types(self):\n return self.get(\"content_type\", decode=True).split(\"#\")",
"def yield_parts(self, mime_type):\n yield from self.parts_by_type[mime_type]",
"def __iter__(self, *item_types):\n return self.storage().__iter__(*item_types)",
"def _get_path_parameters(self) -> Ge... | [
"0.60898995",
"0.60679364",
"0.5736429",
"0.5656851",
"0.5587165",
"0.547377",
"0.5270634",
"0.52450544",
"0.52008677",
"0.51889116",
"0.5184611",
"0.5158318",
"0.5141637",
"0.5141274",
"0.51271886",
"0.507301",
"0.50436175",
"0.5035092",
"0.50330544",
"0.5031691",
"0.5030380... | 0.0 | -1 |
Serialize the result of the RPC call and send it back to the client. | def send_rpc_result(req, result): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def send_result(\n self,\n rpc_message: RpcMessage,\n result_message: ResultMessage,\n return_path: str,\n bus_client: \"BusClient\",\n ):\n raise NotImplementedError()",
"def _success(self, result_ser, request):\n result = json.dumps(result_ser)\n ... | [
"0.66543037",
"0.6296766",
"0.6142886",
"0.6120978",
"0.61099845",
"0.60895675",
"0.5985333",
"0.59626645",
"0.59577644",
"0.59334546",
"0.5809743",
"0.5802393",
"0.5798993",
"0.5763221",
"0.57578456",
"0.57577705",
"0.57374424",
"0.5700236",
"0.56850314",
"0.56526905",
"0.56... | 0.7619752 | 0 |
Send a fault message back to the caller. Exception type and message are used for this purpose. This method SHOULD handle `RPCError`, `PermissionError`, `ResourceNotFound` and their subclasses. This method is ALWAYS called from within an exception handler. | def send_rpc_error(req, rpcreq, e): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def as_fault(self):\n return Fault(self.fault_code, self.internal_message or\n 'unknown server error')",
"def sendError():\n exceptionType, exceptionValue, exceptionTraceback = sys.exc_info()\n\n self.sendData((\n RPC_ERROR,\n request... | [
"0.7071276",
"0.6348312",
"0.6157591",
"0.6079973",
"0.5968808",
"0.58654845",
"0.56166476",
"0.5603174",
"0.5541813",
"0.549976",
"0.54576796",
"0.53889596",
"0.5354191",
"0.53528136",
"0.53274065",
"0.53245324",
"0.5259947",
"0.5250991",
"0.5225134",
"0.5202953",
"0.5176000... | 0.5861101 | 6 |
Provide the namespace in which a set of methods lives. This can be overridden if the 'name' element is provided by xmlrpc_methods(). | def xmlrpc_namespace(): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xmlrpc_methods():",
"def namespace(self):\n raise exceptions.NotImplementedError()",
"def namespaces(self):\n return ()",
"def _ns(self, *args):\n return \"%s.%s\" % (self.namespace, \".\".join([str(arg) for arg in args]))",
"def createNamespace(self):\r\n raise NotImplement... | [
"0.67840374",
"0.6330559",
"0.60799056",
"0.6017906",
"0.58106625",
"0.57945573",
"0.5761432",
"0.57473826",
"0.5687743",
"0.56653756",
"0.5655525",
"0.560176",
"0.55967504",
"0.54732215",
"0.546771",
"0.54126364",
"0.5406012",
"0.54021627",
"0.53649825",
"0.5364481",
"0.5357... | 0.7973318 | 0 |
Return an iterator of (permission, signatures, callable[, name]), where callable is exposed via XMLRPC if the authenticated user has the appropriate permission. The callable itself can be a method or a normal method. The first argument passed will always be a request object. The XMLRPCSystem performs some extra magic t... | def xmlrpc_methods(): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_callables(self):\n self.logger.debug(\"List of callable API objects requested\")\n # Dict of subsystem object names to their callable methods.\n callables = {}\n for name, obj in self.systems.items():\n methods = []\n # Filter out methods which are not exp... | [
"0.61892486",
"0.6071628",
"0.59015536",
"0.57002825",
"0.55370826",
"0.54784065",
"0.54508215",
"0.5414121",
"0.5412082",
"0.537975",
"0.53792226",
"0.5354374",
"0.5345071",
"0.5338745",
"0.5318012",
"0.52992016",
"0.52992016",
"0.52889067",
"0.52845573",
"0.52817297",
"0.52... | 0.57516205 | 3 |
Accept a signature in the form returned by xmlrpc_methods. | def __init__(self, provider, permission, signatures, callable, name = None):
self.permission = permission
self.callable = callable
self.rpc_signatures = signatures
self.description = inspect.getdoc(callable)
if name is None:
self.name = provider.xmlrpc_namespace() + '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handle_signature(self, sig, signode):\n raise NotImplementedError",
"def methodSignature(self, name):\r\n methods = self._listMethods()\r\n for method in methods:\r\n if method == name:\r\n rtype = None\r\n ptypes = []\r\n parsed = ... | [
"0.6711148",
"0.6590422",
"0.6256732",
"0.6185158",
"0.61770433",
"0.60993564",
"0.6063352",
"0.6062019",
"0.5981521",
"0.59380984",
"0.5904751",
"0.5904751",
"0.5851124",
"0.5769249",
"0.5762142",
"0.5746465",
"0.57145953",
"0.5696321",
"0.56754774",
"0.5654689",
"0.56541437... | 0.0 | -1 |
Return the signature of this method. | def _get_signature(self):
if hasattr(self, '_signature'):
return self._signature
fullargspec = inspect.getargspec(self.callable)
argspec = fullargspec[0]
assert argspec[0:2] == ['self', 'req'] or argspec[0] == 'req', \
'Invalid argspec %s for %s' % (argspec, self.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signature(cls):\n raise NotImplementedError(\"%s.signature()\" % cls)",
"def signature(self, p_int): # real signature unknown; restored from __doc__\n return \"\"",
"def signature(self):\n return self._signature",
"def signature(self):\n return self._signature",
"def signatu... | [
"0.74505126",
"0.7274117",
"0.71339434",
"0.71339434",
"0.71339434",
"0.71142375",
"0.70143425",
"0.70143425",
"0.70018256",
"0.7001453",
"0.69338924",
"0.69170797",
"0.6707692",
"0.6699207",
"0.66984206",
"0.6693676",
"0.65883964",
"0.6566268",
"0.6551409",
"0.6475032",
"0.6... | 0.7123017 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.