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
Create new lists were previously doubled points in dist list removed and averaged in elev_list
def average_double_pts(elev_list, dist_list, minimum_point_distance=0.5): import numpy as np dist_array = np.array(dist_list) diffs = dist_array[1:] - dist_array[:-1] bad_pts = diffs < minimum_point_distance bad_indices = [i for i in range(len(bad_pts)) if bad_pts[i]] new_elev_array = np.arra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def v_dist_space(trial):\n return [np.mean(space) for space in trial]", "def _euclidian_distances(stop_list):\n e_dists2 = [transitfeed.approximate_distance_between_stops(stop, tail) for\n (stop, tail) in zip(stop_list, stop_list[1:])]\n\n return e_dists2", "def _transform_d...
[ "0.59104544", "0.5468914", "0.5397144", "0.53817797", "0.5364048", "0.535594", "0.53433156", "0.5334994", "0.53302234", "0.53162", "0.52459675", "0.52387244", "0.52223456", "0.519468", "0.5191414", "0.51864374", "0.5181687", "0.51815665", "0.51673615", "0.5149777", "0.5147351...
0.72335047
0
Return an array of item comparisons, avoiding selfcomparisons.
def pairwise_equalities(things): return np.array([things[i] == things[j] for i in range(len(things)) for j in range(i + 1, len(things))])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def item_comparer(self):\n return self.item_comparer_value", "def OnCompareItems(self, item1, item2):\r\n\r\n return cmp(self.GetItemText(item1), self.GetItemText(item2))", "def by_equality(cls, *expected_items):\n return cls(*(to_matcher(EqualsMatcher, i) for i in expected_items))", "de...
[ "0.58421564", "0.56897765", "0.5672012", "0.5588486", "0.5552559", "0.5403639", "0.5401066", "0.53403103", "0.5271652", "0.5211439", "0.51990104", "0.5190706", "0.5167556", "0.51661444", "0.51609856", "0.5154473", "0.51290977", "0.5125599", "0.5107754", "0.5106961", "0.510658...
0.48618746
46
Because of slight numerical instabilities, the mostlikelytree method does _not_ in fact always return the same tree when there are multiple trees with the same or very nearly the same likelihood. The best we can ask for is that the method returns _a_ best tree, defined as one with the biggest likelihood, or nearly the ...
def test_that_most_probable_always_returns_a_tree_of_the_same_logprob(): grammar = Grammar(rulebooks) actual_tree = grammar.sample_tree() sentence = actual_tree.terminals inner = grammar.compute_inside_probabilities(sentence) best_tree = grammar.compute_most_likely_tree(sentence, inner, root=0) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_maximum_value(self):\n if self.root: \n self.max_val = self.root.value\n else:\n return 'No tree found'\n def inner(root):\n if root.left:\n inner(root.left)\n\n if root.right:\n inner(root.right)\n\n if self.max_val < root.value:\n self.max_val = roo...
[ "0.67465556", "0.6164014", "0.61626226", "0.60900533", "0.6089753", "0.60731304", "0.6045642", "0.60375273", "0.6031647", "0.6021071", "0.5996487", "0.59402007", "0.59293586", "0.58979386", "0.58588094", "0.58377635", "0.58170396", "0.58130044", "0.58093256", "0.5809125", "0....
0.7200898
0
Load in arguments for applying coefficients for Ensemble Model Output Statistics (EMOS), otherwise known as Nonhomogeneous Gaussian Regression (NGR). The coefficients are applied to the forecast that is supplied, so as to calibrate the forecast. The calibrated forecast is written to a netCDF file. If no coefficients ar...
def main(argv=None): parser = ArgParser( description='Apply coefficients for Ensemble Model Output ' 'Statistics (EMOS), otherwise known as Non-homogeneous ' 'Gaussian Regression (NGR). The supported input formats ' 'are realizations, probabilities...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process(current_forecast, coeffs, num_realizations=None,\n random_ordering=False, random_seed=None,\n ecc_bounds_warning=False, predictor_of_mean='mean'):\n if coeffs is None:\n msg = (\"There are no coefficients provided for calibration. The \"\n \"uncalibrated fo...
[ "0.5519549", "0.5417745", "0.53862226", "0.52634716", "0.50273323", "0.5010265", "0.49229556", "0.49013907", "0.4877792", "0.48454607", "0.4783449", "0.47544655", "0.47529", "0.47140917", "0.47133023", "0.47060087", "0.46985283", "0.4687954", "0.46867755", "0.4664076", "0.465...
0.7194427
0
Applying coefficients for Ensemble Model Output Statistics. Load in arguments for applying coefficients for Ensemble Model Output Statistics (EMOS), otherwise known as Nonhomogeneous Gaussian Regression (NGR). The coefficients are applied to the forecast that is supplied, so as to calibrate the forecast. The calibrated...
def process(current_forecast, coeffs, num_realizations=None, random_ordering=False, random_seed=None, ecc_bounds_warning=False, predictor_of_mean='mean'): if coeffs is None: msg = ("There are no coefficients provided for calibration. The " "uncalibrated forecast will b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(argv=None):\n parser = ArgParser(\n description='Apply coefficients for Ensemble Model Output '\n 'Statistics (EMOS), otherwise known as Non-homogeneous '\n 'Gaussian Regression (NGR). The supported input formats '\n 'are realizations, pro...
[ "0.6839221", "0.5753612", "0.5297529", "0.50588846", "0.486943", "0.48606175", "0.48570108", "0.4810559", "0.4788578", "0.47579268", "0.4745183", "0.47238272", "0.47165662", "0.4668261", "0.46644482", "0.4629341", "0.46219748", "0.46173713", "0.46099064", "0.46055603", "0.460...
0.6488239
1
Iterate over batches of a given size when the input is simply the raw image itself
def iterate_batches(inputs, targets, batch_size, shuffle=True): # Make sure that the input and target arrays are also of the same size assert len(inputs) == len(targets) indices = np.arange(len(inputs)) if shuffle: np.random.shuffle(indices) for start_index in rang...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generator(array, batch_size):\n start = 0 # pointer to where we are in iteration\n while True:\n stop = start + batch_size\n diff = stop - array.shape[0]\n if diff <= 0:\n batch = array[start:stop]\n start += batch_size\n else:\n batch = np.concatenate((array[start:], array[:diff]...
[ "0.7110718", "0.7075221", "0.70680904", "0.7002261", "0.6975876", "0.69697165", "0.69678855", "0.69515705", "0.6930055", "0.6887131", "0.68486667", "0.68431544", "0.67821205", "0.6775559", "0.6767301", "0.6744574", "0.67342305", "0.6732619", "0.67257315", "0.6717631", "0.6696...
0.6239594
64
Retrieve a list of all panelist scores from nonBest Of and nonRepeat shows
def retrieve_all_scores(database_connection: mysql.connector.connect ) -> List[int]: cursor = database_connection.cursor() query = ("SELECT pm.panelistscore FROM ww_showpnlmap pm " "JOIN ww_shows s ON s.showid = pm.showid " "WHERE s.bestof = 0 AND s.repeatshowid ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieve_grouped_scores(database_connection: mysql.connector.connect\n ) -> Dict:\n cursor = database_connection.cursor()\n query = (\"SELECT pm.panelistscore, COUNT(pm.panelistscore) \"\n \"FROM ww_showpnlmap pm \"\n \"JOIN ww_shows s ON s.showid = pm.sh...
[ "0.63882565", "0.6345482", "0.60516936", "0.60274804", "0.5971298", "0.59415215", "0.5897459", "0.58885854", "0.58742666", "0.56829435", "0.567487", "0.56604165", "0.56549484", "0.5630021", "0.5613433", "0.56064445", "0.5598407", "0.5592181", "0.55896866", "0.55654347", "0.55...
0.6766444
0
Retrieve a list of grouped panelist scores from nonBest Of and nonRepeat shows
def retrieve_grouped_scores(database_connection: mysql.connector.connect ) -> Dict: cursor = database_connection.cursor() query = ("SELECT pm.panelistscore, COUNT(pm.panelistscore) " "FROM ww_showpnlmap pm " "JOIN ww_shows s ON s.showid = pm.showid " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieve_all_scores(database_connection: mysql.connector.connect\n ) -> List[int]:\n cursor = database_connection.cursor()\n query = (\"SELECT pm.panelistscore FROM ww_showpnlmap pm \"\n \"JOIN ww_shows s ON s.showid = pm.showid \"\n \"WHERE s.bestof = 0 AND ...
[ "0.61236584", "0.60025114", "0.5887449", "0.58714366", "0.58647263", "0.57514274", "0.57352406", "0.5672734", "0.5664091", "0.5638059", "0.5633964", "0.56201035", "0.5512606", "0.55024105", "0.5480762", "0.5474629", "0.5465591", "0.54459333", "0.5442375", "0.53806484", "0.537...
0.6751662
0
Calculate stats for all of the panelist scores
def calculate_stats(scores: List[int]): stats = OrderedDict() stats["count"] = len(scores) stats["minimum"] = int(numpy.amin(scores)) stats["maximum"] = int(numpy.amax(scores)) stats["mean"] = round(numpy.mean(scores), 4) stats["median"] = int(numpy.median(scores)) stats["standard_deviation"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disp_score():", "def update_scores(self):\r\n totals = [0, 0, 0, 0]\r\n for player in range(0, 4):\r\n for round_num in range(0, 17):\r\n try:\r\n bid = int(self.spin_bids[player][round_num].get())\r\n tricks = int(self.spin_tricks...
[ "0.69189066", "0.6732025", "0.6481974", "0.64566064", "0.6448772", "0.6393949", "0.6384861", "0.63422036", "0.63363665", "0.6307522", "0.62796324", "0.6164866", "0.61432964", "0.6126191", "0.6116369", "0.61115795", "0.60974866", "0.60919774", "0.6089504", "0.6074493", "0.6064...
0.6238826
11
Print out the score stats
def print_stats(stats: Dict): print() print(" Panelist Scores") print(" Count: {}".format(stats["count"])) print(" Minimum: {}".format(stats["minimum"])) print(" Maximum: {}".format(stats["maximum"])) print(" Median: {}".format(stats["median"])) print(" Mean: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_scores(self):\n ### FILL IN ###", "def print_scores(self):\n print(\"scores: \", self.get_scores())", "def disp_score():", "def display_scores(scores):\n\n\t#print(\"\\t\\t\\tScores: \", list(scores))\n\tprint(\"\\t\\t\\tMean: \", scores.mean())\n\tprint(\"\\t\\t\\tStandard Deviation:...
[ "0.84830403", "0.8449821", "0.78642124", "0.77374864", "0.75699306", "0.75461483", "0.7507333", "0.74400777", "0.7432176", "0.7403559", "0.727528", "0.71789753", "0.71708167", "0.70969886", "0.70647675", "0.7057524", "0.7038564", "0.70344925", "0.7024657", "0.7006421", "0.697...
0.7133117
13
Print out the scrore spread
def print_score_spread(score_spread: Dict): print(" Score Spread\n") print(" Score Count") for score in score_spread: print(" {:>7}{:>12}".format(score["score"], score["count"])) print() return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print(self):\r\n self.print_avec_separateur()", "def print(self):\n self.print_avec_separateur(\" \")", "def print_scores(self):\n ### FILL IN ###", "def print_output(self):\n print(\"Reference score: \" + str(self.PotTax_reference.sum().TFI))\n print(\"Intervention sco...
[ "0.6561322", "0.643337", "0.6330498", "0.6281885", "0.62810534", "0.62737805", "0.62556595", "0.6224368", "0.6221346", "0.6209357", "0.6202504", "0.6195883", "0.6191251", "0.6188209", "0.6159958", "0.6145935", "0.6139892", "0.60920966", "0.6085532", "0.60845447", "0.6076933",...
0.71421385
0
Load configuration file from config.json
def load_config(app_environment) -> Dict: with open('config.json', 'r') as config_file: config_dict = json.load(config_file) if app_environment.startswith("develop"): if "development" in config_dict: config = config_dict["development"] else: raise Exception("Miss...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_config(self):\r\n with open('config.json', 'r') as f:\r\n self.config = json.load(f)", "def load_config():\n global config\n\n with open(\"config.json\") as f:\n json_config = f.read()\n f.close()\n config = json.loads(json_config)", "def load_config():\n here =...
[ "0.8881662", "0.8681146", "0.86279327", "0.8495189", "0.8393106", "0.8161093", "0.8107652", "0.80916744", "0.8027772", "0.79656696", "0.7927089", "0.791812", "0.7890831", "0.7879447", "0.78793275", "0.78693116", "0.78693116", "0.78527486", "0.7845725", "0.7770614", "0.7750379...
0.69013244
97
Pull in scoring data and generate stats based on the data
def main(): app_environment = os.getenv("APP_ENV", "local").strip().lower() config = load_config(app_environment) database_connection = mysql.connector.connect(**config["database"]) all_scores = retrieve_all_scores(database_connection) stats = calculate_stats(all_scores) print_stats(stats) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_score(self):\n files_flare = self.generate_flare_set()\n files_non_flare = self.generate_non_flare_set()\n timeseries = []\n y = []\n scores = {}\n column_mapping = self.__get_column_mapping()\n for col in tqdm(range(1, 25)):\n for file in tqdm(fi...
[ "0.6874266", "0.6695014", "0.6617427", "0.65822417", "0.63687444", "0.6361665", "0.6314557", "0.6211419", "0.6166223", "0.6105088", "0.6104523", "0.60632145", "0.6057583", "0.60560167", "0.60233086", "0.5951729", "0.59515303", "0.5930597", "0.59092224", "0.59012306", "0.58973...
0.5663475
53
constructeur de la classe
def __init__(self, t, a, v): self.time = t self.attribute = a self.value = v
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self) -> None:\n # TODO: Provide the complete constructor for this object", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise N...
[ "0.8200863", "0.80114734", "0.80114734", "0.80114734", "0.80114734", "0.80000806", "0.79996276", "0.7898036", "0.7823019", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178...
0.0
-1
constructeur de la classe
def __init__(self, n, t, s): self.name = n self.target = t self.start = s self.keyframes = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self) -> None:\n # TODO: Provide the complete constructor for this object", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise N...
[ "0.8200863", "0.80114734", "0.80114734", "0.80114734", "0.80114734", "0.80000806", "0.79996276", "0.7898036", "0.7823019", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178...
0.0
-1
constructeur de la classe
def __init__(self, n): self.name = n self.timelines = {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self) -> None:\n # TODO: Provide the complete constructor for this object", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise NotImplementedError", "def __init__(self):\n raise N...
[ "0.8200863", "0.80114734", "0.80114734", "0.80114734", "0.80114734", "0.80000806", "0.79996276", "0.7898036", "0.7823019", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178", "0.7815178...
0.0
-1
fonction qui ajoute une ligne de temps dans l'animation
def add_timeline(self, t): self.timelines.update({t.name : t})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_timer(self, event):\n \n o = Unicorn()\n data = o.get_data(rt)\n k = len(data[0])\n y[:, :-k] = y[:, k:]\n y[:, -k:] = remap((data), -40, 40, -1, 1 ) \n t2 = _thread.start_new_thread(printT, ())\n #y2 = np.array([lfilter(b, a, y[i]) for i in range(17)]...
[ "0.6608005", "0.6595933", "0.6549832", "0.6526188", "0.6441607", "0.6407639", "0.64039797", "0.63954604", "0.6334338", "0.6334338", "0.63001573", "0.62417245", "0.6231882", "0.62167317", "0.61714906", "0.611921", "0.61162287", "0.60838497", "0.60744506", "0.60744506", "0.6051...
0.0
-1
Return version key to use given a specific version. For example, if a dictionary only has instructions for version 'generic', will return 'generic' given any version string. Raises `ValueError` if no key could be found for requested version.
def get_version_key(self, version): if self._generic_only: return GENERIC_VERSION else: self.check_version_exists(version) return version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetKey(self, version_number):\n return self.dict[str(version_number)]", "def key_version(self) -> Optional[str]:\n return pulumi.get(self, \"key_version\")", "def get_version(self, key, version=None):\n if version is None:\n if key not in self._data:\n raise KeyEr...
[ "0.7516901", "0.6918039", "0.6749801", "0.6605578", "0.6401275", "0.6225745", "0.620228", "0.619842", "0.6191113", "0.6155921", "0.6147764", "0.60847867", "0.6057561", "0.60508114", "0.5988967", "0.59874403", "0.59791094", "0.59724796", "0.5945546", "0.59303916", "0.58354455"...
0.8208527
0
Return dictionary with rendered keys and values.
def render_env(self): return { jinja2.Template(k).render({self.name: self}): jinja2.Template(v).render({self.name: self}) for k, v in self.env.items() } if self.env else self.env
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_dict(self):\n return self.generate_widgets()", "def render_dict(dict):\n\t\treturn str.encode(str(dict))", "def _template_data(self):\n return {\"form\": self.form.render()}", "def render_dictionary(self): \n asset_json = {\n 'name': self.name,\n 'prod...
[ "0.6552589", "0.6363904", "0.62682635", "0.62654954", "0.6263933", "0.6260918", "0.62299466", "0.60744417", "0.6046848", "0.5990396", "0.59854126", "0.5968035", "0.59228987", "0.59225416", "0.5914001", "0.5899469", "0.5892299", "0.5860215", "0.58501613", "0.5825743", "0.58257...
0.6336243
2
Creates a keras regularizer.
def get_regularizer(type, l1, l2): if type == 'l1': reg = keras.regularizers.l1(l1) elif type == 'l2': reg = keras.regularizers.l2(l2) elif type == 'l1_l2': reg = keras.regularizers.l1_l2(l1, l2) else: reg = None return reg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_regularizer(self, regularizer = regularizers.l1(0.1)):\n # for layer in self.layers:\n # layer.kernel_regularizer = regularizer\n self.list_cnn[-1].kernel_regularizer = regularizer", "def add_regularization(self, regularizer):\n for layer in self.prenet_layers:\n ...
[ "0.6614855", "0.6163753", "0.6110547", "0.60351515", "0.5921308", "0.5716683", "0.56689423", "0.5552135", "0.54837906", "0.5478638", "0.546309", "0.5458307", "0.54565173", "0.5401835", "0.53959936", "0.5376531", "0.5373115", "0.5337177", "0.5316122", "0.53155696", "0.52800167...
0.6125757
2
Input layer class that defines the input shape for the network. An input layer is required for the first layer in all models.
def __init__(self, shape): self.shape = literal_eval(shape) self.keras_layer = keras.layers.Input(shape=self.shape) self.type = 'Input' self.name = ':'.join([self.type, str(self.shape)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, shape, input_var=None):\n\n self.output = layers.InputLayer(shape, input_var=input_var)", "def build(self, input_layer, trainable=True):\n\n with tf.variable_scope(self.name):\n # Determine the size of the input when flattened\n input_layer_shape = input_layer.get_s...
[ "0.73620754", "0.68776786", "0.68701315", "0.6866467", "0.6684106", "0.66439646", "0.66422045", "0.65750545", "0.6553184", "0.6525942", "0.63709074", "0.63709074", "0.63709074", "0.6291092", "0.62881696", "0.6286421", "0.6284356", "0.6267243", "0.62483495", "0.62224865", "0.6...
0.700692
1
layer_exist = [conv_act, pool_max_act, pool_ave_act, pool_max_no_act, pool_ave_no_act]
def layers(arr): layer_exist = [0, 0, 0, 0, 0] arr = arr.split() for i, a in enumerate(arr): if arr[i].lower().startswith("convolution") or arr[i].lower().startswith("innerproduct"): if i != len(arr) and arr[i+1].lower() == "relu": layer_exist[0] = 1 if arr[i].lower() == "avepooling": if (i != (len...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_features(inp_layer, pad=0):\n # Note: tweaked to use average pooling instead of maxpooling\n net = OrderedDict()\n net['conv1_1'] = ConvLayer(inp_layer, 64, 3, pad=pad, flip_filters=False, nonlinearity=rectify)\n net['conv1_2'] = ConvLayer(net['conv1_1'], 64, 3, pad=pad, flip_filters=False, non...
[ "0.6113794", "0.60285205", "0.5972099", "0.59599495", "0.58484864", "0.5841038", "0.5795003", "0.5780913", "0.57801276", "0.5778729", "0.5769082", "0.57289445", "0.5715246", "0.5696411", "0.56913024", "0.5674453", "0.5619215", "0.5609114", "0.558215", "0.5575851", "0.5573412"...
0.6529583
0
Interfaces with individually compatible ports that are ordered in different ways should still be deemed compatible.
def test_is_compatible_sel_order(self): # Selectors with multiple levels: i = Interface('/foo[0:2],/bar[0:2]') i['/foo[0:2]', 'interface', 'io'] = [0, 'in'] i['/bar[0:2]', 'interface', 'io'] = [0, 'out'] j = Interface('/bar[0:2],/foo[0:2]') j['/bar[0:2]', 'interface', 'i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_interfaces(self):", "def target_interfaces(self):", "def temporally_align_data_interfaces(self):\n pass", "def connect_interfaces(self, iface1: str, ip1_name: str,\n iface2: str, ip2_name: str):\n if (ip1_name not in self._ips.keys() or\n ip2_...
[ "0.6219634", "0.6219634", "0.5754795", "0.57205325", "0.56868404", "0.56806505", "0.5673285", "0.5562755", "0.55203426", "0.55015105", "0.55015105", "0.5495435", "0.54481024", "0.54418063", "0.5391868", "0.53848755", "0.5348518", "0.5347069", "0.53385854", "0.53363526", "0.53...
0.51881975
30
It should be possible to define compatible interfaces containing both input and output ports.
def test_is_compatible_both_dirs(self): i = Interface('/foo[0:4]') i['/foo[0:2]', 'interface', 'io'] = [0, 'out'] i['/foo[2:4]', 'interface', 'io'] = [0, 'in'] j = Interface('/foo[0:4]') j['/foo[0:2]', 'interface', 'io'] = [1, 'in'] j['/foo[2:4]', 'interface', 'io'] = [1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_interfaces(self):", "def target_interfaces(self):", "def interfaces(self):", "def interfaces(self):", "def __init__(__self__, *,\n from_port: pulumi.Input[int],\n to_port: pulumi.Input[int]):\n pulumi.set(__self__, \"from_port\", from_port)\n pulumi....
[ "0.67224735", "0.67224735", "0.61528635", "0.61528635", "0.5994254", "0.5912999", "0.58316606", "0.58027184", "0.5625491", "0.56192183", "0.5570189", "0.55607367", "0.5545737", "0.5538456", "0.54931146", "0.54783744", "0.5430864", "0.5430864", "0.5412712", "0.54087794", "0.53...
0.0
-1
It should be possible to define compatible interfaces containing both input and output ports with specified types.
def test_is_compatible_both_dirs_types(self): i = Interface('/foo[0:4]') i['/foo[0:2]'] = [0, 'out', 'gpot'] i['/foo[2:4]'] = [0, 'in', 'spike'] j = Interface('/foo[0:4]') j['/foo[0:2]'] = [1, 'in', 'gpot'] j['/foo[2:4]'] = [1, 'out', 'spike'] assert i.is_compati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_interfaces(self):", "def target_interfaces(self):", "def set_io_types(self, other):\n other.set_input_type(self.input_type).set_output_type(self.output_type)\n self.set_input_type(other.input_type).set_output_type(other.output_type)\n return self", "def convert_interface(self, access_modi...
[ "0.62524253", "0.62524253", "0.59509814", "0.5787149", "0.56537616", "0.56537616", "0.55518574", "0.55134493", "0.5413066", "0.54043597", "0.5389857", "0.53701156", "0.5331732", "0.52904046", "0.52746", "0.52578366", "0.52531266", "0.52442455", "0.5240985", "0.52286166", "0.5...
0.46521124
87
Interfaces can be compatible even if some of their ports do not have a set input or output status.
def test_is_compatible_with_nulls(self): i = Interface('/foo[0:3]') i['/foo[0:2]', 'interface', 'io'] = [0, 'out'] i['/foo[2]', 'interface'] = 0 j = Interface('/foo[0:3]') j['/foo[0:2]', 'interface', 'io'] = [1, 'in'] j['/foo[2]', 'interface'] = 1 assert i.is_com...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_interfaces(self):", "def target_interfaces(self):", "def connect_interfaces(self, iface1: str, ip1_name: str,\n iface2: str, ip2_name: str):\n if (ip1_name not in self._ips.keys() or\n ip2_name not in self._ips.keys()):\n raise ValueError(\n...
[ "0.6464873", "0.6464873", "0.61978257", "0.59971684", "0.59839207", "0.57873195", "0.57873195", "0.5763124", "0.5751498", "0.5732146", "0.56955546", "0.5691122", "0.56707364", "0.5632924", "0.5616398", "0.5613331", "0.56106734", "0.55786246", "0.55636865", "0.55598676", "0.55...
0.54418343
22
Interfaces can be compatible even if some of their ports do not have a set type.
def test_is_compatible_with_nulls_types(self): i = Interface('/foo[0:3]') i['/foo[0:2]'] = [0, 'out', 'gpot'] i['/foo[2]', 'interface'] = 0 j = Interface('/foo[0:3]') j['/foo[0:2]'] = [1, 'in', 'gpot'] j['/foo[2]', 'interface'] = 1 assert i.is_compatible(0, j, 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_interfaces(self):", "def target_interfaces(self):", "def connect_interfaces(self, iface1: str, ip1_name: str,\n iface2: str, ip2_name: str):\n if (ip1_name not in self._ips.keys() or\n ip2_name not in self._ips.keys()):\n raise ValueError(\n...
[ "0.6660175", "0.6660175", "0.62674147", "0.6096234", "0.6096234", "0.59134775", "0.5881471", "0.5868384", "0.5858607", "0.5845406", "0.5821904", "0.5656214", "0.5649054", "0.5648483", "0.56465447", "0.5585523", "0.557584", "0.55142313", "0.5511947", "0.5511947", "0.5503032", ...
0.6222775
3
Interfaces that both share a subset of compatible ports can be deemed compatible by setting the `allow_subsets` option of the compatibility test.
def test_is_compatible_subsets(self): i = Interface('/foo[0:6]') i['/foo[0:3]'] = [0, 'out', 'gpot'] i['/foo[3:6]'] = [0, 'out', 'spike'] j = Interface('/foo[0:6]') j['/foo[0:2]'] = [1, 'in', 'gpot'] j['/foo[3:5]'] = [1, 'in', 'spike'] k = Interface('/foo[0:6]') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_is_compatible_subsets_with_null_types(self):\n\n i = Interface('/foo[0:6]')\n i['/foo[0:3]'] = [0, 'out']\n i['/foo[3:6]'] = [0, 'out']\n j = Interface('/foo[0:6]')\n j['/foo[0:2]'] = [1, 'in']\n j['/foo[3:5]'] = [1, 'in']\n k = Interface('/foo[0:6]')\n ...
[ "0.6700613", "0.5888596", "0.5888596", "0.5716942", "0.5570211", "0.5458658", "0.5365004", "0.5320249", "0.52785486", "0.51995903", "0.5177569", "0.515498", "0.51448685", "0.5117207", "0.49495307", "0.49465245", "0.49463874", "0.49270806", "0.4923223", "0.491944", "0.4907876"...
0.78658915
0
Interfaces that both share a subset of compatible ports can be deemed compatible by setting the `allow_subsets` option of the compatibility test even when the types are null.
def test_is_compatible_subsets_with_null_types(self): i = Interface('/foo[0:6]') i['/foo[0:3]'] = [0, 'out'] i['/foo[3:6]'] = [0, 'out'] j = Interface('/foo[0:6]') j['/foo[0:2]'] = [1, 'in'] j['/foo[3:5]'] = [1, 'in'] k = Interface('/foo[0:6]') assert i.i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_is_compatible_subsets(self):\n\n i = Interface('/foo[0:6]')\n i['/foo[0:3]'] = [0, 'out', 'gpot']\n i['/foo[3:6]'] = [0, 'out', 'spike']\n j = Interface('/foo[0:6]')\n j['/foo[0:2]'] = [1, 'in', 'gpot']\n j['/foo[3:5]'] = [1, 'in', 'spike']\n k = Interface(...
[ "0.76551175", "0.6187195", "0.5959266", "0.5550304", "0.5550304", "0.52693313", "0.5247899", "0.5175491", "0.5172923", "0.51695246", "0.51173824", "0.5093611", "0.5085437", "0.50665164", "0.504104", "0.5036018", "0.50319415", "0.5031793", "0.49958917", "0.49873957", "0.497339...
0.7800067
0
Return a strategy that holds if and only if pending >= x or player reaches goal.
def hold_at(x): def strategy(state): # your code here p, me, you, pending = state return "hold" if (pending >= x or me + pending >= goal) else "roll" strategy.__name__ = 'hold_at(%d)' % x return strategy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hold_at(x):\n\n def strategy(state):\n (p, me, you, pending) = state\n return 'hold' if (pending >= x or me + pending >= goal) else 'roll'\n\n strategy.__name__ = 'hold_at(%d)' % x\n return strategy", "def Pwin(state):\n # Assumes opponent also plays with optimal strategy\n p, me...
[ "0.7355454", "0.60242695", "0.6023155", "0.5951468", "0.5937637", "0.572351", "0.5663513", "0.56209296", "0.56154317", "0.56149787", "0.5597981", "0.55769897", "0.556702", "0.55660975", "0.5485379", "0.54448724", "0.5435684", "0.54253024", "0.5404603", "0.5403368", "0.5395781...
0.7068357
1
Play a game of pig between two players, represented by their strategies. Each time through the main loop we ask the current player for one decision, which must be 'hold' or 'roll', and we update the state accordingly. When one player's score exceeds the goal, return that player.
def play_pig(A, B): # your code here strategies = [A,B] state = (0,0,0,0) while True: p, me, you, pending = state if me >= goal: return strategies[p] elif you >= goal: return strategies[other_turn[p]] # elif strategies[p](state) == 'hold': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def play_pig(A, B):\n # your code here\n strategies = [A, B]\n state = (0, 0, 0, 0)\n while True:\n (p, me, you, pending) = state\n if me >= goal:\n return strategies[p]\n elif you >= goal:\n return strategies[other[p]]\n elif strategies[p](state) == 'h...
[ "0.7907119", "0.7647033", "0.7639917", "0.723368", "0.7189156", "0.7187271", "0.7064494", "0.7062731", "0.7054494", "0.68677187", "0.674492", "0.670514", "0.6567981", "0.65314806", "0.6519332", "0.6519332", "0.6519332", "0.65100443", "0.65067357", "0.6433185", "0.632696", "...
0.7669755
1
Decorator that caches the return value for each call to f(args). Then when called again with same args, we can just look it up.
def memo(f): cache = {} def _f(*args): try: return cache[args] except KeyError: cache[args] = result = f(*args) return result except TypeError: # some element of args can't be a dict key return f(args) return _f
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def memoize(f):\n cache = {}\n @functools.wraps(f)\n def g(*args):\n ret = cache.get(args, cache)\n if ret is cache:\n ret = cache[args] = f(*args)\n return ret\n return g", "def __call__(self, *args):\n if args not in self.memo:\n self.memo[args] = self.f(*arg...
[ "0.81131274", "0.80451596", "0.8038009", "0.8008783", "0.79322904", "0.7912004", "0.7912004", "0.7912004", "0.7751491", "0.7736098", "0.7705755", "0.76081574", "0.7593774", "0.7568509", "0.7536149", "0.7459705", "0.7363271", "0.7348799", "0.7338997", "0.73304653", "0.73113525...
0.7772014
9
The utility of a state, here just the probability that an optimal player whose turn it to move can win from the current state
def Pwin(state): # Assumes opponent also plays with optimal strategy p, me, you, pending = state if me + pending >= goal: return 1 elif you >= goal: return 0 else: return max(Q_pig(state, action, Pwin) for action in pig_actions(state))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rough_outcome(self) -> float:\n # HUYNH YOU PRICK WHY THE FUCK DO YOU MAKE US WRITE THIS SHIT EVEN IT'S NOT USED ANYWHERE\n # pick move based on this may not be optimal but better than random\n # return 1 if win immediately\n # return -1 if all states reachable will result the other...
[ "0.77746516", "0.7501392", "0.73808473", "0.7227007", "0.69487715", "0.68937486", "0.68130076", "0.6812178", "0.68047494", "0.6799885", "0.6795713", "0.6783112", "0.67188185", "0.665067", "0.65943986", "0.6592056", "0.65892106", "0.6571575", "0.65390325", "0.6532277", "0.6526...
0.75051713
1
A strategy that maximizes the expected difference between my final score and my opponent's.
def max_diffs(state): # your code here return best_action(state, pig_actions, Q_pig, win_diff)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def final_strategy(score, opponent_score):\r\n free, k = opponent_score // 10 + 1, 1\r\n winning = score > opponent_score\r\n ratio = (goal - score) / (goal - opponent_score)\r\n mean = make_mean_strategy(3)(score, opponent_score)\r\n if goal - score <= free: return 0\r\n while k < 4:\r\n ...
[ "0.7319641", "0.7241692", "0.72058785", "0.70882905", "0.69610775", "0.6886896", "0.688641", "0.6814296", "0.6810675", "0.67275155", "0.67186815", "0.6703836", "0.6694766", "0.6693455", "0.6671631", "0.666438", "0.6662398", "0.66298085", "0.6617561", "0.6569686", "0.6525511",...
0.6654747
17
Parse number from string with automatic type detection. Parses input string and converts to a number using automatic type detection. If the number contains any fractional parts, then the number will be converted to float, otherwise the number will be converted to an int.
def parse_number_auto_dtype(x: str) -> Union[int, float]: value: Union[int, float] = float(x) if value.is_integer(): value = int(value) return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parseNumber(self, str):\r\n\t\tif (str.count(\".\") == 0):\r\n\t\t\treturn int(str)\r\n\t\tif (str.count(\".\") == 1):\r\n\t\t\treturn float(str)\r\n\t\treturn str", "def str2num(s):\r\n try:\r\n return int(s)\r\n except ValueError:\r\n return float(s)", "def str_to_num(s):\n\n meth...
[ "0.806247", "0.7663109", "0.76058894", "0.7603773", "0.7543853", "0.75322175", "0.74632233", "0.7321434", "0.72316444", "0.7026305", "0.7019086", "0.7009801", "0.6992993", "0.69265276", "0.690676", "0.6881941", "0.68817985", "0.68067026", "0.67965007", "0.6696791", "0.6664161...
0.73269945
7
Helper function for `_GenericAlias.__repr__`.
def _to_str(obj: object) -> str: if obj is Ellipsis: return '...' elif isinstance(obj, type) and not isinstance(obj, _GENERIC_ALIAS_TYPE): if obj.__module__ == 'builtins': return obj.__qualname__ else: return f'{obj.__module__}.{obj.__qualname__}' else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n args = []\n if self.name != \"alpha\":\n args.append(repr(self.name))\n if self.propertiesstr:\n args.append(repr(self.propertiesstr))\n elif self.propertiesstr:\n args.append(\"attr=%r\" % self.propertiesstr)\n retur...
[ "0.74621296", "0.73563325", "0.7346365", "0.72829545", "0.7205059", "0.7160061", "0.715092", "0.71405625", "0.71347225", "0.71313053", "0.7101834", "0.7092644", "0.7092644", "0.7092644", "0.7092644", "0.7092644", "0.7081821", "0.70372033", "0.69983757", "0.69691986", "0.69690...
0.0
-1
Search for all typevars and typevarcontaining objects in `args`. Helper function for `_GenericAlias.__init__`.
def _parse_parameters(args: Iterable[Any]) -> Generator[TypeVar, None, None]: for i in args: if hasattr(i, "__parameters__"): yield from i.__parameters__ elif isinstance(i, TypeVar): yield i
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findType(*args, deep: bool=True, exact: bool=True, forward: bool=True, type: AnyStr=\"\",\n **kwargs)->List[AnyStr]:\n pass", "def find(self, *args):\n return _ida_hexrays.lvars_t_find(self, *args)", "def used_variables(*terms):\n\n t = terms[0] if len(terms) == 1 else terms\n\n ...
[ "0.6083603", "0.5493589", "0.53747714", "0.53291667", "0.5164382", "0.5154936", "0.50176644", "0.5015225", "0.49874654", "0.49854574", "0.49834588", "0.4983403", "0.49549422", "0.49442652", "0.4919461", "0.48979554", "0.48860407", "0.47833136", "0.4778925", "0.47677916", "0.4...
0.591873
1
Recursively replace all typevars with those from `parameters`. Helper function for `_GenericAlias.__getitem__`.
def _reconstruct_alias(alias: _T, parameters: Iterator[TypeVar]) -> _T: args = [] for i in alias.__args__: if isinstance(i, TypeVar): value: Any = next(parameters) elif isinstance(i, _GenericAlias): value = _reconstruct_alias(i, parameters) elif hasattr(i, "__para...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_vars(params, contents):\n if isinstance(contents, str):\n contents = [contents]\n replace_contents = []\n\n if params != None and contents != None:\n for content in contents:\n replace_content = content\n for match in regexp_replace_var.findall(content):\n ...
[ "0.5673922", "0.5523126", "0.5507102", "0.54108083", "0.54027843", "0.5336006", "0.5278679", "0.5244699", "0.5235492", "0.5232679", "0.5227746", "0.5176148", "0.5109751", "0.5095588", "0.5087228", "0.505932", "0.5014933", "0.5012798", "0.49798912", "0.49677464", "0.49254423",...
0.6224574
0
Type variables in the ``GenericAlias``.
def __parameters__(self) -> tuple[TypeVar, ...]: return super().__getattribute__("_parameters")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _variable_types(self):\n return self._variable_single_types + self._variable_array_types", "def injectTypes (g):\n\tself=__module__\n\ts=g.symbols\n\tg.token('TYPE_VAR', '_|[A-Z][A-Z0-9]*')\n\tg.rule('TypeParameter', s.LSB, listOf(g.agroup(s.TYPE_VAR, s.FQNAME), s.COMMA, g), s.RSB)\n\tg.rule('TypeRefe...
[ "0.64707834", "0.60676146", "0.5990629", "0.59615344", "0.588528", "0.5847107", "0.5746555", "0.56999505", "0.55221957", "0.54898584", "0.5446973", "0.5353904", "0.53393316", "0.53158456", "0.5303082", "0.525656", "0.52356243", "0.5229733", "0.5203652", "0.52030146", "0.51546...
0.52475464
16
Check if an `obj` is an instance.
def __instancecheck__(self, obj: object) -> NoReturn: raise TypeError("isinstance() argument 2 cannot be a " "parameterized generic")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_is_instance(self, obj, cls, msg=\"\"):\r\n assert isinstance(obj, cls)", "def is_dataclass_instance(obj: Any) -> bool:\n return dataclasses.is_dataclass(obj) and not isinstance(obj, type)", "def assertIsInstance(self, obj, cls, msg=None):\r\n if not _is_instance(obj, cls):\r\n ...
[ "0.77252495", "0.76500654", "0.7596194", "0.7542007", "0.7537573", "0.74013054", "0.7116655", "0.71137726", "0.70612186", "0.7052341", "0.6999939", "0.69481283", "0.6900092", "0.6855783", "0.6831825", "0.67850405", "0.67850405", "0.6783268", "0.67796606", "0.67789185", "0.676...
0.7006438
10
Check if a `cls` is a subclass.
def __subclasscheck__(self, cls: type) -> NoReturn: raise TypeError("issubclass() argument 2 cannot be a " "parameterized generic")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_proper_subclass(cls, maybe_proper_superclass):\n return cls is not maybe_proper_superclass and issubclass(cls, maybe_proper_superclass)", "def is_subclass(parent_class, child_class_name):\n for child_class in parent_class.__subclasses__():\n if child_class.__name__ == child_class_name:\n ...
[ "0.7876223", "0.7705129", "0.7567947", "0.75527894", "0.7437532", "0.7431865", "0.7421365", "0.7377788", "0.7368424", "0.7331841", "0.7313958", "0.7293447", "0.72841907", "0.7261879", "0.7256828", "0.7247368", "0.7236065", "0.72272855", "0.7211588", "0.7210452", "0.71509", ...
0.70036453
31
Return ``self == value``.
def __eq__(self, value: object) -> bool: if not isinstance(value, _GENERIC_ALIAS_TYPE): return NotImplemented return ( self.__origin__ == value.__origin__ and self.__args__ == value.__args__ and self.__unpacked__ == getattr( value, "__unpac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return self.value == other.value", "def __eq__(self, other):\n return self.value == other or self.value == other.value", "def __eq__(self, other):\n if other is None:\n return False\n if self.value == other.value:\n return True\n ...
[ "0.81785744", "0.81545824", "0.7910936", "0.77516854", "0.7656241", "0.7656241", "0.76422757", "0.7580233", "0.7384331", "0.7323974", "0.72412944", "0.72412944", "0.7133235", "0.70649093", "0.7051817", "0.70497334", "0.70427805", "0.70339525", "0.70094466", "0.6975119", "0.69...
0.6931704
23
Generates a population of bitarray strings (individuals) to solve the NQueen problem, here N = 'board_size'. 'pop_size' parameter decides the number of bitarray strings (individuals) generated by this function. Creates a list of bitarrray strings (individuals) representing the population for solving the NQueen problem....
def genPopulation(self): self.population_list = [] for i in xrange(0, self.pop_size): individual = bitarray(self.indv_size) # Loop for randomizing the 'individual' string. for j in xrange(0, self.board_size): vert_pos = random.randint(0, self.boa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_population(board_size, population_size):\n return [Nonogram(board_size) for x in range(0, population_size)]", "def generate_population(population_size, nn_architecture):\n population = []\n for _ in range(population_size):\n population.append(nn.create_nn_from_arch(nn_architecture))\n\...
[ "0.72544706", "0.67998624", "0.6587251", "0.65856385", "0.64451057", "0.6369007", "0.62210387", "0.6044195", "0.6014805", "0.58983636", "0.58905756", "0.58675313", "0.58664834", "0.5811403", "0.5697839", "0.5692206", "0.56726235", "0.5658943", "0.5640834", "0.5509586", "0.548...
0.727817
0
Populates the fitness list with fitness function values of coresponding entries in the population list.
def computeFitnessList(self,fitnessFunction): self.fitness_list = [] cmlsum = 0 for individual in self.population_list: cmlsum = cmlsum + fitnessFunction(individual, self.board_size, self.pos_bits_size) self.fitness_list.append(cmlsum)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_population(self):\n for idx in xrange(0, self.population_size):\n individual = self.individual_factory.create()\n self.population.append(individual)\n\n self.population_fitness = numpy.asarray(map(lambda individual: individual.get_fitness(), self.population))\n\n ...
[ "0.7050818", "0.7024004", "0.6900333", "0.68683046", "0.67409855", "0.6698061", "0.6585672", "0.6527284", "0.65243554", "0.6502384", "0.6475374", "0.6410031", "0.6401292", "0.6385652", "0.6321939", "0.6284058", "0.62710774", "0.6265765", "0.6243417", "0.62331927", "0.6226014"...
0.7070026
0
Binary Search for finding appropriate index for key in fitness list.
def findInFitnessList(self, key): low = 0 high = len(self.fitness_list) mid = 0 while(low <= high): mid = (low + high)/2 if key > self.fitness_list[mid]: low = mid + 1 elif key < self.fitness_list[mid]: high = m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binary_search(self, num_lst, key):\r\n # Running time: O(log n) with O(n logn) overhead\r\n # get sorted list\r\n num_lst = sorted(num_lst)\r\n \r\n low, high, idx = 0, len(num_lst), -1\r\n \r\n while low < high:\r\n mid = int(math.floor((low+high) / ...
[ "0.71013904", "0.70412946", "0.69745183", "0.68652153", "0.6833065", "0.68021667", "0.68017167", "0.6780906", "0.6739357", "0.6714616", "0.6690004", "0.65812993", "0.6545252", "0.6515856", "0.65082943", "0.6490799", "0.6479905", "0.64732397", "0.64555985", "0.6413893", "0.636...
0.78341144
0
Converts a number in int format to a bitarray of length 'size', in binary representation. Returns the bitarray.
def toBitArray(number, size): temp_bitnum = bitarray(64) count = 0 number = number & 0xFFFFFFFFFFFFFFFF # enforces the number to be 64 bit. while count < size: temp_bitnum[63 - count] = (number % 2) # print "digit ", count, " : ", (number % 2) number = number >> 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binary(num, size=32):\n ret = np.zeros(size, dtype=np.int)\n n = np.array([int(x) for x in list(bin(num)[2:])])\n ret[ret.size - n.size:] = n\n return ret", "def binary(num, size=32):\n ret = np.zeros(size, dtype=np.int)\n n = np.array([int(x) for x in list(bin(num)[2:])])\n ret[ret.size...
[ "0.7790668", "0.7790668", "0.7245732", "0.6670738", "0.64003235", "0.6200373", "0.6070387", "0.60702974", "0.60172224", "0.5953754", "0.5915167", "0.591251", "0.58911425", "0.5887502", "0.5887502", "0.5879545", "0.586908", "0.5858048", "0.58292425", "0.58278644", "0.5824009",...
0.7832017
0
Converts a bitarray in binary format to a number in int format, to its coresponding decimal representation. Returns the number.
def fromBitArray(bitnum): number = 0 & 0xFFFFFFFFFFFFFFFF # enforces the number to be 64 bit. idx = len(bitnum) - 1 number = number + bitnum[idx] idx = idx - 1 count = 1 while idx != -1: number = number + (bitnum[idx] << count) count = count + 1 idx = idx - 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_bit_array_to_decimal(bit_array):\n decimal_int = 0\n ii = 0\n for i in np.arange(-(len(bit_array)), 0)*-1-1:\n if bit_array[ii]>0:\n decimal_int += pow(2.,i)\n ii+=1\n return int(decimal_int)", "def bitarray2dec(in_bitarray):\n\n number = 0\n\n for i in rang...
[ "0.7937204", "0.7795629", "0.7240436", "0.6926016", "0.6884594", "0.6877382", "0.6808722", "0.6694597", "0.6669835", "0.6577601", "0.64981467", "0.64833474", "0.6417316", "0.6362759", "0.634778", "0.6308411", "0.6292181", "0.62766623", "0.62646604", "0.62482375", "0.6226497",...
0.6684726
8
Calculates the finess value of an individual and returns it. Has a computational complexity of O(1) per piece.
def fitnessFunction(individual, board_size, pos_bits_size): right_diag = [0] * (2 * board_size - 1) left_diag = [0] * (2 * board_size - 1) vertical = [0] * board_size conflicts = 0 idx = 0 while idx < board_size: # print "idx: ",idx,individual[idx * pos_bits_size : idx * pos_bits...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frobenius(self, value):\n return sum(self.hadamard(value))", "def relative_abundance_fodder(self, animal):\n species = animal.__class__.__name__\n return self.relevant_food(animal) / (\n (len(self.fauna_list[species]) + 1) * animal.parameters['F'])", "def get_fare(self):...
[ "0.6012158", "0.576322", "0.5754833", "0.56664544", "0.5625633", "0.5573023", "0.555937", "0.5543563", "0.5542946", "0.55332303", "0.5504458", "0.54831654", "0.5437056", "0.5428136", "0.5416342", "0.54088235", "0.5377262", "0.5372197", "0.5363929", "0.5355039", "0.53508043", ...
0.0
-1
Initialize a symmetry operation object from a string representation of symmetry operation.
def __init__(self, operation_string): self.operation_string = operation_string.lower() self.operation_function = None self.__set_operation_function()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, op, symbolicExpression1, symbolicExpression2):\n\n SymbolicExpression.__init__(self)\n \n self.op = op\n self.symbolicExpression1 = symbolicExpression1\n self.symbolicExpression2 = symbolicExpression2", "def __init__(self, operand_string):\n\...
[ "0.65855575", "0.6394667", "0.60201573", "0.58792925", "0.5829858", "0.5817785", "0.58118224", "0.5685034", "0.5679989", "0.5663519", "0.5663512", "0.5659587", "0.5653366", "0.5648754", "0.5644039", "0.56371164", "0.56318647", "0.56213385", "0.5609781", "0.5595345", "0.555548...
0.66930246
0
Convert the string form of the symmetry operation into the form of a mathematical function that can be directly applied to a vector to transform a point to a symmetry related point.
def __set_operation_function(self): if self.operation_function is not None: return self.operation_function else: self.operation_function = symm_eval
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_fn(fn_string, symbols):\n fn_string = fn_string.replace('^', '**')\n fn = lambdify([sympy.symbols(symbols)], fn_string, 'numpy')\n return fn", "def matrix_sym_op(x):\n return (x + tf.transpose(x))/2", "def convertStoichiometryMath(self):\n return _libsbml.Model_convertStoichiomet...
[ "0.64556384", "0.5763819", "0.5679932", "0.5665814", "0.5638721", "0.55064327", "0.5426737", "0.54216206", "0.5392853", "0.53914815", "0.53572667", "0.53297466", "0.5317339", "0.5299851", "0.5280908", "0.527228", "0.52579755", "0.52576876", "0.52001554", "0.513768", "0.513490...
0.47996485
70
Applying this symmetry operation on a 3D coordinate to transform it to a symmetryrelated position in the crystal.
def transform_scaled_position(self, data): return self.operation_function(prepare_operation(self.operation_string), data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sat_3d_position(sat_2d_position):\n return np.dot(transformation_parameter, xi_eta(sat_2d_position))", "def convert_coordinate_system_3d(x, y, z):\n\n return x, -z, y", "def LEIsotropic3D(self):\n const = self.ymod / ((1+self.Nu) * (1-(2*self.Nu)))\n a = const * self.Nu\n b = con...
[ "0.6256417", "0.62044483", "0.5919591", "0.5910444", "0.5888323", "0.588735", "0.5876213", "0.5783937", "0.5778394", "0.57703584", "0.5756848", "0.57547265", "0.57113785", "0.56860083", "0.5667107", "0.5617889", "0.55534124", "0.5551718", "0.55438286", "0.5534934", "0.552158"...
0.0
-1
Given the LATT directive in a res file, return the corresponding centered lattice type.
def construct(cls, latt): latt = abs(latt) if latt == 1: return cls.primitive() elif latt == 2: return cls.body_centered() elif latt == 3: # default setting from reading in a res file is Rhombohedral return cls.rhombohedral() elif l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def specified_lattice_constant(self):\n return load_node(self.get_attribute('specified_lattice_constant'))", "def print_abs_type(self):\n return 'DLA'", "def get_ligand_resname_from_topology( topfile ):\n\n file = open( topfile, 'r')\n text = file.readlines()\n file.close()\n indices ...
[ "0.5302461", "0.51673067", "0.51398134", "0.4979288", "0.48934972", "0.48730606", "0.48607278", "0.48193753", "0.47571704", "0.473777", "0.4727024", "0.46984535", "0.46911123", "0.46570626", "0.46286234", "0.46027964", "0.46002376", "0.45856792", "0.45732707", "0.4515798", "0...
0.6210394
0
returns a list containing the al points of the bounding box, starting from bottom left and going anticlockwise
def boundingBox(points): min_x, min_y = float('inf'), float('inf') max_x, max_y = float('-inf'), float('-inf') for x, _, y in points: min_x = min(min_x, x) min_y = min(min_y, y) max_x = max(max_x, x) max_y = max(max_y, y) return (min_x, min_y), (max_x, min_y), (max_x, ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boundingBox(self):\n y_max = np.max(self.points[:,0])\n x_max = np.max(self.points[:,1])\n y_min = np.min(self.points[:,0])\n x_min = np.min(self.points[:,1])\n \n return ((x_max, y_max), (x_min, y_min))", "def bbox(self):\n return [self._x0, self._y0, self._x...
[ "0.75965375", "0.7497875", "0.74912584", "0.7396015", "0.73149467", "0.7234918", "0.7175359", "0.7174177", "0.71489733", "0.7111562", "0.71065605", "0.70789665", "0.7042901", "0.704142", "0.7023269", "0.7008294", "0.69650996", "0.69617414", "0.69278795", "0.6900412", "0.68911...
0.7039391
14
Basic plotting feature. Can be used standalone, in which case you can ignore the 'newfig' and 'plotfig' parameters. Otherwise, you may suppress these by passing False and using the returned axes object.
def basicplot(data, plotter='plot', newfig=True, showplot=True, **kwargs): if plotter not in ('plot', 'step'): raise ValueError if newfig: plt.figure(figsize=kwargs.get('figsize', (8, 6))) # ............................................................................ Plot per type if isinstance(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_axes(self):\n plt.switch_backend(\"cairo\")\n fig = plt.figure(figsize=(15,10))\n ax = fig.add_axes([0.05, 0.15, 0.9, 0.80,])\n return (fig, ax)", "def _newax(ax=None):\n from matplotlib import pyplot as plt\n if ax is not None:\n return ax\n fig = plt.figure(...
[ "0.6635028", "0.6569405", "0.64893675", "0.6439919", "0.6360829", "0.6326854", "0.6290503", "0.627174", "0.62165153", "0.6209581", "0.6181125", "0.61717874", "0.6159054", "0.6155145", "0.6095297", "0.60936546", "0.60824245", "0.60354114", "0.6033826", "0.6010859", "0.59907717...
0.6620118
1
Template for polishing a matplotlib plot.
def basic_plot_polishing(ax, **kwargs): # Title ax.set_title(kwargs.get('title'), **kwargs.get('title_kw', {})) # ............................................... X- and Y-axes # Axes Labels ax.set_xlabel(kwargs.get('xlabel'), **kwargs.get('xlabel_kw', {})) ax.set_ylabel(kwargs.get('ylabel'), **kwarg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def builtin_plot(self, **kwargs):\n self.gp.plot(**kwargs)\n return", "def plot():\n pass", "def evaluate(self, plot):", "def plot(self, ax=..., *, name=..., **kwargs):\n ...", "def plot_figure(param1, param2):\n return 0", "def PygletPlot(*args, **kwargs):\n\n from sympy.plotti...
[ "0.65788615", "0.64977914", "0.63758653", "0.6249835", "0.6161063", "0.61453396", "0.6137437", "0.61225075", "0.61015445", "0.6099689", "0.60799134", "0.6052406", "0.5981926", "0.5980428", "0.5944208", "0.59270716", "0.5923354", "0.59175104", "0.5909176", "0.59045833", "0.589...
0.60760945
11
delegates to base interface run method, then attempts to generate reports
def _run_interface(self, runtime): try: runtime = super( ReportCapableInterface, self)._run_interface(runtime) except NotImplementedError: pass # the interface is derived from BaseInterface # leave early if there's nothing to do if not self.input...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_report(self):\n raise NotImplementedError", "def __execute_reporter(self):\n if not self.__args.report:\n return\n reporter.HTMLReporter().generate_report_from_file(\n self.__lst_json_files)", "def run(self):\n report_file = self.get_report_file_n...
[ "0.7437408", "0.73895234", "0.7325222", "0.7179931", "0.6891885", "0.6887828", "0.6871864", "0.6871864", "0.67655283", "0.67655283", "0.67655283", "0.67655283", "0.67655283", "0.67655283", "0.67655283", "0.67655283", "0.67655283", "0.6731759", "0.67242306", "0.6709329", "0.66...
0.7569578
0
A placeholder to run stuff after the normal execution of the interface (i.e. assign proper inputs to reporting functions)
def _post_run_hook(self, runtime): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def postRun(self):\n pass", "def after_test(self, func, *args, **kwargs):\n pass", "def after_step():\n raise NotImplementedError", "def post_execute(self):", "def post_exec(self):\n raise NotImplementedError(\"Must implement in frontend subclass.\")", "def _initialise_run(self) -> No...
[ "0.64498556", "0.63633126", "0.633806", "0.6311236", "0.62261844", "0.622094", "0.62078357", "0.6205322", "0.61407", "0.6081844", "0.6081844", "0.6050914", "0.60314965", "0.6028222", "0.6022563", "0.59925395", "0.5990467", "0.5945822", "0.5933975", "0.5908431", "0.5903639", ...
0.5792072
25
Saves an svg object.
def _generate_report(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_svg(string, file_name):\n file_handle = file(file_name, \"w\")\n file_handle.write(string)\n file_handle.close()", "def save_canvas_svg(self, filename):\n canvasvg.saveall(filename, self.canvas)", "def export_as_svg(self):\n from ExportCommand import ExportCommand\n\n opt...
[ "0.7298411", "0.72474957", "0.7201746", "0.69764864", "0.69075066", "0.68920994", "0.6787797", "0.65999645", "0.6587811", "0.65750474", "0.6531958", "0.65172744", "0.64560294", "0.64560294", "0.6405152", "0.6390808", "0.6390808", "0.6390808", "0.6378808", "0.63608027", "0.634...
0.0
-1
Saves an svg snippet
def _generate_error_report(self, errno=None): # as of now we think this will be the same for every interface NIWORKFLOWS_LOG.warn('Report was not generated') errorstr = '<div><span class="error">Failed to generate report!</span>.\n' if errno: errorstr += (' <span class="erro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_svg(string, file_name):\n file_handle = file(file_name, \"w\")\n file_handle.write(string)\n file_handle.close()", "def save_plot(p, file_name, path='../static/images/'):\n p.output_backend = \"svg\"\n export_svgs(p, filename=path + file_name + '.svg')", "def save(filename, canvas):\n ...
[ "0.7796538", "0.72046244", "0.7060236", "0.70434374", "0.694006", "0.6827847", "0.6754541", "0.65522254", "0.65489715", "0.65106666", "0.6446291", "0.6428489", "0.6419784", "0.6399665", "0.63871783", "0.6345695", "0.63159513", "0.6313837", "0.6306657", "0.6256271", "0.6255564...
0.0
-1
Generates the visual report
def _generate_report(self): from niworkflows.viz.utils import plot_registration NIWORKFLOWS_LOG.info('Generating visual report') fixed_image_nii = load_img(self._fixed_image) moving_image_nii = load_img(self._moving_image) contour_nii = load_img(self._contour) if self._contour i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_report(self):\n from niworkflows.viz.utils import plot_registration\n NIWORKFLOWS_LOG.info('Generating visual report')\n\n anat = load_img(self._anat_file)\n contour_nii = load_img(self._contour) if self._contour is not None else None\n\n if self._mask_file:\n ...
[ "0.7264522", "0.72419435", "0.72344077", "0.7205322", "0.7167486", "0.70792633", "0.69737315", "0.68265104", "0.67954844", "0.6770184", "0.6706242", "0.6649476", "0.6630725", "0.66305715", "0.66226053", "0.66017485", "0.6577003", "0.6519854", "0.6497918", "0.64795333", "0.645...
0.70916015
5
Generates the visual report
def _generate_report(self): from niworkflows.viz.utils import plot_registration NIWORKFLOWS_LOG.info('Generating visual report') anat = load_img(self._anat_file) contour_nii = load_img(self._contour) if self._contour is not None else None if self._mask_file: anat = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_report(self) -> Report:\n # equity_curve = self._generate_equity_curve()\n # summary_stats = self._generate_summary_stats(equity_curve)\n # return Report(equity_curve, summary_stats)\n pass", "def _generate_report(self):\n raise NotImplementedError", "def generat...
[ "0.72419435", "0.72344077", "0.7205322", "0.7167486", "0.70916015", "0.70792633", "0.69737315", "0.68265104", "0.67954844", "0.6770184", "0.6706242", "0.6649476", "0.6630725", "0.66305715", "0.66226053", "0.66017485", "0.6577003", "0.6519854", "0.6497918", "0.64795333", "0.64...
0.7264522
0
Initialize a new Calibration
def __init__(self, poses=None, selected_point=None): super(Calibration, self).__init__("calibration") self.marker_array = MarkerArray() if selected_point is None: selected_point = 0 if poses is not None: self.poses = poses else: self.load() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self._read_calibration_data()\n self.configure_sensor(\n TemperatureOversamplings.x08,\n PressureOversamplings.x16,\n HumidityOversamplings.x08,\n IIRFilterCoefficients.FC_003,\n 250,\n 250)", "def initialise_ca...
[ "0.7170853", "0.7100124", "0.7099024", "0.7032544", "0.7022527", "0.6957133", "0.6374656", "0.63612366", "0.6234849", "0.6194527", "0.6192426", "0.61858934", "0.6176256", "0.61386317", "0.6112563", "0.61066556", "0.60895455", "0.6060279", "0.6034259", "0.6027615", "0.59995145...
0.73918635
0
Calibration changed event, publish the markers and the calibration data to ROS
def calibration_changed(self): for marker in self.marker_array.markers: marker.action = Marker.DELETE for idx, pose in enumerate(self.poses): marker = Marker() marker.id = int(str(int(round(time.time() * 1000)) + idx)[6:]) marker.header.frame_id = Calibr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _doCalibration(self):\n self._cmdCalibration(2)", "def rDataChanged(self):\n\n self._queues.uResolutionTab.refreshData()\n self._layerManager.updateReviewLayer()", "def fDataChanged(self):\n\n self._layerManager.getAimsFeatures()", "def XPLMDataChanged_f(inRefcon):", "def ge...
[ "0.59780914", "0.5974194", "0.57603115", "0.5716506", "0.5700313", "0.56652844", "0.551917", "0.550133", "0.548774", "0.546406", "0.54577005", "0.5453123", "0.5446209", "0.54401296", "0.5424774", "0.5401204", "0.53942555", "0.5393695", "0.5350199", "0.5338598", "0.5327624", ...
0.7535387
0
Add new model point to the calibration points
def add(self, p): self.poses.append(CalibrationPoint(p)) self.selected_point = len(self.poses) - 1 self.calibration_changed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit(self, p):\n self.poses[self.selected_point].model = p\n self.calibration_changed()", "def add_point(self, xx, fx):\n dim = len(xx)\n self._realloc(dim)\n self.x[self.nump, :] = xx\n self.fx[self.nump, :] = fx\n self.nump += 1\n # Update the leave-o...
[ "0.69154406", "0.6766578", "0.6623721", "0.6548858", "0.6522341", "0.6482697", "0.6431424", "0.63752323", "0.63269496", "0.6270424", "0.6258767", "0.62286866", "0.6175748", "0.6123516", "0.61176217", "0.61059564", "0.6047522", "0.5996935", "0.59870833", "0.5979229", "0.593303...
0.7142621
0
Edit the seleted model point
def edit(self, p): self.poses[self.selected_point].model = p self.calibration_changed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _point_edited(self, _var_name, _list_index, _operation):\r\n #update the point only if:\r\n #- the user edited the var (not just a point selection)\r\n #- the input string can be parsed to ints\r\n if (not self.inhibit_callbacks and\r\n is_float(self.editable_x.get())...
[ "0.7051569", "0.67868155", "0.6757438", "0.66552246", "0.65705884", "0.6387175", "0.6364775", "0.6216918", "0.62072617", "0.59917426", "0.5985266", "0.59831333", "0.59759885", "0.5964893", "0.58861", "0.5845197", "0.58253455", "0.5799752", "0.57940185", "0.5790111", "0.579011...
0.7967514
0
Record the real world position of the selected model point
def record(self): if self.selected_point is None: RosProxy().notify("No calibration point selected", STATE.ERROR) return if len(self.poses) == 0: RosProxy().notify("No calibration point added", STATE.ERROR) return if RobotControllerHandler.curre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _world_point(self, point_3d):\n return self.obj.matrix_world @ point_3d", "def coord(self):\r\n return self.model.coord", "def edit(self, p):\n self.poses[self.selected_point].model = p\n self.calibration_changed()", "def record_pose(self):\n drone_pos = client.getMulti...
[ "0.661618", "0.6589321", "0.6392966", "0.6373264", "0.6324207", "0.6305534", "0.6298948", "0.6229923", "0.6171466", "0.61672115", "0.60906225", "0.60764337", "0.6038905", "0.6004793", "0.6004699", "0.6002335", "0.5980551", "0.5974565", "0.59389585", "0.593828", "0.5920619", ...
0.6123218
10
Remove selected calibration point
def remove(self): if self.selected_point is None: RosProxy().notify("No calibration point selected", STATE.ERROR) return if len(self.poses) == 0: RosProxy().notify("No calibration point added", STATE.ERROR) return self.poses.remove(self.poses[se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_selection(self):\n if self.selected_point_index is not None:\n del self.current_shape[self.selected_point_index]\n self.selected_point_index = None\n self.changed()", "def rm_calibration(self):\n\n self.bin_edges_kev = None", "def removePick(self):\n ...
[ "0.7046191", "0.68148166", "0.6728017", "0.6607091", "0.6529173", "0.63954777", "0.6347519", "0.60552454", "0.6048657", "0.6048657", "0.60466725", "0.6028333", "0.601033", "0.60037434", "0.60037434", "0.5995959", "0.5992583", "0.59890836", "0.5910162", "0.5888631", "0.5885889...
0.8378994
0
Load a given object
def load_object(self, obj): self.poses = obj.poses self.selected_point = obj.selected_point self.calibration_changed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_object(path):\r\n with open(path,\"rb\") as f:\r\n object = pickle.load(f) \r\n return object", "def load_object(path):\n try:\n dot = path.rindex('.')\n except ValueError:\n raise ValueError(\"Error loading object '%s': not a full path\" % path)\n\n modul...
[ "0.7695731", "0.74446046", "0.7410183", "0.73371464", "0.73294044", "0.72880054", "0.7247311", "0.7246651", "0.7245202", "0.7236421", "0.7236421", "0.7191883", "0.71651185", "0.71360666", "0.71178216", "0.7112144", "0.69774926", "0.6947777", "0.68680066", "0.68327016", "0.682...
0.6548898
31
Load a default calibration as an example
def load_default(self): poses = [] cp = CalibrationPoint(Pose(), Pose()) cp.measured.position = Point(0.0, 0.0, 0.12) cp.measured.orientation.x = -0.025 cp.measured.orientation.y = 1. cp.measured.orientation.z = 0.011 cp.measured.orientation.w = 0.002 cp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__ (self) :\n self.loadCSPAD2x2CalibParsDefault()", "def load_cal(self):\n global DEBUG, dtParameterDesc\n if DEBUG:\n print(self.__class__.__name__+'.load_cal(): calibration is loaded')\n if 'refatt' in self.parameters and 'refoutpower' in self.parameters:\n ...
[ "0.64449143", "0.62831944", "0.59671456", "0.5753438", "0.5722229", "0.570451", "0.5687627", "0.5635133", "0.558993", "0.55866563", "0.55388427", "0.55273575", "0.5505142", "0.5503746", "0.5497588", "0.5470468", "0.5460154", "0.5457385", "0.5434277", "0.5433322", "0.54281676"...
0.6843389
0
Goto to the selected position
def goto(self, speed=1): self.safe_goto(speed, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __goto(self):\n from QScintilla.GotoDialog import GotoDialog\n \n aw = self.activeWindow()\n lines = aw.lines()\n curLine = aw.getCursorPosition()[0] + 1\n dlg = GotoDialog(lines, curLine, self.ui, None, True)\n if dlg.exec_() == QDialog.Accepted:\n a...
[ "0.75331914", "0.744304", "0.73540735", "0.71401715", "0.7106989", "0.70884335", "0.70847714", "0.69586277", "0.6954708", "0.686003", "0.6822451", "0.6774556", "0.6698407", "0.66824645", "0.6607257", "0.64744914", "0.6432751", "0.6329947", "0.6266078", "0.62590426", "0.624844...
0.5589648
85
Safe goto to the selected position (the Z is increased with 2cm)
def safe_goto(self, speed=1.0, distance=SAFETY_DISTANCE): moves = [] point = copy.deepcopy( self.poses[self.selected_point].measured.position) orientation = self.poses[self.selected_point].measured.orientation point.z += distance move = Move() move.pose.posit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_to_position2(self):", "def move_to_position1(self):", "def goto(x, y):\n turtleTmp.setposition(x, y)", "def goto_position(editor, pos):\n cursor = editor.textCursor()\n editor.moveCursor(cursor.End)\n cursor.setPosition(pos)\n editor.setTextCursor(cursor)", "def jump(self):\n ...
[ "0.7087748", "0.7047049", "0.6761017", "0.6383471", "0.6282584", "0.6282203", "0.62701017", "0.62499607", "0.6248314", "0.6211238", "0.6206618", "0.6184875", "0.61233246", "0.6099291", "0.6097524", "0.6097524", "0.6070837", "0.6049628", "0.60357076", "0.603397", "0.6002929", ...
0.572487
48
Set the selected point
def set_selected_point(self, i): if i < len(self.poses): self.selected_point = min(len(self.poses), max(0, i)) self.calibration_changed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_point_selected(self, _event):\r\n selected_iid = self._tree.selection()\r\n self._index_of_sel_point = self._tree.index(selected_iid)\r\n self._edit_zone.set_editable_point(self._tree.item(selected_iid)[\"values\"][0])\r\n self._notify(\"focus\", {})", "def setSetpoint(self, p...
[ "0.7825963", "0.780328", "0.7588371", "0.7408778", "0.7331143", "0.7323788", "0.72938347", "0.72737926", "0.71781445", "0.71363586", "0.71363586", "0.70924747", "0.70924747", "0.70924747", "0.7033677", "0.7014697", "0.6998659", "0.6984284", "0.6957518", "0.6957341", "0.693528...
0.77336913
2
Calibration setter service handler
def set_calibration(self, req): cmd = req.command data = json.loads(req.json) if cmd == "add": if "x" in data and "y" in data and "z" in data: x, y, z = float(data["x"]), float(data["y"]), float(data["z"]) self.add(Point(x, y, z)) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _doCalibration(self):\n self._cmdCalibration(2)", "def calibration(self, cal: int, /) -> None:", "def __init__(self, poses=None, selected_point=None):\n super(Calibration, self).__init__(\"calibration\")\n\n self.marker_array = MarkerArray()\n if selected_point is None:\n ...
[ "0.6910026", "0.6533155", "0.64192873", "0.6146642", "0.60480934", "0.6035951", "0.6031567", "0.6006333", "0.5834597", "0.58197874", "0.57702", "0.5759993", "0.5720985", "0.57105434", "0.5708835", "0.5705385", "0.56633836", "0.55804294", "0.5518535", "0.549152", "0.54897946",...
0.60191
7
Same as cloudvolume.paths.extract, but raise an additional cloudvolume.exceptions.UnsupportedProtocolError if either dataset or layer is not set.
def strict_extract(cloudpath, windows=None, disable_toabs=False): path = extract(cloudpath, windows, disable_toabs) if path.dataset == '' or path.layer == '': raise UnsupportedProtocolError(cloudpath_error(cloudpath)) return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract(cloudpath, windows=None, disable_toabs=False):\n if len(cloudpath) == 0:\n return ExtractedPath('','','','','','','')\n\n windows_file_re = re.compile(r'((?:\\w:\\\\)[\\d\\w_\\.\\-]+)')\n bucket_re = re.compile(r'^(/?[~\\d\\w_\\.\\-]+(?::\\d+)?)(?:\\b|$)') # posix /what/a/great/path\n \n error ...
[ "0.57432127", "0.5345072", "0.5141064", "0.48350242", "0.471617", "0.4686658", "0.468103", "0.46336773", "0.462907", "0.46199074", "0.46039414", "0.45926678", "0.4592578", "0.45727795", "0.45651555", "0.4543723", "0.45103985", "0.4503522", "0.4497334", "0.44893438", "0.448435...
0.7009644
0
Given a valid cloudpath of the form
def extract(cloudpath, windows=None, disable_toabs=False): if len(cloudpath) == 0: return ExtractedPath('','','','','','','') windows_file_re = re.compile(r'((?:\w:\\)[\d\w_\.\-]+)') bucket_re = re.compile(r'^(/?[~\d\w_\.\-]+(?::\d+)?)(?:\b|$)') # posix /what/a/great/path error = UnsupportedProtocolErro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_validate(path):\n # functionality to be added later\n return path", "def validate_short_path(short_path):", "def parse_managed_path(path):\n fields = path.split(':', 1)\n return fields[0], fields[1]", "def clean_path(self, path):\n if('.flaccuesplit.' in path):\n ...
[ "0.5782255", "0.5485256", "0.5111033", "0.5109678", "0.5098054", "0.4996147", "0.49742427", "0.4955958", "0.49552155", "0.49309495", "0.49085343", "0.49030942", "0.48504016", "0.48399198", "0.48375192", "0.48148483", "0.47820082", "0.47807506", "0.47638345", "0.47635552", "0....
0.5554715
1
This function checks to see if user guess the correct letter
def check_guess(letter, letters_pending, letters_found): # correct guess if letter in letters_pending: letter_index = letters_pending[letter].pop(0) # return first letter's index letters_found.add(letter_index) # check if list is empty if len(letters_pending[letter]) ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkLetter():\n\tguess = False\n\twhile guess != True:\n\t\tguess = str(raw_input(\"Guess a letter: \"))\n\t\tif guess.isalpha() and len(guess) == 1 :\n\t\t\treturn guess\n\t\telif not guess.isalpha() or len(guess) > 1:\n\t\t\tprint \"The input may be one letter only!\"\n\t\telse:\n\t\t\tprint \"Error in chec...
[ "0.8326243", "0.797419", "0.7970673", "0.78612447", "0.78342074", "0.7764369", "0.77154046", "0.7664183", "0.7633212", "0.7632182", "0.74513006", "0.73829585", "0.7381481", "0.7340003", "0.73062885", "0.72928417", "0.72888887", "0.7277303", "0.7275198", "0.7268439", "0.722009...
0.6817726
38
This function displays the letters that user found and underscores for letters remain to be found
def display_word_status(word, indexes_found): status = [] for i in range(len(word)): if i in indexes_found: status.append(word[i]) else: status.append('_') print('\n[', " ".join(status), '] \n')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_hidden_word(secret_word, old_letters_guessed):\n print(\"\\n\")\n for letter in secret_word:\n if letter in old_letters_guessed:\n print(letter, end=' ')\n else:\n print('_', end=' ')\n return ' '", "def display_letters(word, guesses):\n pass", "def show...
[ "0.70420015", "0.6987924", "0.69101435", "0.68977433", "0.67463523", "0.674226", "0.6739028", "0.66745555", "0.6641939", "0.6510712", "0.6438312", "0.6392078", "0.6339939", "0.6339912", "0.6318629", "0.62372696", "0.6155217", "0.61542034", "0.614742", "0.6090914", "0.6011447"...
0.5992686
22
SCons entry point for this tool.
def generate(env): # NOTE: SCons requires the use of this name, which fails gpylint. # Set target platform bits env.SetBits('debug') env['TARGET_DEBUG'] = True env.Append( CPPDEFINES=['_DEBUG'] + env.get('CPPDEFINES_DEBUG', []), CCFLAGS=env.get('CCFLAGS_DEBUG', []), LINKFLAGS=env.get('LIN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(env):\n\n # FIXME: this is already too late\n #if env.get('quiet', False):\n # quietCommandLines(env)\n\n # shortcuts\n debug = env['debug']\n machine = env['machine']\n platform = env['platform']\n x86 = env['machine'] == 'x86'\n gcc = env['platform'] in ('linux', 'freeb...
[ "0.6464546", "0.6412459", "0.6104805", "0.6104805", "0.60741913", "0.6071515", "0.5993396", "0.59785044", "0.59724134", "0.59724134", "0.59724104", "0.59639555", "0.59407467", "0.5926329", "0.5874594", "0.58656955", "0.5856603", "0.58456635", "0.5837887", "0.5832198", "0.5824...
0.0
-1
Extract tags and mentions from a string. Returns a tuple with a set of tags and mentioned users, if they exist.
def extract_tags_and_mentions(s: str) -> typing.Tuple[set, set]: if not s: return set(), set() # Build a set after stripping the # or @ sign before every item found with # the regular expression. tags = set(t for t in find_hashtags_re.findall(s)) mentions = set(m[1:] for m in find_mentions_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tagged_user(line, unique_users):\n tagged_user = None\n\n for user in unique_users:\n \n tagged_user = re.search(f\"@{user}\\s*\", line)\n \n if tagged_user != None:\n tagged_user = tagged_user.group(0).replace(\"@\", \"\").strip()\n line = line.replace(f\"@{...
[ "0.5984887", "0.5866291", "0.5816416", "0.57498", "0.57427794", "0.56972706", "0.5674774", "0.5634183", "0.5608683", "0.5608683", "0.5608683", "0.5608683", "0.5608683", "0.56065565", "0.56022114", "0.55869055", "0.55849683", "0.5581752", "0.5581752", "0.5576589", "0.5564691",...
0.8448166
0
On post(type) creation, set hash_id.
def on_created_post(sender, instance, created, **kwargs): if not created: return if not issubclass(sender, dillo.models.posts.Post): return instance.hash_id = instance.id instance.save() log.debug('Set user %s as follower of own post %i' % (instance.user, instance.id)) follow(ins...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handler(event, _context):\n model = PostModel()\n post_id = model.create(**json.loads(event['body']))\n return dump_result({'post_id': post_id}, status_code=201)", "def save(self, *args, **kwargs):\n if not self.pkhash:\n self.pkhash = compute_hash(self.script)\n super(DataO...
[ "0.6146022", "0.60286593", "0.5837189", "0.5832979", "0.5738559", "0.57207257", "0.56405866", "0.5623517", "0.5464062", "0.54599774", "0.5413562", "0.5413562", "0.53702575", "0.5368633", "0.53681165", "0.5332242", "0.5332242", "0.5330535", "0.5305785", "0.5294041", "0.529331"...
0.57402194
4
Assign Tags and Mentions to a Post(type) by parsing the description.
def on_saved_post(sender, instance, created, **kwargs): # If the post was just created, stop here since we have no tags yet if created: return if not issubclass(sender, dillo.models.posts.Post): return # Extract tags and mentions from text and assign them to the Post tags, mentions =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_meta(self, post, *args, **kwargs):\n\t\tsuper(Command, self).add_meta(post, *args, **kwargs)\n\t\tpost.gen_description = False\n\t\tpost.description = description_from_content(post)\n\t\tpost.save()", "def post(self, post_id=None):\n\n if post_id:\n abort(400)\n else:\n ...
[ "0.612241", "0.59482175", "0.5902697", "0.5901005", "0.5845779", "0.58072627", "0.5710131", "0.56681836", "0.5645754", "0.5642677", "0.5604725", "0.5604725", "0.55815965", "0.55642414", "0.54975563", "0.54782796", "0.5466466", "0.54545844", "0.54401195", "0.54401195", "0.5419...
0.6026173
1
Create activity for published Post.
def on_post_published(sender, instance: dillo.models.posts.Post, **kwargs): # If activity was already created (the post was already published), # skip this signal to prevent the activity from appearing twice in the feeds. if models_actstream.Action.objects.filter( actor_object_id=instance.user.id, a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_to_activity(self, post):\n id = None\n if post.get('id'):\n # strip USERID_ prefix if it's there\n post['id'] = post['id'].split('_', 1)[-1]\n id = post['id']\n\n obj = self.post_to_object(post)\n activity = {\n 'verb': VERBS.get(post.get('type', obj.get('objectType')), 'po...
[ "0.74787325", "0.6533647", "0.64678", "0.6233577", "0.62174255", "0.61825395", "0.6088378", "0.60738593", "0.60658085", "0.6014791", "0.6014791", "0.6007368", "0.5983524", "0.5974287", "0.5948988", "0.5934463", "0.58406353", "0.58193", "0.58059466", "0.5795128", "0.5768188", ...
0.6908637
1
Assign tags to a comment by parsing the content.
def on_created_comment(sender, instance: dillo.models.comments.Comment, created, **kwargs): if not created: return # Extract tags and mentions from text and assign them to the Comment tags, mentions = extract_tags_and_mentions(instance.content) instance.tags.set(*tags) for mentioned_user in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comment(self, content):\n pass", "def __init__(self, node, declare):\n self.comment = getOptionalTag(node, \"comment\", [])\n if self.comment != []:\n self.comment = self.comment.replace(\"\\n\",\" \")\n while self.comment.find(\" \") != -1:\n self.c...
[ "0.6160088", "0.6029694", "0.58862054", "0.5713247", "0.5622352", "0.561385", "0.5606108", "0.557518", "0.5571938", "0.5537934", "0.54423904", "0.54145694", "0.5373428", "0.5349663", "0.53335774", "0.5330848", "0.5328987", "0.5298146", "0.52952015", "0.52707106", "0.5269429",...
0.5155063
31
Actions to perform once a Like is created.
def on_created_like(sender, instance: dillo.models.mixins.Likes, created, **kwargs): if ( isinstance(instance.content_object, dillo.models.comments.Comment) and instance.content_object.parent_comment ): target = instance.content_object.parent_comment else: target = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def like(self):\n self.like_count = self.like_count + 1 if self.like_count else 1", "def like():\n if CURR_USER_KEY in session:\n cafe_id = int(request.json[\"cafe_id\"])\n print(type(cafe_id))\n user_id = g.user.id\n print(type(user_id))\n like = Like(\n c...
[ "0.6593319", "0.6169452", "0.6148844", "0.6112476", "0.6108443", "0.6105551", "0.60661376", "0.60419214", "0.6040893", "0.59646094", "0.59646094", "0.59571815", "0.5945115", "0.5939536", "0.5915928", "0.5865272", "0.58126223", "0.5807308", "0.5788529", "0.57406265", "0.572260...
0.74319637
0
Decrease user profile likes of 1. The function is available as standalone for easier unit testing.
def profile_likes_count_decrease(target_user: User): try: with transaction.atomic(): dillo.models.profiles.Profile.objects.filter(user=target_user).update( likes_count=F('likes_count') - 1 ) except IntegrityError: log.warning('Integrity error when incremen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_deleted_like(sender, instance: dillo.models.mixins.Likes, **kwargs):\n if not instance.content_object:\n return\n target_user = instance.content_object.user\n profile_likes_count_decrease(target_user)\n log.debug('Decreased like count for user %s' % target_user)", "def unlike(self, data...
[ "0.7092867", "0.69812095", "0.6517912", "0.61881864", "0.61731464", "0.6097247", "0.6096408", "0.6036876", "0.5903274", "0.58781475", "0.58778524", "0.5823332", "0.5778853", "0.5737949", "0.5679264", "0.563741", "0.55705523", "0.5514937", "0.54584485", "0.5454046", "0.5450492...
0.8061975
0
Decrease likes_count for profile when Entity or Comment is unliked.
def on_deleted_like(sender, instance: dillo.models.mixins.Likes, **kwargs): if not instance.content_object: return target_user = instance.content_object.user profile_likes_count_decrease(target_user) log.debug('Decreased like count for user %s' % target_user)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def profile_likes_count_decrease(target_user: User):\n try:\n with transaction.atomic():\n dillo.models.profiles.Profile.objects.filter(user=target_user).update(\n likes_count=F('likes_count') - 1\n )\n except IntegrityError:\n log.warning('Integrity error w...
[ "0.74382937", "0.68135536", "0.62009215", "0.61690074", "0.6078528", "0.5979719", "0.5800343", "0.5772288", "0.5705149", "0.56960106", "0.5675965", "0.56723356", "0.5662375", "0.56615674", "0.5642525", "0.56078047", "0.56078047", "0.56078047", "0.5589605", "0.5575719", "0.557...
0.7310249
1
Fetch social account name and avatar, and add them to the Profile.
def on_social_account_added(sender, instance: SocialAccount, created, **kwargs): if not created: return name = instance.extra_data.get('name') if name: log.debug('Updating name via socialaccount for user %i' % instance.user.id) instance.user.profile.name = name instance.user....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_profile(self,soup,Name,Profile_url):\n h3=soup.find(\"h3\")\n \n if h3 !=None:\n if h3.find(\"a\")!=None: \n name=h3.a.get_text()\n if h3.a.has_attr('href') :\n h3_a_tag=h3.a['href']\n h3_a_tag=h3_...
[ "0.62179977", "0.61199266", "0.61171144", "0.6097713", "0.60976326", "0.60648817", "0.605172", "0.60389084", "0.6031145", "0.60300606", "0.60167927", "0.6015737", "0.6003023", "0.5930042", "0.5929104", "0.5922604", "0.59004813", "0.59002423", "0.58768433", "0.58611965", "0.58...
0.76166373
0
On action created, fan out notifications
def on_created_action(sender, instance: models_actstream.Action, created, **kwargs): if not created: return # If content_type is Post or Profile if ( instance.action_object_content_type == ContentType.objects.get_for_model(dillo.models.posts.Post) and instance.verb == 'poste...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_defined(sender, instance, created, raw, using, **kwargs):\n if created:\n raw_hook_event.send(\n sender=None,\n event_name=\"action_defined\",\n instance=instance,\n payload=ActionSerializer(instance).data,\n user=instance.team,\n )...
[ "0.63869154", "0.6225311", "0.6225311", "0.6225311", "0.6225311", "0.6144163", "0.5890172", "0.58513165", "0.58451253", "0.5807999", "0.57855886", "0.57809436", "0.5763071", "0.5763071", "0.57493734", "0.5724776", "0.572035", "0.5714243", "0.5679732", "0.5625895", "0.55907756...
0.7528839
0
User stops following something.
def on_deleted_follow(sender, instance: models_actstream.Follow, **kwargs): content_type = ContentType.objects.get_for_id(instance.content_type_id) log.debug("Unfollowing %s %s" % (content_type.name, instance.object_id)) dillo.tasks.feeds.repopulate_timeline_content( instance.content_type_id, instan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self):\r\n self.terminating = True", "def stop(self) -> None:", "def stop(self) -> None:", "def stop(self):\r\n pass", "def stop(self):", "def stop(self):", "def stop(self):\n return", "def stop() -> None:", "def stop(self):\n pass", "def stop(self):\n ...
[ "0.758307", "0.7484069", "0.7484069", "0.7418194", "0.73704475", "0.73704475", "0.7342334", "0.733363", "0.73308474", "0.73308474", "0.73308474", "0.73308474", "0.73308474", "0.73308474", "0.73308474", "0.73308474", "0.73308474", "0.73308474", "0.73308474", "0.7324925", "0.73...
0.0
-1
If confirmed, subscribe to newsletter.
def on_email_confirmed(request, email_address: EmailAddress, **kwargs): dillo.tasks.profile.update_mailing_list_subscription(email_address.email, True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscribe(self, request):\n email = self.cleaned_data.get('email')\n\n email_name, domain_part = email.rsplit('@', 1)\n domain_name = '@' + domain_part\n email_domain, created = Domain.objects.get_or_create(name=domain_name)\n\n subscriber, created = Subscriber.objects.get_or...
[ "0.7161424", "0.6835099", "0.6736429", "0.65938777", "0.6326111", "0.6227474", "0.6216683", "0.6181522", "0.6166237", "0.61440307", "0.6120497", "0.61191845", "0.60010856", "0.5983212", "0.595965", "0.5947182", "0.5929845", "0.5913996", "0.5880866", "0.5878438", "0.58783746",...
0.66522044
3
Unsubscribe previous email, wait for new one to be confirmed.
def on_email_email_changed( request, user, from_email_address: EmailAddress, to_email_address, **kwargs ): if from_email_address: dillo.tasks.profile.update_mailing_list_subscription(from_email_address.email, False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unsubscribe_all_emails_from_cloudwatch(self):\n for subscription in self._get_cloudwatch_subscriptions():\n subscription_arn = subscription['SubscriptionArn']\n if not subscription_arn == 'PendingConfirmation':\n self.conn.unsubscribe(subscription_arn)", "def unsub...
[ "0.6626395", "0.64564025", "0.6453663", "0.6379453", "0.6170811", "0.61062586", "0.61062586", "0.61062586", "0.61062586", "0.61062586", "0.60732317", "0.6026578", "0.58910805", "0.5749465", "0.57386756", "0.5738046", "0.5716363", "0.5714279", "0.57047355", "0.5697949", "0.565...
0.0
-1
Delete the user from the newsletter.
def user_pre_delete(sender, instance: User, **kwargs): if not hasattr(settings, 'ANYMAIL'): log.info("Mailgun not configured, skipping mailing list subscription update") return if not hasattr(settings, 'MAILING_LIST_NEWSLETTER_EMAIL'): log.debug("Newsletter not configured, skipping mai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_user():", "def delete_user():\n #TODO user delete\n pass", "def delete_user(self, user):\n self.delete(user)", "def delete_user(id):\n pass", "def delete_user(self):\n User.user_list.remove(self)", "def delete_user(self):\n User.user_list.remove(self)", "def del...
[ "0.7976897", "0.7772087", "0.770037", "0.7479432", "0.746371", "0.746371", "0.746371", "0.7442444", "0.7436067", "0.7431538", "0.73823726", "0.7339518", "0.7288484", "0.7285742", "0.7276345", "0.725602", "0.72481054", "0.72303545", "0.72023326", "0.7187994", "0.71587986", "...
0.71425474
22
runs multiple experiments that calculates the precision and recall of the comparison algorithms' results
def run_multiple_simple_experiments(self, path_to_csv_files, algorithms, thresholds): starting_time = time.time() print("started simple precision recall image_matching_module") for algorithm in algorithms: start_file_time = time.time() print("started algorithm:", algorith...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_experiments():\n if True: # Change to False when done finding max_scoring_num_rolls\n six_sided_max = max_scoring_num_rolls(six_sided)\n print('Max scoring num rolls for six-sided dice:', six_sided_max)\n rerolled_max = max_scoring_num_rolls(reroll(six_sided))\n print('Max s...
[ "0.7036995", "0.6971232", "0.69174814", "0.68236893", "0.6810289", "0.67737514", "0.6682389", "0.66659284", "0.6623596", "0.6608259", "0.65498793", "0.6528051", "0.65186554", "0.64956766", "0.6495176", "0.6481607", "0.6480974", "0.6465037", "0.6449332", "0.64473736", "0.64420...
0.66045517
10
runs an image_matching_module that calculates the precision and recall of the comparison algorithm's results
def run_single_simple_experiment(self, path_to_csv_files, algorithm, thresholds): splitted_path = os.path.abspath(__file__).split("/") if not os.path.isdir("/".join(splitted_path[:-1]) + "/results"): os.mkdir("/".join(splitted_path[:-1]) + "/results") experiment_dict, list_dict = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patternMatchingTest(matchingAlgorithm,\n observations= defaultCOMPREFdump , \n modelsFolder= defaultWRFdumpsFolder,\n #key1='0828',\n key1='',\n key2='',\n #key3='',\n verbose=True,\n makeSmallImages=True,\n smal...
[ "0.686315", "0.66412973", "0.6606622", "0.6439272", "0.64282435", "0.636913", "0.63653", "0.6287904", "0.6282749", "0.61645573", "0.61143124", "0.6112964", "0.6099393", "0.60614634", "0.6056027", "0.60436153", "0.60412055", "0.60172075", "0.6009123", "0.6001078", "0.59953034"...
0.0
-1
runs multiple experiments that calculates the precision and recall of multiple comparison algorithms' results
def run_multiple_advanced_experiments(self, path_to_csv_files, algorithms_weights_list, thresholds): starting_time = time.time() print("started advanced precision recall image_matching_module") for algorithms_weights in algorithms_weights_list: start_file_time = time.time() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_experiments():\n if True: # Change to False when done finding max_scoring_num_rolls\n six_sided_max = max_scoring_num_rolls(six_sided)\n print('Max scoring num rolls for six-sided dice:', six_sided_max)\n rerolled_max = max_scoring_num_rolls(reroll(six_sided))\n print('Max s...
[ "0.70623094", "0.7007437", "0.69541293", "0.6884711", "0.68788844", "0.68726337", "0.67315125", "0.6698763", "0.66550297", "0.6629735", "0.655879", "0.6552913", "0.6541094", "0.6533274", "0.65046316", "0.649451", "0.6487716", "0.64735806", "0.6451186", "0.6437416", "0.6433956...
0.6528349
14
runs an image_matching_module that calculates the precision and recall of multiple comparison algorithms' results
def run_single_advanced_experiment(self, path_to_csv_files, algorithms_weights, thresholds): splitted_path = os.path.abspath(__file__).split("/") if not os.path.isdir("/".join(splitted_path[:-1]) + "/results"): os.mkdir("/".join(splitted_path[:-1]) + "/results") first_run = True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def painting_matching_ml(imgs, db_imgs, method_list, text_masks, author_text, gt_text, metrics, weights, splits=30, max_rank=10):\n descriptor_extractors = [get_descriptor_extractor(method_name) for method_name in method_list]\n tmp_img_format = []\n tmp_mask_format = []\n tmp_text_format = []\n for...
[ "0.70493734", "0.6962549", "0.6559345", "0.6556465", "0.6520097", "0.645765", "0.64450425", "0.6405806", "0.63550365", "0.62989557", "0.62902206", "0.6247937", "0.623757", "0.6215632", "0.6210621", "0.6126112", "0.61117905", "0.61023283", "0.60840875", "0.60789233", "0.606114...
0.0
-1
create the dictionary holding the image_matching_module's results
def create_experiment_dict(algorithm_name, thresholds): experiment_dict = {} for threshold in thresholds: experiment_dict[str(threshold)] = {} experiment_dict[str(threshold)][algorithm_name] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] list_dict = {'TP': 0, 'FP': 1, 'TN': 2, 'FN': 3,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_detect_result(self):\n\n resultdict = {'class_index' : self.class_index,\n 'obj_name' : self.obj_name,\n 'score' : self.score,\n 'bounding_box' : {\n 'x_min' : self.x_min,\n 'y_min' : sel...
[ "0.6621895", "0.64354163", "0.6385068", "0.6345569", "0.63442147", "0.62534124", "0.6184932", "0.61760575", "0.6173091", "0.60566914", "0.6048575", "0.6046165", "0.6008114", "0.59930813", "0.59672993", "0.5958381", "0.59390056", "0.58587366", "0.5855858", "0.5824432", "0.5820...
0.0
-1
updates the precision and recall data in the image_matching_module's results
def update_precision_and_recall(experiment_dict, list_dict, algorithm_name, thresholds): for threshold in thresholds: algorithm_column_name = algorithm_name + "_actual" tp = experiment_dict[str(threshold)][algorithm_name][list_dict['TP']] fp = experiment_dict[str(threshold)][...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate_matrices(self, precision_matrix, recall_matrix):\n\t\tground_truth_count = precision_matrix.shape[0]\n\t\tdetection_count = precision_matrix.shape[1]\n\t\tground_truth_sets_precision = defaultdict(set) # number of ground truth items that match a particular detection in the precision matrix\n\t\tdetect...
[ "0.625239", "0.6167243", "0.6078468", "0.6062458", "0.60042554", "0.5945311", "0.59133434", "0.5907834", "0.5897664", "0.587507", "0.58680505", "0.58505803", "0.5835626", "0.5821899", "0.58180785", "0.57850605", "0.5741462", "0.5735853", "0.57268965", "0.5706414", "0.5699125"...
0.6408821
0
creates a dictionary that can be ingested by pandas DataFrame to write to a csv file
def create_simple_experiment_dict_for_csv(experiment_dict, list_dict, algorithm, thresholds): experiment_dict_for_csv = { "attributes": ['TP', 'FP', 'TN', 'FN', 'TPR (Sensitivity)', 'TNR (Specificity)', 'Precision', 'Recall', 'F1 Measure', 'Accuracy']} for row_key ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csv_to_dict(self):\n log = logger.configure(\"default\")\n try: \n df = pd.read_csv(self.__csv_path)\n except IOError as e:\n # file not found\n log.error('Could not import {}. Got error {}'.format(self.__csv_path, e))\n raise \n else:\n ...
[ "0.68208885", "0.6775985", "0.65989804", "0.6495224", "0.6452339", "0.642253", "0.63207847", "0.629015", "0.6283443", "0.62565273", "0.6228677", "0.62230223", "0.620419", "0.6197963", "0.6147068", "0.61124", "0.60970604", "0.6051975", "0.60255706", "0.60189426", "0.6013112", ...
0.0
-1
creates a dictionary that can be ingested by pandas DataFrame to write to a csv file
def create_advanced_experiment_dict_for_csv(experiment_dict, list_dict, algorithm_name, thresholds): experiment_dict_for_csv = { "attributes": ['TP', 'FP', 'TN', 'FN', 'TPR (Sensitivity)', 'TNR (Specificity)', 'Precision', 'Recall', 'F1 Measure', 'Accuracy']} for r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csv_to_dict(self):\n log = logger.configure(\"default\")\n try: \n df = pd.read_csv(self.__csv_path)\n except IOError as e:\n # file not found\n log.error('Could not import {}. Got error {}'.format(self.__csv_path, e))\n raise \n else:\n ...
[ "0.68224066", "0.67767906", "0.65991676", "0.6495553", "0.64526737", "0.6419535", "0.6320348", "0.62898755", "0.6284467", "0.6255064", "0.62294525", "0.62211573", "0.6205003", "0.6200207", "0.61460024", "0.61113054", "0.6097703", "0.60526484", "0.60267997", "0.6017852", "0.60...
0.0
-1