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
Renders the about page.
def data(): return render_template( 'data.html', title='Data', year=datetime.now().year, img_tichonet = '/static/pics/tichonet.png', message='Your application description page.' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def on_about(self):\n render_about_window()", "def about():\n return render_temp...
[ "0.85650355", "0.85034525", "0.84489655", "0.84044397", "0.8394454", "0.82935613", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82680845",...
0.0
-1
Renders the about page.
def nba(): form1 = ExpandForm() form2 = CollapseForm() df = pd.read_csv(path.join(path.dirname(__file__), 'static/Data/injuries_2010-2020.csv')) raw_data_table = '' if request.method == 'POST': if request.form['action'] == 'Expand' and form1.validate_on_submit(): raw_data_table ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def on_about(self):\n render_about_window()", "def about():\n return render_temp...
[ "0.85650355", "0.85034525", "0.84489655", "0.84044397", "0.8394454", "0.82935613", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82680845",...
0.0
-1
Renders the about page.
def Gallery(): return render_template( 'Gallery.html', title='The to 8 NBA players right now', year=datetime.now().year, message='' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def on_about(self):\n render_about_window()", "def about():\n return render_temp...
[ "0.85650355", "0.85034525", "0.84489655", "0.84044397", "0.8394454", "0.82935613", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82680845",...
0.0
-1
Prints the confusion matrix and precision, accuracy, recall and ROC AUC.
def print_logistic_results( X_test, y_test, logistic_model, predictions_logistic_model, solver, confusion_matrix=False, ): print(solver) print("-----------------") if confusion_matrix: disp = plot_confusion_matrix( logistic_model, X_test, y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_score(classifier,X_test,y_test):\n print(\"Test results:\\n\")\n print('Accuracy Score: {0:.4f}\\n'.format(accuracy_score(y_test,classifier.predict(X_test))))\n print('Classification Report:\\n{}\\n'.format(classification_report(y_test,classifier.predict(X_test))))\n print('Confusion Matrix:\...
[ "0.7529526", "0.750704", "0.7487848", "0.7295018", "0.72805387", "0.71712613", "0.7148443", "0.70700246", "0.70566607", "0.69996154", "0.697553", "0.6913525", "0.6849898", "0.66885924", "0.666082", "0.66598463", "0.6652944", "0.66395116", "0.6633511", "0.662369", "0.66195637"...
0.5877733
81
Compose a label for i'th word of a tree, according to 'fields'. Return a string (possibly multiline).
def _label(tree, node, fields): # Form (always). label = tree.forms(node) # Lemma. if 'lemma' in fields: label += u'\n' + tree.lemmas(node) # Postags. postags = [] if 'cpostag' in fields: postags.append(tree.cpostags(node)) if 'postag' in fields: postags.append(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_label_text(field_name: str, field: dict):\n\n label = \"\"\n if \"required\" in field:\n label = \" * \" if field.get(\"required\") else \"\"\n\n # If we don't have a label defined, used the field name\n if \"label\" not in field:\n field.update({\"label\...
[ "0.65825105", "0.6076069", "0.59696615", "0.5935693", "0.5935261", "0.58478886", "0.58437353", "0.5761943", "0.564017", "0.5549377", "0.5525734", "0.5482963", "0.54392093", "0.5434365", "0.5414149", "0.5410233", "0.53963095", "0.5393825", "0.53839684", "0.53701466", "0.534880...
0.72464603
0
Return label text height. First line is in big font, other lines are in small font.
def _label_height(text): return _BIG_FONT + _SMALL_LINE * text.count(u'\n')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetLabelSize(dc, label, vertical):\r\n\r\n text_width = text_height = 0\r\n\r\n # get the text height\r\n dummy, text_height = dc.GetTextExtent(\"ABCDHgj\")\r\n # get the text width\r\n if label.strip():\r\n text_width, dummy = dc.GetTextExtent(label)\r\n\r\n if vertical:\r\n tm...
[ "0.7271216", "0.71656597", "0.6950726", "0.69150996", "0.68502", "0.68196136", "0.67779195", "0.6538287", "0.64716256", "0.6353686", "0.62325746", "0.6218229", "0.6213206", "0.60821", "0.59820193", "0.59775317", "0.5935517", "0.5899317", "0.58370006", "0.5835381", "0.58216095...
0.8867154
0
Return label text width. Width of a single glyph is considered to be equal to font size. First line is in big font, other lines are in small font.
def _label_width(text): width = 0 for lineno, line in enumerate(text.split(u'\n')): size = [_BIG_FONT, _SMALL_FONT][lineno > 0] # Cool idiom, huh? width = max(width, size * len(line)) return width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def label_width(self):\n return self._label_width", "def label_width(self, start, end, numlabels=None, char_width=None):\n return self.formatter.estimate_width(start, end, numlabels, char_width,\n ticker=self)", "def width(self, text):\n return l...
[ "0.77487105", "0.75036937", "0.70768744", "0.7019592", "0.7008805", "0.69664294", "0.68807596", "0.679242", "0.6748034", "0.67123944", "0.66297275", "0.65036947", "0.6460371", "0.640202", "0.6389833", "0.6327039", "0.6237472", "0.6214645", "0.6123736", "0.61015725", "0.604933...
0.82819164
0
Return radius of a circular segment of an arc of a given height level.
def _arc_radius(height_in_units): return height_in_units * _ARC_HEIGHT_UNIT / (1 - math.cos(_ANGLE))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def circleCirc(radius):\n radius = float(radius)\n return 2*math.pi*radius", "def get_radius(self):\n if self.no_dist is False:\n dist = self.distance\n radius = (dist * self.ang_size / 60. *\n np.pi/180. * ct._kpc_over_pc_)/2.\n self.radius = ra...
[ "0.7022965", "0.694876", "0.6926556", "0.69203454", "0.68934387", "0.68595546", "0.6837693", "0.68078643", "0.6790736", "0.6790736", "0.67545676", "0.67370695", "0.6680574", "0.6631358", "0.6623361", "0.6594229", "0.65553945", "0.65350884", "0.64718235", "0.64544165", "0.6400...
0.81892455
0
Return minimal horizontal size for an arc of a given "flight level".
def _arc_min_length(height_in_units): return 2 * _arc_radius(height_in_units) * math.sin(_ANGLE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minimum_size(self):\n # Size in arcsec\n size = self.seeing.minimum_size()\n try:\n # Try using `intrinsic` as an object\n size = max(self.intrinsic.minimum_size(), size)\n except AttributeError:\n pass\n return size", "def calculate_previou...
[ "0.5729011", "0.5543878", "0.55003494", "0.54918885", "0.5427095", "0.54054224", "0.53995574", "0.5392929", "0.53288615", "0.5295742", "0.528502", "0.52563035", "0.52264947", "0.5151043", "0.51448995", "0.5134441", "0.5106881", "0.50455415", "0.49992964", "0.49982598", "0.498...
0.66271394
0
Draw a multiline label at given position. Enclose elements in a .
def _draw_label(file, text, x, y, css_class): width = _label_width(text) height = _label_height(text) # Start a group. file.write(u' <g class="%s">\n' % css_class) # Invisible hover-rectangle. # Makes it easier to hover over the label. file.write(u' <rect x="%i" y="%i" width="%...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put_label(i):\n i = min(i, len(x)-2)\n dx = sx[i+1] - sx[i]\n dy = sy[i+1] - sy[i]\n rotation = np.rad2deg(math.atan2(dy, dx)) + rotation_offset\n pos = [(x[i] + x[i+1])/2. + offset[0], (y[i] + y[i+1])/2 + offset[1]]\n plt.text(pos[0], pos[1], label_text, size=9, rotat...
[ "0.7264121", "0.72207683", "0.71647966", "0.70395815", "0.7019444", "0.6994132", "0.6829644", "0.66767454", "0.6491546", "0.6471871", "0.646692", "0.6456439", "0.6452432", "0.6445409", "0.64314634", "0.639197", "0.63918877", "0.638899", "0.6381818", "0.6336534", "0.6320836", ...
0.65577906
8
Draw a vertical "arc from the root" to the node at (x, y). Enclose elements in a .
def _draw_root_arc(file, x, y, height_in_units, deprel, css_class): height = height_in_units * _ARC_HEIGHT_UNIT # Start. file.write(u' <g class="%s">\n' % css_class) # Path. path = 'M %i %i L %i %i' % (x, y, x, y - height) file.write(u' <path d="%s" class="arc" />\n' % path) fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _draw_arc(file, start_x, end_x, y, height_in_units, deprel, css_class):\n height = height_in_units * _ARC_HEIGHT_UNIT\n radius = _arc_radius(height_in_units)\n length = _arc_min_length(height_in_units)\n\n # Start.\n file.write(u' <g class=\"%s\">\\n' % css_class)\n\n # Path.\n path =...
[ "0.64772046", "0.64068234", "0.62226677", "0.61593276", "0.6059894", "0.58969045", "0.58713514", "0.586212", "0.5840232", "0.5805969", "0.57956517", "0.56697184", "0.5667503", "0.5664292", "0.56430775", "0.5603307", "0.5598331", "0.55746675", "0.55711836", "0.55608064", "0.55...
0.7157346
0
Draw an arc from the node at (start_x, y) to the node at (end_x, y). Enclose elements in a .
def _draw_arc(file, start_x, end_x, y, height_in_units, deprel, css_class): height = height_in_units * _ARC_HEIGHT_UNIT radius = _arc_radius(height_in_units) length = _arc_min_length(height_in_units) # Start. file.write(u' <g class="%s">\n' % css_class) # Path. path = ( 'M %.2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arc_n(self, xn ,yn, rn, start, stop):\n x = round(xn * self.width)\n y = round(yn * self.height)\n r = round(rn * min(self.width, self.height))\n self.arc(x, y, r, start, stop)", "def draw_arc(ax, center, height, width, theta1=0, theta2=numpy.pi, color='k', direction='down',\n ...
[ "0.70424855", "0.69551045", "0.6952669", "0.688913", "0.6807394", "0.66460675", "0.6618592", "0.6547217", "0.65388316", "0.6534261", "0.6514192", "0.6471966", "0.64710987", "0.6460161", "0.6459329", "0.6446214", "0.64154017", "0.6335754", "0.63317806", "0.625453", "0.6236552"...
0.7387968
0
Draw an arrow with a tip at (tip_x, tip_y), "attacking" the surface at a given angle.
def _draw_arrow(file, tip_x, tip_y, angle): # Offset the tip. tip_x -= _ARROW_SIZE * 0.2 * math.cos(angle) tip_y += _ARROW_SIZE * 0.2 * math.sin(angle) # Draw the arrow. path = ( 'M %.2f %.2f' 'L %.2f %.2f' 'L %.2f %.2f' 'L %.2f %.2f' 'Z' ) % ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_arrow(dc, fr, to, tail_angle, tail_length):\r\n end_x, end_y = to[0], to[1]\r\n vec = -(to - fr)\r\n vec = vec.normalized()\r\n tail_1 = vec.rotated(tail_angle) * tail_length\r\n tail_2 = vec.rotated(-tail_angle) * tail_length\r\n dc.DrawLine(end_x, end_y, end_x+tail_1[0], end_y+tail_1[1...
[ "0.6208793", "0.60975254", "0.60448563", "0.60122025", "0.5948734", "0.5920215", "0.5909208", "0.5828393", "0.57645756", "0.5744468", "0.5715196", "0.5706364", "0.56345356", "0.56342465", "0.5627154", "0.5548939", "0.54402685", "0.5438652", "0.53856605", "0.5363015", "0.53515...
0.7083311
0
Object representation into json Returns;
def __repr__(self): return json.dumps(self.__dict__)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_json(self):", "def json_friendly(self):", "def to_json(self):\n pass", "def serialize(self, obj):\n return json.dumps(obj)", "def json(self):\n class ExtendedJSONEncoder(json.JSONEncoder):\n def default(self, obj):\n if isinstance(obj, datetime.date) or...
[ "0.799896", "0.7658569", "0.7402277", "0.73150796", "0.7264073", "0.7256318", "0.7240075", "0.71770257", "0.7169451", "0.7150388", "0.71494526", "0.7145647", "0.7123351", "0.7119767", "0.70871913", "0.7080076", "0.70696765", "0.70595527", "0.705732", "0.7001852", "0.6998944",...
0.0
-1
Run task on specified `builder`.
def run(self, builder, retry): time_start = time.time() self.date_start = utils.strdate() if self.require: raise TaskDependenciesError("Task {} can't run. Requires {}"\ .format(self.tid, ', '.join(self.require))) try: self.results = getattr(builde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self, builder):\n\n # Change to the test directory\n os.chdir(builder.stage_dir)\n self.logger.debug(f\"Changing to directory {builder.stage_dir}\")\n\n run_cmd = self.cmd + [os.path.basename(builder.build_script)]\n run_cmd = \" \".join(run_cmd)\n\n # ---------- S...
[ "0.59340215", "0.59032077", "0.5841938", "0.58288544", "0.57701546", "0.56623113", "0.54032415", "0.5359394", "0.5356444", "0.53439844", "0.5296021", "0.528549", "0.52820635", "0.5263518", "0.52304286", "0.5229381", "0.5182776", "0.5178227", "0.5171122", "0.5161379", "0.51545...
0.6643704
0
Is the task runnable
def is_runnable(self): return self.state == self.STATE_INIT and not self.require
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_runnable(self):\n \n if len(target_tasks) < 1: \n return False\n # check task names?\n \n if self.run_folder is None or \\\n not os.path.exists(self.run_folder) or \\\n not os.path.exists(os.path.join(self.run_folder, self.run_id, 'SampleSh...
[ "0.73557484", "0.71910566", "0.71346843", "0.6990803", "0.6896121", "0.6896121", "0.6868695", "0.67810875", "0.6776982", "0.66866755", "0.6680824", "0.665087", "0.66431415", "0.66022867", "0.6563005", "0.6540378", "0.65363276", "0.6515555", "0.6485275", "0.6474582", "0.645360...
0.7445494
0
Check if a task is finnished
def is_finished(self): return self.state != self.STATE_INIT and self.state != self.STATE_READY
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_task_stagnant(task):", "def task_succeed(json_raw):\n rally_report = json.loads(json_raw)\n tasks = rally_report.get('tasks')\n if tasks:\n for task in tasks:\n if task.get('status') != 'finished' or \\\n task.get('pass_sla') is not True:\n ...
[ "0.72337425", "0.6817414", "0.66699123", "0.66345733", "0.6586728", "0.65562165", "0.6518176", "0.6507567", "0.6454811", "0.6445249", "0.6433979", "0.64289474", "0.6370663", "0.6345039", "0.6315901", "0.6314589", "0.63130414", "0.62983197", "0.628415", "0.6283269", "0.6277551...
0.0
-1
Update task childs When a task state changes, update childs. If the task success, remove dependencies on childs otherwise mark childs states with STATE_DEPENDENCY
def update_childs(self, _tasks): tasks = copy.deepcopy(_tasks) for child in tasks.keys(): # only process init state tasks if tasks[child].state != self.STATE_INIT: continue # if erased and none if not tasks[child].require: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, request, pk=None):\n child_task = self.get_object()\n serializer = ChildTaskSerializer(data=request.data)\n parent_task_id = serializer.data['parent_task_id']\n if serializer.is_valid():\n # Request passed validation.\n response = super(ChildTaskVi...
[ "0.66115755", "0.61238635", "0.59749055", "0.587335", "0.57489765", "0.5735887", "0.57200396", "0.5662248", "0.56386054", "0.56310064", "0.56048024", "0.5558004", "0.5553909", "0.5491969", "0.54777765", "0.5447478", "0.5438334", "0.5404273", "0.5398509", "0.5397731", "0.53831...
0.75299466
0
Helper function for querying newest predictors
def get_predictors(newest=True, **kwargs): if newest: predictor_ids = db.session.query( func.max(Predictor.id)).group_by(Predictor.name) else: predictor_ids = db.session.query(Predictor.id) if 'run_id' in kwargs: # This following JOIN can be slow predictor_ids = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status_quo_model(X):\n\n def mostrecent(x):\n x = x[x.notnull()]\n if len(x) > 0:\n return x.iloc[-1]\n else:\n return 0\n preds = X.apply(mostrecent, axis=1)\n\n return preds", "def get_latest_model():\n return get_models()[-1]", "def fetch_latest_rou...
[ "0.6160301", "0.57882196", "0.5635682", "0.54638565", "0.54508704", "0.5402498", "0.53701395", "0.5270943", "0.5247883", "0.5204437", "0.51682633", "0.5162629", "0.5126087", "0.50463015", "0.5031413", "0.5011624", "0.5008288", "0.50078815", "0.49992976", "0.4983294", "0.49757...
0.6798848
0
Check some conventions for class declaration and add it to MATRIX_TYPES.
def register_mat_type(cls): base = "Prox" assert issubclass(cls, ProxBase), "Must be a subclass of ProxBase." assert cls.__name__.startswith(base), "Make sure to start your class name with %s." % (base, ) MATRIX_TYPES[cls.__name__[len(base):]] = cls return cls
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_check_types():", "def create_data_types(self):\n for col in self.all_columns:\n try:\n if float(self.train[col].iloc[-3]):\n self.train[col] = self.train[col].astype(np.float32)\n except:\n pass\n self.d_types = self.tra...
[ "0.55636877", "0.55425423", "0.54069316", "0.53332627", "0.5255422", "0.5248838", "0.52114916", "0.5197763", "0.51575273", "0.51413214", "0.51304966", "0.5114597", "0.5092314", "0.5090019", "0.507949", "0.5064494", "0.5049244", "0.5039898", "0.5020227", "0.50085855", "0.50085...
0.55065656
2
Convert adjacency matrix to format suitable for Cooccurrences model.
def _adj_to_feat(self, role2ind: Dict[int, int], token2ind: Dict[int, int], mat) -> Tuple: roles = sorted(role2ind, key=role2ind.get) roles = ["RoleId_%d" % role for role in roles] tokens = sorted(token2ind, key=token2ind.get) return roles + tokens, mat
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def formAdjacencyMatrix(self):\n self.adjacencyMatrix = dict()\n for i in self.node:\n self.adjacencyMatrix[i] = dict()\n for j in self.node:\n self.adjacencyMatrix[i][j] = 0\n \n for ij in self.link:\n self.adjacencyMatrix[self.link[ij].tail][self.link[ij]...
[ "0.6812465", "0.67126846", "0.65021217", "0.6407358", "0.63938165", "0.6392823", "0.6228346", "0.613841", "0.61353105", "0.61353105", "0.61353105", "0.61353105", "0.61353105", "0.6115678", "0.6061505", "0.60569936", "0.6053248", "0.6036972", "0.6013883", "0.6004805", "0.60019...
0.0
-1
Decorator for multiple trial of the test case. The decorated test case is launched multiple times. The case is judged as passed at least specified number of trials. If the number of successful trials exceeds `min_success`, the remaining trials are skipped.
def repeat_with_success_at_least(times, min_success): assert times >= min_success def _repeat_with_success_at_least(f): @functools.wraps(f) def wrapper(*args, **kwargs): assert len(args) > 0 instance = args[0] assert isinstance(instance, unittest.TestCase) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test(numTrials):\n # Your Code Here\n hits = 0.0\n for i in range(numTrials):\n result = trial()\n #print result\n hits += result\n return hits / numTrials", "def main(num_trials, num_actions):\n\tfor i in xrange(int(num_trials)):\n\t\ttrial(i+1, int(num_actions))", "def th...
[ "0.61784405", "0.61314857", "0.596407", "0.59254247", "0.5910247", "0.58234215", "0.58015466", "0.5779273", "0.5725785", "0.57112896", "0.565361", "0.55590385", "0.5535777", "0.5398447", "0.53845537", "0.5376214", "0.5375111", "0.5372522", "0.5372075", "0.53648865", "0.536413...
0.7441564
0
Decorator that imposes the test to be successful in a row. Decorated test case is launched multiple times. The case is regarded as passed only if it is successful specified times in a row.
def repeat(times, intensive_times=None): if intensive_times is None: return repeat_with_success_at_least(times, times) casual_test = bool(int(os.environ.get('CUPY_TEST_CASUAL', '0'))) times_ = times if casual_test else intensive_times return repeat_with_success_at_least(times_, times_)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repeat_with_success_at_least(times, min_success):\n\n assert times >= min_success\n\n def _repeat_with_success_at_least(f):\n @functools.wraps(f)\n def wrapper(*args, **kwargs):\n assert len(args) > 0\n instance = args[0]\n assert isinstance(instance, unitte...
[ "0.72282165", "0.5893259", "0.5893259", "0.58438414", "0.5840127", "0.5832044", "0.5789604", "0.570743", "0.56748116", "0.5672933", "0.56607103", "0.564322", "0.56301177", "0.5628773", "0.5611231", "0.56013286", "0.5548431", "0.5542579", "0.5527588", "0.5468622", "0.54141116"...
0.0
-1
Decorator that imposes the test to be successful at least once. Decorated test case is launched multiple times. The case is regarded as passed if it is successful at least once.
def retry(times): return repeat_with_success_at_least(times, 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repeat_with_success_at_least(times, min_success):\n\n assert times >= min_success\n\n def _repeat_with_success_at_least(f):\n @functools.wraps(f)\n def wrapper(*args, **kwargs):\n assert len(args) > 0\n instance = args[0]\n assert isinstance(instance, unitte...
[ "0.6898724", "0.6600555", "0.6360581", "0.6360581", "0.6300756", "0.6187742", "0.6149502", "0.60974175", "0.60415596", "0.6039456", "0.6007458", "0.59917194", "0.59881485", "0.59328115", "0.5917926", "0.5913737", "0.5906948", "0.5901848", "0.58891857", "0.5841937", "0.5839205...
0.0
-1
Check field to win
def check_win(game_field): if (game_field[0] != ' ') and (game_field[0] == game_field[1] == game_field[2]): return game_field[0] elif (game_field[3] != ' ') and (game_field[3] == game_field[4] == game_field[5]): return game_field[3] elif (game_field[6] != ' ') and (game_field[6] == game_fiel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def WinCheck(field):\n for i in range(len(field)):\n if field[i] == 2048:\n return True\n return False", "def hasWin(self) :\n comparison = self.compareNumberUser()\n if (comparison == 'equal') :\n return True\n else :\n return False", "def _ch...
[ "0.6859255", "0.64502525", "0.64117455", "0.6401923", "0.6345855", "0.62657017", "0.62467015", "0.62204844", "0.62164706", "0.6021899", "0.5994172", "0.59842855", "0.59764385", "0.5944389", "0.593727", "0.5928098", "0.5926611", "0.59181637", "0.59166956", "0.58986425", "0.589...
0.6655412
1
receive user input and return move key or confirm choice
def user_input(): key = input('Move position or press y to do turn: ') if key == 'w' or 's' or 'd' or 'a' or 'y': return key elif key == 'h': print('There is no help yet') else: print('Need help? Press "h"') return user_input()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_choice():\n move = input('Where would you like to move? (Use N, S, E, W to move North, South, East or West.) \\n')\n return move.capitalize()", "def askMove(self,posibleMoves):\n print(\"Where will you move?\")\n while True:\n pos = raw_input(\"Type Colum and Row 'CR' Ex:a...
[ "0.70844096", "0.68121403", "0.6759099", "0.6759018", "0.6693364", "0.6693364", "0.6693364", "0.6686266", "0.66857535", "0.6581062", "0.652651", "0.65197897", "0.6514418", "0.64933616", "0.64899606", "0.6466338", "0.64507335", "0.64295095", "0.6406177", "0.6397167", "0.638439...
0.70637566
1
scale the input image to the specific size by using bilinear interpolation
def scale(input_img, size): width, height = size old_height, old_width = input_img.shape x_scale = float(height) / old_height y_scale = float(width) / old_width output_img = np.zeros((height, width), dtype=np.uint8) for xidx in xrange(height): old_x = float(xidx) / x_scale for y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scale_image(self, pixels, size):\n x_min, x_max = np.amin(pixels[:,0]), np.amax(pixels[:,0])\n y_min, y_max = np.amin(pixels[:,1]), np.amax(pixels[:,1])\n z_min, z_max = np.amin(pixels[:,2]), np.amax(pixels[:,2])\n \n pixels[:,0] -= x_min \n pixels[:,1] -= y_min\n ...
[ "0.7530757", "0.7487166", "0.7231397", "0.710274", "0.6902195", "0.68922347", "0.67708784", "0.67459106", "0.6726698", "0.67057925", "0.6663453", "0.6641842", "0.65853053", "0.65753484", "0.65709734", "0.6562367", "0.65519804", "0.655139", "0.65492624", "0.64551073", "0.64065...
0.804545
0
Make a signature that will be used for the constructor of the Structure
def make_signature(names, required, additional_properties, bases_params_by_name): non_default_args_for_class = OrderedDict( [ (name, Parameter(name, Parameter.POSITIONAL_OR_KEYWORD)) for name in names if name in required ] ) non_default_args_for_bases = O...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_signature(func_name, restype, argtypes):\n global cfi\n f = getattr(cfi, func_name)\n f.restype = restype\n f.argtypes = argtypes", "def make_signature(self, data, classes=None): \n raise NotImplementedError", "def handle_signature(self, sig, signode):\n\n sig_match = rust_a...
[ "0.67649955", "0.6748138", "0.62753767", "0.62733954", "0.62205595", "0.6208152", "0.61552846", "0.6111243", "0.60572535", "0.60572535", "0.60572535", "0.60314375", "0.5854847", "0.5817568", "0.57975745", "0.57575345", "0.572025", "0.56700957", "0.5659344", "0.56551206", "0.5...
0.5923225
12
Extract the parameters from all the base classes to support inheritance of Structures.
def get_base_info(bases): bases_params = OrderedDict() bases_required = [] base_structures = [ base for base in bases if issubclass(base, Structure) and base is not Structure ] for base in base_structures: for k, param in getattr(base, "__signature__").parameters.items(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_params(cls):\n the_classes = cls.mro()\n params = odict()\n for the_class in the_classes:\n for key, val in the_class.__dict__.items():\n if isinstance(val, Parameter):\n params[key] = val\n return params", "def _get_derived_parame...
[ "0.6480872", "0.6387825", "0.6387825", "0.6316849", "0.5984677", "0.5930033", "0.5876679", "0.58338517", "0.58183604", "0.5752015", "0.5737816", "0.5660116", "0.5644318", "0.56097096", "0.55356723", "0.5527715", "0.5501345", "0.54906714", "0.54674923", "0.54569507", "0.544304...
0.70361996
0
convert to string or a list of strings
def as_str(the_val): if hasattr(the_val, "__iter__"): return "[{}]".format(", ".join([str(v) for v in the_val])) return str(the_val)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str_or_list(value):\n if isinstance(value, list):\n return value\n return [value]", "def _strings_to_list(one_or_more_strings):\n if isinstance(one_or_more_strings, str):\n return [one_or_more_strings]\n else:\n return list(one_or_more_strings)", "def _arg_to_str_list(arg: ...
[ "0.74122554", "0.7048533", "0.6944346", "0.67461395", "0.65838027", "0.6525629", "0.6525177", "0.65212876", "0.649296", "0.6492582", "0.6481708", "0.6453794", "0.6448759", "0.64282435", "0.63953394", "0.6367725", "0.636742", "0.6350239", "0.63342106", "0.63309085", "0.6321552...
0.62606215
22
Parses a list of path names for path keys.
def _parse_path(p_names): gnmi_elems = [] for word in p_names: word_search = _RE_PATH_COMPONENT.search(word) if not word_search: # Invalid path specified. raise XpathError('xpath component parse error: %s' % word) if word_search.group('key') is not None: # A path key was provided. tmp_key ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ParsePath(p_names: Iterable[Text]) -> gnmi_pb2.Path:\n gnmi_elems = []\n for word in p_names:\n word_search = _RE_PATH_COMPONENT.search(word)\n if not word_search: # Invalid path specified.\n raise XpathError('xpath component parse error: %s' % word)\n if word_search.group('key') is not None: ...
[ "0.6744838", "0.643762", "0.6129683", "0.6027652", "0.5850749", "0.5803134", "0.5716737", "0.56847453", "0.56610566", "0.56403434", "0.56000715", "0.55541354", "0.5528111", "0.552703", "0.5489616", "0.5481644", "0.5437132", "0.5436902", "0.54319805", "0.542672", "0.54056877",...
0.7012274
0
All this really does is add the devices into a python list! Parses the xpath names. This takes an input string and converts it to a list of gNMI Path names. Those are later turned into a gNMI Path Class object for use in the Get/SetRequests.
def _path_names(xpath): if not xpath or xpath == '/': # A blank xpath was provided at CLI. return [] return xpath.strip().strip('/').split('/') # Remove leading and trailing '/'. For example it turns it into ['interfaces', 'interface[name=Ethernet1]', 'state', 'counters']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_path(p_names):\n gnmi_elems = []\n for word in p_names:\n word_search = _RE_PATH_COMPONENT.search(word)\n if not word_search: # Invalid path specified.\n raise XpathError('xpath component parse error: %s' % word)\n if word_search.group('key') is not None: # A path key was provided.\n ...
[ "0.60383373", "0.58014375", "0.5726008", "0.56360483", "0.55687326", "0.55472445", "0.5278853", "0.5220772", "0.5136307", "0.51119274", "0.5111663", "0.5092509", "0.5083667", "0.50776213", "0.5030007", "0.5019841", "0.4971111", "0.49702564", "0.49412", "0.49258375", "0.490256...
0.64530164
0
Get the gNMI val for path definition.
def _get_val(json_value): val = gnmi_pb2.TypedValue() if '@' in json_value: try: set_json = json.loads(six.moves.builtins.open( json_value.strip('@'), 'rb').read()) except (IOError, ValueError) as e: raise JsonReadError('Error while loading JSON: %s' % str(e)) val.json_ietf_val = j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mn_get_errdef_ ( self ) :\n return _mn_stat_ ( self ) ['ERRDEF']", "def _sysfs_gpio_value_path(self) -> str:\n return SYSFS_GPIO_VALUE_PATH % self.number", "def getvalue(self,num,name):\n return self.M.conf(num)[name]", "def xpath_get(self, path, dtype=str, default=None):\n items...
[ "0.54860014", "0.5419368", "0.5391605", "0.53698635", "0.5327229", "0.52489007", "0.5220476", "0.514872", "0.5135619", "0.51132995", "0.5089152", "0.5076575", "0.504162", "0.50249386", "0.5013237", "0.50073", "0.4996823", "0.49759886", "0.4968135", "0.4957804", "0.49576333", ...
0.0
-1
Creates a gNMI Stub.
def _create_stub(target, port): channel = gnmi_pb2_grpc.grpc.insecure_channel(target + ':' + port) return gnmi_pb2_grpc.gNMIStub(channel)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createRotoNodeMI():\n return gs()", "def CreateStub(creds: grpc.ssl_channel_credentials,\n target: Text,\n port: Text,\n host_override: Optional[Text] = None) -> gnmi_pb2_grpc.gNMIStub:\n if host_override:\n channel = grpc.secure_channel(target + ':' + port, c...
[ "0.61915773", "0.6070097", "0.6048654", "0.5815189", "0.5606532", "0.54397595", "0.54164815", "0.536739", "0.5323115", "0.5196695", "0.51673496", "0.51654017", "0.51477623", "0.5134972", "0.5129161", "0.50861603", "0.5079436", "0.50461864", "0.50413865", "0.5032544", "0.50237...
0.73616546
0
Create a gNMI GetRequest.
def _get(stub, paths, username, password): if username: # User/pass supplied for Authentication. return stub.Get( gnmi_pb2.GetRequest(path=[paths], encoding='JSON_IETF'), metadata=[('username', username), ('password', password)]) return stub.Get(gnmi_pb2.GetRequest(path=[paths], encoding='JSON_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createRequest(self):\n self.get_bmc_website()\n self.__createChangeRequest = Create(self.browser)\n self.__createChangeRequest.createNCR()", "def req():\n return Request()", "def newRequest(self):\n return Request( )", "def _get_request(url, params):\n request = requests...
[ "0.6275348", "0.6039188", "0.5644295", "0.5601162", "0.55611426", "0.5554668", "0.55537415", "0.55537415", "0.55537415", "0.55537415", "0.55537415", "0.55537415", "0.55537415", "0.55537415", "0.55537415", "0.55537415", "0.55537415", "0.55537415", "0.55537415", "0.55537415", "...
0.0
-1
Normalized DTW distance of match. Normalization is the DTW distance divided by the query length.
def value(self): return self.alignment.matching[self.idx]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_norm_distance(length: int, distance: float) -> float:\n return distance/(length*2)", "def norm_distance(self):\n graph_size = self.N + self.M\n return self.distance() / (1. * graph_size)", "def distance(self):\n return self.value * len(self.alignment.query)", "def _get_distanc...
[ "0.6603236", "0.65938926", "0.6180144", "0.6038773", "0.5947053", "0.59462976", "0.5937442", "0.59329134", "0.5930879", "0.59043634", "0.58797866", "0.58697975", "0.58553916", "0.58475196", "0.58244836", "0.58004606", "0.57862604", "0.5781636", "0.57628703", "0.57606786", "0....
0.0
-1
DTW distance of match. This value is dependent on the length of the query. Use the value property when comparing queries of different lengths.
def distance(self): return self.value * len(self.alignment.query)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(self) -> float:\n return self._dist_two_wire() # at this time we only support 2-wire meausre", "async def distance(self):\n return round(await self._rpc.distance(), 2)", "def get_distance(self) -> int:\n return self.get_measurement_data().distance", "def distance(self):\n ...
[ "0.6928184", "0.68774277", "0.6728091", "0.66035616", "0.65458184", "0.65157306", "0.64634323", "0.6341544", "0.6227368", "0.6217934", "0.6202405", "0.6184627", "0.61629593", "0.6140443", "0.6025408", "0.5916094", "0.59097636", "0.59070665", "0.59023696", "0.58621186", "0.585...
0.72271866
0
Matched segment in series.
def segment(self): start = self.alignment.matching_function_startpoint(self.idx) end = self.alignment.matching_function_endpoint(self.idx) return [start, end]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def segment(data):", "def inters_segment(self, s):\r\n if (self.m == s.m) and (self.n == s.n):\r\n # The segment s is over this segment. Return the middle point\r\n x = (self.start[0] + self.end[0]) / 2\r\n y = (self.start[1] + self.end[1]) / 2\r\n elif self.m == s....
[ "0.63851285", "0.636012", "0.5928439", "0.57494164", "0.57120156", "0.5710203", "0.5703304", "0.56625986", "0.5658319", "0.56185806", "0.5548253", "0.55100864", "0.5505265", "0.55011165", "0.549471", "0.5462471", "0.5416681", "0.5410249", "0.54036164", "0.5403587", "0.5396656...
0.56756234
7
Matched path in series
def path(self): return self.alignment.matching_function_bestpath(self.idx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_paths(self, start_key, target_key):\n\n stack = [(start_key, [start_key])]\n while stack:\n node_key, path = stack.pop()\n node = self.nodes[node_key]\n for nxt in node.neighbors - set(path):\n if nxt == target_key:\n yield p...
[ "0.59405094", "0.591103", "0.57794636", "0.5735956", "0.57198715", "0.5684821", "0.56824625", "0.56819975", "0.56717503", "0.566512", "0.5641157", "0.56369686", "0.56321734", "0.5628646", "0.56255174", "0.5623009", "0.5602458", "0.56013024", "0.5598196", "0.55957115", "0.5581...
0.5848285
2
Get matrix with all warping paths. If the aligmnent was computed using a compact, the paths are first copied into a full warping paths matrix.
def warping_paths(self): return self.paths
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def OptimalWarpingPath( self, colStart=None ):\n rows = len(self.D)\n cols = len(self.D[0])\n n = rows-1\n m = cols-1\n if colStart:\n m=colStart\n path = [(n,m)]\n while n > 0 or m > 0:\n if n == 0 :\n path.insert(0,(0,m-1))\n ...
[ "0.57083774", "0.55504566", "0.5493086", "0.5358879", "0.534058", "0.5296055", "0.5175524", "0.51565313", "0.5116445", "0.5079303", "0.50442624", "0.5040348", "0.50351185", "0.5022339", "0.50113636", "0.49944746", "0.49744827", "0.49310946", "0.4899484", "0.48985958", "0.4893...
0.61657995
0
The matching score for each endpoint of a possible match.
def matching_function(self): return self.matching
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def match_score(self):\n return self._match_score", "def process_matches(matches: List[EndpointMatch]) -> List[Result] :\n out=[]\n #sort data\n sort_f = lambda match: match.endpoint_1.name\n sorted_matches = sorted(matches, key = sort_f)\n #group by endpoint 1\n for key, group in iterto...
[ "0.7035574", "0.6779627", "0.65998214", "0.64877146", "0.6409186", "0.6369248", "0.63564235", "0.6307807", "0.6299877", "0.6294158", "0.6294158", "0.6275924", "0.61757773", "0.6149975", "0.6143561", "0.6095175", "0.60838723", "0.60640055", "0.605235", "0.60385066", "0.6019981...
0.5605125
71
Yields the next best match. Stops at k matches (use None for all matches).
def kbest_matches(self, k=1, overlap=0): self.align() matching = np.array(self.matching) maxv = np.ceil(np.max(matching) + 1) matching[:min(len(self.query) - 1, overlap)] = maxv ki = 0 while k is None or ki < k: best_idx = np.argmin(matching) if be...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kbest_matches(self, k=1):\n self.align(k=k)\n # if k is None:\n # return [SSMatch(best_idx, self) for best_idx in range(len(self.distances))]\n # if self.keep_all_distances:\n # best_idxs = np.argpartition(self.distances, k)\n # return [SSMatch(best_idx, se...
[ "0.70543814", "0.6908173", "0.63451654", "0.6075485", "0.58968025", "0.58009946", "0.57997376", "0.5776829", "0.57495296", "0.5703111", "0.556711", "0.556711", "0.55580676", "0.55529094", "0.55048394", "0.54525316", "0.54502773", "0.5401287", "0.53894967", "0.5379987", "0.535...
0.764717
0
Matched segment in series.
def matching_function_segment(self, idx): start = self.matching_function_startpoint(idx) end = self.matching_function_endpoint(idx) return [start, end]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def segment(data):", "def inters_segment(self, s):\r\n if (self.m == s.m) and (self.n == s.n):\r\n # The segment s is over this segment. Return the middle point\r\n x = (self.start[0] + self.end[0]) / 2\r\n y = (self.start[1] + self.end[1]) / 2\r\n elif self.m == s....
[ "0.63851285", "0.636012", "0.5928439", "0.57494164", "0.5710203", "0.5703304", "0.56756234", "0.56625986", "0.5658319", "0.56185806", "0.5548253", "0.55100864", "0.5505265", "0.55011165", "0.549471", "0.5462471", "0.5416681", "0.5410249", "0.54036164", "0.5403587", "0.5396656...
0.57120156
4
Index in series for end of match in matching function at idx.
def matching_function_endpoint(self, idx): if len(self.matching) == len(self.series): return idx diff = len(self.series) - len(self.matching) return idx + diff
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matching_function_startpoint(self, idx):\n real_idx = idx + 1\n path = dtw.best_path(self.paths, col=real_idx)\n start_idx = path[0][1]\n return start_idx", "def return_index(self, idx):\n return (\n self.timeseries[:, idx],\n self.ch_amount,\n ...
[ "0.6543316", "0.6367245", "0.6301939", "0.6193361", "0.6084704", "0.604178", "0.6038365", "0.59744316", "0.5873895", "0.5802779", "0.5789299", "0.57315546", "0.5716819", "0.5716819", "0.5716819", "0.5696154", "0.56579256", "0.5647888", "0.5644456", "0.5643995", "0.5639753", ...
0.76498044
0
Index in series for start of match in matching function at idx.
def matching_function_startpoint(self, idx): real_idx = idx + 1 path = dtw.best_path(self.paths, col=real_idx) start_idx = path[0][1] return start_idx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matching_function_endpoint(self, idx):\n if len(self.matching) == len(self.series):\n return idx\n diff = len(self.series) - len(self.matching)\n return idx + diff", "def return_index(self, idx):\n return (\n self.timeseries[:, idx],\n self.ch_amou...
[ "0.73175603", "0.6497857", "0.6373355", "0.63612413", "0.6209229", "0.6074658", "0.59414655", "0.5822107", "0.58188355", "0.5815306", "0.57833564", "0.5764828", "0.5758278", "0.5715285", "0.5713959", "0.56651026", "0.5658479", "0.565782", "0.5641599", "0.56098294", "0.5585502...
0.76478
0
Indices in series for best path for match in matching function at idx.
def matching_function_bestpath(self, idx): real_idx = idx + 1 path = dtw.best_path(self.paths, col=real_idx) return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matching_function_startpoint(self, idx):\n real_idx = idx + 1\n path = dtw.best_path(self.paths, col=real_idx)\n start_idx = path[0][1]\n return start_idx", "def matching_function_endpoint(self, idx):\n if len(self.matching) == len(self.series):\n return idx\n ...
[ "0.6690884", "0.6565373", "0.6028413", "0.5854189", "0.56420803", "0.5517227", "0.5480761", "0.5445093", "0.543877", "0.5414658", "0.540015", "0.53611726", "0.53540796", "0.5341432", "0.53364134", "0.53286445", "0.52923155", "0.52770895", "0.5264886", "0.5238736", "0.52386314...
0.68909335
0
Local concurrences, see LocalConcurrences.
def local_concurrences(series1, series2=None, gamma=1, tau=0, delta=0, delta_factor=1, estimate_settings=None, only_triu=False, penalty=None, window=None): lc = LocalConcurrences(series1, series2, gamma, tau, delta, delta_factor, only_triu=only_triu, penalty=penalty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_local_school_composition(self):\n # get the composition of the students in the neighbourhood\n\n local_composition = get_counts_util(students=self.students, model=self.model)\n\n self.local_composition = local_composition\n\n self.current_capacity = np.sum(self.local_composition...
[ "0.60490185", "0.60490185", "0.60156554", "0.565439", "0.5614832", "0.5524443", "0.53362507", "0.5183139", "0.5157542", "0.51443374", "0.51101583", "0.51035136", "0.50987923", "0.5077436", "0.5068534", "0.505619", "0.5055168", "0.5046074", "0.5033463", "0.50281024", "0.501018...
0.60815006
0
Yields the next best match. Stops at k matches (use None for all matches).
def kbest_matches(self, k=1, minlen=2, buffer=0): ki = 0 while k is None or ki < k: idx = None lcm = None while idx is None: idx = np.unravel_index(np.argmax(self._wp, axis=None), self._wp.shape) if idx[0] == 0 or idx[1] == 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kbest_matches(self, k=1, overlap=0):\n self.align()\n matching = np.array(self.matching)\n maxv = np.ceil(np.max(matching) + 1)\n matching[:min(len(self.query) - 1, overlap)] = maxv\n ki = 0\n while k is None or ki < k:\n best_idx = np.argmin(matching)\n ...
[ "0.7646963", "0.70550805", "0.63452125", "0.6075674", "0.58965683", "0.58014125", "0.5800323", "0.5776327", "0.57494646", "0.57036394", "0.556718", "0.556718", "0.5560365", "0.5552767", "0.5505271", "0.54529965", "0.54505706", "0.54012245", "0.53904915", "0.538011", "0.535193...
0.69067085
2
Search the best matching (subsequence) time series compared to a given time series.
def __init__(self, query, s, dists_options=None, use_lb=True, keep_all_distances=False, max_dist=None, max_value=None, use_c=None, use_ndim=None): self.query = query if use_ndim is None: self.use_ndim = (util.detect_ndim(query) > 1) else: self.use_ndim = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simsearch_non_exist(self, input_ts, n):\n\n\t\tinput_ts = standardize(input_ts)\n\t\t# calc dist from input_ts to vantage points\n\t\tdist = []\n\t\tfor (vt, id) in self.vantage_pts:\n\t\t\tdist.append((calcDist(vt, input_ts), str(id)))\n\t\t# sort vantage points by distance\n\t\tdist.sort(key=lambda kv: kv[0]...
[ "0.56875837", "0.5610644", "0.55802405", "0.5507607", "0.54011166", "0.5385939", "0.53479487", "0.5211469", "0.52071184", "0.51898646", "0.5148763", "0.51333714", "0.5120546", "0.5094568", "0.508902", "0.5076198", "0.5071674", "0.50551015", "0.5047635", "0.5043175", "0.498195...
0.0
-1
Return the ith value from the kbest values.
def get_ith_value(self, i): if self.distances is None or self.k is None: raise ValueError('Align should be called before asking for the i-th value.') if i > self.k: raise ValueError('The i-th value is not available, i={}>k={}'.format(i, self.k)) return self.kbest_distance...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Kbest(kbest_init, kbest, i, iter_number, all_iter_number=None):\n iter_number = iter_number if all_iter_number is None else all_iter_number\n d = iter_number / kbest_init\n nkbest = math.ceil(abs(kbest_init - i/d))\n return nkbest", "def get_n_best(self):\n pass", "def best_value(self):\...
[ "0.683538", "0.66753155", "0.6674319", "0.64500123", "0.63540584", "0.63536274", "0.63132733", "0.62678784", "0.6219374", "0.6204914", "0.6191994", "0.6184342", "0.6169411", "0.6162491", "0.6113362", "0.60936606", "0.6074645", "0.60177016", "0.6013775", "0.6009977", "0.600826...
0.7239786
0
Return the k best matches. It is recommended to set k to a value, and not None. If k is set to None, all comparisons are kept and returned. Also no early stopping is applied in case k is None.
def kbest_matches(self, k=1): self.align(k=k) # if k is None: # return [SSMatch(best_idx, self) for best_idx in range(len(self.distances))] # if self.keep_all_distances: # best_idxs = np.argpartition(self.distances, k) # return [SSMatch(best_idx, self) for bes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kbest_matches(self, k=1, overlap=0):\n self.align()\n matching = np.array(self.matching)\n maxv = np.ceil(np.max(matching) + 1)\n matching[:min(len(self.query) - 1, overlap)] = maxv\n ki = 0\n while k is None or ki < k:\n best_idx = np.argmin(matching)\n ...
[ "0.75734186", "0.69651777", "0.64580584", "0.62036735", "0.6153091", "0.61466444", "0.5955852", "0.5941158", "0.5936029", "0.5909154", "0.5865215", "0.58565974", "0.58123106", "0.58104837", "0.58069605", "0.5760755", "0.5758019", "0.5743457", "0.57420886", "0.57395303", "0.57...
0.74664825
1
Initialize the default serializer instance.
def __init__(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_serializer(self):\n serializer = self.pyleus_config.get('serializer')\n if serializer in SERIALIZERS:\n self._serializer = SERIALIZERS[serializer](\n self._input_stream, self._output_stream)\n else:\n raise ValueError(\"Unknown serializer: {0...
[ "0.78563565", "0.74911463", "0.7031151", "0.6834225", "0.68167543", "0.65071994", "0.64760256", "0.6447599", "0.64018154", "0.63145745", "0.6253491", "0.62514484", "0.622034", "0.6200799", "0.6196979", "0.6187993", "0.61851466", "0.6144137", "0.61341083", "0.611839", "0.61169...
0.0
-1
r"""AlexNet model architecture from the
def localizer_alexnet(pretrained=False, **kwargs): model = LocalizerAlexNet(**kwargs) if pretrained is True: # load parts of pre-train state_dict_pretrain = model_zoo.load_url(model_urls['alexnet']) state_dict_new = {} for item_name, item_value in state_dict_pretrain.iteritems()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alexnet(**kwargs):\n model = AlexNet(**kwargs)\n # if pretrained:\n # model.load_state_dict(model_zoo.load_url(model_urls['alexnet']))\n return model", "def imagenet_alexnet(**kwargs):\r\n model = ImageNetAlexNet(**kwargs)\r\n return model", "def load(self, name=\"\"):\n\n self...
[ "0.6519144", "0.6468875", "0.64450973", "0.64397836", "0.631246", "0.6307277", "0.6291954", "0.6257867", "0.62547463", "0.6231065", "0.61943966", "0.614853", "0.6140133", "0.6133221", "0.6133221", "0.61192954", "0.61159253", "0.610197", "0.60987943", "0.6097791", "0.6090801",...
0.0
-1
VGG 19layer model (configuration "E")
def localizer_vggnet(pretrained=False, **kwargs): model = LocalizerVGG(make_layers(cfg['E']), **kwargs) if pretrained: model.load_state_dict(model_zoo.load_url(model_urls['vgg19'])) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_vgg():\n input_shape = (256, 256, 3)\n\n vgg = keras.applications.VGG19(include_top = False , input_shape = input_shape , weights=\"imagenet\")\n features = vgg.get_layer(index = 9).output\n\n model = keras.Model(inputs=[vgg.inputs], outputs=[features])\n return model", "def vgg19(pretr...
[ "0.7938028", "0.7352684", "0.7322909", "0.731347", "0.72912514", "0.72898996", "0.7235066", "0.72287446", "0.7197585", "0.71894604", "0.7084843", "0.707336", "0.7058049", "0.7026087", "0.7002693", "0.69967985", "0.69944525", "0.69195586", "0.6903537", "0.68565315", "0.6850008...
0.0
-1
Constructs a ResNet101 model.
def localizer_resnet(pretrained=False, **kwargs): model = LocalizerResNet(Bottleneck, [3, 4, 23, 3], **kwargs) if pretrained: model.load_state_dict(model_zoo.load_url(model_urls['resnet101'])) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet101(pretrained=False, **kwargs):\n model = ResNet(Bottleneck, [3, 4, 23, 3], **kwargs)\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['resnet101']))\n fc = transfer_fc(model.fc)\n model.fc = fc\n return model", "def resnet101(pretrained=False):\n model =...
[ "0.74078393", "0.7382251", "0.7362759", "0.7362759", "0.7362759", "0.7362759", "0.73424184", "0.7229764", "0.71670717", "0.7158963", "0.71486", "0.71486", "0.71299857", "0.70261806", "0.7023042", "0.7003144", "0.67619354", "0.6710136", "0.6650574", "0.6602656", "0.6595372", ...
0.0
-1
Drop `None` valued keys from an object.
def _drop_nulls(o): if isinstance(o, (dict, Mapping)): return {k: _drop_nulls(v) for k, v in o.items() if v is not None} elif isinstance(o, list): return [_drop_nulls(v) for v in o if v is not None] elif isinstance(o, set): return {_drop_nulls(v) for v in o if v is not None} else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_none(obj: dict):\n return remap(\n obj, visit=lambda path, key, value: key is not None and value is not None\n )", "def remove_empty_fields(obj: dict) -> dict:\n return {k: v for k, v in obj.items() if v is not None}", "def strip_empty_optional_fields(object_dict):\n return {k: v ...
[ "0.82257617", "0.7622132", "0.7455038", "0.7318793", "0.7178498", "0.71008503", "0.6978789", "0.69149274", "0.68529075", "0.68520445", "0.6845486", "0.68321306", "0.6754147", "0.674078", "0.6731009", "0.671434", "0.6638371", "0.66069853", "0.6593238", "0.6582964", "0.653182",...
0.7540454
2
Gets the marshmallow serializer for the implementing class.
def schema(cls): schema = getattr(cls, "__schema__") if schema is None: raise Exception(f"{cls.__name__}: not serializable; missing schema") return schema
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSerializer():", "def serializer(self) -> ArchiveSerializer:\n return serializer_from_dict(self.doc.get('serializer'))", "def get_serializer_class(self):\n return self.serializer_class", "def serializer_class(self):", "def serializer_for(self, obj):\n # 1-NULL serializer\n ...
[ "0.6885214", "0.68805057", "0.68130696", "0.6553876", "0.6539851", "0.65222543", "0.6462709", "0.63988924", "0.63497216", "0.6265041", "0.62470025", "0.6222195", "0.6174481", "0.6151403", "0.6135117", "0.61226743", "0.61192995", "0.61141056", "0.6104061", "0.60989475", "0.608...
0.54014117
84
Convert an implementing instance to JSON.
def to_json( self, camel_case: bool = True, pretty_print: bool = True, drop_nulls: bool = False, ) -> str: d = ( self.schema().dump(self) if camel_case else {humps.decamelize(k): v for k, v in self.schema().dump(self).items()} ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toJSON(self):\n raise NotImplementedError()", "def _trait_to_json(x, self):\n return x", "def cls2json(self):\n return json.dumps(self.__dict__)", "def cls2json(self):\n return json.dumps(self.__dict__)", "def to_json(self):\n return json.dumps(self._asdict())", "def to...
[ "0.76304615", "0.72295505", "0.71398264", "0.71398264", "0.70748025", "0.6982968", "0.6981433", "0.6967107", "0.694104", "0.69204724", "0.6879784", "0.6869435", "0.68520975", "0.68448627", "0.6821424", "0.679783", "0.6795996", "0.6789671", "0.6786653", "0.6750585", "0.6750306...
0.0
-1
Convert an implementing instance to a Python dictionary.
def to_dict(self, camel_case: bool = True): if camel_case: # camel case is used by default return self.schema().dump(self) return {humps.decamelize(k): v for k, v in self.schema().dump(self).items()}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(cls) -> dict:\n raise NotImplementedError()", "def to_dict(self):\n raise NotImplementedError('To be implemented in subclass.')", "def to_dict(self) -> dict:\n if self.actual_instance is None:\n return None\n\n to_dict = getattr(self.actual_instance, \"to_dict...
[ "0.7722431", "0.72972405", "0.72160584", "0.7203824", "0.7089014", "0.70702934", "0.6892197", "0.6865275", "0.6825165", "0.6812693", "0.67964077", "0.67964077", "0.6761097", "0.6760542", "0.6744427", "0.6713587", "0.67031294", "0.66965395", "0.6682606", "0.66673934", "0.66619...
0.0
-1
Define the main Situation Map This can then be called from both the Index page (embedded) & the Map_Viewing_Client (fullscreen)
def define_map(window=False, toolbar=False, config=None): if not config: config = gis.get_config() if not deployment_settings.get_security_map() or s3_has_role("MapAdmin"): catalogue_toolbar = True else: catalogue_toolbar = False # @ToDo: Make these configurable search = T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home():\n m = Map() # Create map html\n return render_template('index.html') # pulls map html using jinja2", "def map_page():\n m = Map() # Create map html\n return render_template('index.html') # pulls map html using jinja2", "def map_viewing_client():\n\n # Read configuration settings\n ...
[ "0.68494546", "0.6841336", "0.66321546", "0.6554362", "0.650557", "0.6486836", "0.64321727", "0.63996077", "0.6397022", "0.63146144", "0.62892425", "0.6276585", "0.62084687", "0.6158665", "0.6139917", "0.6106178", "0.61012053", "0.60764265", "0.60558933", "0.6029097", "0.6025...
0.58404505
36
RESTful CRUD controller for Locations
def location(): tablename = "%s_%s" % (module, resourcename) table = db[tablename] # Allow prep to pass vars back to the controller vars = {} # @ToDo: Clean up what needs to be done only for interactive views, # vs. what needs to be done generally. E.g. some tooltips are defined # for non...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n response = view_locations()\n return marshal(response, view_locations_model), SUCCESS", "def locations(request):\n locations = Location.objects.all()\n context = {'locations': locations}\n return render(request, 'std/Locations.html', context)", "def add_location_to_datab...
[ "0.62846005", "0.5941099", "0.58022356", "0.5732818", "0.56623435", "0.5616209", "0.56091696", "0.5553856", "0.55110383", "0.5508723", "0.5465169", "0.54390836", "0.5432776", "0.5418669", "0.5358974", "0.5351006", "0.5321775", "0.5263251", "0.5243733", "0.5202777", "0.5198896...
0.5839535
2
Handle Deduplication of Locations by comparing the ones which are closest together
def location_duplicates(): if not auth.s3_has_role(1): redirect(URL(r=request, c="default", f="index")) # @ToDo: Set this via the UI & pass in as a var dupe_distance = 50 # km # Shortcut locations = db.gis_location table_header = THEAD(TR(TH(T("Location 1")), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_nearest_location():\n locations = [(10, 20), (30, 40), (50, 60)]\n\n assert nearest_location(locations, 8) == 0\n assert nearest_location(locations, 15) == 0\n assert nearest_location(locations, 22) == 0\n\n assert nearest_location(locations, 28) == 1\n assert nearest_location(locations,...
[ "0.6515084", "0.6443725", "0.6310686", "0.62804294", "0.62343484", "0.6222334", "0.6214705", "0.61703825", "0.6148088", "0.61349726", "0.60373837", "0.6024918", "0.59760636", "0.5908262", "0.5871901", "0.58064955", "0.580585", "0.58049893", "0.57756054", "0.57671916", "0.5748...
0.0
-1
Delete references to a old record and replacing it with the new one.
def delete_location(): old = request.vars.old new = request.vars.new # Find all tables which link to the Locations table # @ToDo Replace with db.gis_location._referenced_by tables = shn_table_links("gis_location") for table in tables: for count in range(len(tables[table])): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, old):\n return self.replace(old, None)", "def clean_collection(previous_records, collection):\n for previous_record in previous_records:\n collection.delete_one({\"_ref\": previous_record})", "def unlink(self):\n self._linked = False\n self.is_dirty = Fal...
[ "0.6722188", "0.63206416", "0.6193478", "0.6067735", "0.6048706", "0.6044757", "0.59926844", "0.5902274", "0.58998084", "0.5897296", "0.5842966", "0.5819181", "0.5801957", "0.5744306", "0.571759", "0.56649935", "0.56476563", "0.5647505", "0.5632458", "0.5605677", "0.55868614"...
0.58176273
12
Opens a popup screen where the deduplication process takes place.
def location_resolve(): # @ToDo: Error gracefully if conditions not satisfied locID1 = request.vars.locID1 locID2 = request.vars.locID2 # Shortcut locations = db.gis_location # Remove the comment and replace it with buttons for each of the fields count = 0 for field in locations: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ShowPopUp(self):\n self.popup = True\n t = Timer(1.0, self.RemovePopUp)\n t.start() # after 1 second, the pop up will be removed", "def close_1(self):\n self.pop_up_del.destroy()", "def player_killed_popup(self):\n\n # creates/formats popup content\n content = Box...
[ "0.6079889", "0.59903973", "0.577682", "0.5569663", "0.5477131", "0.5393549", "0.53250754", "0.5319395", "0.5258942", "0.5247842", "0.52020067", "0.5171097", "0.51346767", "0.50580317", "0.50342005", "0.50131637", "0.50029737", "0.49837068", "0.4970867", "0.49681687", "0.4945...
0.0
-1
id the location record id Returns a JSON array of records which link to the specified location
def location_links(): try: record_id = request.args[0] except: item = s3xrc.xml.json_message(False, 400, "Need to specify a record ID!") raise HTTP(400, body=item) try: # Shortcut locations = db.gis_location deleted = (locations.deleted == False) qu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_location_by_id(self, location_id):", "def get_locations_by_ids(self, id_list):", "def get_locations(self, id_):\n with self._db_connection() as connection:\n return connection.get_locations(id_)", "def get_record(self, id: uplink.Path):\n pass", "def get(self, lid=None):\n ...
[ "0.67174894", "0.6008066", "0.58011514", "0.57892656", "0.5722104", "0.57062936", "0.5673444", "0.56674194", "0.5475068", "0.53737307", "0.5360654", "0.53458697", "0.5334068", "0.5311456", "0.5299961", "0.5287552", "0.5255019", "0.525247", "0.52420944", "0.5201093", "0.520053...
0.69435656
0
Map Service Catalogue. Allows selection of which Layers are active.
def map_service_catalogue(): if deployment_settings.get_security_map() and not s3_has_role("MapAdmin"): unauthorised() subtitle = T("List Layers") # Start building the Return with the common items output = dict(subtitle=subtitle) # Hack: We control all perms from this 1 table table = d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addServices(self):\r\n self.addHendrix()\r\n\r\n if not self.options.get('global_cache') and not self.options.get('nocache'):\r\n self.addLocalCacheService()\r\n\r\n if self.is_secure:\r\n self.addSSLService()\r\n\r\n self.catalogServers(self.hendrix)", "def ...
[ "0.56927997", "0.5558211", "0.5455615", "0.5436424", "0.5423937", "0.5407362", "0.5387539", "0.53662133", "0.531283", "0.52958256", "0.5293356", "0.5290555", "0.5283825", "0.5283825", "0.5278759", "0.52735716", "0.5246372", "0.52412826", "0.5204378", "0.5197035", "0.51858264"...
0.7492633
0
RESTful CRUD controller Deprecated? (How to link Symbology with Feature Queries?)
def feature_class(): if deployment_settings.get_security_map() and not s3_has_role("MapAdmin"): unauthorised() tablename = "%s_%s" % (module, resourcename) table = db[tablename] # Model options table.gps_marker.comment = DIV( _class="tooltip", _title="%s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api():\n from gluon.contrib.hypermedia import Collection\n rules = {\n '<tablename>': {'GET':{},'POST':{},'PUT':{},'DELETE':{}},\n }\n return Collection(db).process(request,response,rules)", "def api():\n from gluon.contrib.hypermedia import Collection\n rules = {\n '<tabl...
[ "0.63021535", "0.63021535", "0.63021535", "0.54665816", "0.5306297", "0.51899964", "0.51852626", "0.5146428", "0.5133736", "0.5106283", "0.5064291", "0.5060795", "0.50409156", "0.50372016", "0.50157815", "0.50113213", "0.50113213", "0.5009449", "0.49796224", "0.49735948", "0....
0.48194984
51
OnValidation callback to strip the module from the resource in future may build the simple Query from helpers
def feature_layer_query(form): resource = None if "resource" in form.vars: resource = form.vars.resource # Remove the module from name form.vars.resource = resource[len(form.vars.module) + 1:] #if "advanced" in form.vars: # # We should use the query field as-is # pass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def definition_validator(request):\n return validator(request, DefinitionValidator())", "def clean_scope_path(field_name):\n\n @check_field_is_empty(field_name)\n def wrapper(self):\n \"\"\"Decorator wrapper method.\n \"\"\"\n # convert to lowercase for user comfort\n scope_path = self.cleaned_d...
[ "0.54791737", "0.51245075", "0.5107239", "0.5107239", "0.5095273", "0.50353414", "0.5028772", "0.5028772", "0.49702075", "0.49682945", "0.49621952", "0.491872", "0.48250982", "0.48220852", "0.48180136", "0.48148456", "0.48021254", "0.477355", "0.4771214", "0.47633955", "0.476...
0.0
-1
RESTful CRUD controller for GPS Waypoints
def waypoint(): tablename = "%s_%s" % (module, resourcename) return s3_rest_controller(module, resourcename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def truck_new_destination(request):\n\n # Check if the request type if POST\n if request.method == \"POST\":\n # Deserialize the JSON because it will be in bytes\n body = json.loads(request.body)\n # Make success true\n body[\"success\"] = True\n result = Coordinates.object...
[ "0.6011582", "0.56452894", "0.5466609", "0.53996044", "0.53592944", "0.52812284", "0.5271507", "0.5268566", "0.5232904", "0.52319175", "0.5200802", "0.51974565", "0.5183591", "0.5177245", "0.5163129", "0.51435393", "0.51186156", "0.51055056", "0.50948495", "0.50870943", "0.50...
0.55535144
2
RESTful CRUD controller for GPS Track points
def trackpoint(): tablename = "%s_%s" % (module, resourcename) return s3_rest_controller(module, resourcename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def postPoint(request, Form):\n\tform = Form(request.POST)\n\tform.data = form.data.copy()\n\n\t# Convert coords to valid geometry\n\ttry:\n\t\tform.data['geom'] = normalizeGeometry(form.data['geom'])\n\texcept(ValueError):\n\t\t# TODO provide error message to user here\n\t\tJsonResponse({'success': False})\n\t\t#...
[ "0.5809034", "0.5650834", "0.5485648", "0.54556686", "0.54116833", "0.5347068", "0.5315559", "0.53064376", "0.52042806", "0.5170043", "0.515309", "0.51526916", "0.5140874", "0.5118063", "0.5113319", "0.51017606", "0.50763506", "0.50656134", "0.50540537", "0.50357795", "0.5021...
0.49471533
24
RESTful CRUD controller for GPS Tracks (uploaded as files)
def track(): if deployment_settings.get_security_map() and not s3_has_role("MapAdmin"): unauthorised() tablename = "%s_%s" % (module, resourcename) # Model options # used in multiple controllers, so defined in model # CRUD Strings # used in multiple controllers, so defined in model ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fileupload():\r\n response.view = 'generic.json'\r\n\r\n if not session.add_files:\r\n session.add_files = []\r\n\r\n def GET(tulip_url, file=None, deletefile=None, uploads=None, commit=None):\r\n try:\r\n tulip_url = request.args[0]\r\n tulip = Tulip(url=tulip_url)...
[ "0.5775585", "0.55965734", "0.5479527", "0.5399208", "0.53839546", "0.53149116", "0.5286183", "0.5246993", "0.5221587", "0.52108526", "0.5184614", "0.51574683", "0.5151327", "0.5146005", "0.51184344", "0.5110236", "0.50837094", "0.5052814", "0.50399965", "0.5034756", "0.50265...
0.5204354
10
Map Viewing Client. UI for a user to view the overall Maps with associated Features
def map_viewing_client(): # Read configuration settings config = gis.get_config() if config.opt_gis_layout == 1: window = True else: window = False # @ToDo Make Configurable toolbar = True map = define_map(window=window, toolbar=toolbar, config=config) response.title ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_map(self):\n self.m1.display()", "def view_map():\n print(\"\"\"\n ____________________________________Client Rooms______________________\n| |1 Locker Rooms 2| 1 | 2 | |\n| |_________ ________| | | Dance |\n| ...
[ "0.7127541", "0.67286265", "0.6691963", "0.6657234", "0.6594132", "0.6563301", "0.6557549", "0.65367615", "0.6368804", "0.6324405", "0.63240755", "0.6310753", "0.6295974", "0.6293221", "0.6289974", "0.6289065", "0.6267285", "0.62239516", "0.6221713", "0.62063324", "0.6203795"...
0.7959577
0
Cutdown version of the Map Viewing Client. Used by shn_gis_location_represent() to show just this feature on the map. Called by the s3_viewMap() JavaScript
def display_feature(): # The Feature feature_id = request.args(0) # Check user is authorised to access record if not s3_has_permission("read", db.gis_location, feature_id): session.error = T("No access to this record!") raise HTTP(401, body=s3xrc.xml.json_message(False, 401, session.er...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_viewing_client():\n\n # Read configuration settings\n config = gis.get_config()\n if config.opt_gis_layout == 1:\n window = True\n else:\n window = False\n\n # @ToDo Make Configurable\n toolbar = True\n\n map = define_map(window=window, toolbar=toolbar, config=config)\n\n...
[ "0.70388645", "0.6206016", "0.59935665", "0.5980806", "0.5953084", "0.588402", "0.58347285", "0.57914495", "0.5777059", "0.5756342", "0.5682982", "0.56562376", "0.5653656", "0.56441224", "0.5619128", "0.5595263", "0.5566024", "0.5558867", "0.5549201", "0.55468726", "0.5527164...
0.5667057
11
Cutdown version of the Map Viewing Client. Used as a link from the RHeader. URL generated serverside Shows all locations matching a query.
def display_features(): # Parse the URL, check for implicit resources, extract the primary record # http://127.0.0.1:8000/eden/gis/display_features&module=pr&resource=person&instance=1&jresource=presence ok = 0 if "module" in request.vars: res_module = request.vars.module ok +=1 if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_viewing_client():\n\n # Read configuration settings\n config = gis.get_config()\n if config.opt_gis_layout == 1:\n window = True\n else:\n window = False\n\n # @ToDo Make Configurable\n toolbar = True\n\n map = define_map(window=window, toolbar=toolbar, config=config)\n\n...
[ "0.67756677", "0.62331223", "0.5998669", "0.59628314", "0.5796065", "0.57899296", "0.5650925", "0.56401074", "0.5581914", "0.5578536", "0.5540391", "0.55384326", "0.5536463", "0.55362093", "0.5535088", "0.5525045", "0.54985315", "0.5463616", "0.5459861", "0.54495734", "0.5404...
0.0
-1
Call a Geocoder service
def geocode(): if "location" in request.vars: location = request.vars.location else: session.error = T("Need to specify a location to search for.") redirect(URL(r=request, f="index")) if "service" in request.vars: service = request.vars.service else: # @ToDo: se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geocoding(address, API_KEY=API_KEY, GEOCODE_API_URL=GEOCODE_API_URL):\n # define the parameters of the search\n params = {\n 'address': '{}'.format(address),\n 'key': API_KEY\n }\n\n # Do the request and get the response data\n response = requests.get(GEOCODE_API_URL, params=params)\n r...
[ "0.67605937", "0.66416836", "0.6609462", "0.64985216", "0.63995135", "0.6378873", "0.6299485", "0.62925833", "0.6129592", "0.60888636", "0.60519594", "0.6046673", "0.602397", "0.5928912", "0.59067833", "0.59050494", "0.58398014", "0.5806385", "0.5775408", "0.577366", "0.57714...
0.70826596
0
Custom View for GeoExplorer
def about(): return dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skinProxyGeo(self):\n\n pass", "def view(self):\n raise NotImplementedError", "def layers(self): # -> LayerView:\n ...", "def view(self):", "def home(request):\n # view_options = MVView(\n # projection='EPSG:4326',\n # center=[-70.6,18.75],\n # zoom=8,\n ...
[ "0.6319753", "0.62977684", "0.6024548", "0.59940994", "0.5963482", "0.5947566", "0.58839697", "0.5866329", "0.5845885", "0.57547957", "0.5734449", "0.57217485", "0.57103384", "0.55894476", "0.5579907", "0.55639654", "0.55572385", "0.5553838", "0.55305344", "0.5512673", "0.549...
0.0
-1
Map Save/Publish Handler for GeoExplorer
def maps(): if request.env.request_method == "GET": # This is a request to read the config of a saved map # Which map are we updating? id = request.args(0) if not id: raise HTTP(501) # Read the WMC record record = db(db.gis_wmc.id == id).select(limitby=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_map(self, save_location):\n self.map.save(save_location)", "def save_map(self, path: str):\n self.folium_map.save(path)", "def save_to_geojson(self, topology_map, filename):", "def save(self):\n if self._filename:\n with open(self._filename, 'w') as f:\n ...
[ "0.65955484", "0.65663844", "0.61429054", "0.5894037", "0.58076996", "0.5799099", "0.57216716", "0.5705162", "0.57048523", "0.57038677", "0.56936365", "0.56528556", "0.5625634", "0.5615208", "0.55805653", "0.55427307", "0.5536261", "0.5494068", "0.54426414", "0.5428568", "0.5...
0.5233776
30
Custom View for the Potlatch2 OpenStreetMap editor
def potlatch2(): if request.args(0) == "potlatch2.html": osm_oauth_consumer_key = deployment_settings.get_osm_oauth_consumer_key() osm_oauth_consumer_secret = deployment_settings.get_osm_oauth_consumer_secret() if osm_oauth_consumer_key and osm_oauth_consumer_secret: gpx_url = N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_map():\n print(\"\"\"\n ____________________________________Client Rooms______________________\n| |1 Locker Rooms 2| 1 | 2 | |\n| |_________ ________| | | Dance |\n| | | |__| |__| Fl...
[ "0.5956941", "0.5876095", "0.5870691", "0.5804954", "0.57842386", "0.57654804", "0.5738355", "0.5679043", "0.5668454", "0.5618465", "0.55423635", "0.55370593", "0.547862", "0.54725426", "0.54639965", "0.54085356", "0.54077595", "0.5403992", "0.5376458", "0.5351264", "0.534027...
0.6068055
0
Test new OpenLayers functionality in a RAD environment currently being used to trial using GeoJSON for internal feature layers
def test2(): # Internal Feature Layers feature_queries = [] feature_layers = db(db.gis_layer_feature.resource == "office").select() for layer in feature_layers: if layer.role_required and not auth.s3_has_role(layer.role_required): continue _layer = gis.get_feature_layer(laye...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_product():\n\n fiveconfigure.debug_mode = True\n import collective.geo.openlayers\n zcml.load_config('configuretest.zcml', collective.geo.openlayers)\n\n fiveconfigure.debug_mode = False", "def test_layer_API(self):\n\n # Exceptions\n exclude = ['get_topN', 'get_bins',\n ...
[ "0.654739", "0.6299019", "0.6127946", "0.58873796", "0.57860696", "0.5783082", "0.5711746", "0.56842566", "0.5647381", "0.56204945", "0.559212", "0.55821013", "0.5580289", "0.55746514", "0.557363", "0.5571923", "0.553894", "0.55071616", "0.5482145", "0.5464055", "0.54393184",...
0.7514468
0
Asigna el valor v al elemento kveces anterior.
def __setitem__(self, k, v): self.valores[( zero - k )%self.longitud] = v
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def actualizar_velocidad(self):\r\n pass", "def find_prev(self, v):\n if v - 1 < self.values[0] or v - 1 > self.values[-1]:\n raise IndexError('element not found')\n\n index = self._bin_search_recursive(v, 0, len(self.values) - 1)\n\n if index > 0:\n return self....
[ "0.5935664", "0.58318734", "0.57799566", "0.573883", "0.56817716", "0.56737953", "0.56477207", "0.5641579", "0.5633477", "0.56009114", "0.55635613", "0.5553526", "0.5553526", "0.55367154", "0.5518482", "0.54913104", "0.54913104", "0.54346764", "0.5428058", "0.5373884", "0.537...
0.5369091
22
Obtiene el valor del kesimo elemento.
def __getitem__(self, k): it = Historial.__getitem__(self, k) if it != None: return it[1] else: return it
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valor(self):\n try:\n objeto = self.objeto\n except AttributeError:\n objeto = None\n return objeto", "def valor(self):\n if self._inteiro != None:\n return str(self._inteiro)\n else:\n return \"Sem Valor\"", "de...
[ "0.7187529", "0.71030325", "0.65446925", "0.6502201", "0.6502201", "0.6502201", "0.6472011", "0.6464514", "0.6441088", "0.6440774", "0.64297825", "0.64091015", "0.6393591", "0.6393024", "0.6393024", "0.6393024", "0.6356786", "0.6339224", "0.6331197", "0.6331197", "0.6327495",...
0.0
-1
Obtiene el tiempo del kesimo elemento (por el final).
def time(self, k): it = Historial.__getitem__(self, k) if it != None: return it[0] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def letra_tiempo(self):\n return self.letra, self.tiempo", "def get_t(self):\n return self.t", "def get_tin(self):\n return self.tin[:]", "def Temp(t):\n return 20 # Need to link to data", "def _get_max_t(self):\n \"\"\"\n if hasattr(self,'k_of_t'):\n re...
[ "0.619667", "0.59608144", "0.59497315", "0.5923782", "0.5808081", "0.5783681", "0.5765352", "0.5689239", "0.56744725", "0.56744725", "0.5661414", "0.56252795", "0.5588799", "0.55462325", "0.5516231", "0.5511294", "0.5499417", "0.54709876", "0.5412701", "0.54074687", "0.537343...
0.4978765
78
Devuelve un iterador por la lista de tiempos.
def times(self): class IterTimes: def __init__(self, st): self.c = 0 self.st = st def __iter__(self): return self def next(self): t = self.st.time(self.c) if t =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n start_times = (start for start, end in self.tss)\n names = (name.rstrip() for name in self.inps)\n for ind, (c, t) in enumerate(zip(names, start_times)):\n yield (c, t, ind)", "def build_tiers(self):\n self.tiers = []\n for size in range(1,len(s...
[ "0.594252", "0.56421316", "0.5424925", "0.54007185", "0.539346", "0.53655404", "0.5364286", "0.5360746", "0.5349394", "0.5274494", "0.52421033", "0.5217823", "0.5169063", "0.516716", "0.5154065", "0.51434505", "0.5137085", "0.5135831", "0.5119165", "0.5110781", "0.5105052", ...
0.52542615
10
Interpola linealmente el valor en el instante t
def __call__(self, t): c = c1 = c2 = 0 d = d1 = d2 = None while d1==None or d2==None or d<=d2: _t = self.time(c) if _t == None: break else: d = abs(t - _t) if d1 == None or d<d1: c1, d1 = c, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_t(self):\n return self.t", "def get_t_value(self):\n return float(self.data[2]) / 10", "def Temp(t):\n return 20 # Need to link to data", "def value(t):\r\n return t(0)", "def lin_pol_to_TE_TM(field):\n\n pass", "def __str__(self):\n return str(self.t1)+\"<-->t1,...
[ "0.59880507", "0.5949386", "0.58090144", "0.57953244", "0.5758886", "0.57477516", "0.5688287", "0.5688287", "0.56690115", "0.563481", "0.5611574", "0.5603627", "0.5531453", "0.5472372", "0.5468471", "0.5451955", "0.5434617", "0.54339397", "0.543298", "0.5397063", "0.5372944",...
0.5732259
6
Arranca el reloj, si ya estaba arrancado no pasa nada.
def arranca(self): if self.t0 == None: self.t0 = self.timeFunc() self.funciona = True if not self.funciona: self.retraso += self.timeFunc() - self.parada self.funciona = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def array(self):", "def __init__(self,array):\n self.arr = array\n # self.result = []", "def __init__(self):\n self.arr = []", "def __init__(self):\n self.arr = []", "def __init__(self):\n self.arr = []", "def __init__(self):\n self.arr = []", "def abrir(self):...
[ "0.58543247", "0.56239825", "0.5529206", "0.5529206", "0.5529206", "0.5529206", "0.545713", "0.53414357", "0.52711475", "0.5228194", "0.5209801", "0.52086926", "0.5190303", "0.51595616", "0.5092528", "0.507765", "0.50522804", "0.50134736", "0.49910116", "0.49833843", "0.49538...
0.5356167
7
Consulta el tiempo actual.
def __call__(self): if self.funciona: t = self.timeFunc() - self.t0 - self.retraso elif self.t0!=None: t = self.parada - self.t0 - self.retraso else: t = None return t
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def TempsCotxe(matricula):\n con=lite.connect('parking.db')\n cursor=con.cursor()\n try:\n cursor.execute(\"SELECT (strftime('%s',DATETIME('now'))-strftime('%s',entrada))/60 from parking where id_cotxe=?\",(matricula,))\n row=cursor.fetchone()\n if row:\n if row[0] < 60:\n ...
[ "0.591941", "0.56388557", "0.56071705", "0.556373", "0.55624765", "0.5506412", "0.5460353", "0.5383823", "0.5344067", "0.5318034", "0.52971244", "0.5287082", "0.52630705", "0.5252758", "0.5242119", "0.5242119", "0.5242119", "0.5242119", "0.5242119", "0.5241725", "0.5206754", ...
0.5652158
1
Mapping a value in a given range to another range
def mapped(val, in_min, in_max, out_min, out_max): return (val - in_min) * (out_max - out_min) / \ (in_max - in_min) + out_min
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_to_range(val, old_min, old_max, new_min, new_max):\n return new_max - (val - old_min) * (new_max - new_min) / (old_max - old_min)", "def map(value, in_low, in_high, out_low, out_high):\n # example from /animation_nodes/nodes/number/map_range.py\n # if inMin == inMax:\n # newValue = 0\n ...
[ "0.7836962", "0.7620629", "0.7571556", "0.7556224", "0.7549925", "0.7233073", "0.7195118", "0.7172923", "0.7053617", "0.70404553", "0.70280063", "0.6952438", "0.6834101", "0.68230766", "0.67514455", "0.6728961", "0.67074573", "0.6705688", "0.66193485", "0.6614623", "0.6611945...
0.7085316
8
Terms are equal if their strings are the same
def __eq__(self, other): return str(self) == str(other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_unigrams_same(t1, t2):\n t1_terms = make_terms_from_string(t1)\n t2_terms = make_terms_from_string(t2)\n terms1 = set(t1_terms)\n terms2 = set(t2_terms)\n shared_terms = terms1.intersection(terms2)\n #print(shared_terms)\n all_terms = terms1.union(terms2)\n #print(all_terms)\n ...
[ "0.6751587", "0.6636538", "0.6448691", "0.6327863", "0.62453604", "0.6222981", "0.6178543", "0.59960103", "0.59914863", "0.59817404", "0.5977805", "0.59240603", "0.59124815", "0.59050536", "0.58854413", "0.5883479", "0.5878619", "0.58726865", "0.5872482", "0.5862645", "0.5845...
0.0
-1
Determine if it is an atomic term (e.g. "A") or a statement/compound term (e.g. (&&,A,B,..) or (A > B)) or variable term and creates the corresponding Term.
def from_string(cls, term_string): term_string = term_string.replace(" ", "") if term_string in cls.term_dict: return cls.term_dict[term_string] if term_string[0] == NALSyntax.StatementSyntax.Start.value: """ Compound or Statement Term """ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_term(s, ctx, mctx, ops):\n s = strip_parens(s.strip())\n if re.search(\"^\\w*$\",s): # If a single word, either a variable or a constant\n if s in ops:\n return Con(ops[s], [], ctx, mctx)\n elif s in ctx:\n return Var(s, ctx, mctx)\n elif s in mctx:\n ...
[ "0.6580291", "0.61413693", "0.6123516", "0.60709804", "0.6037164", "0.59499276", "0.5909678", "0.57880825", "0.5784058", "0.5760817", "0.5713413", "0.56021833", "0.5593748", "0.556113", "0.5538992", "0.550548", "0.5455731", "0.5445209", "0.5441471", "0.54201454", "0.5406824",...
0.72168934
0
Recursively calculate the syntactic complexity of the compound term. The connector adds 1 complexity, and the subterms syntactic complexities are summed as well.
def _calculate_syntactic_complexity(self): count = 0 if self.connector is not None: count = 1 # the term connector for subterm in self.subterms: count = count + subterm._calculate_syntactic_complexity() return count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _calculate_syntactic_complexity(self):\n count = 1 # the copula\n for subterm in self.subterms:\n count = count + subterm._calculate_syntactic_complexity()\n\n return count", "def _calculate_complexity(workflow):\n complexity = estimate_complexity(workflow.type_, workflow....
[ "0.7616266", "0.5851079", "0.58404595", "0.5798227", "0.5710593", "0.5690459", "0.5667346", "0.55477387", "0.54747677", "0.5441864", "0.5319728", "0.5311709", "0.52989227", "0.5249006", "0.5198195", "0.51958025", "0.51696", "0.51376545", "0.50467896", "0.5002992", "0.4932325"...
0.79506034
0
Create a compound term from a string representing a compound term
def from_string(cls, compound_term_string): compound_term_string = compound_term_string.replace(" ", "") subterms, connector, intervals = cls.parse_toplevel_subterms_and_connector(compound_term_string) return cls(subterms, connector,intervals=intervals)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_string(cls, term_string):\n term_string = term_string.replace(\" \", \"\")\n\n if term_string in cls.term_dict:\n return cls.term_dict[term_string]\n\n if term_string[0] == NALSyntax.StatementSyntax.Start.value:\n \"\"\"\n Compound or Statement Ter...
[ "0.7619937", "0.6340459", "0.62865704", "0.622182", "0.6211368", "0.6205652", "0.6153318", "0.60456955", "0.58313286", "0.57834095", "0.5756795", "0.5701587", "0.56921804", "0.55409914", "0.5532965", "0.5528887", "0.5520905", "0.54063135", "0.54001784", "0.53797454", "0.53685...
0.75882727
1
Parse out all toplevel subterms from a string representing a compound term compound_term_string a string representing a compound term
def parse_toplevel_subterms_and_connector(cls, compound_term_string): compound_term_string = compound_term_string.replace(" ","") subterms = [] intervals = [] internal_string = compound_term_string[1:-1] # string with no outer parentheses () or set brackets [], {} # check for in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_string(cls, compound_term_string):\n compound_term_string = compound_term_string.replace(\" \", \"\")\n subterms, connector, intervals = cls.parse_toplevel_subterms_and_connector(compound_term_string)\n return cls(subterms, connector,intervals=intervals)", "def parse(self, string, r...
[ "0.7481961", "0.6179253", "0.6024916", "0.58284104", "0.58159286", "0.57567114", "0.55579245", "0.54866225", "0.54343325", "0.54079", "0.5405899", "0.53275555", "0.53219724", "0.5318563", "0.5275198", "0.5262341", "0.52378106", "0.523213", "0.5202051", "0.50821346", "0.507025...
0.8231147
0
Recursively calculate the syntactic complexity of the compound term. The connector adds 1 complexity, and the subterms syntactic complexities are summed as well.
def _calculate_syntactic_complexity(self): count = 1 # the copula for subterm in self.subterms: count = count + subterm._calculate_syntactic_complexity() return count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _calculate_syntactic_complexity(self):\n count = 0\n if self.connector is not None:\n count = 1 # the term connector\n for subterm in self.subterms:\n count = count + subterm._calculate_syntactic_complexity()\n return count", "def _calculate_complexity(workfl...
[ "0.79503584", "0.58502394", "0.5840956", "0.5799161", "0.57101554", "0.569104", "0.56670165", "0.55476683", "0.54750997", "0.544209", "0.53206456", "0.5311971", "0.5299383", "0.5250163", "0.51982045", "0.51967955", "0.51698494", "0.5137146", "0.50471324", "0.50033426", "0.493...
0.7616813
1
Returns the term's string with intervals.
def _create_formatted_string_with_interval(self): if isinstance(self.get_subject_term(),StatementTerm) or isinstance(self.get_subject_term(),CompoundTerm): string = NALSyntax.StatementSyntax.Start.value + \ self.get_subject_term().get_formatted_string_with_interval() els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n value = []\n for term in self.terms:\n value += [term.termname]\n return '<formula: %s>' % ' + '.join(value)", "def __str__(self):\n value = []\n for term in self.terms:\n value += [term.termname]\n return '<formula: %s>' % ' + ...
[ "0.63082343", "0.63082343", "0.6038259", "0.5892248", "0.57218105", "0.5709738", "0.5613051", "0.5574001", "0.5551552", "0.55436116", "0.54802537", "0.5458659", "0.5458", "0.54380184", "0.54280454", "0.5421883", "0.5411787", "0.53858435", "0.53813004", "0.53752476", "0.535993...
0.71998906
0
Returns the term's string. This is very important, because terms are compared for equality using this string.
def _create_formatted_string(self): string = NALSyntax.StatementSyntax.Start.value + \ self.get_subject_term().get_formatted_string() string += " " + self.get_copula_string() + " " string += self.get_predicate_term().get_formatted_string() + \ NALSyntax.StatementSyntax.En...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n\n return \"<Terms term=%s>\" % (self.word)", "def __str__(self):\n value = []\n for term in self.terms:\n value += [term.termname]\n return '<formula: %s>' % ' + '.join(value)", "def __str__(self):\n value = []\n for term in self.terms:...
[ "0.701907", "0.6807694", "0.6807694", "0.63728356", "0.6359468", "0.6359468", "0.6359468", "0.6359468", "0.6359468", "0.6359468", "0.6359468", "0.6359468", "0.6359468", "0.63586587", "0.6223569", "0.6177496", "0.61670923", "0.6108228", "0.6096044", "0.60886693", "0.60877323",...
0.5575014
44
Simplifies a term and its subterms, using NAL Theorems.
def simplify(term): simplified_term = term if isinstance(term,StatementTerm): simplified_term = StatementTerm(subject_term=simplify(term.get_subject_term()), predicate_term=simplify(term.get_predicate_term()), copula=term.get_copula(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simplify(self, text: str):\n # sanitise the input, remove common words and swap out similar words\n text = self.sanitise(text)\n # Decided not to use stopwords because that would take out too many and then get false positives\n common_words = [\"what\", \"i\", \"you\", \"do\", \"a\"...
[ "0.58145285", "0.57417417", "0.5672962", "0.5574244", "0.5386782", "0.52982134", "0.5281623", "0.5270715", "0.5269361", "0.524937", "0.5215512", "0.519514", "0.5169542", "0.51584274", "0.5112584", "0.5109358", "0.51056045", "0.5094979", "0.5041347", "0.5013541", "0.50019133",...
0.6677275
0
Get flatParameters note that getParameters and parameters is not equal in this case getParameters do not get parameters of output module
def getParameters(self): params = [] for m in [self.ix, self.ih, self.fx, self.fh, self.ox, self.oh, self.ux, self.uh]: # we do not get param of output module l = list(m.parameters()) params.extend(l) one_dim = [p.view(p.numel()) for p in params] para...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flatten_parameters(self):", "def get_params(self, deep=...):\n ...", "def get_parameters(self):\n return(_deepcopy(self.parameters))", "def get_params(self, deep=True):\n return super().get_params(deep=deep)", "def get_params(self):", "def flatten_parameters(self):\n self....
[ "0.73429567", "0.6564532", "0.6384027", "0.6347575", "0.633167", "0.6293811", "0.625885", "0.62531525", "0.62531525", "0.62195283", "0.62195283", "0.62195283", "0.62195283", "0.62195283", "0.61976695", "0.61738086", "0.6165213", "0.6111482", "0.6105472", "0.60984695", "0.6077...
0.63266575
5
Get flatParameters note that getParameters and parameters is not equal in this case getParameters do not get parameters of output module
def getParameters(self): params = [] for m in [self.ix, self.ih, self.fx, self.fh, self.ox, self.oh, self.ux, self.uh]: # we do not get param of output module l = list(m.parameters()) params.extend(l) one_dim = [p.view(p.numel()) for p in params] para...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flatten_parameters(self):", "def get_params(self, deep=...):\n ...", "def get_parameters(self):\n return(_deepcopy(self.parameters))", "def get_params(self, deep=True):\n return super().get_params(deep=deep)", "def get_params(self):", "def flatten_parameters(self):\n self....
[ "0.73429567", "0.6564532", "0.6384027", "0.6347575", "0.633167", "0.6293811", "0.625885", "0.62531525", "0.62531525", "0.62195283", "0.62195283", "0.62195283", "0.62195283", "0.62195283", "0.61976695", "0.61738086", "0.6165213", "0.6111482", "0.6105472", "0.60984695", "0.6077...
0.63266575
6
Child sum tree LSTM forward function
def forward(self, tree, embs, training = False): # add singleton dimension for future call to node_forward # embs = F.torch.unsqueeze(self.emb(inputs),1) loss = Var(torch.zeros(1)) # init zero loss if self.cudaFlag: loss = loss.cuda() for idx in range(tree.num_chil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, xs):\n\n xs = torch.split(xs, self.channel, -1)# list of batch, node, featdim\n xs = torch.stack(xs,2)#[batch, nodes, num_layers, num_channels]\n shape = xs.shape\n x = xs.reshape((-1,shape[2],shape[3])) # [ngraph * num_nodes , num_layers, num_channels]\n alpha...
[ "0.6560829", "0.6491293", "0.64687145", "0.6263219", "0.6240839", "0.6211139", "0.61944425", "0.61904705", "0.6172884", "0.6169751", "0.616302", "0.6126835", "0.60965496", "0.60779876", "0.6044476", "0.6039012", "0.60056037", "0.6002348", "0.5969338", "0.596877", "0.5955149",...
0.6306742
3
Get c and h of all children
def get_child_states(self, tree): # add extra singleton dimension in middle... # because pytorch needs mini batches... :sad: if tree.num_children==0: child_c = Var(torch.zeros(1,1,self.mem_dim)) child_h = Var(torch.zeros(1,1,self.mem_dim)) if self.cudaFlag: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Children(self) -> _n_1_t_2:", "def get_children(self, i, elems):\n # if len(elems) == 1:\n # return []\n # elif self.explored[i]:\n # return self.children[i]\n # else:\n self.children[i], self.children_elems[i] = self._get_children(list(elems)) # all_two_par...
[ "0.6792127", "0.673864", "0.6668528", "0.66547626", "0.66468894", "0.6605106", "0.6564175", "0.6527869", "0.6469268", "0.6447035", "0.6377662", "0.6343646", "0.6330529", "0.6330529", "0.6330529", "0.62940097", "0.62744546", "0.6263438", "0.6258187", "0.62352306", "0.62139827"...
0.6630454
5