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
Reshapes the gradient to the shape of the original input.
def _ReshapeToInput(op: ops.Operation, grad): return array_ops.reshape( _IndexedSlicesToTensorNoWarning(grad), array_ops.shape(op.inputs[0]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gradient(self, node, output_grad):\r\n return [reshape_op(output_grad , get_shape_op(node.inputs[0]))]", "def gradient(img):\n nx, ny = np.gradient(unshape(img))\n return reshape(nx), reshape(ny)", "def gradient(self, node, output_grad):\r\n return [reshape_op(output_grad , get_shape_op...
[ "0.6685799", "0.63980293", "0.6297269", "0.62688", "0.6247093", "0.6159095", "0.60085064", "0.598209", "0.5958538", "0.586819", "0.5824665", "0.58166194", "0.5813783", "0.57987344", "0.57870144", "0.5776992", "0.5776424", "0.577207", "0.577207", "0.5748852", "0.57384676", "...
0.69913846
0
Creates multivariate `Deterministic` or `Normal` distribution.
def _fn(dtype, shape, name, trainable, add_variable_fn): loc, scale = loc_scale_fn_(dtype, shape, name, trainable, add_variable_fn) if scale is None: dist = deterministic_lib.Deterministic(loc=loc) else: dist = normal_lib.Normal(loc=loc, scale=scale) reinterpreted_batch_ndims = array_ops.sha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __new__(\n cls,\n mu: Union[float, np.ndarray] = 0.0,\n sigma: Union[float, np.ndarray] = 1.0,\n seed: Optional[int] = 0,\n ):\n\n if sigma == 0:\n # If sigma is zero, return a DiscreteDistribution with a single atom\n return DiscreteDistribution([1.0...
[ "0.6883635", "0.68276316", "0.6710429", "0.6335857", "0.63293964", "0.62173027", "0.62057513", "0.61219674", "0.61156815", "0.6100747", "0.61004573", "0.59886724", "0.59272844", "0.5892869", "0.5887673", "0.58717716", "0.58471864", "0.5843168", "0.58346343", "0.58154094", "0....
0.0
-1
Denselyconnected layer with local reparameterization estimator. This layer implements the Bayesian variational inference analogue to a dense layer by assuming the `kernel` and/or the `bias` are drawn from distributions. By default, the layer implements a stochastic forward pass via sampling from the kernel and bias pos...
def dense_local_reparameterization( inputs, units, activation=None, activity_regularizer=None, trainable=True, kernel_posterior_fn=default_mean_field_normal_fn(), kernel_posterior_tensor_fn=lambda d: d.sample(), kernel_prior_fn=lambda dtype, *args: normal_lib.Normal( # pylint: disable=g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dense_reparameterization(\n inputs,\n units,\n activation=None,\n activity_regularizer=None,\n trainable=True,\n kernel_posterior_fn=default_mean_field_normal_fn(),\n kernel_posterior_tensor_fn=lambda d: d.sample(),\n kernel_prior_fn=lambda dtype, *args: normal_lib.Normal( # pylint: di...
[ "0.6641123", "0.6115173", "0.5956767", "0.5865014", "0.5811584", "0.5803007", "0.57451874", "0.5724043", "0.56831336", "0.566493", "0.5661822", "0.56238157", "0.5545864", "0.55448514", "0.55011815", "0.5471089", "0.54635906", "0.5449913", "0.5443284", "0.5442257", "0.54296845...
0.6967587
0
Sprite is to left or right of screen
def out_of_bounds(self): return self.rect.right <= 0 or self.rect.left >= self.screen_rect.width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hits_left_or_right(self):\n if self.x >= self.scene.screen.get_width() - self.image.get_width() or self.x <= 0:\n return True\n else:\n return False", "def go_right(self):\n self.rect.centerx += 9", "def move_right(self):\r\n if self.rect.right < BG_WIDTH:\...
[ "0.7339836", "0.69387275", "0.68455005", "0.6781197", "0.6766592", "0.6663586", "0.66262686", "0.660086", "0.657184", "0.655616", "0.65025014", "0.64966536", "0.64768547", "0.64475805", "0.64141047", "0.6411345", "0.6404503", "0.6382406", "0.6370232", "0.6261869", "0.6233783"...
0.5728622
99
Plot the Mean value of responses in the test set
def plot_y_test_means(y_test_means, out_dir, response_name, interactive_run=True): plt.rcParams['svg.fonttype'] = 'none' x_label = 'Optimization Step' y_label = f'Mean {response_name} in Test Set' plt.plot([_ for _ in range(len(y_test_means))], y_test_means, marker='s', markerfacecolor='m'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avg_response(df, x, y_obs, y_est, save=False, show=True):\n\n fig, ax1 = plt.subplots(figsize=(15,15))\n\n ax2 = ax1.twinx()\n\n x_name = x\n if df[x].dtype == \"int\":\n x = df[x].astype(\"category\")\n elif df[x].dtype == \"float\":\n x = pd.cut(df[x], bins=10)\n\n metrics = ...
[ "0.67125005", "0.6430533", "0.6387076", "0.63750094", "0.6330063", "0.6288587", "0.62821716", "0.62392116", "0.6179099", "0.61760074", "0.6146362", "0.6135676", "0.61342424", "0.61103433", "0.61024773", "0.6095314", "0.60907954", "0.60318244", "0.6028813", "0.6020579", "0.601...
0.65759766
1
Generate TFRecord dataset from a list of csv files with detections.
def generate_joint_tfrecord( output_path: str, images_dirs: str, csv_inputs: list, label_map: dict = None): writer = tf.python_io.TFRecordWriter(output_path) id_map = label_to_id_map(label_map) for img_dir, csv in zip(images_dirs, csv_inputs): examples = pd.read_csv(csv) grou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_training_data(list_files):\n training_data = []\n for tr_file in list_files:\n with open(os.path.join(\"data\", tr_file)) as csv_file:\n reader = csv.reader(csv_file, delimiter=\",\")\n next(reader)\n for row in reader:\n training_data.append(ro...
[ "0.6571864", "0.637632", "0.63269085", "0.63152325", "0.63044286", "0.6209742", "0.61987484", "0.6196607", "0.6083322", "0.606753", "0.60378313", "0.6013575", "0.6008749", "0.6006046", "0.6001604", "0.599372", "0.5973993", "0.59596205", "0.59187835", "0.5910725", "0.58999115"...
0.58151203
33
Decay learning rates of g
def update_lr(self, g_lr): for param_group in self.g_optimizer.param_groups: param_group['lr'] = g_lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _decay(self):\n wd_losses = tf.get_collection(tf.GraphKeys.REGULARIZATION_LOSSES)\n log.info('Weight decay variables')\n [log.info(x) for x in wd_losses]\n log.info('Total length: {}'.format(len(wd_losses)))\n if len(wd_losses) > 0:\n return tf.add_n(wd_losses)\n else:\n log.warning...
[ "0.70114493", "0.69808054", "0.6935475", "0.6935475", "0.69351035", "0.6895724", "0.6886578", "0.68547916", "0.6831603", "0.6829386", "0.6799702", "0.6777535", "0.67560023", "0.67556185", "0.6743513", "0.6742004", "0.67062783", "0.6682914", "0.66825324", "0.66825324", "0.6653...
0.0
-1
Reset the gradient buffers.
def reset_grad(self): self.g_optimizer.zero_grad()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_grad(self):\n self.unet.zero_grad()", "def reset_grad(self):\n self.g_optimizer.zero_grad()\n self.d_optimizer.zero_grad()\n self.dr_optimizer.zero_grad()", "def reset_grad(self):\r\n self.unet.zero_grad()", "def reset_grad(self):\n self.g_optimizer.zero_gr...
[ "0.7156704", "0.71406925", "0.71314186", "0.71080565", "0.71080565", "0.71080565", "0.70542574", "0.6996964", "0.69681984", "0.6928698", "0.678635", "0.67519945", "0.6728927", "0.6691359", "0.668999", "0.66764534", "0.66677326", "0.6606647", "0.65908575", "0.65665776", "0.656...
0.7002798
7
Check if there is Energy Expended.
def hasEnergyExpended(self, flags): return (flags & 0x08) != 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_energy(self):\n if self.player.get_energy() <= 0:\n print(\"\\nSorry, you ran out of energy and died.\")\n print(\"Maybe the AI program will bring you back again...\")\n sys.exit()\n elif self.player.get_energy() < 15:\n print(\"******************...
[ "0.6731871", "0.62530476", "0.61856246", "0.6057652", "0.6050333", "0.60226136", "0.59565777", "0.58627975", "0.5839908", "0.58172625", "0.57811123", "0.5769362", "0.5762572", "0.57570845", "0.5737044", "0.5701645", "0.56978434", "0.56756836", "0.5655556", "0.5653673", "0.563...
0.8124157
0
Test post object with custom attributes.
def test_custom_attribute_post(self): gen = self.generator.generate_custom_attribute _, cad = gen("product", attribute_type="Text", title="normal text") pid = models.Person.query.first().id product_data = [ { "product": { "kind": None, "owners": [], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_data_object_post(self):\n pass", "def test_post_valid(self):\n response = self._post()\n self.assertEquals(self.model.objects.count(), 1)\n obj = self.model.objects.get()\n self.assertEquals(obj.pk, self.obj.pk)\n self.assertRedirectsNoFollow(response, obj.get_a...
[ "0.71695477", "0.702918", "0.70240444", "0.70239055", "0.696607", "0.6828099", "0.6753909", "0.666823", "0.662503", "0.6567288", "0.6546403", "0.6529289", "0.651847", "0.6516403", "0.6437588", "0.63941807", "0.6383632", "0.63717246", "0.6317528", "0.6294524", "0.6271675", "...
0.67223376
7
Return a saved state value, None if item is undefined.
def __getitem__(self, item): return self._state["data"].get(item, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)", "def __getattr__(self, item):\r\n return self...
[ "0.635614", "0.635614", "0.635614", "0.6147364", "0.6147364", "0.6143075", "0.6132287", "0.60980505", "0.60980505", "0.60980505", "0.5938607", "0.5816747", "0.57945025", "0.57495975", "0.57337904", "0.5725388", "0.57218087", "0.57218087", "0.56860113", "0.56860113", "0.568601...
0.64269394
1
Return a saved state value, None if item is undefined.
def __getattr__(self, item): return self._state["data"].get(item, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, item):\r\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\r\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\n return se...
[ "0.6429514", "0.6429514", "0.6358824", "0.6358824", "0.6358824", "0.6145407", "0.61317384", "0.61004424", "0.61004424", "0.61004424", "0.5938212", "0.58158153", "0.5793487", "0.5748117", "0.57325107", "0.5726615", "0.5721914", "0.5721914", "0.5684511", "0.5684511", "0.5684511...
0.6149625
6
Render the cell for a given column and row.
def render_cell(column, row): return column.render_cell(row)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_cell(self, row, col):\n env = self.env\n size = self.CELL_WIDTH\n panel = self.PANEL_HEIGHT\n margin = self.MARGIN\n screen = self.screen\n\n radius = (size - 2 * margin) // 2\n cellX = (margin + size) * row + margin\n celly = (margin + size) * col...
[ "0.80208915", "0.7057236", "0.6879578", "0.6787069", "0.6762434", "0.6730548", "0.6730548", "0.6730548", "0.6730548", "0.6707078", "0.6657402", "0.66424626", "0.66310644", "0.65979606", "0.65421677", "0.65223783", "0.6510289", "0.64564073", "0.6454309", "0.6396337", "0.625513...
0.8833946
0
Modify the query string of an URL to change the ``sort_variable_name`` argument.
def bob_sort_url(query, field, sort_variable_name, type): query = query.copy() if type == 'desc': query[sort_variable_name] = '-' + field elif type == 'asc': query[sort_variable_name] = field return query.urlencode()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_query_sorting():\n assert (normalize_url('http://example.com/a?b=1&c=2') ==\n 'http://example.com/a?b=1&c=2')\n assert (normalize_url('http://example.com/a?c=2&b=1') ==\n 'http://example.com/a?b=1&c=2')", "def lookup_sort(self, query, varenv):\n\n if ':sort' in query:\n ...
[ "0.6178298", "0.5965117", "0.5931693", "0.5763603", "0.57338655", "0.5701205", "0.5659237", "0.55262357", "0.5501779", "0.54842824", "0.5456122", "0.5456122", "0.5407841", "0.5407841", "0.5386435", "0.5386435", "0.53451675", "0.53092784", "0.53051645", "0.5269677", "0.5269677...
0.7990209
0
Return whether obj is an estimator class or estimator object.
def is_estimator(obj): if isclass(obj): return issubclass(obj, BaseEstimator) else: return isinstance(obj, BaseEstimator)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_sklearn_estimator(obj):\n if not isclass(obj):\n obj = type(obj)\n\n is_in_sklearn = issubclass(obj, SklearnBaseEstimator)\n is_in_sktime = issubclass(obj, BaseObject)\n\n is_sklearn_est = is_in_sklearn and not is_in_sktime\n return is_sklearn_est", "def is_sklearn_classifier(obj):\n...
[ "0.8014405", "0.7595821", "0.7336298", "0.7137613", "0.6930118", "0.6818005", "0.67669797", "0.6660152", "0.6638926", "0.6541589", "0.6501123", "0.6461391", "0.64600104", "0.6415006", "0.6392823", "0.6380369", "0.6375919", "0.6374647", "0.6367869", "0.6343212", "0.6337032", ...
0.86432767
0
Calculates the Shannon Entropy of given dataSet. The Shannon entropy equation provides a way to estimate the average minimum number of bits needed to encode a label based on the frequency of the labels.
def calculate_entropy(dataset) : num_entries = len(dataset) label_counts = {} for vector in dataset : # the label is at the last index of the data set current_label = vector[-1] if current_label not in label_counts : label_counts[current_label] = 0 label_counts[c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entropy(data):\n strings, lens = Counter(data), np.float(len(data))\n return -sum(count / lens * np.log2(count / lens) for count in strings.values())", "def ShannonEntropy(self,s):\n e = s[np.nonzero(s)]**2 * np.log(s[np.nonzero(s)]**2)\n return np.sum(e)", "def H(self, data):\n ...
[ "0.70676106", "0.6903988", "0.6821142", "0.6816265", "0.67478627", "0.67198783", "0.6675629", "0.65205294", "0.64137226", "0.63329506", "0.6314733", "0.6307148", "0.6305175", "0.62166697", "0.62098753", "0.6208406", "0.6208014", "0.61947745", "0.6191617", "0.61649585", "0.615...
0.6940564
1
Returns the ratio of a circle's circumference to its diameter.
def pi(): getcontext().prec += 2 agm0 = agm1 = pow2 = dec.Decimal(1) denm = dec.Decimal(0.25) agm2 = dec.Decimal(0.5).sqrt() # Uses the elliptic integral relation to the agm to calculate pi. while True: agm1 = (agm1 + agm2) / 2 agm2 = (agm0 * agm2).sqrt() diff = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def circumference(self):\n return math.pi * self.radius * 2", "def diameter(self):\n return self.radius * 2", "def diameter(self):\n return self.radius * 2", "def getCircleDiameter(self):\n segments = []\n for (i, p1) in enumerate(self.points):\n for p2 in self.p...
[ "0.74936026", "0.7465725", "0.7465725", "0.74169195", "0.73851794", "0.7363345", "0.7214506", "0.71231043", "0.69820744", "0.69820505", "0.6794374", "0.6792565", "0.67510515", "0.673118", "0.67278904", "0.671904", "0.6695147", "0.66586185", "0.6655653", "0.66363215", "0.66322...
0.0
-1
Returns the principal angle in radians that a given point on the cartesian plane makes with respect to the positive x axis with the origin as the vertex.
def atan2(y, x): if x == 0: if y == 0: raise InvalidOperationError('2-arg inverse tangent not defined at the origin') return pi().copy_sign(dec.Decimal(y)) / 2 elif y == 0: return pi() if x < 0 else dec.Decimal(0) getcontext().prec += 2 arg = dec.Decimal(y) / ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle(self):\n v = self.p1 - self.p0\n return atan2(v.y, v.x)", "def angle(self, vector):\n\n return (math.degrees(math.acos((self.dot(vector) / (self.magnitude() *\n vector.magnitude())))))", "def angle(self):\n return arccos(dot((self.a - self.o) / self.r, (self...
[ "0.6609037", "0.65563405", "0.6453497", "0.6387948", "0.6383385", "0.63802844", "0.63756114", "0.63479453", "0.632503", "0.6248011", "0.6158966", "0.6090713", "0.6074302", "0.6054061", "0.6030921", "0.6015549", "0.5998766", "0.59560853", "0.5954354", "0.5946966", "0.5942134",...
0.0
-1
Returns True if two numbers are sufficiently close to each other in value, which is to say the absolute value of the relative error is less than some referential benchmark value.
def is_close(num1, num2, prec=dec.Decimal('1E-9')): if not isinstance(num1, dec.Decimal): num1 = dec.Decimal(num1) if not isinstance(num2, dec.Decimal): num2 = dec.Decimal(num2) err = abs(num1 - num2) if num1 == 0: if num2 == 0: return True return err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arecloseenough(x1, x2):\n\n if abs(x1 - x2) <= VERYSMALL:\n return True\n \n return False", "def are_close(num1: float, num2: float, error: float) -> bool:\n\n if abs(num1-num2) < error:\n return True\n return False", "def almost_equal(x, y):\n return abs(x-y) < FP_PREC", "def fp_eq...
[ "0.7548929", "0.71317583", "0.700821", "0.6881023", "0.67989886", "0.67319375", "0.66923684", "0.6684985", "0.66588753", "0.6652563", "0.66485775", "0.66010374", "0.657033", "0.6560013", "0.65048045", "0.65044624", "0.64887196", "0.6473519", "0.64599335", "0.6443668", "0.6436...
0.64375395
20
Return self == other.
def __eq__(self, other): return self._real == other.real and self._imag == other.imag
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return self is other", "def __eq__(self, other):\n return self is other", "def __eq__(self, other):\n return equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, othe...
[ "0.9198537", "0.9198537", "0.9066762", "0.9051376", "0.9051376", "0.90299064", "0.8804954", "0.87542135", "0.87542135", "0.8745204", "0.87217265", "0.87139297", "0.8660616", "0.8639041", "0.8623532", "0.8623532", "0.861087", "0.86094683", "0.85829055", "0.8562941", "0.8560450...
0.0
-1
Return self != other.
def __ne__(self, other): return self._real != other.real or self._imag != other.imag
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__ (self, other):\n return not self == other", "def __ne__(self, other):\n return not self == other", "def __ne__(self, other):\n return not self == other", "def __ne__(self, other):\n return not self == other", "def __ne__(self, other):\n return not self == other...
[ "0.91486967", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", "0.9095688", ...
0.0
-1
Returns the real component of self.
def re(self): return self._real
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def component(self):\n return self._component", "def component(self):\n return self._component", "def getReal(self):\n return _libsbml.ASTNode_getReal(self)", "def real(self):\n return self.__array_ufunc__(np.real, \"__call__\", self)", "def x(self):\n return self[0]", ...
[ "0.70407456", "0.70407456", "0.6786648", "0.6683108", "0.6659795", "0.64961165", "0.6467658", "0.6467658", "0.6447271", "0.6337336", "0.63372976", "0.62657636", "0.6202698", "0.61456364", "0.61456364", "0.61456364", "0.61456364", "0.61456364", "0.61456364", "0.61456364", "0.6...
0.0
-1
Returns True if both components have the same exponent or if both components are NaN.
def same_quantum(self, context=None): return self._real.same_quantum(self._imag, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gdx_val_equal(val1,val2,gdxf):\n if gdx_isnan(val1, gdxf) and gdx_isnan(val2, gdxf):\n return True\n return val1 == val2", "def pd_val_equal(val1, val2):\n return pd_isnan(val1) and pd_isnan(val2) or val1 == val2", "def isNan(x: float) -> bool:\n return x != x", "def almost_eq(e1,e2) :...
[ "0.678818", "0.6634419", "0.6394451", "0.61989486", "0.61525494", "0.60909194", "0.6079987", "0.607357", "0.60450697", "0.60420126", "0.6006073", "0.5983916", "0.5967535", "0.5935726", "0.59140116", "0.5900962", "0.58940023", "0.58644414", "0.58503306", "0.58083636", "0.57963...
0.0
-1
Returns True or False on winning weapons.
def beats(self, one, two): return ((one == 'rock' and two == 'scissors') or (one == 'scissors' and two == 'paper') or (one == 'paper' and two == 'rock'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_game_won(self):\n return True", "def won(self):\n if self.current_room.name == \"Victory\":\n return True\n else:\n return False", "def is_game_won(self):\n if self.game_is_tied():\n return False\n my_available_steps = self.steps_availa...
[ "0.77233344", "0.76039624", "0.7554692", "0.70986086", "0.70483893", "0.7028392", "0.6982729", "0.69607526", "0.6934914", "0.6888762", "0.68240255", "0.6802607", "0.67202747", "0.6705797", "0.6696729", "0.66643006", "0.66197366", "0.65990067", "0.65852463", "0.6563705", "0.65...
0.0
-1
Sets the branch_match_kind of this Branchrestriction.
def branch_match_kind(self, branch_match_kind): if branch_match_kind is None: raise ValueError("Invalid value for `branch_match_kind`, must not be `None`") # noqa: E501 allowed_values = ["branching_model", "glob"] # noqa: E501 if branch_match_kind not in allowed_values: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def branch_match_kind(self):\n return self.get_data(\"branch_match_kind\")", "def __init__(self, branch_match_kind=None, branch_type=None, groups=None, id=None, kind=None, links=None, pattern=None, users=None, value=None): # noqa: E501 # noqa: E501\n\n self._branch_match_kind = None\n self...
[ "0.660618", "0.6483435", "0.5436025", "0.542187", "0.5382977", "0.5370938", "0.5316458", "0.51883185", "0.5144634", "0.51438063", "0.50719225", "0.48980653", "0.4870266", "0.47889227", "0.47667858", "0.47437418", "0.47412166", "0.47246608", "0.47246513", "0.47222733", "0.4660...
0.8350047
0
Sets the branch_type of this Branchrestriction.
def branch_type(self, branch_type): allowed_values = ["feature", "bugfix", "release", "hotfix", "development", "production"] # noqa: E501 if branch_type not in allowed_values: raise ValueError( "Invalid value for `branch_type` ({0}), must be one of {1}" # noqa: E501 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_type(self, type_balle):\n self.type_balle = type_balle", "def setHgType(self, hgTypeToSet):\n self.hgType = hgTypeToSet", "def setHgType(self, hgTypeToSet):\n self.huntGroup.setHgType(hgTypeToSet)", "def set_type(self, type):\n self.type = type", "def set_type(self, type...
[ "0.6524324", "0.6260105", "0.59710634", "0.59515464", "0.59515464", "0.58956015", "0.5889222", "0.5764757", "0.5651019", "0.5627617", "0.5578686", "0.55183876", "0.55183876", "0.55183876", "0.55183876", "0.5494313", "0.54888445", "0.54888445", "0.5484459", "0.5484459", "0.548...
0.79962516
0
Sets the groups of this Branchrestriction.
def groups(self, groups): self._groups = groups
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def groups(self, groups):\n self._groups = groups", "def set_pingroups(self, groups):\n self.groups = groups[:]", "def set_groups(self, principal, groups):\n self._check_groups(groups)\n self._groups[principal] = tuple(groups)", "def groups(self, groups):\n if groups is Non...
[ "0.74621856", "0.7115692", "0.6383976", "0.63487846", "0.6155966", "0.5983142", "0.59386146", "0.5890647", "0.5849653", "0.5765736", "0.5755647", "0.5745167", "0.5715525", "0.57036144", "0.5703288", "0.5688512", "0.5666007", "0.5650765", "0.5638324", "0.56322986", "0.56005627...
0.7337564
3
Sets the id of this Branchrestriction.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id_):\n\n self.id_ = id_", "def set_id(self, id):\n self.__id = id", "def SetId(self, id):\n self.id = int(id)", "def set_id(self, id):\n self.data['id'] = id", "def id(self, id):\n if id is None:\n raise ValueError(\"Invalid value for `id`, mu...
[ "0.71410817", "0.6904162", "0.6784741", "0.6675873", "0.6522554", "0.6522554", "0.6522554", "0.6505147", "0.6480972", "0.64220935", "0.64220935", "0.64220935", "0.64220935", "0.64220935", "0.64220935", "0.64220935", "0.64220935", "0.64220935", "0.64220935", "0.64220935", "0.6...
0.0
-1
Sets the kind of this Branchrestriction.
def kind(self, kind): if kind is None: raise ValueError("Invalid value for `kind`, must not be `None`") # noqa: E501 allowed_values = ["require_tasks_to_be_completed", "require_passing_builds_to_merge", "force", "require_all_dependencies_merged", "push", "require_approvals_to_merge", "enfor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetKind(self, new_kind):\r\n\r\n self.kind = new_kind", "def kind(self, kind):\n\n self._kind = kind", "def type(self, kind):\n self.type = kind", "def svn_info_t_kind_set(svn_info_t_self, svn_node_kind_t_kind): # real signature unknown; restored from __doc__\n pass", "def branc...
[ "0.68285924", "0.6470312", "0.6317965", "0.62362915", "0.6006996", "0.5924938", "0.5904838", "0.58630073", "0.5789489", "0.57533014", "0.57399637", "0.5734314", "0.5698222", "0.56862885", "0.5636929", "0.5548835", "0.5484049", "0.53875524", "0.5307235", "0.5279889", "0.523345...
0.61608446
4
Sets the links of this Branchrestriction.
def links(self, links): self._links = links
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def links(self, links):\n self._links = links", "def links(self, links):\n if links is None:\n raise ValueError(\"Invalid value for `links`, must not be `None`\")\n\n self._links = links", "def links(self, links):\n\n self.container['links'] = links", "def SetCannoLinks...
[ "0.75328267", "0.73548615", "0.6972824", "0.68244547", "0.67944944", "0.6548574", "0.6494223", "0.6267699", "0.61857617", "0.6082956", "0.6028528", "0.60262114", "0.6000829", "0.59866095", "0.58545965", "0.56815594", "0.56507695", "0.5562596", "0.5527477", "0.55181044", "0.55...
0.7473172
11
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Branchrestriction): 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.84568954", "0.83923674", "0.81447554", "0.81407183", "0.81326675", "0.80941343", "0.8092415", "0.8092415", "0.8092415", "0.8085536", "0.8085536", "0.8076502", "0.8076502", "0.8066026" ]
0.0
-1
Check the vertex equals another, returns a Boolean.
def __eq__(self, other): if type(other) is type(self): return (self.x == other.x and self.y == other.y and self.z == other.z) return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other_vertex):\n return self.name == other_vertex.name and self.state == other_vertex.state", "def __eq__(self, other: Vertex) -> bool:\n if isinstance(other, self.__class__):\n return self.id == other.id and self.edges == other.edges\n return False", "def __eq_...
[ "0.83838844", "0.83070326", "0.75481176", "0.737792", "0.715381", "0.6971738", "0.69161123", "0.69116545", "0.69053376", "0.69039017", "0.68875784", "0.6885239", "0.6873749", "0.6844305", "0.6834107", "0.6818732", "0.6815809", "0.6805608", "0.6804715", "0.67558473", "0.675584...
0.68496317
13
Check the vertex equals another, returns a Boolean.
def __lt__(self, other): if type(other) is type(self): return (self.x < other.x and self.y < other.y and self.z < other.z) return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other_vertex):\n return self.name == other_vertex.name and self.state == other_vertex.state", "def __eq__(self, other: Vertex) -> bool:\n if isinstance(other, self.__class__):\n return self.id == other.id and self.edges == other.edges\n return False", "def __eq_...
[ "0.83833754", "0.8306732", "0.75479376", "0.73782146", "0.7153019", "0.6973345", "0.6917412", "0.6912378", "0.6905216", "0.69050443", "0.6888866", "0.68868613", "0.6875014", "0.6852429", "0.68460214", "0.6833924", "0.6819111", "0.68172264", "0.68060887", "0.6805833", "0.67575...
0.0
-1
Get a config attribute. If the attribute is defined in the userspecified file, that is used, otherwise the default config file attribute is used if possible. If the attribute is a dictionary, the items in config and default_config will be merged.
def get_config(self, attr): default_config_val = self.get_default_config(attr) config_val = default_config_val if self.config is not None: try: config_val = getattr(self.config, attr) except AttributeError: pass if isinstance(conf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config(self, heading, attribute):\n if attribute in self._config[heading]:\n return self._config[heading][attribute]\n else:\n return None", "def get_default_config(self, attr):\n config_val = None\n\n try:\n config_val = getattr(self.config_de...
[ "0.6982713", "0.688402", "0.688402", "0.6746678", "0.6355968", "0.6295456", "0.6233581", "0.62221605", "0.6165364", "0.60803264", "0.6016906", "0.59591967", "0.5928763", "0.59222674", "0.5912237", "0.5907417", "0.5904703", "0.58924955", "0.58680886", "0.5863755", "0.5840508",...
0.6954067
2
Get a config attribute from the default config file.
def get_default_config(self, attr): config_val = None try: config_val = getattr(self.config_default, attr) except AttributeError: pass return config_val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config(attr):\n if not hasattr(config, 'config'):\n with open('config.json') as f:\n config.config = eval(f.read())\n node = config.config\n for part in attr.split('.'):\n node = node[part]\n return node", "def get_config(self, heading, attribute):\n if attribute i...
[ "0.69072163", "0.68364984", "0.68191034", "0.68070394", "0.67674494", "0.6752202", "0.67013013", "0.6679043", "0.6679043", "0.66362315", "0.6618547", "0.6600685", "0.6594299", "0.658867", "0.6563987", "0.6536496", "0.6503308", "0.64591897", "0.6441625", "0.643911", "0.6423064...
0.76260424
1
Set led to on or off
def set_led(self, on=True): if on: GPIO.output(self.LED, GPIO.HIGH) else: GPIO.output(self.LED, GPIO.LOW)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setLED(self):\n newValue = 0\n while newValue != '':\n newValue = input('Enter 0 or 1 to turn LED on or off or enter to exit.\\n')\n \n if newValue == '0':\n self.board.write(b'0')\n time.sleep(1)\n elif newValue == '1':\n ...
[ "0.79782146", "0.7749223", "0.7710936", "0.7599412", "0.7477314", "0.74591464", "0.742145", "0.72503704", "0.72437567", "0.723886", "0.72186434", "0.7209715", "0.72033614", "0.71153045", "0.710765", "0.7073784", "0.7063215", "0.70554596", "0.70242", "0.7020301", "0.6982956", ...
0.8478801
0
Remove the statistics after the simulation is over.
def clear_stats(self): self._stats = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stats_reset(self):\n self.stats.reset()", "def stats_reset(self):\n self.stats.reset()", "def clearstats(self) :\n\t\ttry :\n\t\t\treturn self._clearstats\n\t\texcept Exception as e:\n\t\t\traise e", "def clearstats(self) :\n\t\ttry :\n\t\t\treturn self._clearstats\n\t\texcept Exception as ...
[ "0.75836", "0.75836", "0.7306759", "0.7306759", "0.7306759", "0.7306759", "0.7048999", "0.7031562", "0.69378775", "0.6798965", "0.6756686", "0.6756686", "0.6756686", "0.6756686", "0.6693251", "0.66695166", "0.66652423", "0.6624123", "0.6605653", "0.64991975", "0.64556265", ...
0.7928672
0
Convert a ``numpy.ndarray`` to tensor. See ``ToTensor`` for more details.
def to_tensor(pic): if not _is_numpy_image(pic): raise TypeError('pic should be ndarray. Got {}'.format(type(pic))) # handle numpy array img = torch.from_numpy(pic.transpose((2, 0, 1))) # backward compatibility if isinstance(img, torch.ByteTensor): return img.float().div(255) els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def np2tensor(array, device=None):\n tensor = torch.from_numpy(array)\n return tensor", "def np2tensor(array, device_id=-1):\n tensor = torch.from_numpy(array)\n if device_id >= 0:\n tensor = tensor.cuda(device_id)\n return tensor", "def to_numpy(tensor):\n raise NotImplementedErro...
[ "0.8022027", "0.7629677", "0.7398654", "0.73371905", "0.68952143", "0.68611306", "0.68370765", "0.6781893", "0.6735821", "0.6712615", "0.6666945", "0.6653137", "0.651048", "0.64829683", "0.6482934", "0.64753187", "0.6411293", "0.6337385", "0.6335414", "0.63148385", "0.6294852...
0.56928414
56
Get number of days in month.
def _max_days(self): # type: (...) -> Union[int, Tuple[int]] return self.value.max_days
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def days_in_month(self):\n return calendar.monthrange(self.year, self.month)[1]", "def days_in_month(year, month):\n num_days = monthrange(year, month)[1]\n return num_days", "def number_of_days_in_month(year=2019, month=1):\n return monthrange(year, month)[1]", "def days_this_month(year, mon...
[ "0.8454375", "0.794394", "0.79145175", "0.7765448", "0.7725565", "0.7708659", "0.76919466", "0.76673126", "0.7550836", "0.7549315", "0.75278175", "0.72877043", "0.7282457", "0.7255492", "0.7255492", "0.7198137", "0.71825606", "0.7153615", "0.71391714", "0.71391714", "0.713917...
0.0
-1
Get ordinal of month.
def ordinal(self): # type: (...) -> int return self.value.ordinal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def month(self) -> int:\n if self.is_old_style:\n return int(self.split('/', 1)[1][2:4])\n return int(self[2:4])", "def to_ordinal(self):\n return ((self.month - 1) * 20) + self.day - 1", "def month(self) -> int:\n return self.arxiv_id.month", "def day_of_month(self) -...
[ "0.75749946", "0.74889636", "0.73740244", "0.7161771", "0.7161771", "0.70405376", "0.69933325", "0.69933325", "0.68510437", "0.6839338", "0.6826002", "0.68003434", "0.68003434", "0.67992705", "0.6790069", "0.675658", "0.6746827", "0.6716623", "0.6703019", "0.6694222", "0.6564...
0.6379779
28
Return object 'Month' by ordinal.
def get_by_ordinal( ordinal # type: int ): # type: (...) -> Optional[namedtuple] if not isinstance(ordinal, int): raise ValueError('Ordinal must be integer.') for month in Months: if month.ordinal == ordinal: return month return Non...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def month(self) -> int:\n return self.arxiv_id.month", "def month(self):\n return gocept.month.Month(self.calendar_month, self.calendar_year)", "def month(self):\n return self._months", "def month(self, month: str):\n return get_from_list(self.months, \"month\", month)", "def month(...
[ "0.69983417", "0.6950296", "0.6868998", "0.6794386", "0.67482686", "0.66860425", "0.66860425", "0.6682167", "0.6616864", "0.66096556", "0.6601976", "0.65622497", "0.65622497", "0.6508325", "0.6494035", "0.6474948", "0.6461141", "0.642812", "0.6424749", "0.6410988", "0.6408480...
0.6495497
14
Get number of days in month.
def get_max_days( self, year=None, # type: Optional[int] ): # type: (...) -> int max_days = self._max_days if self.name == 'FEBRUARY': if year is None: raise ValueError('Year is necessary for \'FEBRUARY\'.') return max_days[1] if se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def days_in_month(self):\n return calendar.monthrange(self.year, self.month)[1]", "def days_in_month(year, month):\n num_days = monthrange(year, month)[1]\n return num_days", "def number_of_days_in_month(year=2019, month=1):\n return monthrange(year, month)[1]", "def days_this_month(year, mon...
[ "0.8454375", "0.794394", "0.79145175", "0.7765448", "0.7725565", "0.7708659", "0.76919466", "0.76673126", "0.7550836", "0.7549315", "0.75278175", "0.72877043", "0.7282457", "0.7255492", "0.7255492", "0.7198137", "0.71825606", "0.7153615", "0.71391714", "0.71391714", "0.713917...
0.0
-1
Gets the number of open trades
def get_num_trades(self): num_trades = self.oanda.get_trades(self.account_id) num_trades = len(num_trades['trades']) return num_trades
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _get_num_open_trades(self) -> int:\n\n num = 0\n\n for pair in self.trades:\n num += len(self.trades[pair]['open'])\n\n return num", "async def _get_num_open_high_low_trades(self) -> float:\n\n low = 0\n high = 0\n\n for pair in self.trades:\n ...
[ "0.9037047", "0.73155195", "0.7179559", "0.7101679", "0.6668676", "0.65677446", "0.6369358", "0.6217808", "0.62137926", "0.61293733", "0.6116637", "0.60710436", "0.6048239", "0.60423577", "0.601068", "0.601068", "0.59848744", "0.5967277", "0.5851773", "0.5831641", "0.582883",...
0.6888877
4
Add experience to the buffer
def append(self, experience: Experience) -> None: self.buffer.append(experience)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, experience):\n self.buffer.append(experience)", "def add_experience(self, action, state, reward, terminal):\n self.replay_buffer.add_experience(action, state, reward, terminal)", "def append(self, experience):\n self.buffer.append(experience)\n self.number += 1", "de...
[ "0.8270671", "0.7972978", "0.7935725", "0.7499212", "0.7168458", "0.6970688", "0.64405805", "0.6439643", "0.6391008", "0.6333003", "0.62965715", "0.6290895", "0.6290808", "0.62784195", "0.61150753", "0.6087419", "0.6083567", "0.6074423", "0.6072279", "0.60656404", "0.60410774...
0.7916825
3
Extracts word embeddings from a model. Words is a list that stores all words you want to extract.
def getEmbeddings(model, words): embeddings = {} for word in words: embeddings[word] = model[word] return embeddings
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def embed(self, loader, model):\n print(\" ** Embedding words\")\n\n words = loader.words\n vectors = [model.get_word_vector(word) for word in words]\n\n return [(w, *v) for w, v in zip(words, vectors)]", "def _get_words_emb(self, words):\n\n if not self._is_cased_embedding:...
[ "0.7265877", "0.668241", "0.6576272", "0.6500501", "0.6433811", "0.64005715", "0.63875705", "0.6342498", "0.6318351", "0.6253743", "0.61638373", "0.6144107", "0.6135777", "0.6128297", "0.6110521", "0.6087532", "0.60740346", "0.60688305", "0.6054182", "0.6012976", "0.59826314"...
0.77758694
0
returns accurate path for wit folder, keyword can be 'images' or 'staging_area' because those are the dirs to be found in .wit. If no keyword is given, return the path of .wit dir
def get_wit_path(keyword=None): if not keyword: keyword = '.wit' for root, dirs, _ in os.walk(os.getcwd()): for d in dirs: if d == keyword and '.wit' in root: path = os.path.join(root, d) return path if d == keyword: path = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_path_outside_wit(filename):\n create_path = False\n for root, dirs, files in os.walk(os.getcwd()):\n for d in dirs:\n if d == filename:\n create_path = True\n for f in files:\n if f == filename:\n create_path = True\n if create_...
[ "0.63301", "0.56051725", "0.55470157", "0.5512353", "0.5512353", "0.5460567", "0.5299562", "0.52823067", "0.5281486", "0.52296907", "0.52296907", "0.52296907", "0.5213343", "0.515731", "0.5156855", "0.51405036", "0.51170063", "0.51162934", "0.5097116", "0.5057716", "0.5056171...
0.80345017
0
return path for a filename that is outside of .wit folder
def get_path_outside_wit(filename): create_path = False for root, dirs, files in os.walk(os.getcwd()): for d in dirs: if d == filename: create_path = True for f in files: if f == filename: create_path = True if create_path: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_wit_path(keyword=None):\n if not keyword:\n keyword = '.wit'\n for root, dirs, _ in os.walk(os.getcwd()):\n for d in dirs:\n if d == keyword and '.wit' in root:\n path = os.path.join(root, d)\n return path\n if d == keyword:\n ...
[ "0.6868828", "0.6712559", "0.6710115", "0.66976225", "0.66645324", "0.6653813", "0.6525332", "0.6494162", "0.64756966", "0.6475048", "0.64653164", "0.64574844", "0.6453546", "0.64271796", "0.6399978", "0.6398724", "0.63881546", "0.637245", "0.63635427", "0.6319702", "0.631886...
0.7927605
0
Add a viapoint to the trajectory Observations and corresponding basis activations
def add_viapoint(self, t, traj_point, traj_point_sigma=1e-6): self._viapoints.append({"t": t, "traj_point": traj_point, "traj_point_sigma": traj_point_sigma})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_point(self, x, fx):\n\t\tself.v.append([x,fx])\n\t\tself.poli = None", "def ADD_I_Vx(self, x):\n\t\tself.I += self.V[x]", "def add_point(self, x, fx, dx):\n\t\tself.v.append([x, fx, dx])\n\t\tself.v.append([x, fx, dx])\n\t\tself.poli = None", "def set_goal(self, traj_point, traj_point_sigma=1e-6):\n ...
[ "0.5817057", "0.5759475", "0.5742527", "0.56013054", "0.545676", "0.5419693", "0.54117703", "0.53282315", "0.5310157", "0.53041965", "0.5267117", "0.5218006", "0.517006", "0.5151938", "0.51368517", "0.5098627", "0.5056349", "0.50355524", "0.50213325", "0.4967857", "0.49663374...
0.7220424
0
Checks if an example contains a transit event or not.
def is_positive(self, example_path): candidate_planets = self.meta_data_frame[self.meta_data_frame['disposition'] == 'PC'] return example_path in candidate_planets['lightcurve_path'].values
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_if_event_event_or_event_timex(self):\n if (type(self.source) is Timex and type(self.target) is Event) or (type(self.source) is Event and type(self.target) is Timex):\n self._is_event_timex = True\n elif type(self.source) is Event and type(self.target) is Event:\n self...
[ "0.6005038", "0.57885283", "0.5730419", "0.57259446", "0.57145303", "0.57056946", "0.56648713", "0.56540024", "0.5621802", "0.5603452", "0.5558246", "0.55431855", "0.5542522", "0.5534795", "0.55129504", "0.5475181", "0.54525983", "0.54235405", "0.5408933", "0.53454006", "0.53...
0.0
-1
Tests building fuzzers with invalid project name.
def test_invalid_project_name(self): with tempfile.TemporaryDirectory() as tmp_dir: self.assertFalse( cifuzz.build_fuzzers( 'not_a_valid_project', 'oss-fuzz', tmp_dir, commit_sha='0b95fe1039ed7c38fea1f97078316bfc1030c523'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_not_a_valid_fuzzer(self):\n self.assertFalse(cifuzz.check_fuzzer_build(TEST_FILES_PATH))", "def test_invalid_workspace(self):\n self.assertFalse(\n cifuzz.build_fuzzers(\n EXAMPLE_PROJECT,\n 'oss-fuzz',\n 'not/a/dir',\n commit_sha='0b95fe1039ed7c3...
[ "0.76435965", "0.7348087", "0.71242833", "0.68992496", "0.6844128", "0.67781764", "0.6562975", "0.6561238", "0.6255851", "0.618119", "0.61574364", "0.6134565", "0.6042468", "0.6028488", "0.60157096", "0.58723766", "0.58681095", "0.573515", "0.5697077", "0.5688184", "0.5621889...
0.8437932
0
Update insurance array based on updated balance array
def update_insurance(origin_matrix, insurance_percent_ongoing, insurance_fixed_ongoing, grace_period_balloon): balance = origin_matrix[BALANCE_IDX] new_insurance_paid= np.zeros(len(origin_matrix[0])) new_insurance_paid[0] = origin_matrix[INSURANCE_IDX][0] new_insurance_paid[1:] = balance[1:] * insurance...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_balance(origin_matrix):\n principal = origin_matrix[PRINCIPAL_PAID_IDX]\n new_balance = np.zeros(len(origin_matrix[0]))\n new_balance[0] = origin_matrix[BALANCE_IDX][0]\n for idx in range(1,len(origin_matrix[0])):\n new_balance[idx] = new_balance[idx-1] - principal[idx]\n\n # w...
[ "0.6546169", "0.64840865", "0.62686056", "0.6048139", "0.6021053", "0.5924032", "0.5890425", "0.58120793", "0.5784999", "0.5744058", "0.5729858", "0.56960356", "0.5672298", "0.5654038", "0.5626236", "0.5617756", "0.56087947", "0.56087947", "0.56087947", "0.5598436", "0.559303...
0.7062385
0
Recalculate the insurance column based on user changes on insurance
def on_insurance_change(origin_matrix, changes_on_insurance): new_insurance = origin_matrix[INSURANCE_IDX] for idx in range(len(origin_matrix[0])): if changes_on_insurance[idx] != None: new_insurance[idx] = changes_on_insurance[idx] return new_insurance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_insurance(origin_matrix, insurance_percent_ongoing, insurance_fixed_ongoing, grace_period_balloon):\n balance = origin_matrix[BALANCE_IDX]\n new_insurance_paid= np.zeros(len(origin_matrix[0]))\n new_insurance_paid[0] = origin_matrix[INSURANCE_IDX][0]\n new_insurance_paid[1:] = balance[1:] * ...
[ "0.6069558", "0.5998544", "0.5566583", "0.5510681", "0.54773957", "0.54104286", "0.5410082", "0.540798", "0.5368224", "0.5353994", "0.5350984", "0.53258336", "0.5324168", "0.5294887", "0.5258726", "0.52482384", "0.5230158", "0.5169313", "0.51664513", "0.5159043", "0.5138139",...
0.6058711
1
Return the precision of this complex field.
def prec(self): return self._prec
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(self) -> float:\n return self._matrix.precision", "def precision(self) :\n return self.__precision", "def precision(self) :\n return self.__precision", "def precision(self):\n return PRECISION_WHOLE", "def precision(self):\n tpos, fpos = len(self.__true_posi...
[ "0.80162644", "0.7938163", "0.7938163", "0.7619381", "0.72521555", "0.69013", "0.6884501", "0.68068284", "0.67756194", "0.6718772", "0.66843766", "0.66352844", "0.6630464", "0.66153187", "0.6564608", "0.6512811", "0.6203379", "0.6180934", "0.6172411", "0.6163582", "0.6084975"...
0.71333754
6
r""" Return a string representation of ``self`` in the Magma language.
def _magma_init_(self, magma): return "ComplexField(%s : Bits := true)" % self.prec()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return self.format()", "def __str__(self):\n if __debug__:\n description = ('CM' in debug.active)\n else:\n description = False\n return self.asstring(short=False, header=True, summary=True,\n description=descripti...
[ "0.7128488", "0.7093338", "0.69856733", "0.69812316", "0.69684005", "0.69684005", "0.69525003", "0.6931051", "0.68866134", "0.68866134", "0.68866134", "0.6865793", "0.686535", "0.684833", "0.684833", "0.684833", "0.684833", "0.6842436", "0.6838721", "0.68160474", "0.6813367",...
0.0
-1
Compare ``self`` to ``other``.
def __cmp__(self, other): if not isinstance(other, ComplexField_class): return cmp(type(self), type(other)) return cmp(self._prec, other._prec)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n raise NotImplementedError", "def __eq__(self, other):\n raise NotImplementedError", "def __eq__(self, other):\n raise NotImplementedError", "def __cmp__(self, other):\n if isinstance(other, type(self)):\n return cmp(self.number, other.number)\...
[ "0.7709011", "0.7709011", "0.7709011", "0.7670916", "0.7654335", "0.7654335", "0.764131", "0.76292026", "0.75581163", "0.75546825", "0.75511265", "0.75511265", "0.75511265", "0.75511265", "0.75489324", "0.75249094", "0.75054294", "0.7490404", "0.7490404", "0.7479606", "0.7457...
0.0
-1
Return a string representation of ``self``.
def _repr_(self): return "Complex Field with %s bits of precision"%self._prec
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toString(self) -> str:\n raise NotImplementedError", "def to_string(self):\r\n return self.__str__()", "def __str__ (self) :\n\n return self.as_string()", "def __repr__(self) -> str:\n return str(self)", "def as_string(self):\n return self.__repr__()", "def __str__(...
[ "0.8741423", "0.87224996", "0.8680442", "0.85674626", "0.85082954", "0.8498878", "0.8472973", "0.84432036", "0.84432036", "0.84432036", "0.84432036", "0.84149486", "0.84149486", "0.84149486", "0.84149486", "0.84149486", "0.84149486", "0.84149486", "0.84149486", "0.84149486", ...
0.0
-1
r""" Return a latex representation of ``self``.
def _latex_(self): return "\\Bold{C}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _latex_(self):\n from sage.misc.latex import latex\n if self.parent()._chart.manifold().options.textbook_output:\n return latex(ExpressionNice(self._express))\n else:\n return latex(self._express)", "def _latex_(self):\n if len(self) == 0:\n return...
[ "0.81067616", "0.76876116", "0.76216835", "0.74790126", "0.7452841", "0.7366953", "0.7366953", "0.7348528", "0.72450554", "0.72160286", "0.718362", "0.7082809", "0.70819694", "0.7045076", "0.7036125", "0.702141", "0.70076203", "0.696737", "0.69583", "0.6921434", "0.6907416", ...
0.67545474
25
r""" Return the characteristic of `\CC`, which is 0.
def characteristic(self): from .integer import Integer return Integer(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def C(self,X):\n return(\n 0\n )", "def parse_is_self_cc(b):\n return f'{int(bool(b)):>{IS_SELF_CC_SIZE}}'", "def mcc(self):\n tp = self.tp\n tn = self.tn\n fp = self.fp\n fn = self.fn\n return tp * tn / np.sqrt((tp + fp) * (tp + fn) * (tn + fp) * ...
[ "0.63939583", "0.62558913", "0.6185733", "0.5951148", "0.5950505", "0.5924652", "0.58709973", "0.5856308", "0.5794466", "0.5776383", "0.5724243", "0.5705976", "0.5692357", "0.5653391", "0.5582844", "0.5581636", "0.55805135", "0.55805135", "0.5534668", "0.55254614", "0.5509804...
0.5670158
13
Ensure the window length provided to a transform is valid.
def check_window_length(window_length): if window_length is None: raise InvalidWindowLength("window_length must be provided") if not isinstance(window_length, Integral): raise InvalidWindowLength( "window_length must be an integer-like number") if window_length == 0: rais...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_window_safety_one_window_length(self):\n with pytest.raises(NonWindowSafeInput):\n SomeFactor(inputs=[SomeOtherFactor()])\n\n SomeFactor(inputs=[SomeOtherFactor()], window_length=1)", "def test_hanning(length, window):\n assert_almost_equal(windows.hanning(length), np.array(w...
[ "0.61781234", "0.57504064", "0.5594496", "0.55634314", "0.5485149", "0.53104687", "0.5258147", "0.5211918", "0.51369745", "0.5125402", "0.51213956", "0.5102692", "0.50767523", "0.5075916", "0.50742066", "0.5053022", "0.5029944", "0.5006983", "0.49745876", "0.49557382", "0.495...
0.7018821
0
Remove all cells with library size above or below a certain threshold.
def filter_library_size( data, *extra_data, cutoff=None, percentile=None, keep_cells=None, return_library_size=False, sample_labels=None, filter_per_sample=None, ): cell_sums = measure.library_size(data) return filter_values( data, *extra_data, values=cell...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size_filter(db, threshold):\n idx2rm = []\n for i, x in db.iterrows():\n if x['size'] < threshold:\n idx2rm.append(i)\n\n print(\"Numero de imagenes: \",len(db)-len(idx2rm),\" de \", len(db))\n return db.drop(idx2rm)", "def remove_small_boxes(boxes, min_size):\r\n ws, hs = bo...
[ "0.6857945", "0.66592896", "0.6406223", "0.633541", "0.633541", "0.6328605", "0.6296911", "0.6255339", "0.61858565", "0.59448", "0.59253705", "0.5911765", "0.58696234", "0.5844147", "0.5844072", "0.584353", "0.58364373", "0.5801732", "0.58010906", "0.57729167", "0.57339525", ...
0.6291844
7
Filter all duplicate cells.
def filter_duplicates(data, *extra_data, sample_labels=None): if sample_labels is not None: warnings.warn( "`sample_labels` is deprecated. " "Passing `sample_labels` as `extra_data`.", DeprecationWarning, ) extra_data = list(extra_data) + [sample_labels] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exclude_duplicates(self):\n from axs.catalog import AxsCatalog\n return self.filter(self._df[AxsCatalog.DUP_COLNAME] == 0)", "def filter_dups(self):\n def dups_filter():\n dups = set()\n for g1, g2, w in self.gen:\n if (min(g1, g2), max(g1, g2)) in du...
[ "0.6507822", "0.6353606", "0.60733736", "0.60639966", "0.59615827", "0.5895223", "0.5846177", "0.58456755", "0.57898045", "0.57874453", "0.5745656", "0.5714447", "0.5706828", "0.5698283", "0.5634563", "0.5620885", "0.55829716", "0.555794", "0.54890656", "0.54648495", "0.54597...
0.5347904
26
Return xmlformatted string representing query result.
def get_query_xml(query): root = get_query_etree(query) # can get actual field types by inspecting cursor.description, # but these (I think) depend on the database back-end # so I decided it was too hard to be smart here, # and instead just say that everything is "CDATA #REQURED"... attlist = '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_xml(self,query_results):\n results=query_results.data\n factory=factory_xml()\n dump=factory.dumps({'data':results})\n print(dump)\n # TODO return output for this\n return \"\"", "def format(cls, result, result_tag='result', head_tag='head',\n ro...
[ "0.8073055", "0.7138711", "0.66492414", "0.637289", "0.6335337", "0.6314267", "0.60827446", "0.60282624", "0.6000834", "0.5980814", "0.59194195", "0.58998626", "0.58989894", "0.5879399", "0.5877428", "0.58768123", "0.58663577", "0.5855469", "0.58418506", "0.5834019", "0.58238...
0.70674473
2
Return jsonformatted string representing query result.
def get_query_json(query): rows = [dict(row.attrib) for row in get_query_etree(query)] return json.dumps(rows, indent=2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_json(self,query_results):\n results=query_results.data\n factory=factory_json()\n dump=factory.dumps(results)\n print(dump)\n # TODO return output for this\n return \"\"", "def formatResult(self, result):\r\n return str(result)", "def format_results(r...
[ "0.8192802", "0.68817216", "0.6860699", "0.67340505", "0.66919434", "0.66919434", "0.66919434", "0.66919434", "0.66919434", "0.66919434", "0.66919434", "0.66919434", "0.66919434", "0.66919434", "0.6685108", "0.6682299", "0.665037", "0.6637528", "0.6635697", "0.6635697", "0.66...
0.6854796
3
Returns the next probe that must be run immediately. If the earliest available probe needs to be run later, this will internally wait until it's time to run the probe. If the scheduling queue changes while waiting, the earliest scheduled probe will be reelected immediately. This means that you can concurrently add and ...
async def get_next(self) -> Probe: schedule: Optional[Schedule] = None while schedule is None: try: # Try to get the earliest scheduled probe schedule = self.queue[0] except IndexError: # If there is none, wait for a change ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_ele(self):\n\t\ttry:\n\t\t\tret = self._queue.get(block = True, timeout=0.5)\n\t\t\tself._queue.task_done()\n\t\t\treturn ret\n\t\texcept queue.Empty:\n\t\t\tif not self.is_running():\n\t\t\t\traise\n\t\t\telse:\n\t\t\t\treturn None", "def next_ele(self):\n\t\ttry:\n\t\t\tret = self._queue.get(block=Tru...
[ "0.61887944", "0.60196537", "0.59081274", "0.573002", "0.5656411", "0.5599499", "0.5520124", "0.54116374", "0.52884704", "0.5268198", "0.5264708", "0.52560306", "0.5237014", "0.5232957", "0.5217256", "0.51940256", "0.5187326", "0.51839", "0.51692384", "0.5098743", "0.5076269"...
0.86496276
0
BatchNorm1d over the batch, N. Requires shape (N, C, L). Otherwise, same as torch.nn.BatchNorm1d with extra num_channel. Cannot do the temporal batch norm case.
def __init__( self, num_channels: int, num_features: int, eps: float = 1e-5, momentum: float = 0.1, affine: bool = True, track_running_stats: bool = True, ) -> None: num_features = num_channels * num_features super().__init__(num_features, eps,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batch_norm(input_tensor):\n epsilon = 1e-3\n batch_mean, batch_var = tf.nn.moments(input_tensor, [0])\n input_tensor = tf.nn.batch_normalization(input_tensor, mean=batch_mean, variance=batch_var, offset=None,\n scale=None, variance_epsilon=epsilon)\n\n re...
[ "0.70602345", "0.6922279", "0.6911417", "0.6898921", "0.6787584", "0.65479213", "0.6368629", "0.63485044", "0.6315762", "0.62954116", "0.62581193", "0.62194026", "0.6193065", "0.61433405", "0.6093739", "0.6082891", "0.60733795", "0.6065571", "0.6050721", "0.6043515", "0.60255...
0.0
-1
Convert tracker boxes to a standardized format (x, y, w, h)
def normalize_tracker_boxes(boxes, is_sort): n_boxes = [] track_ids = [] for t in boxes: if is_sort: (x1, y1, x2, y2, tid) = t.astype(np.int32) x, y, w, h = min(x1, x2), min(y1, y2), np.abs(x2 - x1), np.abs(y2 - y1) else: (x, y, w, h, tid) = t if 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert(size, box):\n # TODO rewrite box to be [TL, BR] coordinates\n #pdb.set_trace()\n dw = 1./size[0]\n dh = 1./size[1]\n x = (box[0] + box[1])/2.0\n y = (box[2] + box[3])/2.0\n w = box[1] - box[0]\n h = box[3] - box[2]\n x = x*dw\n w = w*dw\n y = y*dh\n h = h*dh\n ret...
[ "0.6848397", "0.6612929", "0.6455999", "0.64266545", "0.64206326", "0.6216739", "0.62066585", "0.6170469", "0.61687094", "0.6116827", "0.6020458", "0.60040593", "0.59891135", "0.5978143", "0.5969502", "0.5967825", "0.59642386", "0.5929327", "0.5927229", "0.5903745", "0.589503...
0.68655056
0
Return an accumulator function that takes a single numeric argument and accumulates that argument into total, then returns total. >>> acc = make_accumulator() >>> acc(15) 15 >>> acc(10) 25 >>> acc2 = make_accumulator() >>> acc2(7) 7 >>> acc3 = acc2 >>> acc3(6) 13 >>> acc2(5) 18 >>> acc(4) 29
def make_accumulator(): pass # replace with your solution
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_accumulator():\n sum = []\n def accumulator(x):\n sum.append(x)\n total = 0\n for elem in sum:\n total += elem\n return total\n return accumulator", "def create_accumulator(self):\n raise NotImplementedError", "def make_accumulator_nonlocal():\n to...
[ "0.7567601", "0.6434998", "0.62577957", "0.62115055", "0.6123985", "0.6123985", "0.60399216", "0.60283095", "0.60177696", "0.59717524", "0.5931308", "0.5864821", "0.5806483", "0.57568526", "0.57179654", "0.5701432", "0.5651258", "0.56238264", "0.5621056", "0.5498875", "0.5488...
0.6917254
1
Sends a 401 response that enables basic auth
def authenticate(): return Response( 'Could not verify your access level for that URL.\n' 'You have to login with proper credentials', 401, {'WWW-Authenticate': 'Basic realm="Login Required"'})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate():\n return Response('Not Authorized', 401, {'WWW-Authenticate': 'Basic realm=\"api\"'})", "def authenticate():\n return Response(\n '', 401, {'WWW-Authenticate': 'Basic realm=\"Login Required\"'}\n )", "def authenticate():\n return Response(\n 'You have to login with pro...
[ "0.8093736", "0.80926424", "0.7958403", "0.7852648", "0.7843114", "0.7824419", "0.776624", "0.7754693", "0.774767", "0.774767", "0.774767", "0.774767", "0.774767", "0.774767", "0.774767", "0.774767", "0.771945", "0.7667712", "0.7664151", "0.76493174", "0.76140213", "0.76131...
0.7810746
26
Test homepage route with location params.
def test_homepage_with_location(self): with self.client: response = self.client.get('/?location=US-CA') self.assertEqual(response.status_code, 200) self.assertIn(b'California News', response.data) response = self.client.get('/?location=US-FAKE') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_homepage_view(self):\n response = self.client.get(url_for('home'))\n self.assertEqual(response.status_code, 200)", "def test_homepage_view(self):\n response = self.client.get(url_for('home'))\n self.assertEqual(response.status_code, 200)", "def test_home(self):\n res...
[ "0.7126617", "0.7126617", "0.6980778", "0.69588023", "0.69265205", "0.68410796", "0.68087685", "0.6780387", "0.67687", "0.6744791", "0.6688457", "0.66666925", "0.666617", "0.6618392", "0.6618085", "0.6587523", "0.6515065", "0.6479519", "0.6477713", "0.6461935", "0.6437698", ...
0.7055962
2
Test login POST route w/ invalid credentials.
def test_login_POST_2(self): User.signup(username='testuser2', password="PASSWORD", location="US-FL") db.session.commit() with app.app_context(): form = UserLoginForm(username='testuser2', password='WRONG_PASSWORD') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_login_route_incorrect(self):\n result = self.client.post(\"/login\",\n data={\"username\":\"test_user1\", \"password\":\"test_pass2\"}, follow_redirects=True)\n self.assertEqual(result.status_code, 200)\n self.assertIn(b\"The password you inputed for test_user1 is incorrect. Tr...
[ "0.8252938", "0.82021385", "0.8058481", "0.803621", "0.80001605", "0.791227", "0.79057145", "0.7897973", "0.7865996", "0.7789902", "0.7751401", "0.7729049", "0.77182835", "0.77131015", "0.7707831", "0.76876646", "0.76692814", "0.7611026", "0.7602175", "0.7589674", "0.7543333"...
0.7219975
50
Test user location GET route w/o logged in user.
def test_user_location_GET(self): with self.client: u = User.query.first() response = self.client.get( f'/users/${u.username}/location', follow_redirects=True) self.assertIn(b'Unauthorized.', response.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_location_GET_3(self):\r\n\r\n u1 = User.query.filter_by(username='testuser').one()\r\n\r\n with self.client as c:\r\n with c.session_transaction() as sess:\r\n sess[CURR_USER_KEY] = u1.id\r\n response = c.get('/users/anotherUser/location',\r\n ...
[ "0.72751456", "0.70904523", "0.67806196", "0.6583521", "0.65551674", "0.6539657", "0.6484461", "0.6366712", "0.6246071", "0.62313557", "0.6212521", "0.62110037", "0.6210344", "0.62081033", "0.6203838", "0.62025476", "0.619941", "0.61915636", "0.6153907", "0.61218476", "0.6121...
0.7437403
0
Test user location GET route w/ logged in user.
def test_user_location_GET_2(self): u1 = User.query.filter_by(username='testuser').one() with self.client as c: with c.session_transaction() as sess: sess[CURR_USER_KEY] = u1.id response = c.get( f'/users/{u1.username}/location', follow_r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_location_GET_3(self):\r\n\r\n u1 = User.query.filter_by(username='testuser').one()\r\n\r\n with self.client as c:\r\n with c.session_transaction() as sess:\r\n sess[CURR_USER_KEY] = u1.id\r\n response = c.get('/users/anotherUser/location',\r\n ...
[ "0.73714465", "0.73374885", "0.6747311", "0.67367697", "0.64646333", "0.64151454", "0.6389424", "0.6379252", "0.63781023", "0.63493884", "0.6333009", "0.6326079", "0.62559444", "0.62451816", "0.62256205", "0.6218647", "0.6201266", "0.6200421", "0.6200421", "0.6196672", "0.617...
0.7192185
2
Test wrong user location GET route w/ logged in user.
def test_user_location_GET_3(self): u1 = User.query.filter_by(username='testuser').one() with self.client as c: with c.session_transaction() as sess: sess[CURR_USER_KEY] = u1.id response = c.get('/users/anotherUser/location', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_location_GET(self):\r\n\r\n with self.client:\r\n u = User.query.first()\r\n response = self.client.get(\r\n f'/users/${u.username}/location', follow_redirects=True)\r\n self.assertIn(b'Unauthorized.', response.data)", "def test_user_location_G...
[ "0.7383094", "0.7055438", "0.6973297", "0.68218935", "0.6774831", "0.6774831", "0.6774831", "0.6774831", "0.66833216", "0.6638217", "0.6563056", "0.6541757", "0.6528573", "0.6516021", "0.6514362", "0.6506936", "0.6506936", "0.6506936", "0.6417328", "0.64118284", "0.6396186", ...
0.7313256
1
Test user saved articles GET route w/o logged in user.
def test_saved_articles_GET(self): with self.client: u = User.query.first() response = self.client.get( f'/users/${u.username}/saved-articles', follow_redirects=True) self.assertIn(b'Unauthorized.', response.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_saved_articles_GET_3(self):\r\n\r\n u1 = User.query.filter_by(username='testuser').one()\r\n\r\n with self.client as c:\r\n with c.session_transaction() as sess:\r\n sess[CURR_USER_KEY] = u1.id\r\n response = c.get('/users/anotherUser/location',\r\n ...
[ "0.75301933", "0.7484046", "0.6795192", "0.6790967", "0.673682", "0.66530854", "0.6623884", "0.66120976", "0.65798074", "0.65774906", "0.65136284", "0.6437879", "0.64297575", "0.6372395", "0.6316534", "0.6299589", "0.62957436", "0.62810946", "0.62802845", "0.62760323", "0.624...
0.81484205
0
Test user saved articles GET route w/ logged in user.
def test_saved_articles_GET_2(self): u1 = User.query.filter_by(username='testuser').one() with self.client as c: with c.session_transaction() as sess: sess[CURR_USER_KEY] = u1.id response = c.get( f'/users/{u1.username}/saved-articles', f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_saved_articles_GET(self):\r\n\r\n with self.client:\r\n u = User.query.first()\r\n response = self.client.get(\r\n f'/users/${u.username}/saved-articles', follow_redirects=True)\r\n self.assertIn(b'Unauthorized.', response.data)", "def test_saved_ar...
[ "0.80580217", "0.76165485", "0.6846217", "0.6821734", "0.67638856", "0.6754496", "0.6665632", "0.6643979", "0.66295296", "0.6603077", "0.65474147", "0.65359545", "0.65296173", "0.6502077", "0.6474109", "0.64039344", "0.63245237", "0.628762", "0.6285193", "0.62720716", "0.6264...
0.7561221
2
Test wrong user saved articles GET route w/ logged in user.
def test_saved_articles_GET_3(self): u1 = User.query.filter_by(username='testuser').one() with self.client as c: with c.session_transaction() as sess: sess[CURR_USER_KEY] = u1.id response = c.get('/users/anotherUser/location', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_saved_articles_GET(self):\r\n\r\n with self.client:\r\n u = User.query.first()\r\n response = self.client.get(\r\n f'/users/${u.username}/saved-articles', follow_redirects=True)\r\n self.assertIn(b'Unauthorized.', response.data)", "def test_saved_ar...
[ "0.7879827", "0.72719616", "0.6872468", "0.68596584", "0.67939293", "0.67724085", "0.67254126", "0.6712251", "0.6711524", "0.6681882", "0.6681173", "0.65779424", "0.6541725", "0.65361035", "0.6509388", "0.6500808", "0.64987755", "0.6474946", "0.647328", "0.64704055", "0.64658...
0.75056505
1
Test user saved article POST route w/ logged in user.
def test_user_saved_articles_POST(self): u1 = User.query.filter_by(username='testuser').one() a = Article.query.filter_by(saved_by=u1.id).all() with app.app_context(): form = ArticleAddForm(path=a[0].path, url=a[0].url, location=a[0].location, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_saved_articles_POST_3(self):\r\n\r\n u1 = User.query.filter_by(username='testuser').one()\r\n a = Article.query.filter_by(saved_by=u1.id).all()\r\n User.signup(username='testuser2',\r\n password=\"PASSWORD\", location=\"US-FL\")\r\n db.session.commit()\r...
[ "0.7399259", "0.7111708", "0.70298916", "0.69399166", "0.67694587", "0.67291105", "0.67022", "0.6637124", "0.6637124", "0.6610007", "0.65476483", "0.65366125", "0.6530042", "0.65098774", "0.6509555", "0.64837223", "0.64598477", "0.64592874", "0.64531237", "0.6449709", "0.6392...
0.73646975
1
Test wrong user saved article POST route w/ logged in user.
def test_user_saved_articles_POST_2(self): u1 = User.query.filter_by(username='testuser').one() a = Article.query.filter_by(saved_by=u1.id).all() User.signup(username='testuser2', password="PASSWORD", location="US-FL") db.session.commit() u2 = User.que...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_saved_articles_POST_3(self):\r\n\r\n u1 = User.query.filter_by(username='testuser').one()\r\n a = Article.query.filter_by(saved_by=u1.id).all()\r\n User.signup(username='testuser2',\r\n password=\"PASSWORD\", location=\"US-FL\")\r\n db.session.commit()\r...
[ "0.70764816", "0.68455493", "0.6780872", "0.6766503", "0.66686046", "0.6634975", "0.6631664", "0.659899", "0.65880996", "0.6587624", "0.6540605", "0.65155923", "0.64827955", "0.64679945", "0.6448429", "0.6414598", "0.63951975", "0.63810015", "0.636428", "0.636428", "0.6320789...
0.6744496
4
Test user saved article POST route w/o logged in user.
def test_user_saved_articles_POST_3(self): u1 = User.query.filter_by(username='testuser').one() a = Article.query.filter_by(saved_by=u1.id).all() User.signup(username='testuser2', password="PASSWORD", location="US-FL") db.session.commit() u2 = User.que...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_saved_articles_POST(self):\r\n\r\n u1 = User.query.filter_by(username='testuser').one()\r\n a = Article.query.filter_by(saved_by=u1.id).all()\r\n\r\n with app.app_context():\r\n form = ArticleAddForm(path=a[0].path, url=a[0].url, location=a[0].location,\r\n ...
[ "0.7176774", "0.69636154", "0.6927341", "0.6857316", "0.68053246", "0.66379553", "0.66011095", "0.6597171", "0.65928423", "0.6525459", "0.6519771", "0.6519771", "0.6518567", "0.64228773", "0.6413204", "0.6411368", "0.6379105", "0.63685346", "0.6366547", "0.63598216", "0.63367...
0.72546494
0
Test user sort saved articles PATCH route w/o logged in user.
def test_sort_saved_articles_PATCH(self): with self.client: u = User.query.first() response = self.client.patch( f'/users/${u.username}/saved-articles', follow_redirects=True) self.assertIn(b'Unauthorized.', response.data) self.assertEqual(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_sort_saved_articles_PATCH_3(self):\r\n\r\n u1 = User.query.filter_by(username='testuser').one()\r\n User.signup(username='testuser2',\r\n password=\"PASSWORD\", location=\"US-FL\")\r\n db.session.commit()\r\n u2 = User.query.filter_by(username='testuser2').on...
[ "0.7392448", "0.7251366", "0.6369687", "0.61882484", "0.61654633", "0.6017641", "0.60083044", "0.5988215", "0.5965181", "0.5875579", "0.58318573", "0.5822886", "0.58100957", "0.57776326", "0.5772916", "0.57627577", "0.57487935", "0.5746072", "0.57396024", "0.5732534", "0.5724...
0.80012494
0
Test user sort saved article PATCH route w/ logged in user.
def test_sort_saved_articles_PATCH_2(self): u1 = User.query.filter_by(username='testuser').one() a = Article.query.filter_by(saved_by=u1.id).all() with app.app_context(): form = ArticleAddForm(path=a[0].path, url=a[0].url, location=a[0].location, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_sort_saved_articles_PATCH(self):\r\n\r\n with self.client:\r\n u = User.query.first()\r\n response = self.client.patch(\r\n f'/users/${u.username}/saved-articles', follow_redirects=True)\r\n self.assertIn(b'Unauthorized.', response.data)\r\n ...
[ "0.7922849", "0.7409088", "0.66333216", "0.63777864", "0.63361496", "0.6187593", "0.6176324", "0.6110985", "0.60596526", "0.6043125", "0.59926564", "0.5940337", "0.5939828", "0.5930393", "0.5900189", "0.5896901", "0.58950436", "0.5861858", "0.5856839", "0.585185", "0.5805451"...
0.72069687
2
Test wrong user sort saved article PATCH route w/ logged in user.
def test_sort_saved_articles_PATCH_3(self): u1 = User.query.filter_by(username='testuser').one() User.signup(username='testuser2', password="PASSWORD", location="US-FL") db.session.commit() u2 = User.query.filter_by(username='testuser2').one() with s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_sort_saved_articles_PATCH(self):\r\n\r\n with self.client:\r\n u = User.query.first()\r\n response = self.client.patch(\r\n f'/users/${u.username}/saved-articles', follow_redirects=True)\r\n self.assertIn(b'Unauthorized.', response.data)\r\n ...
[ "0.78071696", "0.6823352", "0.6767462", "0.67212415", "0.6671268", "0.6624037", "0.64513713", "0.6433423", "0.6410915", "0.63829714", "0.63579154", "0.6323414", "0.63207364", "0.6315069", "0.6290836", "0.6236841", "0.6210708", "0.6196189", "0.619518", "0.61899686", "0.6172942...
0.7352162
1
This functions checks whether input date string is between input start date string and to end date string
def date_range_validator(input_date_str, from_date_str, to_date_str, pattern="%d-%m-%Y"): import sys from datetime import datetime try: input_date = datetime.strptime(input_date_str, pattern).date() from_date = datetime.strptime(from_date_str, pattern).date() to_date = datetime.strpt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_whether_date_in_range(search_date, start_date, end_date):\n if search_date > end_date:\n return False\n if search_date < start_date:\n return False\n return True", "def check_date(created_at, start, end):\n x = get_date(created_at)\n return x <= end and x >= start", "def ...
[ "0.7849753", "0.76580286", "0.7656711", "0.7211986", "0.6976649", "0.69418436", "0.691801", "0.69140196", "0.69043565", "0.6786955", "0.67546314", "0.67459905", "0.65896416", "0.64261085", "0.6395907", "0.6371844", "0.6310035", "0.6307657", "0.6269493", "0.6245867", "0.624581...
0.8025939
0
Saves a plot object with showing message
def savefig(plt, path, show_message= True, tight_flag= True, newline= True): if show_message: print("Saving to {}".format(path)) if tight_flag: plt.savefig(path, bbox_inches='tight', pad_inches=0) else: plt.savefig(path) if newline: print("")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_plot(self, ):\n pass", "def on_save(self, event):\n file_choices = \"PNG (*.png)|*.png\"\n \n dlg = wx.FileDialog(\n self, \n message=\"Save plot as...\",\n defaultDir=os.getcwd(),\n defaultFile=\"plot.png\",\n wildcard=f...
[ "0.8497265", "0.73613065", "0.69812757", "0.6870931", "0.68566364", "0.6796502", "0.675206", "0.6715448", "0.6700636", "0.66601396", "0.6648489", "0.6620172", "0.65819126", "0.6570276", "0.6540196", "0.6502102", "0.6489511", "0.6487128", "0.64746606", "0.64494145", "0.6419864...
0.6399153
23
Numerically stable version of sigmoid function. Taken from Assignment 2.
def get_sigmoid(x): output = np.zeros(x.shape) ind1 = (x >= 0) ind2 = (x < 0) output[ind1] = 1 / (1 + np.exp(-x[ind1])) output[ind2] = np.divide(np.exp(x[ind2]), (1 + np.exp(x[ind2]))) return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(x):\n return 1 / (1 + math.exp(-x))", "def sigmoid(x):\n return 1 / (1 + exp(-x))", "def sigmoid(x):\n return 1 / (1 + exp(-x))", "def sigmoid(x):\r\n return 1 / (1 + np.exp(-x))", "def sigmoid(x):\n return 1 / (1 + math.exp(-x))", "def sigmoid(x):\n\n return 1 / (1 + math.exp...
[ "0.85846925", "0.85715055", "0.85715055", "0.8533385", "0.85272235", "0.8518283", "0.8518283", "0.84872323", "0.84872323", "0.84872323", "0.84872323", "0.84872323", "0.84872323", "0.84648824", "0.846446", "0.84491193", "0.84464", "0.84268767", "0.8426077", "0.8422556", "0.841...
0.77025676
98
Calculates affine transformations of sigmoid
def affine_sigmoid(xin, m= 10, c= 3): if type(xin) != np.ndarray: x = np.array([xin]) else: x = xin x = get_affine(x, m, c) output = get_sigmoid(x) if type(xin) != np.ndarray: return output[0] else: return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tanh_to_sigmoid(x):\n return x * 0.5 + 0.5", "def affine_sigmoid_forward(x, w, b):\n a, fc_cache = affine_forward(x, w, b)\n out, sigmoid_cache = sigmoid_forward(a)\n cache = (fc_cache, sigmoid_cache)\n return out, cache", "def _sigmoid_to_tanh(x):\n return (x - 0.5) * 2.", "def sigmoi...
[ "0.728688", "0.71955705", "0.7104531", "0.7080513", "0.7071187", "0.707076", "0.69978404", "0.6977138", "0.6977138", "0.69714606", "0.69714606", "0.69714606", "0.69714606", "0.69714606", "0.69714606", "0.696388", "0.69501716", "0.6949755", "0.69190335", "0.6909729", "0.689043...
0.7332949
0
Calculates the integral e^{x^2} f(x) dx numerically.
def gass_hermite_quad(f, degree, m, c): points, weights = np.polynomial.hermite.hermgauss( degree) #function values at given points f_x = f(points, m= m, c= c) #weighted sum of function values F = np.sum( f_x * weights) return F
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def f2(x):\n return x**2 + 2 * x + 1", "def FermiDirac_integral(self, y):\n return sint.quad_vec(lambda x: x**2.*np.sqrt(x**2.+y**2.)/(np.exp(x)+1.), 0., 500.)[0]", "def exp_integral(x):\n gamma = 0.577215665\n return (-gamma - expn(x,1) - np.log(x))", "def integralFunction(xa, ya, xb, yb):\n...
[ "0.66732836", "0.64203036", "0.6069754", "0.6052687", "0.6024172", "0.59957707", "0.5964896", "0.591946", "0.58927697", "0.58796", "0.58796", "0.58104354", "0.5767218", "0.57546866", "0.5744972", "0.5728148", "0.57104796", "0.56900185", "0.5668421", "0.56031543", "0.558352", ...
0.0
-1
Returns KE from the momentum vector
def get_KE(p, scale= 1): p = p.flatten() return scale * 0.5*np.sum(np.multiply(p, p))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def energyK(k):\r\n C1 = 9.7846113e-07\r\n C2 = 12.263868e0 \r\n E = (-1.0 + np.sqrt(1.0 + 4.0 * C1 * C2**2 * k**2))/(2.0 * C1)\r\n return E", "def get_E(J,k):\n E = -2 * J * np.cos(k) # energyeigenvalue \n return E", "def keV(E):\n if np.min(E) >= 100:\n return E / 100...
[ "0.71807945", "0.70496315", "0.6939545", "0.68826014", "0.6822304", "0.6754371", "0.6718966", "0.6524951", "0.6509311", "0.64933944", "0.6420543", "0.64157987", "0.6399082", "0.6347327", "0.6341967", "0.629807", "0.6265332", "0.6226262", "0.6220273", "0.6191231", "0.61510354"...
0.0
-1
return sizes of output queues.
def outputsizes(self): result = [] for q in self.outqueues: result.append(q.qsize()) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def outputsizes(self):\n\n result = []\n for q in self.outqueues:\n result.append(q.qsize())\n return result", "def get_all_output_tensors_sizes(self):\n return self._engine.get_all_output_tensors_sizes()", "def queue_size(self):\n return len(self.groups)", "def outp...
[ "0.8995115", "0.7129151", "0.7115764", "0.70966893", "0.69873023", "0.69465595", "0.69439024", "0.6940555", "0.6940555", "0.6940555", "0.6940555", "0.69172883", "0.69172883", "0.69113106", "0.69016397", "0.68971395", "0.6835457", "0.6804229", "0.6777378", "0.66525924", "0.663...
0.9046233
0
close connection with the server.
def quit(self, reason="", *args, **kwargs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_connection(self):\n\n self._connection.close()\n print(\"Closed connection....\")", "def closeConnection(self):\n print(\"closing connection...\")\n self.s.close()\n quit()", "def close_connection(self):\n self.nodesocket.close()", "def close_connection(sel...
[ "0.81794584", "0.8136035", "0.8089123", "0.80348945", "0.8020672", "0.8013639", "0.80051285", "0.7999521", "0.798737", "0.7982346", "0.7982346", "0.7973022", "0.792874", "0.7918277", "0.7892073", "0.7850703", "0.7824399", "0.7824399", "0.7824399", "0.7824399", "0.7824399", ...
0.0
-1
convert markup to IRC bold.
def normalize(self, what): txt = strippedtxt(what, ["\002", "\003"]) txt = re.sub("\s+", " ", what) txt = stripcolor(txt) txt = txt.replace("\002", "*") txt = txt.replace("<b>", "*") txt = txt.replace("</b>", "*") txt = txt.replace("<i>", "") txt = txt.rep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_bold(mkd):\n\t\n\tfor md_code in re.findall(r\"\\*\\*.*?\\*\\*\", mkd, re.M):\n\t\ttex_code = \"\\\\textbf{\" + re.findall(r\"\\*\\*(.*?)\\*\\*\", md_code, re.M)[0] + \"}\"\n\t\tmkd = mkd.replace(md_code, tex_code)\n\t\n\tfor md_code in re.findall(r\"__.*?__\", mkd, re.M):\n\t\ttex_code = \"\\\\textbf{...
[ "0.6645335", "0.66015893", "0.64435273", "0.6426406", "0.6425068", "0.6345588", "0.61542314", "0.6106281", "0.60682184", "0.6032436", "0.6017657", "0.59722066", "0.5946256", "0.5886245", "0.5838541", "0.583267", "0.57723445", "0.5772097", "0.57436997", "0.57153505", "0.567842...
0.5192131
39
The position of the bins for the histogram based on the current state.
def bins(self): if self.hist_x_min is None or self.hist_x_max is None or self.hist_n_bin is None: return None if self.x_log: return np.logspace(np.log10(self.hist_x_min), np.log10(self.hist_x_max), self.hist_n_bin + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bins(self):\n\n if self.hist_x_min is None or self.hist_x_max is None or self.hist_n_bin is None:\n return None\n\n if self.x_log:\n return np.logspace(np.log10(self.hist_x_min),\n np.log10(self.hist_x_max),\n self....
[ "0.6661031", "0.6540836", "0.64741886", "0.6455725", "0.6455725", "0.6393859", "0.63581336", "0.6334161", "0.6307209", "0.61829287", "0.61670864", "0.608374", "0.6055638", "0.60100234", "0.59851366", "0.59765875", "0.5963052", "0.59426653", "0.5920312", "0.5918137", "0.588193...
0.64850295
2
Test that the repr method returns an official representation of the object as a string.
def test_repr(self): # Create a Resource object book = Book("Penguin Group", "New York", "fiction", 1, "White Noise", Name("Don", "", "DeLillo"), "Delillo's White Noise follows narrator Jack "\ "Gladney, a professor at a small Libera...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_repr(self):\n dummy = DummyCryptographicObject()\n repr(dummy)", "def test_repr():\n c = Circle(4) \n assert c.__repr__() == 'Circle(4)'", "def repr_(object_):\n return repr(object_)", "def test_repr(self):\n self.assertEqual(repr(self.card), \"A of Spades\")", "def r...
[ "0.8037619", "0.7992412", "0.7988347", "0.7737927", "0.76742977", "0.7670939", "0.7617808", "0.7584389", "0.75466436", "0.7544901", "0.7543479", "0.7535306", "0.7476006", "0.7457964", "0.7454906", "0.74449784", "0.74011624", "0.7344937", "0.7343532", "0.73381126", "0.7324486"...
0.7562513
8
Returns the largest test statistic seen during simulations.
def MaxTestStat(self): return max(self.test_stats)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_highest(self, test):\n return", "def sim_max(sim_mats):\n return np.array(sim_mats).max(axis=0)", "def max(self):\r\n\t\treturn max(self.sample)", "def getMaxSimTime(self):\n return self.max_simsecs_value", "def search_for_maximum(self):\n return self.maximise_aquisition(sel...
[ "0.71215695", "0.64967453", "0.64642525", "0.6404307", "0.6377231", "0.63149863", "0.62553626", "0.62291723", "0.6219297", "0.6210953", "0.6198376", "0.6198376", "0.6198376", "0.6198376", "0.6198376", "0.6198376", "0.6178518", "0.6176318", "0.61617124", "0.6131281", "0.612617...
0.7995712
0
Get file name from path or URL.
def fn(f): return f[f.rfind('/')+1:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_name(path):\n return os.path.basename(path)", "def get_filename(path):\n return path.split('/')[-1]", "def get_file_name(path: str) -> str:\n return os.path.splitext(os.path.basename(path))[0]", "def file_name(path):\n return os.path.basename(path).split('.')[0]", "def getfilename(...
[ "0.83026415", "0.80025476", "0.79701763", "0.793759", "0.78346217", "0.7797902", "0.77886164", "0.7755772", "0.77403927", "0.77323234", "0.7596781", "0.75798994", "0.7536698", "0.7515717", "0.7494808", "0.74541545", "0.7425901", "0.7408403", "0.7400185", "0.7398898", "0.73831...
0.0
-1
Render the main page
def main_page(): return render_template("index.html")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_page():\n return render_template(\"main_page.html\")", "def main():\n return render_template(\"main.html\")", "def main():\n return render_template(\"main.html\")", "def main():\n page = get_page_arg()\n\n items = load_data(page)\n total_pages = get_total_pages()\n context = {\"...
[ "0.82781464", "0.7775523", "0.7775523", "0.7712574", "0.7690664", "0.7571747", "0.7568287", "0.75666183", "0.7554107", "0.75477314", "0.7508612", "0.74583364", "0.7413243", "0.7413243", "0.73617375", "0.732339", "0.732339", "0.7316146", "0.72481865", "0.7230807", "0.720924", ...
0.8103563
1
generate 10 char random string
def get_session_key(): result = "" for i in range(1, 11): result += str(int(9 * random.random())+1)[0] return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_random_string():\n return \"\".join(random.choice(string.ascii_lowercase + string.digits) for _ in range(16)) # nosec", "def genRandString(dl = 10):\n ret = ''\n for i in range(dl) :\n ret += random.choice(string.ascii_letters + string.digits)\n return ret", "def generate_rnd_m...
[ "0.8173635", "0.7999708", "0.79775035", "0.79560435", "0.79028094", "0.78892934", "0.7889082", "0.7856121", "0.7818488", "0.7791472", "0.7777588", "0.77717924", "0.77635163", "0.77627087", "0.7739786", "0.77337325", "0.7718114", "0.7682214", "0.76815695", "0.76779777", "0.763...
0.0
-1
Calculates the PROGREV column. Note that TOTREV2 is taken from 990EZ part I, 9, while TOTREV is calculated from the expense and income subtotals. This is the only column like this, and usually any discrepencies between stated and calculated values are tested in the validation steps. However, it was always done this way...
def ez_totrev(self, ez): return ez['EXPS'] + ez['NETINC']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_pr_rc_F1(GTD, block_occ):\r\n true_pos = ((GTD + block_occ)==2).sum()\r\n false_pos = sum([1 if BI_val==1 and GTD[i]==0 else 0 for i, BI_val in enumerate(block_occ.values)])\r\n precision = float(true_pos/(true_pos+false_pos))\r\n recall = float(true_pos/(GTD.sum()))\r\n if precision == 0:\...
[ "0.5233093", "0.5203486", "0.51458496", "0.51440907", "0.50617236", "0.5038878", "0.5017143", "0.49467668", "0.49305633", "0.48918483", "0.47984198", "0.47847646", "0.4761369", "0.4751597", "0.47405678", "0.4718419", "0.47177008", "0.47128147", "0.47058326", "0.47043058", "0....
0.44060236
61
Opens a new database connection if there is none yet for the current application context.
def get_db(): if not hasattr(g, 'sqlite_db'): g.sqlite_db = connect_db() return g.sqlite_db
{ "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.63833284
97