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
Creates a convex line segment between two points. In the context of polygon creation, desc_y is set to True if we are building the top left or top right corner. Desc_X is set to True if we are building the top right or bottom right corner. This impacts the order we accept points and how we interpret the direction of po...
def convex_line_segment(point_list:list, desc_y:bool=False, desc_x:bool=False)->list: if len(point_list) < 3: return point_list line = [] x_extrema = None # Since the list is sorted by x second, the last point is actually the # first point of the last block of y values in the list (if more t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addRevLineSeg(self, x1, y1, x2, y2):\n # tip triangles\n if np.allclose(x1, 0.0):\n a = [x1, y1, 0.0]\n for (sa1, ca1), (sa2, ca2) in self._mesh.sincos:\n r = x2\n b = [r * sa2, y2, r * ca2]\n c = [r * sa1, y2, r * ca1]\n ...
[ "0.61220574", "0.5985634", "0.58928055", "0.586802", "0.5844202", "0.5812266", "0.5790249", "0.57509595", "0.5726299", "0.5695145", "0.5691318", "0.56896853", "0.5685234", "0.5680852", "0.56595385", "0.563459", "0.5601871", "0.5600169", "0.5596646", "0.55840945", "0.5568787",...
0.74640554
0
Determines if a line segment described by d_y, d_x, and b is right of a point.
def intersects_right(point:tuple, line:tuple, d_y:float, d_x:float, b:float, include_top:bool=False, inclusive:bool=False)->bool: min_y, max_y = line[0][1], line[1][1] if min_y > max_y: min_y, max_y = max_y, min_y if not between(point[1], min_y, max_y): # The point is above or below the line...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def point_on_line(point:tuple, line:tuple, d_y:float, d_x:float, b:float)->bool:\n if not near_segment(point, line):\n # Fast fail to handle cases where the point isn't in the bounding rectangle of the line segment.\n return False\n if b == None and point[0] == line[0][0]:\n return True\...
[ "0.779486", "0.6765233", "0.6753991", "0.6690972", "0.66500854", "0.65380234", "0.65158004", "0.64917606", "0.6466559", "0.64534605", "0.63823503", "0.63814336", "0.6377494", "0.6278903", "0.62738436", "0.6271943", "0.62362576", "0.6226385", "0.6216552", "0.62099683", "0.6205...
0.7685959
1
Determines if a point is on the segment.
def point_on_line(point:tuple, line:tuple, d_y:float, d_x:float, b:float)->bool: if not near_segment(point, line): # Fast fail to handle cases where the point isn't in the bounding rectangle of the line segment. return False if b == None and point[0] == line[0][0]: return True return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pointInSegment(point, segmentPoint1, segmentPoint2):\n\t\tx = point[0]\n\t\ty = point[1]\n\n\t\tif x < segmentPoint1[0] and x < segmentPoint2[0]:\n\t\t\treturn False\n\t\t\n\t\tif x > segmentPoint1[0] and x > segmentPoint2[0]:\n\t\t\treturn False\n\t\t\n\t\tif y < segmentPoint1[1] and y < segmentPoint2[1]:\n\t...
[ "0.7799579", "0.76022875", "0.76022875", "0.7578741", "0.755237", "0.750448", "0.7461112", "0.74219817", "0.7264109", "0.7250185", "0.7214966", "0.7196955", "0.7158082", "0.71503884", "0.71443844", "0.7110474", "0.7107299", "0.70606035", "0.7057359", "0.70439357", "0.7029545"...
0.69189537
27
Determines the crossing number of a horizontal positive ray from point with a polygon defined in edges.
def crossing_number(point:tuple, edges:list, include_edges:bool=True)->int: crossing_number = 0 for edge in edges: d_y, d_x, b = line_equation(edge) if include_edges and point_on_line(point, edge, d_y, d_x, b): return 1 if is_horizontal(edge): continue if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def winding_number(x, y, primitive):\n\n wn = 0\n\n edges = zip(primitive[\"vertices\"][-1:] + primitive[\"vertices\"][:-1],\n primitive[\"vertices\"])\n for edge in edges:\n # check if cuts y parallel line at (x, y) &&\n if (edge[0][0] > x) != (edge[1][0] > x):\n #...
[ "0.6319946", "0.628875", "0.61075354", "0.6013507", "0.5910155", "0.56875455", "0.5654235", "0.56247514", "0.5608675", "0.5508915", "0.54895514", "0.54782134", "0.5462136", "0.54489154", "0.54295504", "0.54053026", "0.5375274", "0.5368317", "0.5356745", "0.5355982", "0.534888...
0.76824135
0
Determines if a point is in a polygon using crossingnumber method.
def pinp_crossing(point:tuple, edges:list, include_edges:bool=True)->bool: return crossing_number(point, edges, include_edges) % 2 == 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_in_polygon(self, point):\n reference_point = self.get_reference_point()\n \n reference_segment = DirectedEdge(point, reference_point)\n\n num_crossings = 0\n \n left_idx = 0\n while left_idx != len(self):\n right_idx = (left_idx + 1) % len(self)\n ...
[ "0.823988", "0.78379107", "0.7658638", "0.75398535", "0.75207394", "0.7450259", "0.7434018", "0.74160594", "0.7403389", "0.7377856", "0.73732316", "0.7357391", "0.73370737", "0.7325637", "0.72021", "0.7176894", "0.70702785", "0.6982318", "0.6976491", "0.6976491", "0.6949547",...
0.66881317
32
Determines which points are inside a polygon defined by edges. Points are streamed to callers. This is an adaptation of the above algorithm optimized for many points by only doing the slope and intercept calculations once per edge.
def pinp_multiple_crossing(points, edges, include_edges = True): crossing_number = [] initialized = False for edge in edges: d_y, d_x, b = line_equation(edge) index = -1 for point in points: index += 1 if not initialized: crossing_number.append...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def points_inside_poly(points, all_verts):\n return Path(all_verts, close=True).contains_points(points)", "def polygon_contains(self, poly_outer, poly_inner):\n inner_list = self.poly_to_list(poly_inner, \"Global\")\n contain_list = []\n\n # Loop over all points in the inner polygon to se...
[ "0.6561789", "0.63151556", "0.6271785", "0.6117632", "0.6092992", "0.60631436", "0.6012318", "0.6011012", "0.5953818", "0.58825284", "0.580966", "0.58055735", "0.5803588", "0.57825583", "0.57565135", "0.5723604", "0.5716897", "0.5709425", "0.5709039", "0.5676375", "0.5661738"...
0.57207507
16
An implementation of Graham's scan using inplace sorting to quickly build a convex hull.
def graham_scan(points): if len(points) <= 3: return points pointList = ExtendedTupleList(points) complete_range = pointList.range_within(0, 1) first_point = (complete_range[1]["min"][1], complete_range[1]["min"][0]) newPoints = ExtendedTupleList([]) for point in pointList: squar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graham_scan(points):\n\n # Find point with smallest y coordinate\n # If two points have equal y coordinates, select the one with the lower x-coordinate\n smallest = points[0]\n for p in points:\n if p[1] < smallest[1]:\n smallest = p\n elif p[1] == smallest[1]:\n ...
[ "0.70704556", "0.7060805", "0.67267764", "0.64879376", "0.6486455", "0.640975", "0.61319625", "0.60088277", "0.57791483", "0.57625085", "0.55533165", "0.54938835", "0.54901403", "0.5473391", "0.5443114", "0.5408968", "0.5403702", "0.5362627", "0.5359406", "0.5355959", "0.5330...
0.67683274
2
My own homegrown algorithm for building the convex hull.
def convex_hull(points): pointList = ExtendedTupleList(points) complete_ranges = pointList.range_within(0, 1) # Filters for four quadrants filters = [ ((0, complete_ranges[1]["max"][2], ">="), (1, complete_ranges[0]["max"][2], ">=")), #Q1 ((0, complete_ranges[1]["max"][1], "<="), (1, com...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convex_hull(l):\n\tpass", "def convex_hull(points):\n\n # Sort the points lexicographically (tuples are compared lexicographically).\n # Remove duplicates to detect the case we have just one unique point.\n points = sorted(set(points))\n\n # Boring case: no points or a single point, possibly repe...
[ "0.80086", "0.78709483", "0.75600183", "0.745202", "0.7436891", "0.7415585", "0.7319434", "0.7194905", "0.71566576", "0.70986134", "0.70718306", "0.7056313", "0.7040411", "0.70237267", "0.7002169", "0.6926358", "0.6903651", "0.6885412", "0.68636125", "0.686115", "0.6727542", ...
0.75075173
3
Select the longest edge from hull that doesn't start with a point in ignore_left_points, with minimum length. Returns
def select_longest_edge(hull:list, ignore_left_points:list, min_sqr_length:int=0)->tuple: max_sqr_length = None selected = None for k in range(0, len(hull) - 1): if hull[k] in ignore_left_points: continue edge_sqr_length = point_sqr_distance(hull[k], hull[k+1]) if edge_sq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_hull(hull):\n max_unproc_edge = hull[np.lexsort((-hull.length, hull.is_processed))][0]\n idx = np.where(hull == max_unproc_edge)[0][0]\n\n # shift convex hull to have the longest edge at the beginning\n hull = np.roll(hull, -idx, axis=0)\n\n return hull, max_unproc_edge.length", "def conc...
[ "0.5784756", "0.5722361", "0.57186353", "0.571596", "0.561899", "0.5575985", "0.5559472", "0.5450202", "0.5366452", "0.5360122", "0.53597206", "0.53502905", "0.53324366", "0.5321323", "0.5316823", "0.5307588", "0.5303187", "0.5294098", "0.52727485", "0.5253577", "0.5250945", ...
0.8255255
0
Determines if the new edge would intersect the hull at any point.
def segments_intersects_hull(new_edges:list, hull:list, current_edge:tuple)->bool: new_edge_extent = extent(new_edges[0][0], new_edges[0][1], new_edges[1][1]) for k in range(0, len(hull) - 1): if new_edges[0][0] == hull[k] or new_edges[0][0] == hull[k+1]: continue elif new_edges[0][1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_new(self):\n c_up = self.upper_binary_tree().single_edge_cut_shapes()\n c_down = self.lower_binary_tree().single_edge_cut_shapes()\n return not any(x in c_up for x in c_down)", "def check_inside_hull(hull, instance):\n for face in hull:\n if not check_inside(face=face, insta...
[ "0.6484378", "0.63872766", "0.62879694", "0.6258108", "0.6223334", "0.62019885", "0.6185283", "0.6149708", "0.6138869", "0.61183757", "0.6070646", "0.60460234", "0.6039633", "0.6038786", "0.6038608", "0.6034174", "0.5997268", "0.59944534", "0.59907645", "0.5983716", "0.597896...
0.7658259
0
Selects the point that meets the conditions to become part of a concave hull.
def select_candidate_point(edge:tuple, points:list, hull:list, min_cosine:float=-1)->tuple: min_sqr_distance = None selected = None for point in points: nearest_point = closest_line_point(point, edge) if not near_segment(nearest_point, edge): # We ignore points that wouldn't be a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def teselado(self,points):\n #muestrea todo el espacio de la envolvente para conseguir las fronteras de decision a intervalos regulares \n #get_hull\n area = boundingbox(points)\n #(min_x,min_y),(max_x,min_y),(max_x,max_y),(min_x,max_y)\n #sample inside hull\n lat_sample =...
[ "0.63103765", "0.63064873", "0.61816275", "0.6154425", "0.61095697", "0.60735637", "0.59671175", "0.5935509", "0.5914783", "0.5901849", "0.5872185", "0.5870017", "0.58488506", "0.5796634", "0.5792759", "0.5779052", "0.57423526", "0.57101136", "0.56947124", "0.5675157", "0.566...
0.6182271
2
Creates a concave hull.
def concave_hull(hull:list, points:list, max_iterations:int=None, min_length_fraction:float=0, min_angle:float=90)->list: tweet.info("Creating concave hull; minimum side length {}% of average, minimum_angle {}".format(min_length_fraction * 100, min_angle)) test_points = set(points) ignore_points = [] av...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convex_hull(self):\n return self._geomgen(capi.geom_convex_hull)", "def convex_hull(points):\n\n # Sort the points lexicographically (tuples are compared lexicographically).\n # Remove duplicates to detect the case we have just one unique point.\n points = sorted(set(points))\n\n # Boring ...
[ "0.7206272", "0.71888036", "0.71256506", "0.7085061", "0.7075677", "0.7031924", "0.69883245", "0.6819022", "0.68025535", "0.67614084", "0.6739058", "0.6691165", "0.667362", "0.6638784", "0.65221596", "0.6512171", "0.646188", "0.64251655", "0.6401495", "0.6394388", "0.6354288"...
0.7279524
0
Returns (None, specific set of required operands or None).
def Rewrite(self, expression, defaults=None, keys=None): self._keys = keys or {} _, operands = super(FilterScopeRewriter, self).Rewrite( expression, defaults=defaults) if isinstance(operands, six.string_types): operands = set([operands]) return None, operands
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def try_fold_arithmetic_binop(\n op: ast.ops.Operator, left: irast.Set, right: irast.Set, *,\n ctx: context.ContextLevel) -> typing.Optional[irast.Set]:\n schema = ctx.schema\n\n real_t = schema.get('std::anyreal')\n float_t = schema.get('std::anyfloat')\n int_t = schema.get('std::anyint'...
[ "0.554483", "0.55098975", "0.54648745", "0.54308915", "0.5397291", "0.53851604", "0.53750557", "0.53668904", "0.534204", "0.5338202", "0.5331988", "0.5327878", "0.53219956", "0.5321779", "0.5303595", "0.5287829", "0.52522546", "0.5238614", "0.52210104", "0.521642", "0.521374"...
0.0
-1
Punt on negation. Only the caller knows the operand universe.
def RewriteNOT(self, expr): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _negation_op(spec, expression):", "def __neg__(self):\n return type(self)(self.parent(), self._simplify(-self._express))", "def __neg__(self):\n return self.__mul__(-1)", "def neg(a):\n return prod(a, -1)", "def __neg__(self):\n return self.negated()", "def neg(a):\n return...
[ "0.73435956", "0.699165", "0.682434", "0.6806528", "0.6806039", "0.67607474", "0.6726903", "0.67132604", "0.6632549", "0.66181093", "0.66095734", "0.65735376", "0.6505464", "0.64757454", "0.6429829", "0.6410526", "0.64044005", "0.6384057", "0.6345979", "0.63177085", "0.629151...
0.57410866
75
OR keeps all operands in play.
def RewriteOR(self, left, right): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __or__(self, other: Any) -> Operators:\n return self.operate(or_, other)", "def or_(a, b):", "def or_filter(self):\n return self.__or", "def __or__(self, other):\n return self.fam.c_binop('or', self, other)", "def __or__(self, other):\n return self.or_(other)", "def _or(se...
[ "0.7526833", "0.748305", "0.72272426", "0.7208705", "0.7124411", "0.711627", "0.711627", "0.711627", "0.711627", "0.711627", "0.7092017", "0.70893234", "0.70513535", "0.7031522", "0.7018625", "0.70110357", "0.7006967", "0.6979673", "0.69745207", "0.6944217", "0.6928026", "0...
0.73900056
2
Rewrites restrictions for keys in self._keys.
def RewriteTerm(self, key, op, operand, key_type): if key not in self._keys or op != '=': return None return operand
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _constrain_keys(self, dictionary):\n\n constrained = { k: dictionary[k] for k in self._keys if k in dictionary }\n return constrained", "def harmonize_keys(self):\n self._data.key_regex_replacements = _key_regex_replacements\n self._data.key_replacements = _key_replacements", "d...
[ "0.69033045", "0.6338012", "0.6272551", "0.6123107", "0.5859973", "0.5691391", "0.5625764", "0.5609194", "0.5576054", "0.5485195", "0.5455576", "0.53918344", "0.5368339", "0.5357722", "0.5356005", "0.5309407", "0.5308894", "0.53055555", "0.53029096", "0.5256986", "0.5244978",...
0.0
-1
Returns a string representation
def __str__(self): return "[Square] (" + str(self.id) + ") " + str( self.x) + "/" + str(self.y) + " - " + str( self.width)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_str(self) -> str:", "def toString():", "def toString(self) -> str:\n raise NotImplementedError", "def to_string(self):\r\n return self.__str__()", "def to_str(self):\n return pformat(self.to_dict())", "def to_str(self):\n return pformat(self.to_dict())", "def to_str(s...
[ "0.8396673", "0.82936347", "0.80012363", "0.7915748", "0.77012867", "0.77012867", "0.77012867", "0.77012867", "0.77012867", "0.77012867", "0.77012867", "0.77012867", "0.77012867", "0.77012867", "0.77012867", "0.77012867", "0.77012867", "0.77012867", "0.77012867", "0.77012867", ...
0.0
-1
Assign an argument to each attributes
def update(self, *args, **kwargs): attributes = ["id", "size", "x", "y"] if len(args) > 0: for i in range(len(args)): setattr(self, attributes[i], args[i]) else: self.id = kwargs.get("id", self.id) self.size = kwargs.get("size", self.size) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setAttributes(self, args):\n for atr in self.defaultAttributes:\n if args.has_key(atr):\n # convert atr to proper type\n objAttr = getattr(self, atr)\n myType = type(args[atr])\n if type(objAttr) == types.IntType and myType <> types....
[ "0.74129784", "0.7253339", "0.7120195", "0.7037738", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", "0.6990127", ...
0.64679074
43
returns the dictionary representation of a Rectangle
def to_dictionary(self): return {"id": self.id, "x": self.x, "size": self.size, "y": self.y}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rectangledict(self):\n return rectangledict(self.rectangles)", "def to_dictionary(self):\n rect = {\n \"x\": self.x,\n \"y\": self.y,\n \"id\": self.id,\n \"height\": self.height,\n \"width\": self.width\n }\n return(rect)", ...
[ "0.8602724", "0.8201665", "0.8108615", "0.8052318", "0.79804254", "0.774604", "0.7632502", "0.7477445", "0.73376447", "0.7333853", "0.7112657", "0.68645644", "0.67418987", "0.6740587", "0.67366946", "0.671641", "0.6686742", "0.6686742", "0.6638892", "0.6613355", "0.66103834",...
0.626603
32
Nose will execute this function before executing the tests. Remove all the files generated during previous test runs, create necessary directories and run the prepare data function
def setup_class(cls): self = cls() self.remove_files_created_during_previous_runs() if not os.path.exists(self.plaintext_directory): os.makedirs(self.plaintext_directory) if not os.path.exists(self.training_path): os.makedirs(self.training_path) if not o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.tearDown()\n utils.mkdir_p(TMP_BASENAME_DIR)", "def setUp(self):\r\n super(TestImport, self).setUp()\r\n self.content_dir = path(tempfile.mkdtemp())\r\n self.addCleanup(shutil.rmtree, self.content_dir)\r\n\r\n # Create good course xml\r\n s...
[ "0.73244756", "0.72804755", "0.7233866", "0.7178239", "0.71641874", "0.7157685", "0.71102923", "0.71080315", "0.7104167", "0.7100945", "0.70877147", "0.7069167", "0.7059233", "0.7031363", "0.7018821", "0.7005832", "0.6993371", "0.6931856", "0.6929316", "0.69214904", "0.691219...
0.0
-1
Nose will execute this function after executing all the tests. Remove files generated during test runs
def teardown_class(cls): self = cls() self.remove_files_created_during_previous_runs()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n self.remove_test_files()", "def tearDown(self):\n testing_dir = os.path.split(os.path.realpath(__file__))[0]\n for f in glob.glob(os.path.join(testing_dir, \"*\")):\n if f.split(\".\")[-1] in [\"o\", \"out\", \"pyc\", \"log\"]:\n subprocess.cal...
[ "0.79564494", "0.7922551", "0.7731818", "0.7725066", "0.7597718", "0.7541712", "0.75238997", "0.7476529", "0.7441866", "0.7432386", "0.74241424", "0.74227935", "0.7406666", "0.7307176", "0.7307176", "0.7307176", "0.73070675", "0.7299069", "0.72886336", "0.72333694", "0.723083...
0.0
-1
Method to get a reference to a class that specifies the input data for class cls. @ In, cls, the class for which we are retrieving the specification @ Out, inputSpecification, InputData.ParameterInput, class to use for specifying input of cls.
def getInputSpecification(cls): inputSpecification = super(Metropolis, cls).getInputSpecification() return inputSpecification
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getInputSpecification(cls):\n inputSpecification = InputData.parameterInputFactory(cls.__name__, ordered=True, baseNode=None)\n\n StatePartInput = InputData.parameterInputFactory(\"state\", contentType=InputTypes.StringType)\n StatePartInput.addParam(\"outcome\", InputTypes.FloatType, True)\n State...
[ "0.6275034", "0.60379297", "0.5730839", "0.5726884", "0.56846875", "0.5625551", "0.55976015", "0.5574512", "0.55434084", "0.5535107", "0.55097574", "0.5491663", "0.5483585", "0.5470132", "0.5409276", "0.54024297", "0.5361116", "0.53348005", "0.53283894", "0.53078043", "0.5294...
0.59754
2
Default Constructor that will initialize member variables with reasonable defaults or empty lists/dictionaries where applicable. @ In, None @ Out, None
def __init__(self): MCMC.__init__(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwds):\n raise NotImplementedError", "def __init__(self, *args, **kwargs) -> None:\n pass", "def __init__(self, *args, **kwargs) -> None:\n pass", "def __init__(self) -> None:\n # TODO: Provide the complete constructor for this object", "def __init__(self, *...
[ "0.72449476", "0.70512044", "0.70512044", "0.7036811", "0.7014676", "0.69895023", "0.6976433", "0.6954044", "0.695061", "0.6948332", "0.6934927", "0.6900211", "0.68901324", "0.68901324", "0.68901324", "0.6817234", "0.67974657", "0.67517906", "0.6742774", "0.6742774", "0.67427...
0.0
-1
Read input specs @ In, paramInput, InputData.ParameterInput, parameter specs interpreted @ Out, None
def handleInput(self, paramInput): MCMC.handleInput(self, paramInput)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _handleInput(self, paramInput):\n pass", "def read_input(self, specs, mode, comp_name):\n self.raiseADebug(' ... loading interaction \"{}\"'.format(self.tag))\n self._dispatchable = specs.parameterValues['dispatch']\n for item in specs.subparts:\n name = '_' + item.getName()\n if name i...
[ "0.65148056", "0.6373364", "0.6224871", "0.6187908", "0.61549926", "0.6142404", "0.61416185", "0.61400414", "0.61288595", "0.6105816", "0.60883975", "0.6038212", "0.6015596", "0.59900856", "0.5985972", "0.5976563", "0.587159", "0.58707494", "0.58549327", "0.58468914", "0.5834...
0.61994773
3
This function should be called every time a clean MCMC is needed. Called before takeAstep in @ In, externalSeeding, int, optional, external seed @ In, solutionExport, DataObject, optional, a PointSet to hold the solution @ Out, None
def initialize(self, externalSeeding=None, solutionExport=None): MCMC.initialize(self, externalSeeding=externalSeeding, solutionExport=solutionExport) if not self._correlated: for var in self._updateValues: if var in self.distDict: dist = self.distDict[var] dim = dist.getDimens...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_up(self) -> None:\n print('Doing some clean-up work...')", "def trial_clean_up(self):\n pass", "def cleanUp():\n pass", "def clean(self):\n self.iiter = 0\n print(colored('Finished patch %s' % self.image_name, 'yellow'))\n torch.cuda.empty_cache()\n self...
[ "0.5972903", "0.5940058", "0.57677114", "0.5659115", "0.56506276", "0.5642487", "0.56210417", "0.56102026", "0.5481459", "0.54640925", "0.5445583", "0.5422247", "0.540909", "0.5407289", "0.5386823", "0.53828806", "0.53821695", "0.5377255", "0.5371626", "0.5362387", "0.5349434...
0.0
-1
Provides the next sample to take. After this method is called, the self.inputInfo should be ready to be sent to the model @ In, model, model instance, an instance of a model @ In, myInput, list, a list of the original needed inputs for the model (e.g. list of files, etc.) @ Out, None
def localGenerateInput(self, model, myInput): if self.counter < 2: MCMC.localGenerateInput(self, model, myInput) else: self._localReady = False for key, value in self._updateValues.items(): # update value based on proposal distribution newVal = value + self._proposal[key].rvs()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input(self):\n try:\n return self.inputs[-1]\n except IndexError:\n pass\n raise ValueError(\"The sample method has not been called\")", "def test_prepare_sample_to_forward(self):\n sample = [\n {\"src\": \"ola mundo\", \"ref\": \"hi world\", \"mt\...
[ "0.70868576", "0.6604615", "0.65657943", "0.6411239", "0.6372315", "0.63269866", "0.62161213", "0.61675435", "0.6153169", "0.6153169", "0.61334926", "0.6080559", "0.607126", "0.5985408", "0.59807396", "0.5938614", "0.5915001", "0.5886959", "0.5884955", "0.58460677", "0.582307...
0.6721474
1
General function (available to all samplers) that finalize the sampling calculation just ended. In this case, The function is aimed to check if all the batch calculations have been performed @ In, jobObject, instance, an instance of a JobHandler @ In, model, model instance, it is the instance of a RAVEN model @ In, myI...
def localFinalizeActualSampling(self, jobObject, model, myInput): MCMC.localFinalizeActualSampling(self, jobObject, model, myInput)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_finalize_job_record(self):\n pass", "def has_full_batch(self) -> bool:", "def finalize(self):\n\t\tself.logger.info(\"Please wait while finalizing the operation.. Thank you\")\n\t\tself.save_checkpoint()\n\t\tself.summary_writer.export_scalars_to_json(\"{}all_scalars.json\".format(self.config.su...
[ "0.6187927", "0.5795619", "0.5728285", "0.56815076", "0.56358445", "0.5633501", "0.5633048", "0.5577172", "0.55352855", "0.55237323", "0.5502523", "0.5490598", "0.54837555", "0.54806143", "0.5472647", "0.5471663", "0.5465032", "0.5452882", "0.54441124", "0.54441124", "0.54441...
0.6751163
0
Used to feedback the collected runs within the sampler @ In, newRlz, dict, new generated realization @ In, currentRlz, dict, the current existing realization @ Out, netLogPosterior, float, the accepted probabilty
def _useRealization(self, newRlz, currentRlz): netLogPosterior = 0 # compute net log prior for var in self._updateValues: newVal = newRlz[var] currVal = currentRlz[var] if var in self.distDict: dist = self.distDict[var] netLogPrior = dist.logPdf(newVal) - dist.logPdf(currVa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inference_spa(flow_lik,\n flow_post,\n prior,\n simulator,\n optimizer_lik,\n optimizer_post,\n decay_rate_post,\n x_o,\n x_o_batch_post,\n dim_post,\n ...
[ "0.6228127", "0.61634594", "0.6074014", "0.6050275", "0.6050275", "0.59674543", "0.5956656", "0.5953617", "0.58580154", "0.58394265", "0.5830465", "0.5820498", "0.57669336", "0.5730289", "0.5701165", "0.5655382", "0.56536853", "0.56534696", "0.56493", "0.5646722", "0.56436014...
0.73664874
0
Determines if sampler is prepared to provide another input. If not, and if jobHandler is finished, this will end sampling. @ In, ready, bool, a boolean representing whether the caller is prepared for another input. @ Out, ready, bool, a boolean representing whether the caller is prepared for another input.
def localStillReady(self, ready): ready = self._localReady and MCMC.localStillReady(self, ready) return ready
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_buffered_inputs(self):", "def is_prepared(self):\n try:\n ret = (\n self.is_prepared_for_input_socket() and\n self.is_prepared_for_setting() and\n self.is_prepared_for_hoge()\n )\n except CheckPreparedException as e:\n ...
[ "0.558299", "0.5549085", "0.5531201", "0.5440989", "0.5403814", "0.53479713", "0.5329904", "0.53009325", "0.523241", "0.5161378", "0.50855684", "0.5058236", "0.50328124", "0.502983", "0.50063264", "0.49893746", "0.49873114", "0.49788696", "0.4978666", "0.4960595", "0.49489564...
0.49407262
21
Forward pass for prediction aggregator
def forward(self, encodings: Dict) -> Union[Dict, torch.Tensor]: raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward_train(self, *args, **kwargs):\n pass", "def forward_propagation(self):\n pred_y = argmax(self.model.predict(train_x), axis=1)\n\n accuracy_func = Accuracy()\n accuracy_func.update_state(pred_y, train_y)\n self.accuracy = accuracy_func.result().numpy()", "def forwa...
[ "0.74012876", "0.7157714", "0.7145412", "0.7046437", "0.7015131", "0.6985374", "0.6952822", "0.69475394", "0.6920287", "0.68856066", "0.6870751", "0.6853668", "0.684333", "0.6823695", "0.6816687", "0.68037724", "0.6794375", "0.6794375", "0.67894006", "0.67894006", "0.67894006...
0.0
-1
Lifecycle a model defined in Swagger
def __init__(self, applicable_job_statuses=None, action_time=None, action=None, type=None): self.swagger_types = { 'applicable_job_statuses': 'list[str]', 'action_time': 'datetime', 'action': 'str', 'type': 'str' } self.attribute_map = { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.swagger_types = {\n 'ids': 'list[str]',\n 'consumer': 'str',\n 'entity_type': 'str',\n 'start_date': 'datetime',\n 'end_date': 'datetime',\n 'created_date': 'datetime',\n 'updated_date': 'datetime',\n ...
[ "0.57578397", "0.57171565", "0.5694597", "0.56923044", "0.56630313", "0.56269646", "0.55970424", "0.5569859", "0.5567609", "0.55565476", "0.5546851", "0.5546806", "0.5544655", "0.5544655", "0.5544655", "0.5544655", "0.55091864", "0.5480632", "0.54442686", "0.54442686", "0.544...
0.0
-1
Gets the applicable_job_statuses of this Lifecycle. Job status needs to be in this list in order for the action to be performed!
def applicable_job_statuses(self): return self._applicable_job_statuses
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def applicable_job_statuses(self, applicable_job_statuses):\n allowed_values = []\n if applicable_job_statuses not in allowed_values:\n raise ValueError(\n \"Invalid value for `applicable_job_statuses` ({0}), must be one of {1}\"\n .format(applicable_job_statu...
[ "0.6967596", "0.6617357", "0.6617357", "0.61123466", "0.5901221", "0.58656716", "0.5798119", "0.5798119", "0.5790288", "0.57691395", "0.57252294", "0.5707428", "0.5665692", "0.5640539", "0.5625412", "0.55947644", "0.55841506", "0.5555595", "0.5541644", "0.5536113", "0.552849"...
0.8614955
0
Sets the applicable_job_statuses of this Lifecycle. Job status needs to be in this list in order for the action to be performed!
def applicable_job_statuses(self, applicable_job_statuses): allowed_values = [] if applicable_job_statuses not in allowed_values: raise ValueError( "Invalid value for `applicable_job_statuses` ({0}), must be one of {1}" .format(applicable_job_statuses, allowed...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def applicable_job_statuses(self):\n return self._applicable_job_statuses", "def __init__(self, applicable_job_statuses=None, action_time=None, action=None, type=None):\n self.swagger_types = {\n 'applicable_job_statuses': 'list[str]',\n 'action_time': 'datetime',\n ...
[ "0.6695411", "0.5844042", "0.5563415", "0.5545432", "0.5485883", "0.5475218", "0.5449763", "0.5404465", "0.5384887", "0.53246635", "0.53229064", "0.5294377", "0.52781755", "0.52380747", "0.5186252", "0.5116745", "0.50967646", "0.5069076", "0.50412786", "0.502424", "0.4990202"...
0.8249736
0
Gets the action_time of this Lifecycle. The time at which the job and files will be deleted, regardless of whether it has been retrieved or not. Maximal time is 1 day from job creation
def action_time(self): return self._action_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_consumed(self) -> int:\n if not self.actions:\n return 0\n else:\n return self.actions[-1].time_end", "def delete_time(self) -> str:\n return pulumi.get(self, \"delete_time\")", "def delete_time(self) -> str:\n return pulumi.get(self, \"delete_time\")"...
[ "0.6351681", "0.6334942", "0.6334942", "0.6254808", "0.62357366", "0.615849", "0.61072457", "0.6091936", "0.6077282", "0.60503584", "0.59982574", "0.5907601", "0.5900668", "0.58995885", "0.5868122", "0.5856616", "0.5840132", "0.57963824", "0.57763684", "0.57763684", "0.577636...
0.78159416
0
Sets the action_time of this Lifecycle. The time at which the job and files will be deleted, regardless of whether it has been retrieved or not. Maximal time is 1 day from job creation
def action_time(self, action_time): self._action_time = action_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_time(self):\n return self._action_time", "def on_action_time_changed(self, content):\n time = parse_iso_dt(content['time']).time()\n self.set_guarded(time=time)", "def action(self, action):\n allowed_values = [\"DELETE\", \"NONE\"]\n if action not in allowed_values...
[ "0.60692436", "0.6039037", "0.5710749", "0.55339384", "0.55339384", "0.55339384", "0.55339384", "0.55339384", "0.55339384", "0.55339384", "0.55339384", "0.55339384", "0.55339384", "0.55103743", "0.5410098", "0.53928286", "0.53928286", "0.5351073", "0.5344618", "0.53365284", "...
0.7611136
0
Gets the action of this Lifecycle. The action to perform. Currently only delete is supported
def action(self): return self._action
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_action(self):\n return self.__action", "def get_action(self):\n return self.current_action", "def action(self):\n return self._get_field(\"action\")", "def action(self) -> Optional[str]:\n return pulumi.get(self, \"action\")", "def action(self) -> Optional[str]:\n ...
[ "0.7956197", "0.7459488", "0.7432588", "0.7238182", "0.7238182", "0.7238182", "0.7208887", "0.71846193", "0.71716344", "0.71587044", "0.7045301", "0.70392245", "0.6941939", "0.6926468", "0.68683374", "0.6690194", "0.6672939", "0.6605948", "0.65702957", "0.64770836", "0.645596...
0.7538712
5
Sets the action of this Lifecycle. The action to perform. Currently only delete is supported
def action(self, action): allowed_values = ["DELETE", "NONE"] if action not in allowed_values: raise ValueError( "Invalid value for `action` ({0}), must be one of {1}" .format(action, allowed_values) ) self._action = action
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_action(self, action):\n self._action = action\n return self", "def setAction(self, action):\n self.action = action\n return self", "def set_action(self, action):\n self.action = action", "def set_action(self, action):\n self.action = action", "def set_actio...
[ "0.798209", "0.7937381", "0.78521293", "0.78521293", "0.77787465", "0.7659929", "0.7434554", "0.7401559", "0.73724025", "0.7369807", "0.72310543", "0.72310543", "0.72310543", "0.72310543", "0.72310543", "0.72310543", "0.70674974", "0.699461", "0.6960725", "0.6901665", "0.6726...
0.7996904
0
Gets the type of this Lifecycle. Determine when to delete the job and associated files. RETRIEVAL means delete directly after retrieving the PDF file. When the file has not been retrieved before the action time, it will be deleted regardless. Time means, delete on specific time, regardless of whether it has been proces...
def type(self): return self._type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ExpireType(self):\n if self.force_auto_sync:\n self.get('ExpireType')\n return self._ExpireType", "def delete_time(self) -> str:\n return pulumi.get(self, \"delete_time\")", "def delete_time(self) -> str:\n return pulumi.get(self, \"delete_time\")", "def deleted_tim...
[ "0.5974232", "0.54896796", "0.54896796", "0.51819205", "0.5125803", "0.49722493", "0.4905789", "0.4882752", "0.47758582", "0.47730514", "0.47563097", "0.4699075", "0.46979105", "0.4691771", "0.4682157", "0.4674297", "0.4623792", "0.46149534", "0.46005246", "0.4593693", "0.458...
0.4375041
85
Sets the type of this Lifecycle. Determine when to delete the job and associated files. RETRIEVAL means delete directly after retrieving the PDF file. When the file has not been retrieved before the action time, it will be deleted regardless. Time means, delete on specific time, regardless of whether it has been proces...
def type(self, type): allowed_values = ["RETRIEVAL", "TIME"] if type not in allowed_values: raise ValueError( "Invalid value for `type` ({0}), must be one of {1}" .format(type, allowed_values) ) self._type = type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__, *,\n duration: pulumi.Input[str],\n object_type: pulumi.Input[str]):\n pulumi.set(__self__, \"duration\", duration)\n pulumi.set(__self__, \"object_type\", 'AbsoluteDeleteOption')", "def ExpireType(self):\n if self.force_auto_sync:\n ...
[ "0.55426234", "0.54422", "0.54303664", "0.5243352", "0.5130753", "0.51242626", "0.49633163", "0.49580863", "0.4862699", "0.4837523", "0.48264766", "0.47609124", "0.47609124", "0.47589472", "0.47226307", "0.4716207", "0.4709835", "0.46772438", "0.46732327", "0.46732327", "0.46...
0.5637675
0
Returns the model properties as a dict
def to_dict(self): result = {} for attr, _ in iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n return self.properties", "def to_dict(self):\n return self.properties", "def get_properties(self):\n return self.properties", "def asdict(self):\n return self._prop_dict", "def json(self):\n rv = {\n prop: getattr(self, prop)\n f...
[ "0.7751993", "0.7751993", "0.73391134", "0.7334895", "0.7297356", "0.727818", "0.7159078", "0.71578115", "0.71494967", "0.71494967", "0.71283495", "0.71275014", "0.7122587", "0.71079814", "0.7060394", "0.7043251", "0.7034103", "0.70233124", "0.69635814", "0.69586295", "0.6900...
0.0
-1
Returns the string representation of the model
def to_str(self): return pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self) -> str:\n # noinspection PyUnresolvedReferences\n opts = self._meta\n if self.name_field:\n result = str(opts.get_field(self.name_field).value_from_object(self))\n else:\n ...
[ "0.85856134", "0.7814518", "0.77898884", "0.7751367", "0.7751367", "0.7712228", "0.76981676", "0.76700574", "0.7651133", "0.7597206", "0.75800353", "0.7568254", "0.7538184", "0.75228703", "0.7515832", "0.7498764", "0.74850684", "0.74850684", "0.7467648", "0.74488163", "0.7442...
0.0
-1
For `print` and `pprint`
def __repr__(self): return self.to_str()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pprint(*args, **kwargs):\n if PRINTING:\n print(*args, **kwargs)", "def print_out():\n pass", "def custom_print(*objects):\n print(*objects, sep=OFS, end=ORS)", "def _print(self, *args):\n return _ida_hexrays.vd_printer_t__print(self, *args)", "def _printable(self):\n ...
[ "0.75577796", "0.73381156", "0.6987731", "0.6985827", "0.69452065", "0.6924739", "0.68991655", "0.6898615", "0.681538", "0.6807118", "0.6752345", "0.67502004", "0.674556", "0.67000055", "0.6690762", "0.66755", "0.66583294", "0.66100985", "0.6608339", "0.6602482", "0.6563445",...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.7961088", "0.7961088", "0.79433626", "0.79303336", "0.7926563", "0.7897525", "0.78826123", "0.78826123", "0.78806067", "0.7872423", "0.7868354", "0.78668815", "0.7825702", "0.7819993", "0.78162885", "0.78078854", "0.78068...
0.79670393
45
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Method generates temporary population, which will be reproduced
def generate_T(self): T = np.empty([self.lmbd, self.d * 2]) # loop for sampling with replacement for i in range(self.lmbd): random_id = np.random.randint(low=0, high=self.mi-1) T[i, :] = self.P[random_id, :] return T
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def genPopulation(self):\r\n self.population_list = []\r\n for i in xrange(0, self.pop_size):\r\n individual = bitarray(self.indv_size)\r\n # Loop for randomizing the 'individual' string.\r\n for j in xrange(0, self.board_size):\r\n vert_pos = random.ra...
[ "0.7213548", "0.71295714", "0.7119022", "0.70341957", "0.6996263", "0.6936632", "0.6900848", "0.68596786", "0.68436706", "0.67404014", "0.6738945", "0.67345905", "0.67268467", "0.67135733", "0.66405267", "0.6623459", "0.6619895", "0.658391", "0.65606153", "0.6538149", "0.6520...
0.0
-1
Method creates new individuals from T by mutation
def reproduce(self, T): R = np.empty([self.lmbd, self.d * 2]) for i in range(0, self.lmbd): R[i, :] = self.mutate(T[i]) return R
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutatation(self, indiv: Tour) -> Tour:\n n = indiv.size()\n for i in range(n):\n if random.random() < self.mutation_rate:\n j = int(random.random() * n)\n\n # Swap 2 genes (cities)\n indiv.tour_ids[i], indiv.tour_ids[j] = indiv.tour_ids[j], ...
[ "0.6567575", "0.6517559", "0.6228159", "0.6022811", "0.58399093", "0.58164763", "0.57760966", "0.5718301", "0.5622647", "0.5590459", "0.55880195", "0.5586507", "0.5582022", "0.55698514", "0.55439436", "0.5483295", "0.5431505", "0.5415131", "0.53600824", "0.533807", "0.5329494...
0.50152284
47
Method creates new population by choosing mi best individuals from children and current population
def choose_mi_best(self, R): population = np.empty([self.P.shape[0] + R.shape[0], 2*self.d + 1]) i = 0 for individual in np.vstack([self.P, R]): population[i, 0] = -self.J(individual[0:self.d], self.nCEC) population[i, 1:] = individual i = i+1 sorted_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_new_population(self):\n self.check_for_generation_cap()\n pop_container = list()\n for chromosome in self.population:\n partner = bm.select_partner(\n self.fitness_scores, self.population)\n child = bm.mutate(bm.crossover(chromosome, partner))\n ...
[ "0.72537977", "0.7044384", "0.6994038", "0.6913278", "0.6836467", "0.68160486", "0.6813089", "0.6794303", "0.66997755", "0.6687283", "0.6557448", "0.6555261", "0.6468302", "0.64377743", "0.6427576", "0.64246714", "0.63853765", "0.6369065", "0.6355021", "0.6325369", "0.6313070...
0.0
-1
One iteration of unmodified evolutionary algorithm
def iteration(self): T = self.generate_T() R = self.reproduce(T) self.P = self.choose_mi_best(R) #print(self.P)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def algorithm_loop(self):", "def illuminator_of_elfes():\n\n\t# Alpha - simplified by taking out the i by multiplying the outerproduct by 2i\n\talpha1i = np.matrix([[0, 0, 0, 2], [0, 0, 2, 0], [0, -2, 0, 0], [-2, 0, 0, 0]])\n\talpha2i = np.matrix([[0, 2, 0, 0], [-2, 0, 0, 0], [0, 0, 0, 2], [0, 0, -2, 0]])\n\talp...
[ "0.6418409", "0.64113474", "0.6084446", "0.6018408", "0.5965569", "0.58419895", "0.58355474", "0.5834112", "0.5818233", "0.58062494", "0.57600445", "0.57425374", "0.57184786", "0.57096803", "0.56773627", "0.56721646", "0.56531054", "0.56517786", "0.56475276", "0.5627075", "0....
0.0
-1
Method makes new individual from another individual by mutation
def mutate(self, x): ksi = np.random.normal(0, 1) mutated_x = np.zeros(len(x)) for i in range(self.d): ksi_i = np.random.normal(0, 1) mutated_x[self.d + i] = x[self.d + i] * np.exp(self.tau * ksi + self.tau_prim * ksi_i) for i in range(self.d): v_i =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_individual(self):\n pass", "def copy_as_new(self) -> \"Individual\":\n return Individual(self.main_node.copy(), to_pipeline=self._to_pipeline)", "def mutate(self, individual):\n bulbs_on = self.decode(individual)\n x = np.random.randint(0, self.width, (self.width,))\n ...
[ "0.67647445", "0.6372697", "0.62912905", "0.62885576", "0.6243023", "0.6224085", "0.616013", "0.6096474", "0.6072597", "0.59859306", "0.596885", "0.59619415", "0.5945391", "0.5942911", "0.5937435", "0.5925736", "0.59109753", "0.59108746", "0.58518016", "0.58446056", "0.583830...
0.0
-1
initialize a player and associated symbol.
def __init__( self, symbol: int, lr: float = 0.2, exp_rate: float = 0.4, discount_factor: float = 0.1, ) -> None: self.symbol = symbol self.lr = lr self.exp_rate = exp_rate self.discount_factor = discount_factor self.states: Dict[str, f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, player_name):\n self._player_name = player_name\n self._hand = Deck() \n self._coder = Deck()", "def __init__(self, player):\n\t\tself.player = player", "def __init__(self, symbol, row, col, player, king):\n self.symbol = symbol\n self.row = row\n ...
[ "0.7044783", "0.6994902", "0.6952127", "0.6900736", "0.69004774", "0.68714845", "0.6831614", "0.67411584", "0.6740048", "0.67184275", "0.66184455", "0.65796345", "0.6571856", "0.65473825", "0.6523081", "0.64922744", "0.6482463", "0.647235", "0.6465849", "0.6444604", "0.643477...
0.0
-1
checks if move has been made before. if not, initialize in move dictionary. otherwise, return current value of making that move.
def _get_values(self, hash: str) -> float: if hash not in self.states: values = 0.0 else: values = self.states[hash] return values
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeMove(self, move):\n\t\ttry:\n\t\t\tif (self.board[int(move) - 1] is Piece.BLANK):\n\t\t\t\tself.board[int(move) - 1] = self.current\n\t\t\t\treturn 1\n\t\t\telse:\n\t\t\t\treturn 0\n\t\texcept:\n\t\t\treturn 0", "def forecast_move(self, move):\n if move not in get_legal_moves(self):\n r...
[ "0.6581317", "0.64663315", "0.6350605", "0.6310733", "0.62825227", "0.6280581", "0.6211462", "0.618281", "0.61476415", "0.6136375", "0.61113304", "0.6085092", "0.60824883", "0.6075988", "0.6072908", "0.60634327", "0.60537124", "0.60463786", "0.60163736", "0.6004055", "0.59900...
0.0
-1
add move to front of the list.
def update_move_history(self, board_hash: str) -> None: self.moves_taken.insert(0, board_hash)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_front(self, item):\n\n self.items.insert(0, item)", "def addFront(self, item, clock):\n temp = Node2Way(item, clock)\n temp.setPrevious(self._front)\n \n if self._size == 0:\n self._rear = temp\n else:\n self._front.setNext(temp)\n ...
[ "0.74281985", "0.7051179", "0.6917639", "0.68836725", "0.6876215", "0.6802277", "0.67820287", "0.67804265", "0.672873", "0.66930217", "0.66753036", "0.66617584", "0.6631564", "0.6548123", "0.63872343", "0.6376272", "0.6376272", "0.62471837", "0.6227319", "0.6203899", "0.61776...
0.0
-1
back to square one.
def reset(self) -> None: self.moves_taken = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def square(l):\n for i in range(4):\n forward(l)\n left(90)", "def walk_down(self):\n if self.col_num == len(self.master_grid.matrix[0])-1 and self.row_num == len(self.master_grid.matrix)-1:\n return None\n if self.row_num == len(self.master_grid.matrix)-1:\n ...
[ "0.6398951", "0.61307216", "0.60816234", "0.6041529", "0.59746027", "0.58239824", "0.57904434", "0.5785858", "0.5785107", "0.5766752", "0.57411844", "0.5710696", "0.5701157", "0.56979847", "0.56743014", "0.56705886", "0.5663607", "0.56095517", "0.558232", "0.5569058", "0.5557...
0.0
-1
Return FP, FN, TP for each class in the image
def compare_with_annot(last_pred, last_annot, iou_thres = 0.5): classes_results = {} for class_idx, pred_dict in last_pred.items(): classes_results[class_idx] = {} classes_results[class_idx]['N'] = len(last_annot[class_idx]['bboxes']) hits = 0 for bbox_annot in last_annot[class_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tp_tn_fp_fn(accuracy_foreach_class_dict):\n tp = accuracy_foreach_class_dict[\"anomaly\"][1]\n tn = accuracy_foreach_class_dict[\"normal\"][1]\n fp = accuracy_foreach_class_dict[\"normal\"][2]\n fn = accuracy_foreach_class_dict[\"anomaly\"][2]\n return tp, tn, fp, fn", "def extract_feat(self, ...
[ "0.686146", "0.6137188", "0.6137188", "0.6093621", "0.6043819", "0.60024786", "0.59570175", "0.5947353", "0.59439754", "0.59368724", "0.5914622", "0.590833", "0.5902004", "0.5901651", "0.58622044", "0.58407634", "0.58253527", "0.57962793", "0.572621", "0.5714585", "0.57066804...
0.0
-1
Selects the best bounding box out of NUMBER_OF_BBOX possible bboxes and calculates the average IOU if consider_class is true then predicted_class has to be equal to annotated class to consider de IOU
def get_IOUs_enhanced(annotations, predictions, n_classes, consider_class = True): NUMBER_OF_BBOX = annotations.shape[-2] obj_indexes = np.where(annotations[:,:,:,:,0] == 1) annotated_bboxes = annotations[obj_indexes][:][:,n_classes+1:n_classes+1+4] bboxes_iou = np.zeros([annotated_bboxes.shape[0], NUMB...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nms(bboxes, iou_threshold, sigma = 0.3, method = 'nms'):\n \"\"\" takes bboxes with the shape of (num_of_box, 6), where 6 => (xmin, ymin, xmax, ymax, score, class) \"\"\"\n \n # remove duplicates in classes\n classes_in_img = list(set(bboxes[:, 5]))\n \n # initialise list to store best bboxes...
[ "0.6985329", "0.6839801", "0.6732569", "0.6646707", "0.66217047", "0.65684223", "0.6531683", "0.64877915", "0.6476494", "0.64743674", "0.6451059", "0.64403445", "0.6401157", "0.63813376", "0.63734615", "0.6373079", "0.6362368", "0.6344149", "0.6338288", "0.6330694", "0.631954...
0.64803255
8
Basic test for findService parsing with a civic address.
def test_findservice_civic_address(self): xml = """ <findService xmlns="urn:ietf:params:xml:ns:lost1" serviceBoundary="reference"> <location id="ce152f4b-2ade-4e37-9741-b6649e2d87a6" profile="civic"> <civ:civicAddress xmlns:civ="urn:ietf:params:xml:ns:pidf:geopri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_client_address_retrieve(self):\n pass", "def test_ipam_services_read(self):\n pass", "def test_get_service_string(self):\n pass", "def test_get_virtual_service(self):\n pass", "def testParse(self):\n services = self._getServices()", "def test_ipam_services_list...
[ "0.64207476", "0.62982064", "0.62926865", "0.62176013", "0.6189355", "0.60833365", "0.606279", "0.5928941", "0.5896843", "0.58331347", "0.57547104", "0.5736013", "0.56428236", "0.56183106", "0.5606168", "0.55707866", "0.5561389", "0.5544311", "0.55386513", "0.5505321", "0.545...
0.7775548
0
Compare tone with OpenSMILE returns 0 score with error message if error occured
def comparePhoneticSimilarity(audioFile, featureFile, verbose=False, profile=False): if (profile): start = time.time() assert(".wav" in audioFile), "Expected .wav as audioFile" configFile = 'databuilder/configs/prosodyShs.conf' error = "" if not (os.path.exists(configFile) and os.path.exists(audioFi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def no_match():\n S1=Spectrum.Spectrum()\n S1.add_peak(50.7,234)\n S1.add_peak(54.6,585)\n S1.add_peak(60.7,773)\n S1.add_peak(65.6,387)\n S1.add_peak(87.7,546)\n S1.add_peak(104.6,598)\n S1.pep_mass=100\n S1.euclidean_scale()\n\n S2=Spectrum.Spectrum()\n S2.add_peak(50.2,234)\n ...
[ "0.601301", "0.5996349", "0.597326", "0.59076625", "0.5871764", "0.5788689", "0.5727182", "0.56832933", "0.5633397", "0.56301457", "0.5597745", "0.5586412", "0.5571524", "0.5533426", "0.5515297", "0.55130965", "0.5483196", "0.5480128", "0.5478033", "0.5466535", "0.5452381", ...
0.51855856
46
Returns the dialogueIDth caption from vttFile
def getCaptionFromVTTcaptionFile(vttFile, dialogueID): import webvtt return webvtt.read(vttFile)[dialogueID].text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def caption(self):\n return self._caption", "def get_caption(self):\n try:\n return self.canvas.getID()\n except (TypeError, AttributeError):\n return self.id", "def __load_dialogue_ids(self, filename):\n with open(filename, \"r\") as file:\n return ...
[ "0.59000456", "0.58283216", "0.5773122", "0.55387735", "0.54730004", "0.54553735", "0.53017414", "0.52924526", "0.52771646", "0.5201588", "0.5136322", "0.51156497", "0.51120484", "0.50966525", "0.5068463", "0.5060997", "0.50441873", "0.50228816", "0.49699327", "0.49609575", "...
0.8716171
0
Requests contentDB for data using urllib
def getProcessedFromContentDB(netflixWatchID, dialogueID, profile=False): if (profile): start = time.time() featureFileURL = '' emotion = '' originalCaption = '' # dialogueID-th dialogue from captionFile # construct json reqdict = { "netflixWatchID" : netflixWatchID, "dialogueID...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch():\n req_data= request.get_json()\n \n ## ddb uses text files, using this as to eat my own dogfoor and improve\n ## no service sql client. No daemon, low cpu.\n\n\n e=load_db()\n try:\n res=e.query(req_data['query'])\n \n serialized = jsonpickle.encode( res,\n ...
[ "0.5862957", "0.57975626", "0.5705349", "0.56556296", "0.5587389", "0.5567929", "0.5567161", "0.5537809", "0.55234325", "0.54986084", "0.5458948", "0.54458195", "0.54153746", "0.5395738", "0.53842735", "0.53804666", "0.53761894", "0.5364374", "0.5359499", "0.5359499", "0.5359...
0.0
-1
returns True (if same emotion)
def compareEmotionSimilarity(audioFile, emotion, emoPredictor, verbose=False, profile=False): error = "" if (profile): start = time.time() # from speech_to_emotion.emotion_classifier_nn import livePredictions # emoPredictor = livePredictions(path='speech_to_emotion/Emotion_Voice_Detection_Model.h5', fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_equivalence(self) -> bool:", "def is_duplicate(self, other):\n if self.att != other.att or self.pol != other.pol:\n return False\n similarity = F.cosine_similarity(self.emb.unsqueeze(0),\n other.emb.unsqueeze(0))\n return similarity >...
[ "0.66043097", "0.6126945", "0.5980369", "0.5870635", "0.5852156", "0.58448535", "0.5837227", "0.5769008", "0.5768744", "0.57412714", "0.5719944", "0.5682366", "0.5676539", "0.56701696", "0.56568533", "0.56337667", "0.5630597", "0.556876", "0.5558811", "0.55464154", "0.5519768...
0.62601924
1
Convert audioFile to text and compares against originalCaption string Returns 0 if an error occured
def compareLyricalSimilarity(userTranscript, originalCaption, verbose=False, profile=False): error = "" if (profile): start = time.time() # cmp = compareToDialogue(audioFile, originalCaption, verbose=verbose) cmp = similar(userTranscript, originalCaption) if (profile): end = time.time() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_text(self):\n if msg.askyesno(message=\"Do you want to save audio file?\"):\n text = self.textbox.get(\"1.0\", tk.END)\n self.file.text = text\n files = [('Sound', '*.mp3')]\n mp3_file = asksaveasfile(title=\"Save your mp3 file\", filetypes=files, defa...
[ "0.64471585", "0.61322695", "0.60957986", "0.6042997", "0.5996542", "0.5938845", "0.57494444", "0.5700308", "0.5667412", "0.5630515", "0.56009644", "0.5593606", "0.5548273", "0.5531259", "0.5517921", "0.5501903", "0.5478674", "0.5471566", "0.54637545", "0.54493004", "0.543375...
0.5649577
9
Log any errors / updates worth consideration to `logFile.txt`
def _logToFile(logsLst, resultJSON=None, logFile="logFile.txt"): if not LOGGING_TO_FILE: return with open(logFile, "a+") as file: message = "\n".join(logsLst) file.write("------------------Logging--------------------\n") file.write(str(datetime.datetime.now()) + "\n") # file.writ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(self, txt):\n if self.logfile:\n self.logfile.write(txt)", "def log(self, *lst):\n self.print2file(self.logfile, self.debug, True, *lst)\n if 'Error' in '\\n'.join([str(x) for x in lst]):\n self.caught_error = '\\n'.join([str(x) for x in lst])", "def logsave(self):\n...
[ "0.68882483", "0.6652503", "0.6550226", "0.6489648", "0.64801645", "0.6474686", "0.6437777", "0.6369502", "0.6365998", "0.6261356", "0.62492037", "0.62482655", "0.6248004", "0.62204903", "0.62183195", "0.62150043", "0.62097436", "0.62011856", "0.6189739", "0.61854243", "0.616...
0.58193773
65
Perform comparison $ python compareAudio.py audioFile(.webm), netflixWatchID(str), dialogueID(number), gameID(str)
def performThreeComparisons(netflixWatchID, dialogueID, audioFile, gameID, userTranscript, emoPredictor, verbose=False, profile=False, logErrors=True): logFile = "logFile.txt" errorsLst = [] resultDICT = {"gameID" : gameID, "dialogueID" : dialogueID, "error" : "", "success" : True} overallscore = 0.0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare(file1, file2):\n process = subprocess.Popen([PBWT_BIN, 'compare', file1, file2],\n stdout=subprocess.PIPE)\n process_results(str(process.communicate()[0]))", "def same_file(wavecar1, wavecar2, wavecar3):\n same = False\n if (filecmp.cmp(wavecar1, wavecar2, sh...
[ "0.5997795", "0.5918491", "0.5860667", "0.5591653", "0.5559069", "0.5415558", "0.537906", "0.53485507", "0.53323954", "0.5326343", "0.5321445", "0.52875805", "0.526904", "0.5242733", "0.5236806", "0.52278113", "0.5217617", "0.5208304", "0.51605356", "0.5155278", "0.51301885",...
0.6617059
0
Build agent's function approximators
def build_graph(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_function(self):\n result = {}\n x0 = 0\n for i, x in enumerate(self.step_vals):\n vals_range = xrange(x0, x)\n for k in vals_range:\n result[k] = i\n x0 = x\n self.function = result", "def _build_expression(self):\n # Get...
[ "0.6071946", "0.58984506", "0.58775413", "0.58521664", "0.5732764", "0.5710692", "0.5704847", "0.5697908", "0.5696569", "0.5598104", "0.5588668", "0.5572613", "0.55401134", "0.5528618", "0.55070966", "0.5493993", "0.54565287", "0.54370886", "0.5425819", "0.54256546", "0.54068...
0.0
-1
Build graph for the logging procedure
def build_logger(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_graph(self):\n pass", "def build_graph(self):\n pass", "def build_graph(self):\n raise NotImplementedError", "def gen_graph(self):", "def log_init(self):\n\t\tlayer_id = \"Data\"\n\t\tself.graph[layer_id] = layer_id\n\t\tself.bottoms[layer_id] = None\n\t\tself.output_shape[l...
[ "0.716409", "0.70692104", "0.65841585", "0.65536815", "0.6370009", "0.63324153", "0.6261546", "0.6247608", "0.6217703", "0.6187986", "0.61408377", "0.6097877", "0.6089329", "0.6065247", "0.6061484", "0.60463005", "0.60370535", "0.6012218", "0.596317", "0.59546924", "0.5934546...
0.6071812
13
Initialize the variables of the model
def initialize_model(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialisation(self):\n self.create_variables()\n self.create_placeholders()\n self.build_model()\n self.reset_lr(None, True)\n self.build_loss()\n self.initialised = True", "def initialize_variables(self):\n self.sess.run(self.init)", "def init_model(self):...
[ "0.79028624", "0.76701003", "0.7357904", "0.7299997", "0.7258896", "0.7204345", "0.7200145", "0.7173436", "0.7050764", "0.7028793", "0.7026541", "0.6996758", "0.6944324", "0.6934423", "0.6934076", "0.6934076", "0.6931822", "0.6903529", "0.68874097", "0.68786246", "0.6864961",...
0.7493104
2
Train the neural network with the trajectories
def train(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trainNet():", "def train(self):\r\n raw_dataset = pd.read_csv(self.datafile, sep = ',', header = 0,\r\n na_values = '?', comment = '\\t',\r\n skipinitialspace = True)\r\n\r\n dataset = raw_dataset.copy()\r\n dataset.tail()...
[ "0.84238064", "0.78679293", "0.76970464", "0.76484424", "0.7647099", "0.75862604", "0.7565016", "0.7514085", "0.7514085", "0.7475018", "0.7415142", "0.7370216", "0.7369993", "0.7343511", "0.73250616", "0.7298394", "0.72868323", "0.7273052", "0.7260297", "0.72523785", "0.72279...
0.709416
41
Evaluate the trained network with simulations (This is seperated from simulation since exploration is not necessary)
def play(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate():\n\tmodel.eval()\n\tstddev = 1 # And mean=0\n\tfor batch_idx, (data, _) in enumerate(syn_test_loader):\n\t\tdata = data.cuda()\n\t\tif batch_idx == 0:\n\t\t\tnoise = torch.autograd.Variable(torch.randn(batch_size, bottleneck).cuda() * stddev)\n\t\t\tsample_representation(\"orig_nat\", data, noise)\...
[ "0.7049329", "0.6991395", "0.6920516", "0.68952745", "0.67432266", "0.67410535", "0.6698653", "0.6678496", "0.6621551", "0.66032165", "0.6575123", "0.6570769", "0.6531601", "0.650734", "0.6446003", "0.643147", "0.6360606", "0.63559276", "0.63241136", "0.63096213", "0.6277143"...
0.0
-1
Init constructor of HID.
def __init__(self, vendor_id: int = 0x2C97, hid_path: Optional[bytes] = None) -> None: if hid is None: raise ImportError("hidapi is not installed, try: " "'pip install ledgercomm[hid]'") self.device = hid.device() self.path: Optional[bytes] = hid_path ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, device_handle):\n\n self.device_handle = device_handle", "def __init__(self):\n self._device_info = None", "def __init__(self, Interface=\"USB\", Number=DRIVER_NUM):\n self.bib = CDLL(\"delib64\") # this will NOT fail...\n self.interface = Interface\n self....
[ "0.6862138", "0.6743291", "0.67000437", "0.66972363", "0.6555643", "0.6550871", "0.65466005", "0.65423924", "0.6522224", "0.6498889", "0.64774984", "0.64688903", "0.64580566", "0.6452935", "0.6445795", "0.6438601", "0.6433724", "0.64092666", "0.6399368", "0.63911164", "0.6384...
0.7098126
0
Open connection to the HID device. Returns None
def open(self) -> None: if not self.__opened: if self.path is None: self.path = HID.enumerate_devices(self.vendor_id)[0] self.device.open_path(self.path) self.device.set_nonblocking(True) self.__opened = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init():\n try:\n h = hid.device()\n h.open(USB_VID, USB_PID)\n h.set_nonblocking(1)\n except IOError as ex:\n print('ERROR: could not establish connection to device')\n print(ex)\n return None\n return h", "def performOpen(self, options={}):\n self._l...
[ "0.76332617", "0.6955843", "0.69416445", "0.68056446", "0.6553122", "0.65466124", "0.6523534", "0.6514852", "0.6506754", "0.64412344", "0.6438013", "0.6406292", "0.6384707", "0.63268006", "0.62957555", "0.6287522", "0.6280608", "0.6214638", "0.62089825", "0.6192919", "0.61830...
0.75960964
1
Enumerate HID devices to find Nano S/X.
def enumerate_devices(vendor_id: int = 0x2C97) -> List[bytes]: devices: List[bytes] = [] for hid_device in hid.enumerate(vendor_id, 0): if (hid_device.get("interface_number") == 0 or # MacOS specific hid_device.get("usage_page") == 0xffa0): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enumerate_devices():\n devices = list(\n map(XInputJoystick, list(range(XInputJoystick.max_devices))))\n return [device for device in devices if device.is_connected()]", "def listUsbHidDevices():\n \n for d in hid.enumerate():\n keys = list(d.keys())\n keys.sort()...
[ "0.669791", "0.65644383", "0.62645656", "0.62418604", "0.62051696", "0.6056922", "0.5982882", "0.5976185", "0.58864295", "0.58860993", "0.5870821", "0.5814101", "0.57680804", "0.5751848", "0.572239", "0.57181394", "0.56890416", "0.5645336", "0.5617422", "0.5617189", "0.561115...
0.60071063
6
Send `data` through HID device `self.device`.
def send(self, data: bytes) -> int: if not data: raise Exception("Can't send empty data!") LOG.debug("=> %s", data.hex()) data = int.to_bytes(len(data), 2, byteorder="big") + data offset: int = 0 seq_idx: int = 0 length: int = 0 while offset < len(d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Send(self, data):\n # TODO(josephsih): should have a method to check the connection status.\n # Currently, once RN-42 is connected to a remote host, all characters\n # except chr(0) transmitted through the serial port are interpreted\n # as characters to send to the remote host.\n logging.debug(...
[ "0.8114699", "0.74745846", "0.72835046", "0.7225305", "0.7079121", "0.69480795", "0.686888", "0.68374884", "0.6755113", "0.6726118", "0.66238755", "0.66056156", "0.6604241", "0.6583607", "0.6567921", "0.65530527", "0.65352786", "0.64986926", "0.6492017", "0.64563245", "0.6445...
0.6496641
18
Receive data through HID device `self.device`. Blocking IO. Returns Tuple[int, bytes] A pair (sw, rdata) containing the status word and response data.
def recv(self) -> Tuple[int, bytes]: seq_idx: int = 0 self.device.set_nonblocking(False) data_chunk: bytes = bytes(self.device.read(64 + 1)) self.device.set_nonblocking(True) assert data_chunk[:2] == b"\x01\x01" assert data_chunk[2] == 5 assert data_chunk[3:5] ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receive_data(self):\n chunks = []\n bytes_recd = 0\n while bytes_recd < 8:\n #I'm reading my data in byte chunks\n try:\n chunk = self.sockfd.recv(min(8 - bytes_recd, 4))\n chunks.append(chunk)\n bytes_recd = bytes_recd + l...
[ "0.65270954", "0.6320771", "0.62461853", "0.6179725", "0.616269", "0.60660446", "0.6049839", "0.59986186", "0.59340626", "0.59284836", "0.59060866", "0.5892542", "0.5891193", "0.5879894", "0.5854489", "0.58111537", "0.5801802", "0.579307", "0.57675236", "0.5746004", "0.572689...
0.67547876
0
Exchange (send + receive) with `self.device`.
def exchange(self, data: bytes) -> Tuple[int, bytes]: self.send(data) return self.recv() # blocking IO
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _ExchangeMessage( self, rx_bytes ) :\r\n \r\n if ( self.handle == None ) : \r\n self._open_device()\r\n if ( self.handle == None ) :\r\n self.Raise( \"USB device not found\" ) \r\n \r\n tx_bytes = self.hand...
[ "0.6672568", "0.6610441", "0.64421993", "0.60326284", "0.6002608", "0.59985787", "0.5998004", "0.59948575", "0.59585065", "0.5938672", "0.5900946", "0.5900208", "0.5843479", "0.5816089", "0.5791394", "0.57508886", "0.57472557", "0.57411444", "0.57379746", "0.5736334", "0.5731...
0.60813767
3
Close connection to HID device `self.device`. Returns None
def close(self) -> None: if self.__opened: self.device.close() self.__opened = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n self.device.close()", "def close(self):\n self.device.disconnect()", "def close_device(self):\n\t\t\n\t\t# reset DigitalIO instrument\n\t\tdwf.FDwfDigitalIOReset()\n\n\t\t#reset DigitalIn instrument\n\t\tdwf.FDwfDigitalInReset(ad_utils.interface_handler)\n\n\t\tdwf.FDwfDeviceCl...
[ "0.7689541", "0.76033694", "0.7488144", "0.7346484", "0.7259698", "0.7257906", "0.7236381", "0.71463615", "0.7126705", "0.7120404", "0.7090371", "0.6978015", "0.6959391", "0.6923237", "0.69071007", "0.68967503", "0.68130153", "0.6735064", "0.6725293", "0.672066", "0.665815", ...
0.7241656
6
Search through the provided list of devices to find the one with the matching usage_page and usage.
def find_device(devices, *, usage_page, usage): if hasattr(devices, "send_report"): devices = [devices] for device in devices: if ( device.usage_page == usage_page and device.usage == usage and hasattr(device, "send_report") ): return devic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_devices (devicelist):\n vprint(\"\\nFind known devices:\")\n for device in devicelist:\n if find_device(device) is not None :\n vprint(\"\\tFound :\", device)\n else:\n vprint(\"\\tNOT found:\", device )\n vprint(\"..........\") \n return", "def ...
[ "0.6269344", "0.5997133", "0.59589404", "0.588711", "0.5793125", "0.57546246", "0.568376", "0.56786346", "0.55943453", "0.550942", "0.55043346", "0.54662585", "0.54382575", "0.5410512", "0.54044867", "0.5389828", "0.5379705", "0.5365242", "0.53301144", "0.5328609", "0.5327337...
0.7825975
0
Suffix tree contains empty string at root node.
def __init__(self): Tree.__init__(self, "")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hasSuffix(self, s):\n node, off = self.followPath(s)\n if node is None:\n return False # fell off the tree\n if off is None:\n # finished on top of a node\n return '$' in node.out\n else:\n # finished at offset 'off' within an edge leading...
[ "0.6829639", "0.6604397", "0.6604397", "0.653885", "0.6506044", "0.64041114", "0.620266", "0.6085274", "0.6077728", "0.6068", "0.60575527", "0.605403", "0.60514796", "0.6047121", "0.60298663", "0.60246706", "0.6022461", "0.60204464", "0.59820855", "0.5976126", "0.59737945", ...
0.0
-1
Insert prefix into current tree.
def insert_suffix(self, prefix, idx): parent_pos = self.path_to_matching_prefix(prefix)[-1] has_inserted = False for child_pos in self.children(parent_pos): if child_pos.element()._label[0] == prefix[0]: # Intermediate node is added between parent and child. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, prefix: str):\n leaf = self.root\n for level in range(len(prefix)):\n letter = prefix[level]\n\n # if current character is not present\n if letter not in leaf.children:\n leaf.children[letter] = self.get_node()\n leaf = leaf....
[ "0.824454", "0.6702643", "0.6659329", "0.65441847", "0.65267813", "0.6520331", "0.64193934", "0.6335701", "0.6227362", "0.6089401", "0.6089401", "0.60877794", "0.60377556", "0.6022887", "0.6006063", "0.59953064", "0.5995097", "0.59828734", "0.5922838", "0.59098965", "0.590850...
0.5517972
76
A O(n^2) algorithm to construct a suffix tree for string with length n. Creates a new tree
def naive_construction(self, string): if not self.is_empty(): Tree.__init__(self, self._SuffixNode(None, -1)) # ensure string ends with '$' character (termination.) if not string.endswith('$'): string += '$' # Insert all prefixes. for i in range(len(stri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_suffix_tree(text):\n tree = dict()\n tree[0] = {}\n head_node = 1\n\n # 例えば、ABC$ という文字列の場合、ABC$, BC$, C$, $ の順に処理\n for p in range(len(text)):\n suffix = text[p:]\n current_node = 0\n\n # サブ文字列の先頭から一文字ずつ処理\n i = 0\n while i < len(suffix):\n c = suffix[i]\n cur_str = suffix[i...
[ "0.76870435", "0.6643681", "0.6568005", "0.65335166", "0.62937254", "0.614511", "0.61273575", "0.598203", "0.5965032", "0.5751854", "0.56694895", "0.5659555", "0.56507343", "0.5617138", "0.55916727", "0.55526924", "0.55391175", "0.5462947", "0.54626524", "0.5446805", "0.54132...
0.6463355
4
Calculate the great circle distance between two points on the earth (specified in decimal degrees) by default, between the center of the earh and anypoint
def haversine( coordsA, coordsB = {'lat': 0, 'long': 0} ) -> int: # convert decimal degrees to radians if type( coordsA ) == dict: [lat1, lon1] = [coordsA['lat'], coordsA['long']] elif type( coordsA ) == str: [lat1, lon1] = coordsA.split(",") elif type( coordsA ) == list: [lat1,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long...
[ "0.76905084", "0.72814983", "0.7257619", "0.7141139", "0.71320075", "0.6970445", "0.69449705", "0.6929295", "0.6892779", "0.6889518", "0.68526417", "0.68168545", "0.6815274", "0.68049467", "0.67489856", "0.6743163", "0.67333126", "0.6712626", "0.66993904", "0.66911364", "0.66...
0.0
-1
function to convert contribs collection items to edges ones edge doc {_id, name_1, name_2, tags [{name, urls[]}]} =========================================================== if src in srcs then skip if name_1 and name_2 not found then insert new doc if tag.name not found then insert new tag if tag.url not found then in...
def contribs2edges(): client = mongo.MongoClient(config["MONGO_URI"]) db = client.links db.edges.remove() edges = dict() for contrib in db.contribs.find(): for item in contrib["data"]: id = u"{} {}".format(item["name_1"], item["name_2"]).replace(" ", "_") edge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_edge_list(cong):\n usr_to_src = []\n list_to_exclude = [\n 'twitter',\n 'youtu',\n 'fllwrs',\n 'unfollowspy',\n 'livetv',\n 'pscp',\n 'live',\n 'ln.is',\n 'tinyurl',\n 'facebook',\n 'bit.ly',\n 'goo.gl',\n ...
[ "0.5155826", "0.5116931", "0.502896", "0.48469794", "0.4804909", "0.47966293", "0.47729138", "0.47717592", "0.47354752", "0.4730931", "0.47188097", "0.47089943", "0.4695777", "0.46924073", "0.4670455", "0.4657417", "0.46162593", "0.46076247", "0.45932865", "0.45638296", "0.45...
0.7434294
0
Bootstrap resample an array_like
def bootstrap_resample(self, X, n=None): if n == None: n = len(X) resample_i = np.floor(np.random.rand(n)*len(X)).astype(int) X_resample = X.iloc[resample_i, :] return X_resample
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bootstrap_resample(X, n=None):\r\n if n == None:\r\n n = len(X)\r\n \r\n resample_i = np.floor(np.random.rand(n)*len(X)).astype(int)\r\n X_resample = X[resample_i]\r\n return X_resample", "def bootstrap_resample(X, n=None):\r\n if n == None:\r\n n = len(X)\r\n\r\n resam...
[ "0.7452041", "0.7263313", "0.71732163", "0.6405318", "0.63510484", "0.63177764", "0.6304294", "0.6232666", "0.62305534", "0.61733615", "0.61665726", "0.6103233", "0.6089676", "0.60844344", "0.60844344", "0.6076023", "0.60429317", "0.6033939", "0.6027019", "0.60022396", "0.595...
0.7123745
3
Emit overrides the abstract logging.Handler logRecord emit method records the log
def emit(self, record): print(record.__dict__)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emit(self, record):\n try:\n msg = self.format(record)\n log_level = record.levelno\n self.write_log(msg, log_level)\n except Exception:\n self.handleError(record)", "def emit(self, record):\n try:\n msg = self.format(record)\n ...
[ "0.81659305", "0.80186856", "0.7616163", "0.753549", "0.74377483", "0.74377483", "0.7402443", "0.7399078", "0.73509914", "0.7346712", "0.732033", "0.7156843", "0.7148359", "0.7119556", "0.71083254", "0.7105942", "0.7044156", "0.7007883", "0.6835894", "0.6824077", "0.68092453"...
0.7213005
11
Execute executes the specified SQL query (might be in a transaction context, if Query.transaction_id is set).
def Execute(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute_statement(self, statement):\n context = self.__context\n session = context.session()\n with session as connection:\n query_result = connection.execute(statement)\n\n return query_result", "def execute_query(self, query):\n with self.db_engine.connect() as...
[ "0.7590123", "0.7247031", "0.7169071", "0.7088199", "0.70669395", "0.7059763", "0.70256394", "0.698615", "0.6926175", "0.6868136", "0.6859177", "0.6851325", "0.6851325", "0.6835212", "0.6789023", "0.6758888", "0.6758811", "0.67554", "0.6754189", "0.6751403", "0.6685197", "0...
0.0
-1
ExecuteBatch executes a list of queries, and returns the result for each query.
def ExecuteBatch(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batch_execute(self, sql_list):\n with self.connection.cursor() as dbc:\n responses = []\n for sql in sql_list:\n dbc.execute(sql)\n responses.append(dbc.fetchall())\n return responses", "def execute_many(self, sql, args=None):\r\n a...
[ "0.78971225", "0.7297311", "0.7183084", "0.6912823", "0.68590426", "0.68088025", "0.67924225", "0.6742135", "0.67240494", "0.6717273", "0.6667804", "0.6663774", "0.6625337", "0.65395296", "0.6484512", "0.64706194", "0.646509", "0.6462636", "0.64610827", "0.6405896", "0.639893...
0.58510387
56
StreamExecute executes a streaming query. Use this method if the query returns a large number of rows. The first QueryResult will contain the Fields, subsequent QueryResult messages will contain the rows.
def StreamExecute(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(self, query):\n with self.conn.cursor() as cur:\n # Execute the query\n try:\n cur.execute(query)\n except Exception as exc:\n print(\"Unable to execute query. Error was {0}\".format(str(exc)))\n exit()\n ro...
[ "0.61123246", "0.6092492", "0.5998644", "0.5964264", "0.5893205", "0.587983", "0.5879137", "0.5836698", "0.5732992", "0.5697595", "0.5687175", "0.5622964", "0.5613709", "0.55874527", "0.5575201", "0.5553297", "0.5541185", "0.55186146", "0.5512491", "0.54958117", "0.548273", ...
0.0
-1
Prepare preares a transaction.
def Prepare(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare(self) -> None:\n trans = self._transaction\n if trans is None:\n trans = self._autobegin_t()\n\n trans.prepare()", "def prepare_for_commit(self):", "def prepare(self):\n pass", "def prepare(self):\n pass", "def prepare(self):\n pass", "def ...
[ "0.8410679", "0.7001432", "0.6574274", "0.6574274", "0.6574274", "0.64655685", "0.63754845", "0.6311319", "0.6223688", "0.61802596", "0.61802596", "0.61802596", "0.61802596", "0.61802596", "0.61802596", "0.61802596", "0.61754274", "0.61486727", "0.6050652", "0.60368794", "0.6...
0.0
-1
CommitPrepared commits a prepared transaction.
def CommitPrepared(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CommitPrepared(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def CommitPrepared(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()", "def post_prepared_commit(self, key, prepared):\n docs = ...
[ "0.69002336", "0.68232703", "0.677715", "0.567485", "0.5660226", "0.5630717", "0.5601845", "0.55818135", "0.55588466", "0.5414727", "0.537227", "0.5353509", "0.53374785", "0.53097814", "0.52796453", "0.5208319", "0.5195262", "0.5135492", "0.5135492", "0.50988245", "0.5068812"...
0.62075883
3
RollbackPrepared rolls back a prepared transaction.
def RollbackPrepared(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RollbackPrepared(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def RollbackPrepared(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()", "def rollback(self):\n self._connection.execute_nonquery(\"...
[ "0.65784436", "0.6450222", "0.6257658", "0.5932248", "0.5872741", "0.5795709", "0.5696239", "0.5617441", "0.55968213", "0.5574776", "0.5546432", "0.54966366", "0.5483333", "0.54233134", "0.5419659", "0.5336303", "0.5319498", "0.5277183", "0.52744156", "0.52693737", "0.5252406...
0.58695024
6
CreateTransaction creates the metadata for a 2pc transaction.
def CreateTransaction(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateTransaction(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()", "def CreateTransaction(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def create_transaction(self, receiver, amount, comment=\"\"):\n...
[ "0.7027417", "0.65196544", "0.64316773", "0.62087923", "0.60003686", "0.59858954", "0.58080804", "0.57972205", "0.5790327", "0.57589394", "0.5734144", "0.5703672", "0.5678347", "0.5670476", "0.5629838", "0.56017053", "0.55468065", "0.55460596", "0.5519897", "0.5475936", "0.54...
0.62451214
3
StartCommit initiates a commit for a 2pc transaction.
def StartCommit(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def StartCommit(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def StartCommit(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()", "def begin_commit(self, _stacklevel=1):\n if self.commit_phase:\n ...
[ "0.69779134", "0.67022675", "0.6374768", "0.62052375", "0.5827012", "0.5754907", "0.5623243", "0.5612392", "0.55755603", "0.5503088", "0.5498579", "0.54919153", "0.54549724", "0.54370314", "0.5418667", "0.52956843", "0.52474976", "0.5242918", "0.5212305", "0.5158825", "0.5135...
0.6510619
2
SetRollback marks the 2pc transaction for rollback.
def SetRollback(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetRollback(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def SetRollback(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()", "def rollback(self):\n self._rollback = True", "def rollback(self, ...
[ "0.70415974", "0.67804295", "0.6566904", "0.6302689", "0.6279038", "0.5817215", "0.5795934", "0.5751513", "0.57504106", "0.57360476", "0.5729921", "0.55963874", "0.556732", "0.5525788", "0.55152684", "0.5480133", "0.54312456", "0.5368917", "0.5368417", "0.5331688", "0.5325234...
0.6231145
5
ConcludeTransaction marks the 2pc transaction as resolved.
def ConcludeTransaction(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ConcludeTransaction(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def ConcludeTransaction(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()", "def tpc_finish(self, transaction):\n raise NotImplem...
[ "0.67960286", "0.6696259", "0.60833055", "0.53630143", "0.53046906", "0.51564556", "0.5111534", "0.5006666", "0.4965056", "0.4959645", "0.4903526", "0.49033082", "0.48385334", "0.48318043", "0.4801351", "0.47558016", "0.47272316", "0.47141683", "0.46993113", "0.4675617", "0.4...
0.6253946
2
ReadTransaction returns the 2pc transaction info.
def ReadTransaction(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ReadTransaction(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def ReadTransaction(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()", "def _read_transaction(self, tx_fun, **kwargs):\n # Wrapper f...
[ "0.69325835", "0.67596567", "0.6342749", "0.566911", "0.56382346", "0.56372833", "0.55744946", "0.5509677", "0.544398", "0.5404501", "0.54030645", "0.54030645", "0.5399337", "0.53950936", "0.5383335", "0.53821176", "0.5373266", "0.5349258", "0.5288624", "0.5255775", "0.524392...
0.62335604
3
BeginExecute executes a begin and the specified SQL query.
def BeginExecute(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def begin(self):\n self._in_transaction = True\n self.execute(\"BEGIN\")", "def start_transaction_sql(self):\n return \"BEGIN TRANSACTION\"", "def start_transaction(self):\n self._connection.execute_nonquery(\"sql\", \"START TRANSACTION\", True)", "def startTxn(self,msg=\"\"):\n\t...
[ "0.6814344", "0.6080396", "0.5855154", "0.58330435", "0.56852597", "0.56840986", "0.56803703", "0.5670721", "0.55603486", "0.55467397", "0.5541032", "0.5533288", "0.5515175", "0.5459195", "0.5458255", "0.54457515", "0.5431761", "0.5396275", "0.5384897", "0.53836185", "0.53566...
0.0
-1
BeginExecuteBatch executes a begin and a list of queries.
def BeginExecuteBatch(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def BeginExecuteBatch(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def BeginExecuteBatch(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()", "def insert_many_execute(self) -> None:\n self.connection...
[ "0.68904305", "0.67491", "0.6390388", "0.59859765", "0.59389424", "0.5861362", "0.57830834", "0.57773644", "0.5732274", "0.5667679", "0.5549289", "0.5544553", "0.55342305", "0.5516681", "0.5435256", "0.536045", "0.5342036", "0.53406656", "0.5280119", "0.52774423", "0.5263082"...
0.6208538
4
MessageStream streams messages from a message table.
def MessageStream(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def message_table(message):\r\n table = Table(['property', 'value'])\r\n table.align['property'] = 'r'\r\n table.align['value'] = 'l'\r\n\r\n table.add_row(['id', message['id']])\r\n table.add_row(['initial_entry_time', message['initial_entry_time']])\r\n table.add_row(['visibility_delay', messag...
[ "0.5896682", "0.5609692", "0.56041276", "0.5388515", "0.53177005", "0.52457964", "0.5238697", "0.52366567", "0.52348894", "0.5195175", "0.5176002", "0.5151693", "0.51319724", "0.51315767", "0.5099497", "0.5045646", "0.50385904", "0.50096095", "0.5003209", "0.49966025", "0.493...
0.47767812
47
MessageAck acks messages for a table.
def MessageAck(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MessageAck(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def MessageAck(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()", "def ack(self, tup_id):\n pass", "async def ack(self, offset: int):", "...
[ "0.64959633", "0.64412004", "0.62590575", "0.6091653", "0.5954156", "0.58493274", "0.5831551", "0.57382613", "0.57264817", "0.56786704", "0.5646465", "0.5615886", "0.56138206", "0.5597098", "0.54789007", "0.5456883", "0.5329339", "0.53248435", "0.53145635", "0.5300762", "0.52...
0.6130686
4
SplitQuery is the API to facilitate MapReducetype iterations over large data sets (like full table dumps).
def SplitQuery(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SplitQuery(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "def SplitQuery(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()", "def get_splits(datastore, query, num_splits, partition=None):\n\n # Validate...
[ "0.69221485", "0.65455127", "0.6398275", "0.5844143", "0.58412147", "0.5747338", "0.5668508", "0.5646011", "0.56448406", "0.5368807", "0.53658277", "0.53620774", "0.5309061", "0.5297343", "0.5291058", "0.52775466", "0.5261138", "0.52405804", "0.5234456", "0.519282", "0.516202...
0.6370883
4
StreamHealth runs a streaming RPC to the tablet, that returns the current health of the tablet on a regular basis.
def StreamHealth(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def StreamHealth(self, request, timeout, metadata=None, with_call=False, protocol_options=None):\n raise NotImplementedError()", "def StreamHealth(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)", "async def health(self):\n\n request = telemetry_pb2.SubscribeHealt...
[ "0.7608533", "0.7594466", "0.65876895", "0.596237", "0.5666134", "0.5444123", "0.5427727", "0.54094017", "0.5407425", "0.53967756", "0.53581214", "0.53127843", "0.52864975", "0.5257775", "0.5237875", "0.523024", "0.5206512", "0.5199296", "0.5146353", "0.51393175", "0.51260155...
0.7317585
3