query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Prepare the bbox for testing
def im_detect_bbox(model, im, target_scale, target_max_size, boxes=None): inputs, im_scale = _get_blobs(im, boxes, target_scale, target_max_size) if cfg.DEDUP_BOXES > 0: v = np.array([1, 1e3, 1e6, 1e9, 1e12]) hashes = np.round(inputs['rois'] * cfg.DEDUP_BOXES).dot(v) _, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_bbox(self, bbox):\n self.bbox = bbox", "def _initial_normal_bbox(self):\n cx = cy = .5\n width = FLAGS.bbox_grid / float(FLAGS.cropbox_grid)\n x1 = cx - width / 2\n x2 = cx + width / 2\n y1 = cy - width / 2\n y2 = cy + width / 2\n return [y1,x1,y2,x...
[ "0.6966571", "0.67420197", "0.6552466", "0.6518729", "0.6516403", "0.6432396", "0.6400132", "0.6351744", "0.6219042", "0.62138695", "0.6196406", "0.6147961", "0.6111215", "0.61093885", "0.60705376", "0.6052948", "0.6038364", "0.600349", "0.5991612", "0.5981897", "0.59487635",...
0.0
-1
Performs bbox detection on the horizontally flipped image. Function signature is the same as for im_detect_bbox.
def im_detect_bbox_hflip( model, im, target_scale, target_max_size, box_proposals=None): # Compute predictions on the flipped image im_hf = im[:, ::-1, :] im_width = im.shape[1] box_proposals_hf = box_utils.flip_boxes(box_proposals, im_width) scores_hf, boxes_hf, im_scale = im_detect_bbox(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def im_detect_bbox_hflip(model, im, box_proposals=None):\n # Compute predictions on the flipped image\n im_hf = im[:, ::-1, :]\n im_width = im.shape[1]\n\n if not cfg.MODEL.FASTER_RCNN:\n box_proposals_hf = box_utils.flip_boxes(box_proposals, im_width)\n else:\n box_proposals_hf = None...
[ "0.6182488", "0.5824704", "0.57493585", "0.57272583", "0.56876653", "0.5658653", "0.5552626", "0.54948044", "0.5457508", "0.5437004", "0.54337484", "0.54308534", "0.5421245", "0.541279", "0.541279", "0.5407608", "0.54063535", "0.53689456", "0.5360466", "0.53449714", "0.533777...
0.5569363
6
Computes bbox detections at the given widthrelative aspect ratio. Returns predictions in the original image space.
def im_detect_bbox_aspect_ratio( model, im, aspect_ratio, box_proposals=None, hflip=False): # Compute predictions on the transformed image im_ar = image_utils.aspect_ratio_rel(im, aspect_ratio) box_proposals_ar = box_utils.aspect_ratio(box_proposals, aspect_ratio) if hflip: scores_ar, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def im_detect_bbox_aspect_ratio(\n model, im, aspect_ratio, box_proposals=None, hflip=False\n):\n # Compute predictions on the transformed image\n im_ar = image_utils.aspect_ratio_rel(im, aspect_ratio)\n\n if not cfg.MODEL.FASTER_RCNN:\n box_proposals_ar = box_utils.aspect_ratio(box_proposals, a...
[ "0.672954", "0.6302237", "0.6214299", "0.5986568", "0.59765476", "0.5962023", "0.58295494", "0.58108795", "0.5795237", "0.57898295", "0.57642776", "0.5759593", "0.5736138", "0.5731034", "0.57209665", "0.57071453", "0.5703209", "0.5688644", "0.5647422", "0.56324524", "0.562777...
0.6585105
1
Returns boundingbox detection results for CorLoc evaluation. `boxes` has shape (detections, 4 classes), where each row represents a list of predicted bounding boxes for each of the object classes in the dataset (including the background class). The detections in each row originate from the same object proposal. `scores...
def box_results_for_corloc(scores, boxes): # NOTE: support single-batch num_classes = cfg.MODEL.NUM_CLASSES + 1 cls_boxes = [[] for _ in range(num_classes)] # Apply threshold on detection probabilities and apply NMS # Skip j = 0, because it's the background class for j in range(1, num_classes): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_human_box_detection(boxes,scores,classes,height,width):\n\t# print(boxes)\n\tarray_boxes = list() # Create an empty list\n\tfor i in range(boxes.shape[1]):\n\t\t# If the class of the detected object is 1 and the confidence of the prediction is > 0.75\n\t\tif int(classes[i]) == 0 and scores[i] > 0.5:\n\t\t\...
[ "0.7741904", "0.7510764", "0.6929808", "0.6835392", "0.679587", "0.67734", "0.6743864", "0.66875964", "0.66742665", "0.66711694", "0.6646879", "0.6578414", "0.65684825", "0.65482825", "0.65476054", "0.652466", "0.6506024", "0.6491173", "0.64657885", "0.6430328", "0.6418303", ...
0.84902674
0
convert index tensor into onehot tensor
def onehot(t, num_classes, device='cpu'): return torch.zeros(t.size()[0], num_classes).to(device).scatter_(1, t.view(-1, 1), 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot(index):\n\toutput = np.zeros(100)\n\toutput[index] = 1\n\treturn output", "def one_hot(index, dims, dtype=np.uint8):\n\n seq_len = len(index)\n ret = np.zeros((seq_len, dims), dtype)\n for i in range(seq_len):\n ret[i][index[i]]=1\n\n return ret", "def one_hot(index, dims, dtype=...
[ "0.8141822", "0.8123348", "0.7938807", "0.7934676", "0.78259844", "0.7813101", "0.78078324", "0.7753636", "0.7753636", "0.7753636", "0.7753636", "0.7714539", "0.7690334", "0.7602584", "0.7563389", "0.75560385", "0.74890256", "0.7458115", "0.7444748", "0.7422105", "0.7404215",...
0.71148354
40
Computes the distillation loss (crossentropy). xentropy(y, t) = kl_div(y, t) + entropy(t) entropy(t) does not contribute to gradient wrt y, so we skip that. Thus, loss value is slightly different, but gradients are correct. \delta_y{xentropy(y, t)} = \delta_y{kl_div(y, t)}. scale is required as kl_div normalizes by nel...
def distillation_KL_loss(y, teacher_scores, T, scale=1, reduction='batchmean'): return F.kl_div(F.log_softmax(y / T, dim=1), F.softmax(teacher_scores / T, dim=1), reduction=reduction) * scale
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kl_loss(y_true, y_pred):\n #y_true = tf.constant(y_true, dtype=tf.dtypes.float64)\n #y_pred = tf.constant(y_pred, dtype=tf.dtypes.float64)\n #y_true = tf.reshape(y_true, shape=[y_true.shape[0], y_true.shape[1] * y_true.shape[2]])\n #y_pred = tf.reshape(y_pred, shape=[y_pred.shape[0], y_pred.shape[1...
[ "0.70151705", "0.6756773", "0.6650427", "0.66294473", "0.6439588", "0.6436321", "0.64304984", "0.6389738", "0.63784224", "0.6375937", "0.63245344", "0.6306833", "0.62557304", "0.6247313", "0.6241362", "0.623707", "0.62316644", "0.6202028", "0.6199382", "0.6194296", "0.6191860...
0.7143486
0
Plot the correlations between the imaging section and the overscan regions
def plot(self, dtables, figs, **kwargs): self.safe_update(**kwargs) figs.setup_amp_plots_grid("row", title="Correlation: imaging region and serial overscan", xlabel="Correlation", ylabel="Number of fram...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_corls():\n datar = data_from_fits(\"752_1_373_r.fits\")\n datar = other_object(datar)\n datag = data_from_fits(\"752_1_373_g.fits\")\n datag = other_object(datag)\n corl = correlate2d(datar, datag, mode=\"same\")\n plt.figure()\n plt.imshow(corl)\n\n datar = data_from_fits(\"752_1_...
[ "0.693846", "0.6372102", "0.6355463", "0.63510984", "0.63501024", "0.6235761", "0.6174513", "0.6094558", "0.6092361", "0.6078088", "0.60762465", "0.603099", "0.602353", "0.60150677", "0.60141426", "0.60004723", "0.5980533", "0.5951548", "0.5924953", "0.5900207", "0.5882456", ...
0.56890625
42
Prepares decimal properties for serialization.
def decimal_default(obj): if isinstance(obj, Decimal): return float(obj) raise TypeError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addDecimal(self):\n\t\t# set the decimal flag to true\n\t\tself.decimal = True", "def to_python(self, value):\n if not value or value is models.fields.NOT_PROVIDED:\n value = None\n elif not isinstance(value, Decimal):\n try:\n value = Decimal(value)\n ...
[ "0.60131687", "0.5874916", "0.5849401", "0.5716265", "0.57061917", "0.57061917", "0.56848085", "0.55435526", "0.54976004", "0.53915364", "0.52813786", "0.5277511", "0.5253179", "0.5213687", "0.5206545", "0.517817", "0.517263", "0.5167077", "0.5116264", "0.5096722", "0.5096722...
0.52745336
12
Generate a yaxis label.
def get_y_axis_label( self, label: float | str | Mobject, edge: Sequence[float] = UR, direction: Sequence[float] = UP * 0.5 + RIGHT, buff: float = SMALL_BUFF, **kwargs, ): return self._get_axis_label( label, self.get_y_axis(), edge, direction, buf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yaxis(self,label,units):\r\n if units != \"\": label = label + \" (\" + units + \")\"\r\n self.ybox.set_text(r\"$%s$\" % (label))\r\n pass", "def yaxis(self,label,units):\n if units != \"\": label = label + \" (\" + units + \")\"\n self.subplot.set_ylabel(label)\n pa...
[ "0.8227942", "0.79052377", "0.7674196", "0.76579213", "0.750895", "0.75019664", "0.7406044", "0.7255396", "0.71438473", "0.70828366", "0.7052797", "0.7042221", "0.68928456", "0.6886702", "0.6879837", "0.68081725", "0.673278", "0.66869974", "0.66759884", "0.66285", "0.6595231"...
0.6677377
18
Gets the label for an axis.
def _get_axis_label( self, label: float | str | Mobject, axis: Mobject, edge: Sequence[float], direction: Sequence[float], buff: float = SMALL_BUFF, ) -> Mobject: label = self.x_axis._create_label_tex(label) label.next_to(axis.get_edge_center(edge), d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAxisLabel(self, dim=0):\n return self.__axis_labels__[dim]", "def get_label(self, ):\n return self.attrs.get(self.AttributeNames.LABEL, None)", "def get_label(self):\n return self._label", "def get_xlabel(self):\n return self._frame.GetXaxis().GetTitle()", "def axis_name(...
[ "0.87753755", "0.7530706", "0.73374903", "0.72849876", "0.72739863", "0.7272935", "0.72253925", "0.72253925", "0.72253925", "0.72253925", "0.7222282", "0.7215354", "0.7119576", "0.7114512", "0.71038204", "0.70706046", "0.70706046", "0.7050689", "0.70433223", "0.70149016", "0....
0.71934664
12
Generate both horizontal and vertical lines from the axis to a point.
def get_lines_to_point(self, point: Sequence[float], **kwargs) -> VGroup: return VGroup( self.get_horizontal_line(point, **kwargs), self.get_vertical_line(point, **kwargs), )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vertical_line(self, point: Sequence[float], **kwargs) -> Line:\n return self.get_line_from_axis_to_point(0, point, **kwargs)", "def get_horizontal_line(self, point: Sequence[float], **kwargs) -> Line:\n\n return self.get_line_from_axis_to_point(1, point, **kwargs)", "def _timeseries_scatt...
[ "0.7108244", "0.6875732", "0.66365963", "0.65928745", "0.65909636", "0.6520879", "0.6503831", "0.6487805", "0.648163", "0.6432075", "0.6308987", "0.6271464", "0.6261162", "0.6258664", "0.62463564", "0.6241959", "0.6208864", "0.6199402", "0.6172402", "0.6143931", "0.61390734",...
0.63500106
10
Returns the coordinates of the point on a ``graph`` corresponding to an ``x`` value.
def input_to_graph_point( self, x: float, graph: ParametricFunction | VMobject, ) -> np.ndarray: if hasattr(graph, "underlying_function"): return graph.function(x) else: alpha = binary_search( function=lambda a: self.point_to_coords(gr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_to_graph_coords(self, x: float, graph: ParametricFunction) -> tuple:\n return x, graph.underlying_function(x)", "def getXPoint(self, x):\n # Find the correct parameter\n t = (x - self.p0.x) / self.d.x\n return self.point(t)", "def x(self):\n return self.coords[0]", ...
[ "0.7841663", "0.66105354", "0.6508879", "0.6476537", "0.64451355", "0.63583493", "0.6354626", "0.62801176", "0.62641", "0.6256653", "0.6178826", "0.6174611", "0.6141701", "0.60935956", "0.6065692", "0.6032158", "0.6015208", "0.5977572", "0.5914724", "0.58902", "0.5873554", ...
0.74346864
1
Returns the slope of the tangent to the plotted curve at a particular xvalue.
def slope_of_tangent(self, x: float, graph: ParametricFunction, **kwargs) -> float: return np.tan(self.angle_of_tangent(x, graph, **kwargs))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slope_from_origin(self):\n\n return (self.y / self.x)", "def _get_slope(x, y):\n slope = linregress(x, y)\n return slope", "def slope_from_origin(self):\n\n return self.y / self.x", "def y_x(self, x: datetime) -> float:\n return self.point_1_price + self.slope * ((x - self.poin...
[ "0.6639386", "0.66348726", "0.6610466", "0.65976924", "0.6513201", "0.64980966", "0.6454291", "0.6426198", "0.62436086", "0.62435144", "0.62250084", "0.6168508", "0.6142982", "0.60090274", "0.6003554", "0.59907705", "0.59572643", "0.59516686", "0.5924366", "0.590071", "0.5825...
0.7194209
0
Returns the curve of the derivative of the passed graph.
def plot_derivative_graph( self, graph: ParametricFunction, color: ParsableManimColor = GREEN, **kwargs ) -> ParametricFunction: def deriv(x): return self.slope_of_tangent(x, graph) return self.plot(deriv, color=color, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def derivative ( self ):\n return self.__derivative", "def GetDerivative(self, *args):\n return _ITKCostFunctionsPython.itkMultipleValuedCostFunction_GetDerivative(self, *args)", "def GetDerivative(self, *args):\n return _ITKCostFunctionsPython.itkSingleValuedCostFunction_GetDerivative(sel...
[ "0.6369099", "0.6326718", "0.6288467", "0.6017354", "0.59758127", "0.59411705", "0.5863611", "0.5855571", "0.5836694", "0.5816868", "0.58127904", "0.5799604", "0.5785975", "0.5708168", "0.5697701", "0.5684031", "0.5659943", "0.56595534", "0.55859095", "0.555919", "0.5558215",...
0.67640215
0
Obtains multiple lines from the xaxis to the curve.
def get_vertical_lines_to_graph( self, graph: ParametricFunction, x_range: Sequence[float] | None = None, num_lines: int = 20, **kwargs, ) -> VGroup: x_range = x_range if x_range is not None else self.x_range return VGroup( *( sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qline(xlist,ylist):\n dislin.qplot(xlist,ylist,len(xlist))", "def plot_lines(self):\n self.plot(3)", "def replot(self,ax):\n self.XP_Plotter.replot(ax)\n # theoretical lines\n self.lines_theory[0].set_xdata(self.xx)\n self.lines_theory[1].set_xdata(self.xx)\n se...
[ "0.65871125", "0.65809375", "0.6135538", "0.6092746", "0.6072509", "0.6069105", "0.60562533", "0.6054617", "0.60489064", "0.60173464", "0.5973174", "0.59499687", "0.5937346", "0.5905085", "0.5882371", "0.5876883", "0.58451146", "0.5839097", "0.582798", "0.58190787", "0.580837...
0.0
-1
Gets the axes. Returns
def get_axes(self) -> VGroup: return self.axes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def axes(self):\n return self._axes", "def axes(self):\n return self._axes", "def axes(self) -> np.ndarray: # array[Axes]\n return self._axes", "def get_data(self):\n return [self.axes]", "def getPlot(self):\n return self.axes", "def line_axes (self):\n return self....
[ "0.92088455", "0.92088455", "0.87896276", "0.78004646", "0.7642295", "0.76063794", "0.7527869", "0.7503387", "0.7351898", "0.731086", "0.72215635", "0.6981592", "0.6928016", "0.68351", "0.67023706", "0.66861635", "0.66528016", "0.65697604", "0.65534", "0.6546364", "0.6543556"...
0.8363567
3
Generate a yaxis label.
def get_y_axis_label( self, label: float | str | Mobject, edge: Sequence[float] = UR, direction: Sequence[float] = UR, buff: float = SMALL_BUFF, rotation=PI / 2, rotation_axis=OUT, **kwargs, ) -> Mobject: positioned_label = self._get_axis_labe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yaxis(self,label,units):\r\n if units != \"\": label = label + \" (\" + units + \")\"\r\n self.ybox.set_text(r\"$%s$\" % (label))\r\n pass", "def yaxis(self,label,units):\n if units != \"\": label = label + \" (\" + units + \")\"\n self.subplot.set_ylabel(label)\n pa...
[ "0.8227942", "0.79052377", "0.7674196", "0.76579213", "0.750895", "0.75019664", "0.7406044", "0.7255396", "0.71438473", "0.70828366", "0.7052797", "0.7042221", "0.68928456", "0.6886702", "0.6879837", "0.68081725", "0.673278", "0.66869974", "0.6677377", "0.66759884", "0.66285"...
0.6411918
24
Gets the axes. Returns
def get_axes(self) -> VGroup: return self.axes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def axes(self):\n return self._axes", "def axes(self):\n return self._axes", "def axes(self) -> np.ndarray: # array[Axes]\n return self._axes", "def get_data(self):\n return [self.axes]", "def getPlot(self):\n return self.axes", "def line_axes (self):\n return self....
[ "0.92088455", "0.92088455", "0.87896276", "0.78004646", "0.7642295", "0.76063794", "0.7527869", "0.7503387", "0.7351898", "0.731086", "0.72215635", "0.6981592", "0.6928016", "0.68351", "0.67023706", "0.66861635", "0.66528016", "0.65697604", "0.65534", "0.6546364", "0.6543556"...
0.8363567
4
Generate a list containing the numerical values of the plane's labels. Returns List[float | complex] A list of floats representing the xaxis and complex numbers representing the yaxis.
def _get_default_coordinate_values(self) -> list[float | complex]: x_numbers = self.get_x_axis().get_tick_range() y_numbers = self.get_y_axis().get_tick_range() y_numbers = [complex(0, y) for y in y_numbers if y != 0] return [*x_numbers, *y_numbers]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self):\n a0 = map(self._alphabet.unrank, self._labels[0])\n a1 = map(self._alphabet.unrank, self._labels[1])\n return [a0, a1]", "def extract_labels_xyz(scene: \"Scenemaker\") -> List[Tuple[int, np.ndarray]]:\r\n objects = utils.select_collection(scene.target_collection)\r\n ...
[ "0.65264416", "0.63392854", "0.63300544", "0.6297901", "0.6264676", "0.6235284", "0.6090482", "0.60119814", "0.5992731", "0.59487486", "0.59450656", "0.5908407", "0.5888929", "0.58832306", "0.587827", "0.5862866", "0.58465964", "0.5810316", "0.5808058", "0.57920593", "0.57806...
0.0
-1
Initialize plasma parameters. The most basic description is composition (ion), temperature, density, and ionization.
def __init__(self, T_e, n_e, Z=None, particle="p"): self.T_e = T_e self.n_e = n_e self.particle = particle self.Z = _grab_charge(particle, Z) # extract mass from particle self.ionMass = particle_mass(self.particle)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_params(self):\n self.params = Parameters()\n self.params.add('qoff', self.qoff, vary=0, min=-np.inf, max=np.inf, expr=None, brute_step=0.1)\n self.params.add('yscale', self.yscale, vary=0, min=0, max=np.inf, expr=None, brute_step=0.1)\n self.params.add('int_bg', self.int_bg, va...
[ "0.6619388", "0.6609449", "0.65829253", "0.65325874", "0.6515237", "0.63627404", "0.6353513", "0.6349745", "0.6313364", "0.6297623", "0.6278166", "0.6256949", "0.6210718", "0.6196087", "0.6187879", "0.61841136", "0.6180741", "0.61795187", "0.6158163", "0.6157898", "0.6137592"...
0.0
-1
Return a string representation of this instance. Returns str Examples >>> import astropy.units as u >>> PlasmaBlob(1e4u.K, 1e20/u.m3, particle='p') PlasmaBlob(T_e=10000.0u.K, n_e=1e+20u.m3, particle='p', Z=1)
def __repr__(self) -> str: argument_dict = { "T_e": self.T_e, "n_e": self.n_e, "particle": self.particle, "Z": self.Z, } return code_repr.call_string(PlasmaBlob, (), argument_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self) -> str:\n if self.scalar_vector:\n return f\"({self.w:-.4f} {self.x:+.4f}i {self.y:+.4f}j {self.z:+.4f}k)\"\n return f\"({self.x:-.4f}i {self.y:+.4f}j {self.z:+.4f}k {self.w:+.4f})\"", "def __str__(self):\n return '<Keplerian object: a={:e} m, e={:f}, i={:f} rad,...
[ "0.6809445", "0.6658465", "0.6652905", "0.6564657", "0.653215", "0.6522062", "0.65184504", "0.6480154", "0.64537305", "0.644143", "0.64235455", "0.6411826", "0.6383402", "0.63499856", "0.62904036", "0.6283699", "0.6277792", "0.62743527", "0.62660027", "0.62549216", "0.6248767...
0.7801059
0
Create KAHost from hostname and network interface.
def __init__(self, hst, iface): self.host = hst self.iface = iface
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_host(self, wwpns, hostname):\n\n if not wwpns or len(wwpns) == 0 or not hostname or len(hostname) == 0:\n ex_args = {'wwpns': wwpns,\n 'hostname': hostname}\n raise SVCCreateHostParameterError(**ex_args)\n\n ports = ':'.join(wwpns)\n # get...
[ "0.6407725", "0.5987066", "0.58470106", "0.5828066", "0.58223563", "0.56906056", "0.56758946", "0.5528933", "0.54766107", "0.5401757", "0.539176", "0.5373446", "0.5371424", "0.5319288", "0.53046006", "0.5297927", "0.52865714", "0.5176965", "0.5141282", "0.51357836", "0.510014...
0.53480786
13
Convert IPMapping to string.
def __repr__(self): ret_str = f"{self.__class__.__name__}(total_nodes={self.total_nodes}, " ret_str += f"ips_p_node={self.ips_p_node}, mapping={self.mapping}, " ret_str += f"auth_pass={self.auth_pass}, base_rid={self.base_rid})" return ret_str
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_str(self):\n return pformat(self.to_dict())", "def to_str(self):\n return pformat(self.to_dict())", "def to_str(self):\n return pformat(self.to_dict())", "def to_str(self):\n return pformat(self.to_dict())", "def to_str(self):\n return pformat(self.to_dict())", "...
[ "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "0.6300817", "...
0.0
-1
Build a test cohort (list of UIDs) for the given project.
def generate_test_cohort(project, max_size=10, write=False, user_interval_size=1, rev_interval_size=7, rev_lower_limit=0): # Determine the time bounds that define the cohort acceptance crite...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_test_cohort_name(project):\n return 'testcohort_{0}_{1}'.\\\n format(project,\n format_mediawiki_timestamp(datetime.now()))", "def test_get_cohort(self):\r\n course = modulestore().get_course(self.toy_course_key)\r\n self.assertEqual(course.id, self.toy_course_k...
[ "0.67783827", "0.5708332", "0.55687207", "0.5541946", "0.5476705", "0.5429774", "0.53934073", "0.53917027", "0.5290652", "0.5174525", "0.5158054", "0.51247346", "0.5077848", "0.5074821", "0.503579", "0.5025241", "0.5020254", "0.5005642", "0.4996248", "0.4964494", "0.49439225"...
0.71551216
0
Validation on MediaWiki user names. Returns userID for a username if it exists. False otherwise.
def is_user_name(user_name, project): try: uid = query_mod.get_mw_user_id(user_name, project) except Exception: return False if uid: return uid return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_username(u):\n return u and USER_RE.match(u)", "def verify_username(entered_username):\n return USER_RE.match(entered_username)", "def validate_name(self, username: str) -> bool:\n\t\treturn not self.registry.name_taken(username)", "def checkUsername(userName):\n trace(\"checkUsername(%s)\...
[ "0.73957247", "0.71762145", "0.7077482", "0.70608693", "0.70254797", "0.6979531", "0.6890388", "0.68687195", "0.6864237", "0.68084186", "0.6808258", "0.6787152", "0.6761821", "0.67566985", "0.67343414", "0.6730553", "0.6729732", "0.66736513", "0.6642833", "0.66224724", "0.662...
0.740255
0
Multiplies a vector (represented as a list of numbers) by a scalar value and returns the new vector (original vector values are not changed)s
def scalar_multiply(vector_list, scalar): v = copy.deepcopy(vector_list) for i in range(0, len(v)): v[i] = v[i] * scalar return v
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scalar_multiply(c: float, v: Vector) -> Vector:\n return [c * v_i for v_i in v]", "def scalar_multiply(c: float, v: Vector) -> Vector:\n return [c * v_i for v_i in v]", "def scalar_multiply(s: float, v: Vector) -> Vector:\n return [s * v_item for v_item in v]", "def scalar_vector_mult(alpha, v):...
[ "0.834154", "0.834154", "0.831533", "0.8202148", "0.8006595", "0.7915865", "0.7910059", "0.7910059", "0.7858722", "0.7598578", "0.75971824", "0.7504152", "0.74955004", "0.73293334", "0.7299856", "0.7210107", "0.702259", "0.697976", "0.69552904", "0.6932597", "0.69295996", "...
0.8115528
4
Creates a new organisation
def post(self): request_user = User.get_by_id(token_auth.current_user()) if request_user.role != 1: return { "Error": "Only admin users can create organisations.", "SubCode": "OnlyAdminAccess", }, 403 try: organisation_dto = Ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testCreateOrg(self):\n self.timeline.orgSignup()\n self.data.createProfile()\n self.record.createOrgApp('new_org', self.data.user)\n\n url = '/gci/profile/organization/' + self.gci.key().name()\n create_url = url + '?org_id=new_org'\n response = self.get(create_url)\n self.assertResponseOK...
[ "0.76257896", "0.7234811", "0.7067907", "0.6971906", "0.67996895", "0.67915577", "0.6717069", "0.6652658", "0.66143763", "0.6475481", "0.6404474", "0.6400521", "0.6353515", "0.6334427", "0.62643874", "0.6182838", "0.61736166", "0.6079545", "0.6042977", "0.60255384", "0.598561...
0.74718446
1
Function for building the heap containing graph vertices and assigning 'heap_index's to vertices
def prepare_heap(graph, total_order): H = binheap(graph.Vertices, total_order=total_order) index = 0 for vertice in H: vertice.heap_index = index index += 1 return H
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_heap(self, elems):\n for e in elems:\n self.n += 1\n self.A.append(e)\n self.pos[e[0]] = self.n\n for i in range(self.n // 2, 0, -1):\n self.combine(i)", "def build_heap(arr):\n for i in range((len(arr)//2), -1, -1):\n heapify(arr,...
[ "0.6751881", "0.6725413", "0.6718123", "0.6711173", "0.67101246", "0.6686796", "0.66116583", "0.66093767", "0.6602597", "0.65530497", "0.6484547", "0.6468745", "0.64647365", "0.64487624", "0.64415425", "0.6388789", "0.6334124", "0.6330784", "0.6326977", "0.6307619", "0.629742...
0.770072
0
Generate a leaveonerunout split for crossvalidation. Generates as many splits as there are runs.
def generate_leave_one_run_out(n_samples, run_onsets, random_state=None, n_runs_out=1): random_state = check_random_state(random_state) n_runs = len(run_onsets) # With permutations, we are sure that all runs are used as validation runs. # However here for n_runs_out > 1, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_leaveout(self, force=None):\n if force is not None:\n self.leaveout = force\n\n if self.leaveout == self.NUM_BUCKETS:\n print('Have completed cross-validation')\n # raise CrossValidationComplete\n return None\n\n # Select next bucket to leav...
[ "0.6112913", "0.60531414", "0.6006914", "0.5982287", "0.58714324", "0.5804961", "0.57528365", "0.5649248", "0.561365", "0.55578357", "0.55442333", "0.55377346", "0.55173475", "0.5506908", "0.54700446", "0.5440295", "0.54194325", "0.54079443", "0.54018325", "0.53819394", "0.53...
0.6317191
0
Find the nearest point and return the corresponding value from specified column.
def nearest(row, geom_union, df1, df2, geom1_col='geometry', geom2_col='geometry', src_column=None): # Find the geometry that is closest nearest = df2[geom2_col] == nearest_points(row[geom1_col], geom_union)[1] # Get the corresponding value from df2 (matching is based on the geometry) value = df2[neares...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def closest_row(dataframe, column, value):\n sort = dataframe.iloc[(dataframe[column]-value).abs().argsort()[:1]]\n return sort", "def nearest_direct(row, gdf1, gdf2, src_column=None):\r\n #create a unary union\r\n unary_union = gdf2.unary_union \r\n # Find the geometry that is closest\r\n n...
[ "0.73204553", "0.71278715", "0.6791997", "0.67379254", "0.66024554", "0.6580779", "0.65057546", "0.64809513", "0.64798063", "0.6477402", "0.6476898", "0.6395828", "0.6387285", "0.63698477", "0.63199085", "0.631192", "0.631192", "0.6299665", "0.6296471", "0.6279883", "0.627027...
0.6841369
2
This function takes in a user's input of a date. The date is passed in and split using the .split method. Using some casting functions, the if statements sort out the inputted date by month, date, and year and sees if the input is a valid date. If the input is a valid date, it will return a tuple of the date. If the in...
def validate_input(date_string): #I decided to make sure the input was valid by checking each individual piece. I did this by splitting the input string by the dashes. #I checked first that the month value was between 1 and 12. I then checked depending on the month if the day value was valid. #I also made s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_date(input):\n input = input.strip()\n if input == '':\n return None, None\n\n # Parse the start\n mo = yyyymmdd_re.match(input)\n if not mo:\n mo = yyyymmdd_hyphen_re.match(input)\n if not mo:\n mo = ddmmyyyy_re.match(input)\n if not mo:\n mo = ddmmyyyy_h...
[ "0.7075205", "0.69487023", "0.6854316", "0.68378437", "0.67845863", "0.6736248", "0.668508", "0.65206116", "0.6488566", "0.6476186", "0.64523536", "0.6436022", "0.6428463", "0.6364954", "0.6338545", "0.6338545", "0.63058376", "0.6287919", "0.62804204", "0.6267053", "0.6257301...
0.8472455
0
This function takes in a date tuple, increments the day (whether it be a new month or year), and returns the next day, also in tuple form.
def next_date(date): #For this function, I just created as many if else statements as I could to cover every situation I could think of. #Most of these if else statements are distinct edge cases where I add 1 in a different spot each time. if date[0] == 1 or date[0] == 3 or date[0] == 5 or date[0] == 7 or d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_day(year, month, day):\n thisday = dt.datetime(year, month, day)\n nextday = thisday + dt.timedelta(days=1)\n y = nextday.year\n m = nextday.month\n d = nextday.day\n return y, m, d", "def nextDay(year, month, day):\n if day < daysInMonth(year,month):\n return year, month, da...
[ "0.80586785", "0.78024226", "0.7625353", "0.75817585", "0.75817585", "0.7553072", "0.74940497", "0.7463184", "0.72252077", "0.6787799", "0.6671278", "0.65437865", "0.6466887", "0.6458826", "0.64546436", "0.63737565", "0.63737565", "0.63287455", "0.6274409", "0.6225656", "0.60...
0.7258513
8
This function takes in a date tuple, decrements the day (whether it be a new month or year), and returns the previous day, also in tuple form.
def previous_date(date): #This function is basically the same as the next_date function, except I subtracted 1 instead of adding 1. #The main difference was figuring out what to do when transitioning to a different month with a different amount of days. #This is why August, for example, is in it's own if el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prevDate(y, m, d):\n dateTuple = (y, m, d, 0, 0, 0, 0, 0, 0)\n epochSecs = mktime(dateTuple)\n prevDateTuple = localtime(epochSecs-24*60*60)\n return prevDateTuple[:3]", "def previous_month(year, month):\n if month >= 1:\n month -= 1\n else:\n month = 12\n year -= 1\n ...
[ "0.73254776", "0.6358831", "0.613971", "0.60897636", "0.6019879", "0.60037637", "0.5964291", "0.58047825", "0.5681081", "0.56618196", "0.56560266", "0.5636376", "0.55211943", "0.53486556", "0.5316761", "0.5299009", "0.52777284", "0.52704537", "0.5269632", "0.5259468", "0.5192...
0.689958
1
Returns the smallest power of 2 that is greater than x
def _next_power_of_2(x): return 1 if x == 0 else 2**(x - 1).bit_length()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_nearest_power_of_two(x):\n\n return 1 << (x - 1).bit_length()", "def _nearest_bigger_power_of_two(x: int) -> int:\n y = 2\n while y < x:\n y *= 2\n return y", "def next_power_2(x: int) -> int:\n return 0 if x < 1 else shift_left_bit_length(x)", "def closest_power_2(x):\n ...
[ "0.83292603", "0.8316638", "0.7846474", "0.78365076", "0.7427054", "0.74214023", "0.7218975", "0.71265906", "0.69472224", "0.6911688", "0.6824418", "0.6804076", "0.6799296", "0.67340463", "0.6705012", "0.67013687", "0.6678983", "0.66642874", "0.665376", "0.6606363", "0.658732...
0.7809824
4
The 'home' page route
def index(): return render_template('index.html', name=urlpath)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def go_home(request):\n\n url = request.route_url('home', _app_url=get_app_url(request))\n return HTTPFound(location=url)", "def home():\n logging.info('Entering route: HOME')\n\n logging.info('Rendering template: main.html')\n return render_template('main.html')", "def home():\n\n return ren...
[ "0.8235689", "0.7975705", "0.7909117", "0.7794644", "0.77156496", "0.7699965", "0.7698153", "0.7698153", "0.7698153", "0.7698153", "0.7698153", "0.7698153", "0.7698153", "0.7698153", "0.7698153", "0.7698153", "0.7698153", "0.7698153", "0.7698153", "0.7698153", "0.7698153", ...
0.0
-1
Reset all the statistics and metrics fields.
def reset(self) -> None: self.statistics = defaultdict(int)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n self.sum_metric = 0.\n self.num_inst = 0.\n self.metrics.reset_stats()", "def reset_metric_stats(self):\n\n self.__stats_table = {}", "def stats_reset(self):\n self.stats.reset()", "def stats_reset(self):\n self.stats.reset()", "def reset_metric_...
[ "0.8472925", "0.832886", "0.82712287", "0.82712287", "0.82181585", "0.8191474", "0.81063384", "0.7841572", "0.7768799", "0.7764818", "0.77358586", "0.768062", "0.76459306", "0.7632498", "0.7632498", "0.7632498", "0.75435334", "0.7526935", "0.74830943", "0.7433618", "0.7430342...
0.8127687
6
Opens a new database connection if there is none yet for the current application context.
def get_db(): if not hasattr(g, 'Session'): Session, engine = db_connect(database_path=app.config['DATABASE_PATH'], ensure_db_exists=False) g.Session = Session return g.Session
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_open():\n if not hasattr(g, 'sqlite_db'):\n g.sqlite_db = db_connect()\n return g.sqlite_db", "def open_database(self):\n if self._conn is None:\n self._conn = sqlite3.connect(self._db_path)", "def open_db(db_name: str = DB_NAME) -> DBConnection:\n return sqlite3.connec...
[ "0.7737639", "0.7582971", "0.73180443", "0.71693045", "0.70220166", "0.6966687", "0.6954785", "0.69486743", "0.6897534", "0.6842663", "0.68292314", "0.68191963", "0.680592", "0.67950195", "0.67697805", "0.6762173", "0.6751266", "0.6746273", "0.67316663", "0.670031", "0.668866...
0.0
-1
Create a Path2D representing a circle pattern.
def circle_pattern(pattern_radius, circle_radius, count, center=[0.0, 0.0], angle=None): from .path import Path2D if angle is None: angles = np.linspace(0.0, np.pi * 2.0, count + 1)[:-1] elif isinstance(angle, float) or isi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _circle_path(N=100): # noqa\n theta = np.linspace(0, 2 * np.pi, N)\n center, radius = [0.5, 0.5], 0.5\n verts = np.vstack([np.sin(theta), np.cos(theta)]).T\n return mpath.Path(verts * radius + center)", "def _calc_circle_pattern(self):\n circle_pattern_dist = 0.0125\n circle_patter...
[ "0.7284107", "0.68455124", "0.6672661", "0.65682656", "0.63899505", "0.6288982", "0.6283888", "0.6251139", "0.6221757", "0.617856", "0.61397886", "0.607043", "0.6058973", "0.6032326", "0.6007215", "0.6006227", "0.5995197", "0.5970986", "0.59289443", "0.58641785", "0.586133", ...
0.7027944
1
Given a list of timepoint indexes, return the timepoints
def GetTimepoints(vDataSet,tpis=None,datetime=False): t0 = GetTimepoint(vDataSet,0) if tpis is None: nt = vDataSet.GetSizeT() tpis = range(nt) else: nt = len(tpis) ret = [] for i in range(nt): ts = GetTimepoint(vDataSet,tpis[i])-t0 if datetime:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _travel_times(self, trip_list, index=0):\n\n def distance_in_travel_time(dep_secs, arr_secs):\n t_dist = arr_secs - dep_secs\n if t_dist < 0:\n t_dist = self._DUMMY_SEPARATOR # min separation\n return t_dist\n\n if not trip_list:\n retur...
[ "0.6269135", "0.60457766", "0.5934484", "0.5878291", "0.5829112", "0.58269817", "0.57506233", "0.56883526", "0.56721693", "0.5671606", "0.5667779", "0.56318057", "0.5617738", "0.5612524", "0.5608158", "0.5607932", "0.56034744", "0.5594634", "0.5546414", "0.55298734", "0.55248...
0.62051904
1
Get the Description string for a channel
def GetChannelDescription(vDataSet,aIndexC): s = "" if aIndexC >= 0 and aIndexC < vDataSet.GetSizeC(): s = vDataSet.GetChannelDescription(aIndexC) return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_description(self):\n return self.bot_data_file[\"description\"]", "def get_description(self):\n return self.description", "def get_description(self):\n return self.description", "def get_description(self):\n return self.description", "def get_description(self):\n ...
[ "0.68694293", "0.65957034", "0.65957034", "0.65957034", "0.65957034", "0.6553324", "0.65384406", "0.65384406", "0.6535109", "0.6520707", "0.64930433", "0.6484933", "0.64560664", "0.6455084", "0.64550614", "0.64550614", "0.6443888", "0.6441778", "0.6437882", "0.6414287", "0.63...
0.74989116
0
Set the Description string for a channel
def SetChannelDescription(vDataSet,aIndexC,s): vDataSet.SetChannelDescription(aIndexC,s)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetDescription(self, description):\n self.description = str(description)", "def set_description(self, description):\n self.description = description", "def set_description(self, description):\r\n self.__description = description", "def set_description(self, room_description):\n ...
[ "0.718835", "0.6999216", "0.69504035", "0.6934122", "0.6900495", "0.6875039", "0.6875039", "0.6875039", "0.6875039", "0.6841008", "0.6831169", "0.68283665", "0.6816624", "0.67398375", "0.6711927", "0.6711927", "0.6711927", "0.6711927", "0.6711927", "0.6711927", "0.6711927", ...
0.78476745
0
Copies the model parameters of one estimator to another.
def copy_network_parameters(sess): e1_params = [t for t in tf.trainable_variables() if t.name.startswith('q_network')] e1_params = sorted(e1_params, key=lambda v: v.name) e2_params = [t for t in tf.trainable_variables() if t.name.startswith('target')] e2_params = sorted(e2_params, key=lambda v: v.name) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_model_parameters(sess, estimator1, estimator2):\n e1_params = [t for t in tf.trainable_variables() if t.name.startswith(estimator1.scope)]\n e1_params = sorted(e1_params, key=lambda v: v.name)\n e2_params = [t for t in tf.trainable_variables() if t.name.startswith(estimator2.scope)]\n e2_param...
[ "0.7852879", "0.7852879", "0.66554946", "0.61860365", "0.61860365", "0.6184476", "0.60527664", "0.60499156", "0.60399276", "0.5963272", "0.5963272", "0.5920757", "0.59034836", "0.5899948", "0.58918744", "0.58678216", "0.58601093", "0.58497196", "0.5828383", "0.58271724", "0.5...
0.54891086
34
Calculate x^m modulo n using O(log(m)) operations.
def power(x, m, n): a = 1 while m > 0: if m % 2 == 1: a=(a*x)%n x=(x*x)%n m//=2 return a
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ModExp(n, k, m):\n a = list(bin(k))[2:]\n a.reverse()\n s = 1\n for i in a:\n if i == '1':\n s = (s * n) % m\n n = (n * n) % m\n return s", "def powmod(x, k, m):\n ans = 1\n while k > 0:\n if odd(k):\n ans = ans * x % m\n k -= 1\n ...
[ "0.7599664", "0.74315625", "0.7374175", "0.7219739", "0.7127198", "0.7122053", "0.69996965", "0.69894725", "0.6938514", "0.69061136", "0.6875816", "0.6859509", "0.68496764", "0.68241173", "0.68238646", "0.6819605", "0.6812801", "0.6798555", "0.67820793", "0.67738426", "0.6767...
0.80051047
0
Get a datetime object or a int() Epoch timestamp and return a pretty string like 'an hour ago', 'Yesterday', '3 months ago', 'just now', etc
def get_date(time=False): time = time.replace(tzinfo=None) now = datetime.utcnow() if type(time) is int: diff = now - datetime.fromtimestamp(time) elif isinstance(time, datetime): diff = now - time elif not time: diff = now - now else: raise ValueError('invalid da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def humanize_ts(timestamp=False):\n now = datetime.now()\n diff = now - datetime.fromtimestamp(timestamp)\n second_diff = diff.seconds\n day_diff = diff.days\n\n if day_diff < 0:\n return ''\n\n if day_diff == 0:\n if second_diff < 10:\n return \"just now\"\n if se...
[ "0.78833723", "0.7736534", "0.77089053", "0.7691787", "0.7648496", "0.7515203", "0.7102702", "0.6906622", "0.68916446", "0.6840511", "0.68208", "0.6811143", "0.66553074", "0.66552603", "0.6654102", "0.66214156", "0.6586633", "0.655445", "0.65288556", "0.65129405", "0.65016985...
0.0
-1
This function generate a random name to save files.
def directory_path(directory, file): try: file_name, file_extension = os.path.splitext(file) except Exception: file_extension = '' new_file_name = str(uuid.uuid4()) + file_extension return '{}/{}'.format(directory, new_file_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_random_file_name():\n\n def random_file_name_factory():\n length = random.randint(10, 15)\n chars = string.ascii_letters + string.digits + \"-_\"\n return f\"{''.join(random.choice(chars) for _ in range(length))}.jpg\"\n\n return random_file_name_factory", "def generate_rand...
[ "0.8275941", "0.8180113", "0.7985668", "0.78921986", "0.7861188", "0.7780428", "0.77412575", "0.77126265", "0.7638043", "0.76225156", "0.7593835", "0.7518483", "0.7514238", "0.7498905", "0.74696386", "0.7452037", "0.7407897", "0.73675585", "0.73460615", "0.7334054", "0.729953...
0.0
-1
Computes the attention vector from the encoder outputs and the decoder state returns the attention vetor
def compute_attention(self, decoder_state, forward_encoder_states, backward_encoder_states): assert len(forward_encoder_states) == len(backward_encoder_states) max_encoding_len = len(forward_encoder_states) output_states=[] for i in range(max_encoding_len): state = np.concatenate([forward_encoder_stat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attention(self, decoder_state, coverage=None):\n with tf.variable_scope(\"attention_compute\"):\n attn_size = 2*self.hidden_dim\n batch_size = tf.shape(self.encoder_states)[0]\n # Reshape encoder_states (need to insert a dim)\n encoder_states = tf.expand_dims(...
[ "0.70744646", "0.6976823", "0.68100196", "0.6760604", "0.67564625", "0.6610464", "0.64383334", "0.64219415", "0.63858587", "0.63554895", "0.6354639", "0.6331805", "0.6294686", "0.6270537", "0.6238189", "0.62085557", "0.6093544", "0.6073566", "0.603284", "0.6032662", "0.599956...
0.7300376
0
Sets the inventory of this DestinyCharacterResponse.
def inventory(self, inventory): self._inventory = inventory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inventory_items(self, inventory_items):\n\n self._inventory_items = inventory_items", "def inventory_id(self, inventory_id):\n\n self._inventory_id = inventory_id", "def setArmor(self, armor):\n self.av = armor", "def equipment(self, equipment):\n\n self._equipment = equipment...
[ "0.5843782", "0.5464982", "0.5422779", "0.53242856", "0.5253488", "0.4949954", "0.4900357", "0.48783776", "0.48271966", "0.47580072", "0.47058398", "0.4702781", "0.46986252", "0.4689338", "0.4674871", "0.46724826", "0.46589485", "0.46542928", "0.46479684", "0.4641575", "0.463...
0.6592847
0
Sets the kiosks of this DestinyCharacterResponse.
def kiosks(self, kiosks): self._kiosks = kiosks
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeKerning(self, location=None, masters=None):\n if self.currentInstance is None:\n return\n kerningElement = ET.Element(\"kerning\")\n if location is not None:\n locationElement = self._makeLocationElement(location)\n kerningElement.append(locationElemen...
[ "0.50676435", "0.49207956", "0.49122378", "0.48031145", "0.46916625", "0.46490604", "0.4620134", "0.45974818", "0.44931585", "0.44661605", "0.44533122", "0.4430753", "0.44028598", "0.43920535", "0.43279982", "0.4322305", "0.4311385", "0.4299662", "0.428602", "0.42802742", "0....
0.66261417
0
Sets the uninstanced_item_components of this DestinyCharacterResponse.
def uninstanced_item_components(self, uninstanced_item_components): self._uninstanced_item_components = uninstanced_item_components
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def item_components(self, item_components):\n\n self._item_components = item_components", "def uninstanced_item_objectives(self, uninstanced_item_objectives):\n\n self._uninstanced_item_objectives = uninstanced_item_objectives", "def modifyNotValuableComponents(self):\n # Nothing to do\n ...
[ "0.64310783", "0.6052537", "0.47256866", "0.4529424", "0.44706416", "0.446204", "0.4366735", "0.43522725", "0.43422863", "0.43137577", "0.42728356", "0.42435384", "0.42435384", "0.42289084", "0.42281803", "0.42158931", "0.4197114", "0.41927963", "0.41896272", "0.41828355", "0...
0.77889264
0
Sets the currency_lookups of this DestinyCharacterResponse.
def currency_lookups(self, currency_lookups): self._currency_lookups = currency_lookups
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def currencies(self, currencies):\n\n self._currencies = currencies", "def collateral_currencies(self, collateral_currencies):\n if self.local_vars_configuration.client_side_validation and collateral_currencies is None: # noqa: E501\n raise ValueError(\"Invalid value for `collateral_cur...
[ "0.5843485", "0.4718915", "0.45601684", "0.45601684", "0.4458234", "0.4458234", "0.42972362", "0.41677904", "0.41590473", "0.41501495", "0.41501495", "0.41501495", "0.41501495", "0.41364965", "0.41350856", "0.41105163", "0.40913257", "0.4081665", "0.40715504", "0.4036781", "0...
0.74609286
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, DestinyCharacterResponse): return False 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.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
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
Convert string of letters to list of ints
def letter_to_num(self, string, dict_): #dict_= {'A': '0', 'C': '1', 'D': '2', 'E': '3', 'F': '4', 'G': '5', 'H': '6', 'I': '7', 'K': '8', 'L': '9', 'M': '10', 'N': '11', 'P': '12', 'Q': '13', 'R': '14', 'S': '15', 'T': '16', 'V': '17', 'W': '18', 'Y': '19'} patt = re.compile('[' + ''.join(dict_.keys())...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stringToInts(string):\r\n ints=[];\r\n for char in string:\r\n ints.append(charToInt(char));\r\n return ints;", "def string_to_numbers(str):\n return [ord(ch) - ord(\"a\") for ch in str]", "def convert_to_num(text):\n\n\tnums = []\n\tfor character in text:\n\t\tnums.append(ord(character)...
[ "0.8213246", "0.80486065", "0.7225561", "0.7217381", "0.7162763", "0.7162212", "0.71576333", "0.7144066", "0.7101151", "0.7093495", "0.7062118", "0.70558095", "0.7049765", "0.70228916", "0.6998064", "0.6997102", "0.6986649", "0.6981444", "0.6981444", "0.6981444", "0.6981444",...
0.64725435
39
Return magnitude of the vector.
def magnitude(self): # @todo @caution check: something wrong? return (math.sqrt(reduce(lambda x, y: x+y, [x**2 for x in self.vector])))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def magnitude(v: Vector) -> float:\n return math.sqrt(sum_of_squares(v))", "def magnitude(vector):\n return math.sqrt(sum_of_squares(vector))", "def magnitude(v):\n if len(v.arr) != 4 or v[3] != 0.0:\n raise ValueError(\"Only use this function with vectors.\")\n return np.sqrt(np.sum(np.squa...
[ "0.8017034", "0.79612964", "0.79595196", "0.7892397", "0.7873412", "0.78647536", "0.77303493", "0.7571249", "0.75417465", "0.75417465", "0.7527453", "0.750239", "0.7485373", "0.7444988", "0.7415117", "0.74081886", "0.73014045", "0.7261887", "0.7147598", "0.7113899", "0.707933...
0.853588
0
Return a Vector instance as the cross product of two vectors
def cross(self, vector): return Vector((self.y * vector.z - self.z * vector.y), (self.z * vector.x - self.x * vector.z), (self.x * vector.y - self.y * vector.x))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vec_cross(a,b):\r\n return [a[1] * b[2] - a[2] * b[1],\r\n a[2] * b[0] - a[0] * b[2],\r\n a[0] * b[1] - a[1] * b[0]]", "def cross_product(v1, v2):\n return cg3d_vector.CG3dVector(\n v1[1] * v2[2] - v2[1] * v1[2],\n v1[2] * v2[0] - v2[2] * v1[0],\n v1[0] * v2[1] - v2...
[ "0.8505113", "0.8344239", "0.8310741", "0.8273691", "0.82367706", "0.81789404", "0.81201696", "0.80693376", "0.7818604", "0.77697337", "0.7753768", "0.7736727", "0.77201647", "0.77111876", "0.76852375", "0.7659114", "0.7658154", "0.7608303", "0.75680614", "0.75577724", "0.750...
0.75311995
20
Return True if vectors are parallel(strictly) to each other. if 2 vectors are negative, they are not parallel strictly.
def parallels(self, vector): # if self.cross(vector).magnitude() == 0 or self.cross(vector.negative()).magnitude() == 0: if abs(self.cross(vector).magnitude()) < 0.01 : # @todo @caution:: find a better way. return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parallel(self, vector):\n\n # if self.cross(vector).magnitude() == 0 or self.cross(vector.negative()).magnitude() == 0:\n if abs(self.cross(vector).magnitude()) < 0.01 : # @todo @caution:: find a better way.\n return True\n return False", "def vector_equal(v1,v2):\n if (v2...
[ "0.76355577", "0.7198974", "0.71021557", "0.7003271", "0.6888429", "0.6848745", "0.64869916", "0.64829326", "0.6468592", "0.6461152", "0.64260197", "0.6383691", "0.63269633", "0.6179352", "0.61631995", "0.6156856", "0.61259997", "0.61034614", "0.61025953", "0.6082973", "0.608...
0.7676825
0
Return True if vectors are perpendicular to each other.
def is_perpendicular_to(self, vector): if abs(self.dot(vector)) < 0.01: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_perpendicular_to_vectors():\n random_state = np.random.RandomState(0)\n a = pr.norm_vector(pr.random_vector(random_state))\n a1 = pr.norm_vector(pr.random_vector(random_state))\n b = pr.norm_vector(pr.perpendicular_to_vectors(a, a1))\n c = pr.norm_vector(pr.perpendicular_to_vectors(a, b))\n...
[ "0.77470535", "0.74018204", "0.72997224", "0.7205659", "0.66265005", "0.6620005", "0.6609689", "0.6598128", "0.6557633", "0.6524736", "0.65042055", "0.6503991", "0.6385439", "0.6376769", "0.6165153", "0.61503613", "0.6120689", "0.6109275", "0.6055098", "0.60473114", "0.602961...
0.86681396
0
Saves json resource from data structure into disk
def save_resource(resource, data): if resource not in RES_PATHS: raise Exception(f"Unknown resource: {resource}") with open(RES_PATHS[resource], 'w', encoding='utf8') as f: json.dump(data, f, sort_keys=True, indent=4, separators=(',', ': '))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_json(path, data):\n with open(path, 'w') as fp:\n json.dump(data, fp)", "def save(self, data, outpath):\n with open(path, \"wt\") as open_file:\n json.dump(data, open_file, indent=4)", "def save_json(data: Any, path: Path, **kwargs) -> None:\n with path.open('w', encodin...
[ "0.7550784", "0.75431526", "0.7489738", "0.74690473", "0.7456846", "0.7314175", "0.7291592", "0.72631365", "0.7246065", "0.7245885", "0.72414124", "0.71985495", "0.71886075", "0.7187451", "0.716752", "0.7162907", "0.71494573", "0.71459216", "0.7138747", "0.709647", "0.7066991...
0.7875483
0
Helper to get the state dict for either a raw optimizer or an optimizer wrapped in an LRScheduler.
def _get_state_dict(optimizer) -> dict: if is_scheduler(optimizer): state = { "scheduler": optimizer.state_dict(), "optimizer": optimizer.optimizer.state_dict(), } else: state = optimizer.state_dict() return state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_state_dict(optimizer, state: dict) -> None:\n if is_scheduler(optimizer):\n optimizer.load_state_dict(state[\"scheduler\"])\n optimizer.optimizer.load_state_dict(state[\"optimizer\"])\n else:\n optimizer.load_state_dict(state)", "def _get_state_dict(self) -> dict:\n re...
[ "0.7447006", "0.7167801", "0.7167801", "0.6614314", "0.65130156", "0.6211941", "0.6211941", "0.61884445", "0.60200757", "0.60066575", "0.5935537", "0.5868897", "0.58415145", "0.57621235", "0.56798697", "0.5653951", "0.56079525", "0.55687493", "0.55671006", "0.5566309", "0.553...
0.822805
0
Get state associated with all the optimizers in the form of a dictionary with keyvalue pairs (parameter name, optim state dicts)
def get_state(self) -> Dict: state_dict = {} for param in self.optim_objs: param_name = pyro.get_param_store().param_name(param) state_dict[param_name] = _get_state_dict(self.optim_objs[param]) return state_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_state_dict(self) -> dict:\n return {\n 'optimizers': [o.state_dict() for o in self.optimizers],\n 'schedulers': [s.state_dict() for s in self.schedulers],\n }", "def _get_state_dict(self) -> dict:\n return {\n 'optimizers': [o.state_dict() for o in s...
[ "0.80344224", "0.80344224", "0.73383725", "0.7201054", "0.70106196", "0.6910621", "0.68009955", "0.6784907", "0.66105986", "0.66105986", "0.656703", "0.64387757", "0.6377929", "0.6337778", "0.63316387", "0.6314496", "0.6245427", "0.6095705", "0.60645115", "0.60154617", "0.598...
0.80878353
0
Checks the uniqueness of each digit in the coloured cells of the row. Return True if didits in a row are unique, False otherwise. >>> check_uniqueness_in_rows([" " ,"1 ", " 3",\ " 4 5", " 9 5 ", " 6 83 ", "3 1 ", " 8 2",\ " 2 "]) True >>> check_uniqueness_in_rows([" " ,"1 ", " 3",\ " 4 4", " 9 5 ", " 6 83 ", "3 1 ", " ...
def check_uniqueness_in_rows(board: list): for i in range(0, len(board)): check_number_in_str = any(map(str.isdigit, board[i])) if check_number_in_str: numbers = [] for j in board[i]: try: numbers.append(int(j)) except: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_row(sudoku):\r\n for row in range(len(sudoku)):\r\n for col in range(len(sudoku)):\r\n if sudoku[row].count(sudoku[row][col]) != 1:\r\n return True #returns True is there is more than two of the same numbers in a row\r", "def check_uniqueness_in_columns(board: list):...
[ "0.6896659", "0.6745015", "0.66598326", "0.65966254", "0.6485218", "0.6443759", "0.6296213", "0.6275154", "0.6202981", "0.61091256", "0.6090504", "0.6047886", "0.6046663", "0.60454583", "0.6030986", "0.6013529", "0.59975785", "0.59612244", "0.5924312", "0.59130025", "0.591096...
0.8000123
0
Fallback to utf8 if we get an invalid charset in the ContentType header.
def test_response_fallback_to_utf8_encoding(): headers = {"Content-Type": "text-plain; charset=invalid-codec-name"} content = "おはようございます。".encode("utf-8") response = httpx.Response( 200, content=content, headers=headers, ) assert response.text == "おはようございます。" assert respo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_response_no_charset_with_iso_8859_1_content():\n content = \"Accented: Österreich abcdefghijklmnopqrstuzwxyz\".encode(\"iso-8859-1\")\n headers = {\"Content-Type\": \"text/plain\"}\n response = httpx.Response(\n 200, content=content, headers=headers, default_encoding=autodetect\n )\n ...
[ "0.74644244", "0.7247726", "0.7187377", "0.7105494", "0.70785505", "0.7045408", "0.7031607", "0.70227385", "0.69560426", "0.69291407", "0.68248475", "0.6766807", "0.67659724", "0.65439624", "0.63450915", "0.63252217", "0.6315944", "0.62623376", "0.6258481", "0.6237718", "0.62...
0.75407857
0
Thresholds output neuron activation to 1 or 0.
def threshold(activation): if activation >= 0.0: return 1 else: return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neural_result(self, input):\n n_output = self.network.activate(input)\n if n_output >= 0.5:\n return 2\n else:\n return 1", "def activate(self, inputs):\n\t\tstrength = np.dot(self.weights, inputs)\n\t\t# if strength <= self.threshold:\n\t\t# \tself.result = 0\n\t\t...
[ "0.6825139", "0.67335653", "0.6656636", "0.6507296", "0.648135", "0.6449215", "0.63851726", "0.6344211", "0.62399125", "0.61652577", "0.6163624", "0.61634415", "0.6161248", "0.6159693", "0.6149919", "0.614141", "0.60709316", "0.60692376", "0.60692376", "0.6065353", "0.6048731...
0.74346626
0
Increase the learning rate to by 'factor'
def increase_learning(self, factor): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_learning_rate(optimizer, lr_factor, epoch):\n #lr = args.lr * (0.1 ** (epoch // 30))\n print('the learning rate is set to {0:.5f}'.format(lr_factor[epoch]*args.lr))\n for param_group in optimizer.param_groups:\n param_group['lr'] = lr_factor[epoch]*args.lr", "def _update_learning_rate(...
[ "0.76822525", "0.7623058", "0.7236946", "0.72332567", "0.7181966", "0.7115393", "0.70982206", "0.7091277", "0.7091277", "0.7086705", "0.7034822", "0.7020923", "0.700962", "0.70051515", "0.69723105", "0.6967799", "0.6966622", "0.6946296", "0.692404", "0.6922158", "0.6909092", ...
0.8504892
0
Add gaussian noise to all weights with stddev
def noise(self, stddev): #add noise to weights pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_gaussian_noise(x, std):\n noise = x.new_zeros(x.size()).normal_(std=std)\n return x + noise", "def add_weight_noise(self, std):\n with torch.no_grad():\n param_vector = parameters_to_vector(self.parameters())\n normal_dist = torch.distributions.Normal(loc=torch.tensor([...
[ "0.7435477", "0.7225236", "0.7057147", "0.6874546", "0.67428094", "0.6723956", "0.6668098", "0.6668098", "0.66318214", "0.64935833", "0.64885527", "0.64788675", "0.64723283", "0.6451817", "0.64303327", "0.6417272", "0.6407344", "0.6381957", "0.6380635", "0.63773674", "0.63756...
0.80869573
0
Set the password hash attribute.
def password(self, password): self.password_hash = generate_password_hash(password)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_password(self, password):\n self.password = self.hash_password(password)", "def set_password_hash(self, password):\n salt = bcrypt.gensalt()\n self.password_hash = bcrypt.hashpw(password.encode(), salt)", "def hash_password(self):\n self.__password = self.str_to_hash(self.__...
[ "0.82697", "0.82260287", "0.81238616", "0.8084923", "0.8084661", "0.8084126", "0.8079829", "0.8079829", "0.80285925", "0.8024383", "0.7940814", "0.79312944", "0.79047114", "0.7882576", "0.7829608", "0.7821766", "0.7797144", "0.76772755", "0.7598731", "0.7580656", "0.75222987"...
0.7950121
11
Return the user's full name.
def full_name(self): return self.first_name + " " + self.last_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_full_name(self):\n full_name = '%s %s' % (self.user.first_name.strip(), self.user.last_name.strip())\n if len(full_name.strip()) == 0:\n full_name = self.user.username\n return full_name.strip()", "def full_name(self):\n return \"{} {}\".format(self.user.first_name,...
[ "0.9090513", "0.90020806", "0.8982839", "0.89684016", "0.88434756", "0.88178194", "0.88178194", "0.8801882", "0.8628019", "0.86096245", "0.85385114", "0.8529365", "0.8521824", "0.8413708", "0.8393574", "0.8393574", "0.8377325", "0.8355223", "0.8351524", "0.8350241", "0.834679...
0.8221452
57
Return True if the correct password is provided by the user.
def verify_password(self, password): return check_password_hash(self.password_hash, password)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_has_password(self, user):\n return True if user.password else False", "def check_password(self, password):\n return self.password == password", "def verify_password(self, password):\n return self.PASS == password", "def verify_password(self, password):\n return self.PASSWO...
[ "0.8129239", "0.81034195", "0.79780716", "0.7949103", "0.7699896", "0.76989955", "0.7671435", "0.75522935", "0.7538158", "0.7526128", "0.75133425", "0.7508751", "0.7493216", "0.7465401", "0.74607825", "0.7455026", "0.74538875", "0.7439177", "0.74376637", "0.73923177", "0.7384...
0.7063647
82
Return True if the user is the owner of the given event.
def is_organizer(self, event): return event.user_id == self.id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_user_is_owner(self):\n return self._tag == 'user_is_owner'", "def isowner(self, o):\n return self._owner is o", "def is_owner(self):\n return self._is_owner", "def is_owned_by(self, user):\n return user and user.id == self.user_id", "def has_ownership(self):\n user...
[ "0.769225", "0.737754", "0.7257492", "0.71795774", "0.7055413", "0.70178586", "0.6871077", "0.6866165", "0.68137443", "0.6794553", "0.67648435", "0.67007875", "0.6692285", "0.66882086", "0.6608403", "0.6595469", "0.6588406", "0.65544564", "0.65061724", "0.64108455", "0.633761...
0.6896338
6
Return True if the user has administrator permissions
def is_administrator(self): return self.can(Permission.ADMIN)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_administrator(self):\n return False", "def check_admin() -> bool:\n return ctypes.windll.shell32.IsUserAnAdmin() == 1", "def is_admin_user(self):\n if \"is_admin\" in self._properties and self.is_admin == 'YES':\n return True\n return False", "def is_admin(self):...
[ "0.83494174", "0.823918", "0.816414", "0.8104511", "0.81042594", "0.7987201", "0.7969444", "0.79093665", "0.78822184", "0.7877999", "0.7868253", "0.7866525", "0.78601587", "0.785088", "0.784095", "0.78388053", "0.7783382", "0.77749825", "0.77727383", "0.77727383", "0.77640873...
0.8494714
1
Return True if the given event is in the list of the user's saved events. Return False otherwise.
def has_saved(self, event): return event in self.saved_events
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def existing_event(self, title, location, category, description):\n for event in self.event_list:\n # test to see if the user has the same event, in the same location in their list\n if event['title'] == title and event['location'] == location and event['category'] == category and even...
[ "0.6681823", "0.66332495", "0.6370351", "0.63050914", "0.6223466", "0.60660845", "0.6057256", "0.60196775", "0.5907761", "0.5870805", "0.5868797", "0.58071935", "0.5718949", "0.5714852", "0.56993306", "0.56385213", "0.56059164", "0.5591951", "0.558239", "0.5579109", "0.557755...
0.7529543
0
Return the directory that the user's profile photo is in along with the image name.
def profile_photo(self): images_directory_index = 6 filepath = None photo = self.profile_photo_path if photo is not None: photo_dir = photo.split("/")[images_directory_index:] filepath = "/".join(photo_dir) return filepath
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def photo_path(instance, filename):\n return 'users/{0}/{1}'.format(instance.user.username, '.'.join(['profile-photo', filename.split('.')[-1]]))", "def photo_directory_path(instance, filename):\n return 'gallery/photos/{0}/{1}'.format(instance.photo_name, filename)", "def avatar_directory_path(instance,...
[ "0.76140475", "0.7101126", "0.7026414", "0.6932838", "0.691498", "0.6797305", "0.6680349", "0.6664907", "0.6650704", "0.6569051", "0.6521014", "0.64727724", "0.64668465", "0.6454821", "0.63730913", "0.63466984", "0.6337161", "0.6319505", "0.62805355", "0.6231589", "0.62275654...
0.8456203
0
Return a string representation of a user> Used for debugging purposes.
def __repr__(self): return "<User %r>" % (self.first_name + " " + self.last_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\r\n return str(self.user)", "def __str__(self):\n return str(self.user)", "def __str__(self):\n return str(self.user)", "def __str__(self):\n return str(self.user)", "def __str__(self):\n return str(self.user)", "def __str__(self):\n return str...
[ "0.80522674", "0.7998329", "0.7998329", "0.7998329", "0.7998329", "0.7998329", "0.78775686", "0.78425753", "0.78425753", "0.78425753", "0.78425753", "0.7821551", "0.7629587", "0.7628807", "0.7584698", "0.75814176", "0.75591934", "0.75558084", "0.7553594", "0.7546333", "0.7512...
0.7687537
12
Get the query set.
def get_source_query(self): return InvestmentProject.objects.annotate( # this contains helper annotations _possible_uk_region_names=get_string_agg_subquery( InvestmentProject, 'uk_region_locations__name', ), _actual_uk_region_names=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qs(self) -> MIZQuerySet:\n if isinstance(self, type):\n raise TypeError(\n f\"Calling qs() from class level is prohibited. Use {self.__name__}.objects instead.\"\n )\n # noinspection PyUnresolvedReferences\n return self._meta.model.objects.filter(pk=sel...
[ "0.75368756", "0.736203", "0.736203", "0.7292596", "0.72000855", "0.71407306", "0.7107554", "0.70250833", "0.70114", "0.698723", "0.6960464", "0.68939906", "0.6874282", "0.6865236", "0.6860153", "0.68484783", "0.6837436", "0.68008727", "0.6796836", "0.6790314", "0.6766196", ...
0.0
-1
Check if 2 variables have the same type
def sametype(variable1, variable2): # Return the result return isinstance(variable1, type(variable2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def same_type(one, two):\n\n return isinstance(one, type(two))", "def is_same(type1, type2):\n nake_type1 = remove_declarated(type1)\n nake_type2 = remove_declarated(type2)\n return nake_type1 == nake_type2", "def _is_equal_same_type(self, other):\n return True", "def check_type_compat(inp...
[ "0.79493785", "0.76695025", "0.7530512", "0.7294999", "0.7248732", "0.7117405", "0.70532453", "0.703935", "0.7038933", "0.67295814", "0.6719667", "0.67010045", "0.6627721", "0.6585853", "0.6548693", "0.6548662", "0.6546346", "0.6511548", "0.6502922", "0.64963573", "0.64830554...
0.8292035
0
Get the value of __name__
def pyname(ifmain=False): if ifmain is True: return __name__ == "__main__" return __name__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name():\n return __name__", "def getName(self):\r\n return self.__name__", "def name(self):\n return self.__name__", "def getname(self):\n return self.__name", "def get_name(self):\n return self.__name", "def _get_name(self):\n return self.__name", "def _get_name(s...
[ "0.8974173", "0.82942736", "0.81482327", "0.81387544", "0.81360406", "0.8130425", "0.8130425", "0.8130425", "0.8130425", "0.8130425", "0.8130425", "0.8130425", "0.8130425", "0.8130425", "0.8130425", "0.8130425", "0.8130425", "0.8130425", "0.8130425", "0.8130425", "0.8130425",...
0.0
-1
Get the type of an object
def gettype(value): # Return the type return type(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_type ( self, object ):\n return self.type", "def get_type ( self, object ):\n return self.type", "def object_type(self):\n return self._object_type", "def object_type(self):\n return self._object_type", "def object_type(self):\n return self._object_type", "def o...
[ "0.8609359", "0.8609359", "0.80195457", "0.80195457", "0.80195457", "0.80195457", "0.80195457", "0.80186933", "0.80186933", "0.80186933", "0.80186933", "0.80186933", "0.80186933", "0.80186933", "0.80186933", "0.80186933", "0.80186933", "0.80186933", "0.80186933", "0.80186933", ...
0.0
-1
Get the value of each letter of a string's position in the alphabet added up
def wordvalue(word): # Set total to 0 total = 0 # For each character of word for i in enumerate(word): # Add it's letter value to total total += letternum(word[i[0]]) # Return the final value return total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_value(word):\n letters = 'abcdefghijklmnopqrstuvwxyz'\n sum = 0\n for letter in word:\n letter_value = letters.find(letter)\n if letter_value == -1:\n letter_value = 0\n sum += letter_value\n return sum", "def alphabet_position(l...
[ "0.7612964", "0.7325625", "0.73044825", "0.7208458", "0.72041804", "0.72041804", "0.7087329", "0.6900961", "0.6866222", "0.68506795", "0.6834927", "0.682594", "0.679289", "0.67543745", "0.6749131", "0.67112386", "0.66913855", "0.6637431", "0.6615804", "0.65996903", "0.6598333...
0.70091903
7
Find the sigmoid of a number.
def sigmoid(number): # Return the calculated value return 1 / (1 + math.exp(-number))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(x):\n return 1 / (1 + math.exp(-x))", "def sigmoid(x):\n return 1 / (1 + math.exp(-x))", "def sigmoid(x):\n\n return 1 / (1 + math.exp(-x))", "def sigmoid(x):\n\n return 1 / (1 + math.exp(-x))", "def sigmoid(x):\n return 1/(1 + math.exp(-x))", "def sigmoid(x):\n return amath.e...
[ "0.79935193", "0.79638124", "0.79239535", "0.79239535", "0.7914904", "0.7861643", "0.78494775", "0.78492415", "0.7808203", "0.7806936", "0.7804052", "0.7804052", "0.7803349", "0.780096", "0.77683944", "0.7749339", "0.7735204", "0.7730017", "0.7714474", "0.7714474", "0.7714474...
0.8580923
0
Find the lowest common multiple of 2 numbers
def lcm(num1, num2): if num1 > num2: bigger = num1 else: bigger = num2 while True: if bigger % num1 == 0 and bigger % num2 == 0: return bigger bigger += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def least_common_multiple(number1, number2):\n return number1 * number2 // math.gcd(number1, number2)", "def lowest_common_multiple(a, b):\n # 两个数字相乘后除以最大公约数 = 两个数字的最小公倍数\n return a * b // gcd(a, b)", "def least_common_multiple2(number1, number2, number3, number4):\n return least_common_multiple((n...
[ "0.85526365", "0.8484602", "0.78606063", "0.7454287", "0.73254347", "0.73094875", "0.73043525", "0.72881943", "0.7276686", "0.72694284", "0.72694284", "0.72615737", "0.72615737", "0.72607243", "0.72473466", "0.72473466", "0.72473466", "0.72473466", "0.72473466", "0.72473466", ...
0.6976464
39
Generate a random string consisting of letters, digits and punctuation
def randstring(length=1): charstouse = string.ascii_letters + string.digits + string.punctuation newpass = '' for _ in range(length): newpass += str(charstouse[random.randint(0, len(charstouse) - 1)]) return newpass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_random_alphanumeric_string():\n return get_random_string(char_choice=string.ascii_letters + string.digits)", "def rand_string():\n out = ''\n for _ in range(24):\n out += choice(ascii_letters)\n return out", "def random_string():\n return \"\".join(random.choice(string.ascii_lette...
[ "0.81747365", "0.8062149", "0.7784518", "0.7772026", "0.77012944", "0.76947284", "0.7690052", "0.76105994", "0.75816846", "0.7570214", "0.7566948", "0.75421137", "0.75376517", "0.7510428", "0.74782443", "0.745258", "0.74509436", "0.74301624", "0.7366482", "0.73561114", "0.735...
0.7795579
2
Flip the names and keys in a dictionary.
def dictflip(dictionary): return {v: k for k, v in dictionary.items()}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def InvertDict(dict_in):\n return dict(zip(dict_in.values(), dict_in.keys()))", "def revert_dictionary(dictionary):\n return {v: k for k, v in dictionary.items()}", "def swapdict(d):\n x = {}\n for k, v in d.iteritems():\n x[v] = k\n return x", "def invert_dictionary(dictionary):\n inv...
[ "0.72221696", "0.70376945", "0.6958453", "0.68716097", "0.6662582", "0.6638676", "0.6598032", "0.65314555", "0.6529691", "0.647249", "0.6469067", "0.64594454", "0.64334196", "0.6385905", "0.6348275", "0.61514163", "0.61347973", "0.60983956", "0.60716546", "0.6029822", "0.6024...
0.7754054
0
Replace multiple spaces in a string with a single space.
def catwalk(text): # Return the fixed version return ' '.join(text.split())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_whitespace(s, rep=' '):\n s = re.sub(r'\\s+', rep, s)\n return s", "def removeMultipleSpaces(self) -> None:\n self.text = re.sub('\\s+', ' ', self.text)", "def insert_spaces(word):\n new_word = \"\"\n for c in word:\n new_word += c + \" \" \n return new_word", "def ad...
[ "0.7397841", "0.73439866", "0.7116597", "0.7083662", "0.70552474", "0.7052292", "0.6969243", "0.69222546", "0.6860277", "0.68382484", "0.6835841", "0.67142224", "0.6700654", "0.6700654", "0.66781884", "0.6615247", "0.66076064", "0.65538806", "0.6516413", "0.6514602", "0.64717...
0.0
-1
Convert all the tabs to a specific amount of spaces
def converttabs(text, spaces=4): return text.replace('\t', ' ' * spaces)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tab2space(text, tabsize=1):\n return text.expandtabs(tabsize)", "def tabify(st: str, width: int) -> str:\n assert width % 8 == 0\n if len(st) >= width:\n # Ensure some empty space at the end\n return f'{st}\\t'\n padding = width - len(st)\n tabcount = padding // 8\n if padding...
[ "0.80161273", "0.7275121", "0.7152495", "0.7128644", "0.7100503", "0.6908192", "0.6901011", "0.68525845", "0.67723036", "0.66819274", "0.66633624", "0.66352135", "0.65069777", "0.6418354", "0.6402516", "0.6325122", "0.6307636", "0.6220551", "0.621551", "0.61672276", "0.612569...
0.8203328
0
Choose a random item from a list.
def randomstr(valuelist): # Choose a random item and return it return random.choice(valuelist)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _random_pick(lst):\n\n choice = random.randint(0, len(lst) - 1)\n return lst[choice]", "def choice(L):\r\n LEN = len(L) # Get the length\r\n randomindex = int(LEN*random()) # Get a random index\r\n return L[randomindex] # Return that element\r", "def pick_one(_lst):\n if...
[ "0.8330435", "0.7742515", "0.77410364", "0.7590071", "0.7567772", "0.7553193", "0.7390439", "0.7378119", "0.7292455", "0.7292455", "0.7292455", "0.7292455", "0.7210265", "0.7200561", "0.7168485", "0.71328497", "0.7043727", "0.7002514", "0.6980137", "0.6922097", "0.6908427", ...
0.6362305
55
Convert a relative directory to an absolute directory.
def absolutedir(relativedirectory): # Return the absolute version of the directory return os.path.abspath(str(relativedirectory))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def absolute(self):\n if self.relative == '':\n return self.root # don't join in this case as that appends trailing '/'\n return os.path.join(self.root, self.relative)", "def _makeAbsolute(fname):\n if fname[0] != '/':\n return os.path.join(os.getcwd(), fname)\n else:\n ...
[ "0.70130837", "0.6943495", "0.691371", "0.68350965", "0.6758418", "0.66823345", "0.66025215", "0.6583042", "0.65718687", "0.6532396", "0.6505406", "0.6485628", "0.64787704", "0.64636153", "0.64491427", "0.6426827", "0.63688564", "0.6366474", "0.6358071", "0.63322306", "0.6323...
0.72017336
0
Get the current system platform.
def getplatform(): # Return the system platform return sys.platform
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetCurrentPlatform():\n if sys.platform == 'darwin':\n return 'mac'\n if sys.platform == 'win32':\n return 'win'\n if sys.platform == 'linux2':\n return 'linux'\n raise RuntimeError('Unknown platform')", "def get_platform(self):\n return self._platform", "def get_platform():\n global...
[ "0.84539765", "0.8326626", "0.8309208", "0.8141718", "0.80552435", "0.8016257", "0.7992015", "0.798255", "0.78836226", "0.78620505", "0.78579366", "0.77770764", "0.77458495", "0.77099895", "0.7704173", "0.77035415", "0.7664933", "0.7658954", "0.7650623", "0.7636617", "0.76098...
0.8645731
0
Get the maximum amount of characters allowed by your system.
def charlimit(): # Return the value return sys.maxsize
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_length(self):\n\t\treturn self._max_length", "def _max_length(self):\n return self.__max_length", "def max_length(self) -> int | None:\n return self._underlying.max_length", "def max_chars(self):\n return self.range_field[0] * self.range_field[1]", "def __get_max_length(self):\...
[ "0.83186924", "0.8166045", "0.8066409", "0.78199387", "0.75077397", "0.7445967", "0.7282823", "0.72417414", "0.7201217", "0.7175748", "0.7166187", "0.7131474", "0.7129711", "0.7109871", "0.7084934", "0.7030606", "0.69539714", "0.69539714", "0.69539714", "0.6930102", "0.686478...
0.85016626
0
Set or get the logging level of Quilt
def loglevel(leveltype=None, isequal=False): log = logging.getLogger(__name__) leveltype = leveltype loglevels = { "none": 0, "debug": 10, "info": 20, "warning": 30, "error": 40, "critical": 50 } if leveltype is None and isequal is False: retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setLogLevel(self,value):\n self.PDFreactorConfiguration.in1[\"logLevel\"] = value", "def test_set_single_logger_level(self):\n pass", "def log_level(self) -> str:\n return pulumi.get(self, \"log_level\")", "def set_logging_level(self, level):\n if str(level) == '1':\n ...
[ "0.71671265", "0.6991101", "0.69806015", "0.6972833", "0.6961177", "0.6899327", "0.68799967", "0.6868855", "0.6850275", "0.67684495", "0.67592555", "0.6734873", "0.67189497", "0.67114717", "0.670655", "0.6672562", "0.6665188", "0.66530836", "0.66527706", "0.6643168", "0.66259...
0.644738
28
Get the current timezone code.
def timezone(): return time.timezone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_timezone(self) -> str:\n return self.AD.time_zone", "def timezone(self) -> str:\n return self._tz", "def time_zone(self) -> str:\n return pulumi.get(self, \"time_zone\")", "def get_timezone():\n return dates.get_timezone(_get_tz())", "def time_zone(self):\n # type: ()...
[ "0.7542851", "0.7289681", "0.7259182", "0.71575993", "0.7076425", "0.70737106", "0.6992405", "0.69887596", "0.6970666", "0.6951073", "0.6928702", "0.691014", "0.6780188", "0.6755103", "0.6728035", "0.6709188", "0.6709188", "0.6709188", "0.6700383", "0.66726667", "0.662336", ...
0.7411233
1
Get the current date or time in a specific format.
def getdatetime(timedateformat='complete'): timedateformat = timedateformat.lower() if timedateformat == 'day': return ((str(datetime.datetime.now())).split(' ')[0]).split('-')[2] elif timedateformat == 'month': return ((str(datetime.datetime.now())).split(' ')[0]).split('-')[1] elif ti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_now():\r\n now = dt.datetime.now()\r\n now_str = now.strftime(\"%d/%m %H:%M\")\r\n return now_str", "def get_current_time(format='%Y-%m-%d %H:%M:%S.%f %z'):\n return datetime.utcnow().replace(\n tzinfo=pytz.utc\n ).strftime(format)", "def now(format='%m/%d/%Y %H:%M:%S'):\n ...
[ "0.7809423", "0.7759299", "0.7674586", "0.7638057", "0.7622604", "0.7621821", "0.7516453", "0.75143325", "0.75072104", "0.7484746", "0.7465155", "0.7459493", "0.74460596", "0.7404178", "0.7397776", "0.7391513", "0.7375329", "0.7359765", "0.7307797", "0.7297182", "0.72716105",...
0.0
-1
Open a URL in a web browser.
def openurl(url): # Open the URL webbrowser.open(url)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open(url):\r\n webbrowser.open(url)", "def open_browser(url):\n import webbrowser\n webbrowser.open_new(url)", "def open_web_browser(url: str):\n Popen(web_browser + [url], stdout=DEVNULL, stderr=DEVNULL)", "def openSite(url):\n\timport webbrowser\n\twebbrowser.open('http://www.' + ur...
[ "0.8969239", "0.87253445", "0.8557133", "0.81484085", "0.8076435", "0.80640006", "0.8029827", "0.79677635", "0.7844253", "0.7794731", "0.77911973", "0.7767753", "0.7721501", "0.7678924", "0.7650243", "0.7632872", "0.7605001", "0.7573197", "0.75597835", "0.7485942", "0.7483687...
0.90411264
0
Open a URL in a new window of a web browser.
def newwindow(url): # Open the URL webbrowser.open_new(url)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_browser(url):\n import webbrowser\n webbrowser.open_new(url)", "def open_browser_window(url):\n logger.debug('about to open url \"{url}\" in browser \"{browser}\"'.format(url=url, browser=BROWSER_NAME))\n browser = webbrowser.get(BROWSER_NAME)\n browser.open(url, new=(1 if BRO...
[ "0.8764067", "0.85479325", "0.852124", "0.8515487", "0.84469545", "0.8038043", "0.7733854", "0.7711025", "0.7679564", "0.7652327", "0.76442903", "0.7636936", "0.75982", "0.75979555", "0.75563836", "0.75090975", "0.7460393", "0.7418922", "0.7299728", "0.72462755", "0.7217785",...
0.9021047
0
Open a URL in a new tab of a web browser.
def newtab(url): # Open the URL webbrowser.open_new_tab(url)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_browser(url):\n import webbrowser\n webbrowser.open_new(url)", "def newwindow(url):\n\n # Open the URL\n webbrowser.open_new(url)", "def open(url):\r\n webbrowser.open(url)", "def openurl(url):\n\n # Open the URL\n webbrowser.open(url)", "def open_browser_window(url):\n ...
[ "0.8496775", "0.83396", "0.81892425", "0.81786484", "0.7989292", "0.7830576", "0.7660511", "0.75942165", "0.7529363", "0.75082964", "0.7415607", "0.73747844", "0.7274339", "0.72502756", "0.7241896", "0.71490616", "0.7135733", "0.7125485", "0.7097186", "0.7090098", "0.70830226...
0.8929259
0
Return a given value from a row and column. Indexing start at 0.
def column(self, row, column): if type(row) is not int or type(column) is not int: raise TypeError(self._ERRORS[4]) if row > 2 or row < 0 or column > 2 or column < 0: raise ValueError(self._ERRORS[5]) return self._matrix_data[row][column]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCellValue_quick(self, row, column):\n\n\t\t\t\treturn self.thing[f\"{column}{row}\"].value", "def get_index(self, row, col):\n return (row * self.cols) + col", "def get_cell(self, row, column):\n return self.sudoku_matrix[row][column]", "def getCell(self, row, column):\n\t\t\t\t\n\t\t\t\...
[ "0.7550607", "0.752697", "0.7394443", "0.7248657", "0.72050214", "0.7164187", "0.7128174", "0.7124939", "0.7119277", "0.70775634", "0.705178", "0.70413846", "0.70384586", "0.7013382", "0.700421", "0.69833153", "0.6966188", "0.69304734", "0.6923727", "0.6890669", "0.6885197", ...
0.7505621
2
Convert a rotation to a rotation matrix.
def rotation_matrix(self, rotation, rotation_order="zyx"): x = math.radians(rotation[0]) y = math.radians(rotation[1]) z = math.radians(rotation[2]) cos = math.cos sin = math.sin if rotation_order == 'zyx': index_0 = cos(y) * cos(z) index_1 = cos(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rot2mat(rotation: np.ndarray) -> np.ndarray:\n rotation_radians = ndarray_to_rotation(rotation)\n pitch = np.deg2rad(rotation_radians.pitch)\n roll = np.deg2rad(rotation_radians.roll)\n yaw = np.deg2rad(rotation_radians.yaw)\n return transforms3d.euler.euler2mat(roll, pitch, yaw).T", "def angle_to_rotat...
[ "0.77474576", "0.7683646", "0.75516844", "0.751084", "0.7292169", "0.7284365", "0.72582865", "0.72189486", "0.7151234", "0.7092738", "0.7071549", "0.7038132", "0.70273405", "0.6982649", "0.6972232", "0.6950541", "0.69122386", "0.68775266", "0.68774337", "0.6862889", "0.681432...
0.6946713
16
Return the state attributes.
def extra_state_attributes(self) -> dict[str, str] | None: reading = self.reading if self._sensor_type[0] == "air_quality" and reading is not None: air_quality = None if reading <= 0.4: air_quality = STATE_AIR_QUALITY_VERY_ABNORMAL elif reading <= 0.5...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state_attributes(self):\n return self._attributes", "def state_attributes(self):\n return self._attributes", "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\n return self._state_attrs", "def device_state_attributes(self):\...
[ "0.8953404", "0.8953404", "0.85239846", "0.8366765", "0.8366765", "0.8363429", "0.83362615", "0.8334551", "0.8310377", "0.8292682", "0.8289349", "0.8289349", "0.82871646", "0.82871646", "0.82871646", "0.82871646", "0.82871646", "0.82871646", "0.82871646", "0.82871646", "0.828...
0.0
-1
Route that maps to the main index page.
def index(): return render_template('index.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\n return render_template(\n 'main/index.html',\n title='Main page'\n )", "def index_page():\n \n return render_template(\"index.html\")", "def index_page():\n\n return render_template(\"index.html\")", "def index_page():\n\n return render_template(\"index.html\")"...
[ "0.7834809", "0.7520777", "0.75168097", "0.75168097", "0.75168097", "0.7481033", "0.74744314", "0.74737954", "0.74678326", "0.74594164", "0.7458999", "0.7458999", "0.7446545", "0.7443823", "0.74249005", "0.74249005", "0.7424361", "0.74197274", "0.74155515", "0.7401802", "0.73...
0.73473835
48
Return new Aligner object with specified params.
def __init__(self, params): self.Params = params
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, params):\r\n _params = {\r\n 'Application': 'Infernal',\r\n }\r\n _params.update(params)\r\n Aligner.__init__(self, _params)", "def __init__(self, params):\r\n _params = {\r\n 'min_pct': 75.0,\r\n 'min_len': 150,\r\n ...
[ "0.77533215", "0.76638275", "0.63797265", "0.6275623", "0.56531173", "0.547672", "0.54714", "0.54679006", "0.51819515", "0.5141497", "0.5129864", "0.49742946", "0.4936145", "0.49230275", "0.49107376", "0.4906633", "0.48497516", "0.48357785", "0.4796896", "0.4769973", "0.47660...
0.0
-1
Return new InfernalAligner object with specified params.
def __init__(self, params): _params = { 'Application': 'Infernal', } _params.update(params) Aligner.__init__(self, _params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, params):\r\n _params = {\r\n 'min_pct': 75.0,\r\n 'min_len': 150,\r\n 'blast_db': None,\r\n 'template_filepath': None,\r\n 'pairwise_alignment_method': 'blast',\r\n 'Application': 'PyNAST',\r\n 'Algorithm': 'NAST...
[ "0.7583841", "0.574195", "0.5672373", "0.49822187", "0.49335185", "0.4865261", "0.48604318", "0.4823072", "0.47603545", "0.4760297", "0.468482", "0.46765077", "0.46490178", "0.4632601", "0.4607816", "0.4594962", "0.4591404", "0.4585417", "0.45784053", "0.4569891", "0.4569817"...
0.8288774
0