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
`S.removeprefix(prefix)` returns a copy of string S with the prefix `prefix` removed if S starts with `prefix`, otherwise it returns S.
def removeprefix(self, x) -> String: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_prefix(string, prefix):\n assert string.startswith(prefix), \"{!r} is not a prefix of {!r}\".format(prefix, string)\n return string[len(prefix):]", "def without_prefix(string, prefix):\n assert string.startswith(prefix)\n return string[len(prefix):]", "def StripPrefix(string, prefix):\n ...
[ "0.8163265", "0.81366485", "0.8106727", "0.8092988", "0.7984369", "0.79414815", "0.79414815", "0.79414815", "0.7915034", "0.7867632", "0.7701932", "0.7642583", "0.7511167", "0.7405655", "0.72607243", "0.7103934", "0.697307", "0.6409727", "0.626243", "0.6254007", "0.6226805", ...
0.74247044
13
`S.removesuffix(suffix)` returns a copy of string S with the suffix `suffix` removed if S ends with `suffix`, otherwise it returns S.
def removesuffix(self, x) -> String: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_suffix(string, suffix):\n assert string.endswith(suffix), \"{!r} is not a suffix of {!r}\".format(suffix, string)\n return string[:-len(suffix)]", "def remove_suffix(x, suffix=\" \"):\n if x.endswith(suffix):\n x = x[: -len(suffix)]\n return x", "def remove_suffix(input_string, suf...
[ "0.8466956", "0.8398737", "0.8354831", "0.8342437", "0.8328942", "0.82474893", "0.79960144", "0.7670023", "0.7202017", "0.71691424", "0.6583081", "0.65725434", "0.65544647", "0.65302217", "0.6506754", "0.64774305", "0.64015025", "0.6237398", "0.621708", "0.6172074", "0.613809...
0.754023
8
`S.rpartition(x)` is like `partition`, but splits `S` at the last occurrence of `x`.
def rpartition(self, x): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rpartition(self, sep):\n return asarray(rpartition(self, sep))", "def rpartition(a, sep):\n return _to_bytes_or_str_array(\n _vec_string(a, object_, 'rpartition', (sep,)), a)", "def partition_by(pred):\n def _partition_by_xducer(step):\n\n outer = {\"last\": Missing,\n ...
[ "0.65062094", "0.60032034", "0.572855", "0.5719659", "0.56842595", "0.5555204", "0.5463263", "0.5408134", "0.54047966", "0.54047334", "0.53654295", "0.5353213", "0.52678233", "0.5241728", "0.5223588", "0.51839864", "0.5170503", "0.51408637", "0.51297843", "0.5052696", "0.5029...
0.7729742
0
`S.rsplit([sep[, maxsplit]])` splits a string into substrings like `S.split`, except that when a maximum number of splits is specified, `rsplit` chooses the rightmost splits.
def rsplit(self) -> List[String]: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rsplit(s, sep, maxsplits=0):\n L = s.split(sep)\n if not 0 < maxsplits <= len(L):\n return L\n return [sep.join(L[0:-maxsplits])] + L[-maxsplits:]", "def rsplit(self, sep=None, maxsplit=None):\n return rsplit(self, sep, maxsplit)", "def _rsplit(value, sep, maxsplit=None):\n\tstr_part...
[ "0.88012934", "0.833378", "0.8087746", "0.7641582", "0.657193", "0.6556745", "0.6425024", "0.6003273", "0.58873713", "0.5766773", "0.568554", "0.5632648", "0.5620053", "0.56186074", "0.553044", "0.5505947", "0.54201835", "0.53695893", "0.5345748", "0.5270103", "0.52048284", ...
0.6851114
4
`S.rstrip()` returns a copy of the string S with trailing whitespace removed.
def rstrip(self) -> String: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def safe_rstrip(value, chars=None):\n if not isinstance(value, six.string_types):\n LOG.warn(_(\"Failed to remove trailing character. Returning original \"\n \"object. Supplied object is not a string: %s,\") % value)\n return value\n\n return value.rstrip(chars) or value", "...
[ "0.7013781", "0.69596666", "0.6687747", "0.665804", "0.663454", "0.657967", "0.646712", "0.6343644", "0.6337832", "0.63174385", "0.6285493", "0.6268532", "0.6223074", "0.6194672", "0.61715305", "0.6145392", "0.61281884", "0.6125089", "0.61071587", "0.60757095", "0.6061415", ...
0.69743097
1
`S.strip()` returns a copy of the string S with leading and trailing whitespace removed.
def strip(self) -> String: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inner_strip(s):\n\n if strip_string:\n return s.strip(strip_string)\n return s.strip()", "def trim_whitespace(str):\n return str.strip()", "def validate_strip(cls, value: str) -> str:\n if cls.strip is True:\n value = value.strip()\n return value", "de...
[ "0.7268597", "0.7242337", "0.7008292", "0.69867504", "0.6930271", "0.6894531", "0.6763975", "0.664435", "0.66138685", "0.6594711", "0.6594711", "0.6525947", "0.6470092", "0.6435453", "0.6384404", "0.6328534", "0.63172257", "0.6286382", "0.62597847", "0.6190276", "0.61730015",...
0.66156316
8
`S.upper()` returns a copy of the string S with letters converted to uppercase.
def upper(self) -> String: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uppercase(str):\n \n return str.upper()", "def uppercase(string):\n\n return str(string).upper()", "def upper(value): # Only one argument.\n return value.upper()", "def upper(value):\n return value.upper()", "def UPPER(text):\n return text.upper()", "def upper(self):\n if not ...
[ "0.762669", "0.7436968", "0.73848265", "0.72774976", "0.7165942", "0.71065193", "0.7062013", "0.70316464", "0.6939224", "0.68135166", "0.6782134", "0.67413574", "0.6733982", "0.66847", "0.66268754", "0.6624792", "0.65921235", "0.6503123", "0.6425465", "0.6422631", "0.6395056"...
0.7059407
7
Produces a Vandermonde like matrix where each column corresponds to a monomial and every row corresponds to the evaluation of that monomial on a point in the evaluation_list. That is, P(row,col) is the evaluation of the monomial_basis[row].Evaluate(evaluation_list[col])
def BuildPolynomialMatrix(monomial_basis, evaluation_list): shape = np.shape(evaluation_list) num_centers = shape[1] # Number of columns in evaluation_list determines number of input points. Amend documentation appropriately. P = np.zeros((num_centers, len(monomial_basis))) # Loop over Polynomial basis?...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vandermonde_matrix(x):\n m = size(x) \n n = m+1\n V = ones((m, n))\n for j in range(1, n):\n for i in range(0, m):\n V[i,j] = pow(x[i],j) \n return V", "def matrix_simmetric_representate(self, p):\r\n if (p >0 and (p <= self.dimension()) ):\r\n v = self.bas...
[ "0.62540805", "0.58639354", "0.56932867", "0.5620231", "0.55696785", "0.5538003", "0.55326027", "0.5469735", "0.54195535", "0.5380813", "0.5341778", "0.53148896", "0.5291837", "0.5290642", "0.5270249", "0.5240945", "0.5234696", "0.5197836", "0.51921", "0.51832014", "0.5166355...
0.7237669
0
Close a MySQL connection.
def disconnect(self): if self.db: try: self.db.close() finally: self.db = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_connection(exception):\n db = database()\n\n if db is not None:\n db.close()", "def close_connection():\n if DbUtil.connection:\n DbUtil.connection.commit()\n DbUtil.connection.close()", "def close_db(error):\n if hasattr(g, 'mysql_db'):\n g.mysql_d...
[ "0.688108", "0.6814058", "0.67784375", "0.67132515", "0.66632026", "0.66614693", "0.66122466", "0.6608385", "0.6606626", "0.65930676", "0.6576929", "0.650057", "0.6497268", "0.64671326", "0.6453418", "0.64246505", "0.64241356", "0.64233065", "0.6423113", "0.64215493", "0.6419...
0.5935493
94
distance is negative b is leftOf a
def get_dist(row, bstrand=None): fields = row.fields astart, aend = row.start, row.end bstart, bend = int(fields[7]), int(fields[8]) # TODO: handle ties in distance. if bstart >= aend: dist = (bstart - aend) + 1 elif astart >= bend: dist = bend - astart else: 1/0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def direct_distance(a, b):\n\n if a[0] == b[0]:\n return abs(a[1] - b[1]) - 1\n if a[1] == b[1]:\n return abs(a[0] - b[0]) - 1\n return abs(a[0] - b[0]) - 1", "def heuristic(self, a, b):\n return math.fabs(a[0] - b[0]) + math.fabs(a[1] - b[1])", "def _heuristic(a, b):\n ret...
[ "0.7060343", "0.68046385", "0.6799882", "0.6784235", "0.6784235", "0.6651153", "0.66470504", "0.6599503", "0.65870273", "0.65703607", "0.65606576", "0.65369886", "0.65064025", "0.64903724", "0.64875454", "0.64818174", "0.64735836", "0.6467983", "0.6466783", "0.6466783", "0.64...
0.5827667
87
Sets the num_lanes of this RunSequencingStats.
def num_lanes(self, num_lanes): if self.local_vars_configuration.client_side_validation and num_lanes is None: # noqa: E501 raise ValueError("Invalid value for `num_lanes`, must not be `None`") # noqa: E501 self._num_lanes = num_lanes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_n_runs(self, n_runs):\n if not isinstance(n_runs, int) or n_runs < 1:\n raise ValueError(\"'n_runs' must be a positive integer.\")\n \n self.n_runs = n_runs\n # reset measurement results\n self._set_runtimes()\n self._tmean = np.nan\n self._tstde...
[ "0.61484635", "0.5740742", "0.5631294", "0.562861", "0.5554181", "0.55286914", "0.5491252", "0.5479681", "0.54494184", "0.54456687", "0.54137135", "0.5352932", "0.5351594", "0.5311457", "0.5311457", "0.5308986", "0.52942216", "0.52637315", "0.5240663", "0.5212023", "0.5203711...
0.7596674
0
Sets the error_rate of this RunSequencingStats.
def error_rate(self, error_rate): self._error_rate = error_rate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_rate_r1(self, error_rate_r1):\n\n self._error_rate_r1 = error_rate_r1", "def error_rate_r2(self, error_rate_r2):\n\n self._error_rate_r2 = error_rate_r2", "def error_count(self, error_count):\n\n self._error_count = error_count", "def setError(self,err):\n self.error = e...
[ "0.6807575", "0.67326343", "0.60664177", "0.57145816", "0.5686214", "0.5532094", "0.55226785", "0.54679924", "0.54679924", "0.54679924", "0.5398743", "0.5358808", "0.5310472", "0.530899", "0.5300389", "0.5248033", "0.52299964", "0.52198654", "0.51908726", "0.51907825", "0.519...
0.81694686
0
Sets the error_rate_r1 of this RunSequencingStats.
def error_rate_r1(self, error_rate_r1): self._error_rate_r1 = error_rate_r1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_rate_r2(self, error_rate_r2):\n\n self._error_rate_r2 = error_rate_r2", "def error_rate(self, error_rate):\n\n self._error_rate = error_rate", "def _set_rate(self):\r\n interval = self.data.iloc[2, 0] - self.data.iloc[1, 0]\r\n self.rate = int(1 / interval)", "def set_sa...
[ "0.71610945", "0.69299793", "0.58888245", "0.52829933", "0.50969154", "0.49957427", "0.4978035", "0.49736965", "0.4965315", "0.4941671", "0.4898473", "0.48786908", "0.48611736", "0.48192018", "0.48192018", "0.4753801", "0.47500777", "0.4734711", "0.4732294", "0.47281876", "0....
0.8784437
0
Sets the min_cycle_scored of this RunSequencingStats.
def min_cycle_scored(self, min_cycle_scored): self._min_cycle_scored = min_cycle_scored
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_cycle_called(self, min_cycle_called):\n\n self._min_cycle_called = min_cycle_called", "def min_cycle_counter(self):\n return self._min_cycle_counter", "def min_cycle_extracted(self, min_cycle_extracted):\n\n self._min_cycle_extracted = min_cycle_extracted", "def max_cycle_scored(...
[ "0.61314225", "0.6011922", "0.58431214", "0.579573", "0.54917824", "0.54909503", "0.5480085", "0.54364556", "0.542284", "0.54079926", "0.5385116", "0.5385116", "0.534368", "0.5312027", "0.53045654", "0.53045654", "0.53045654", "0.527363", "0.5269558", "0.5189496", "0.5181051"...
0.86660886
0
Sets the non_indexed_error_rate of this RunSequencingStats.
def non_indexed_error_rate(self, non_indexed_error_rate): self._non_indexed_error_rate = non_indexed_error_rate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_rate(self, error_rate):\n\n self._error_rate = error_rate", "def non_indexed_yield_total(self, non_indexed_yield_total):\n\n self._non_indexed_yield_total = non_indexed_yield_total", "def set_error(self, index: int) -> None:\n ...", "def error_rate_r2(self, error_rate_r2):\n\n ...
[ "0.63548106", "0.5891731", "0.5305205", "0.52991426", "0.52142406", "0.51215845", "0.511283", "0.5057403", "0.5006466", "0.4902407", "0.488516", "0.485879", "0.48488396", "0.48241183", "0.47761405", "0.47238833", "0.47161093", "0.47036567", "0.4698342", "0.46824154", "0.46816...
0.8348333
0
Sets the non_indexed_percent_gt_q30 of this RunSequencingStats.
def non_indexed_percent_gt_q30(self, non_indexed_percent_gt_q30): self._non_indexed_percent_gt_q30 = non_indexed_percent_gt_q30
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def percent_gt_q30(self, percent_gt_q30):\n\n self._percent_gt_q30 = percent_gt_q30", "def percent_gt_q30_r1(self, percent_gt_q30_r1):\n\n self._percent_gt_q30_r1 = percent_gt_q30_r1", "def percent_gt_q30_last10_cycles(self, percent_gt_q30_last10_cycles):\n\n self._percent_gt_q30_last10_cy...
[ "0.7782721", "0.65313977", "0.6504365", "0.6496631", "0.5891459", "0.54475325", "0.5404517", "0.5341212", "0.522038", "0.5194092", "0.5156872", "0.5141217", "0.5132426", "0.51191014", "0.5076402", "0.50750434", "0.5068564", "0.50669116", "0.50431126", "0.50011665", "0.4984911...
0.88486445
0
Sets the non_indexed_projected_total_yield of this RunSequencingStats.
def non_indexed_projected_total_yield(self, non_indexed_projected_total_yield): self._non_indexed_projected_total_yield = non_indexed_projected_total_yield
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def non_indexed_yield_total(self, non_indexed_yield_total):\n\n self._non_indexed_yield_total = non_indexed_yield_total", "def projected_total_yield(self, projected_total_yield):\n\n self._projected_total_yield = projected_total_yield", "def yield_total(self, yield_total):\n\n self._yield_...
[ "0.844836", "0.70358145", "0.65928847", "0.5757039", "0.55535126", "0.52560216", "0.5037989", "0.501336", "0.50078773", "0.4969224", "0.48688167", "0.48450708", "0.4844417", "0.48224837", "0.48206708", "0.479515", "0.4792659", "0.47778332", "0.47310236", "0.4716577", "0.46987...
0.8579839
0
Sets the non_indexed_yield_total of this RunSequencingStats.
def non_indexed_yield_total(self, non_indexed_yield_total): self._non_indexed_yield_total = non_indexed_yield_total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def non_indexed_projected_total_yield(self, non_indexed_projected_total_yield):\n\n self._non_indexed_projected_total_yield = non_indexed_projected_total_yield", "def yield_total(self, yield_total):\n\n self._yield_total = yield_total", "def projected_total_yield(self, projected_total_yield):\n\n...
[ "0.8409403", "0.6428945", "0.61647487", "0.61277807", "0.5827263", "0.5656488", "0.5606697", "0.52031434", "0.5182848", "0.5043984", "0.49960595", "0.498668", "0.49793217", "0.49642053", "0.49616757", "0.49431714", "0.48572817", "0.48421744", "0.48228022", "0.48176298", "0.47...
0.8846889
0
Sets the projected_total_yield of this RunSequencingStats.
def projected_total_yield(self, projected_total_yield): self._projected_total_yield = projected_total_yield
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yield_total(self, yield_total):\n\n self._yield_total = yield_total", "def non_indexed_projected_total_yield(self, non_indexed_projected_total_yield):\n\n self._non_indexed_projected_total_yield = non_indexed_projected_total_yield", "def non_indexed_yield_total(self, non_indexed_yield_total):...
[ "0.75057924", "0.6340216", "0.5782333", "0.5718449", "0.5690264", "0.5486175", "0.54556733", "0.5385036", "0.53634185", "0.5352533", "0.5352533", "0.5352533", "0.5352533", "0.5352533", "0.5352533", "0.5352533", "0.5352533", "0.5272862", "0.52384675", "0.5238021", "0.52196646"...
0.88020605
0
Sets the reads_pf_total of this RunSequencingStats.
def reads_pf_total(self, reads_pf_total): self._reads_pf_total = reads_pf_total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reads_total(self, reads_total):\n\n self._reads_total = reads_total", "def total_data_processed(self, total_data_processed):\n\n self._total_data_processed = total_data_processed", "def total(self, total):\n\n self._total = total", "def total(self, total):\n\n self._total = to...
[ "0.76012343", "0.57087594", "0.5671018", "0.5671018", "0.5671018", "0.5671018", "0.5671018", "0.5671018", "0.5671018", "0.5671018", "0.5658782", "0.55357987", "0.5473845", "0.53925955", "0.5378512", "0.536465", "0.53112096", "0.52703774", "0.5265884", "0.52445275", "0.5229465...
0.8748527
0
Sets the reads_total of this RunSequencingStats.
def reads_total(self, reads_total): self._reads_total = reads_total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reads_pf_total(self, reads_pf_total):\n\n self._reads_pf_total = reads_pf_total", "def total_samples_processed(self, total_samples_processed):\n\n self._total_samples_processed = total_samples_processed", "def total(self, total):\n\n self._total = total", "def total(self, total):\n\n...
[ "0.6895563", "0.60603213", "0.59451115", "0.59451115", "0.59451115", "0.59451115", "0.59451115", "0.59451115", "0.59451115", "0.59451115", "0.57619417", "0.5727208", "0.5670569", "0.56032974", "0.556535", "0.55449855", "0.552168", "0.5518452", "0.551363", "0.54791284", "0.547...
0.8615408
0
Sets the yield_total of this RunSequencingStats.
def yield_total(self, yield_total): self._yield_total = yield_total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def projected_total_yield(self, projected_total_yield):\n\n self._projected_total_yield = projected_total_yield", "def total(self, total):\n\n self._total = total", "def total(self, total):\n\n self._total = total", "def total(self, total):\n\n self._total = total", "def total(s...
[ "0.7597644", "0.64521116", "0.64521116", "0.64521116", "0.64521116", "0.64521116", "0.64521116", "0.64521116", "0.64521116", "0.6043587", "0.6015443", "0.5996574", "0.5991903", "0.5814103", "0.57889766", "0.5750502", "0.57345796", "0.5705205", "0.56952316", "0.56787825", "0.5...
0.8688306
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, RunSequencingStats): return False return self.to_dict() == other.to_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): if not isinstance(other, RunSequencingStats): return True return self.to_dict() != other.to_dict()
{ "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.8456082", "0.83912885", "0.81436425", "0.81406975", "0.8131807", "0.8093013", "0.80912536", "0.80912536", "0.80912536", "0.8084505", "0.8084505", "0.8075543", "0.8075543", "0.8065009", "0.80417395", "0.80417395", "0.80417395", "0.80417395", "0.80417395", "0.80417395", "0.8...
0.0
-1
Returns the features to be consumed by the network
def features(self, piece: "CurrentPiece", next_piece: Piece) -> Optional[Tuple]: # without pieces # heights: 10 features heights = (self._array != 0).argmax(axis=0) heights[heights == 0] = self._array.shape[0] # holes: 10 features holes = np.array( [ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_features(self):\n return self._features", "def get_features(self):\n return []", "def features(self):\n return self._features", "def features(self):\n\n return self._features", "def get_all_features(self) :\n raise NotImplementedError", "def readFeatures(self):\...
[ "0.79674417", "0.7944202", "0.7847797", "0.7673495", "0.75377107", "0.7463369", "0.73460275", "0.7258514", "0.7240138", "0.71685714", "0.7128698", "0.7090225", "0.70540583", "0.70488924", "0.7034476", "0.7002242", "0.7000577", "0.69796914", "0.6962584", "0.69175106", "0.68958...
0.0
-1
Return a distribution over the action space, given observation.
def forward(self, obs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_action(self, observation):\n return self.env.action_space.sample()", "def act(self, observation):\n return self.action_space.sample()", "def act(observation):\n current_policy = sess.run(policy, {observation_: [observation]})\n action = np.random.choice(action_size, p=current_policy[...
[ "0.71830446", "0.71646243", "0.68419677", "0.6757053", "0.66740984", "0.6623401", "0.6487852", "0.64420354", "0.6425905", "0.6411917", "0.64102477", "0.63908327", "0.6378888", "0.6341586", "0.62980217", "0.62262684", "0.6213679", "0.6129898", "0.6101261", "0.61009794", "0.608...
0.0
-1
Changes the mesh matrix such that its front is facing the camera.
def align_mesh_to_direction(mesh, back_azimuth, back_elevation): cam_to_world = cameras.spherical_coord_to_cam( 60.0, azimuth=back_azimuth, elevation=back_elevation).cam_to_world() # Ignore translation. cam_to_world[:, 3] = 0 # Invert X and Z coordinates (Y being UP). cam_to_world[0, :] *=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frontFace(self):\n\n if not self.threedee:\n return gl.GL_CCW\n\n # Only looking at the mesh -> display\n # transform, thus we are assuming that\n # the MVP matrix does not have any\n # negative scales.\n xform = self.opts.getTransform('mesh', 'display')\n\n...
[ "0.65007365", "0.57568765", "0.572668", "0.57034224", "0.5696387", "0.56669766", "0.56551445", "0.56171846", "0.559674", "0.5584429", "0.557476", "0.55286264", "0.55071235", "0.5471323", "0.54581285", "0.5410684", "0.5360664", "0.5329033", "0.5311814", "0.53062046", "0.526435...
0.53693247
16
Constructor for each math element.
def __init__(self, data=None, texOutput=None): self.data = data self.texOutput = texOutput
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, math, variables=None, first_derivatives=None,\n second_derivatives=None, name=None):\n self.math = math\n if variables is not None:\n self.variables = variables\n else:\n # expr_manip still returns Sets instead of sets; cast the\n ...
[ "0.7161639", "0.6917189", "0.65276104", "0.6505433", "0.64967245", "0.64621925", "0.6398433", "0.63499236", "0.63114035", "0.6307109", "0.6228951", "0.62071985", "0.6204796", "0.619707", "0.6186282", "0.61448723", "0.61448723", "0.60858667", "0.6084221", "0.6084221", "0.60842...
0.0
-1
Ensure that the slices match the maximum permissible bounds of this particular chunk. Used for datasources that are unable to pad or handle out of bounds arrays properly
def squeeze_slices(self, slices): return tuple( slice( None if sl.start is None else sl.start if sl.start > bounds.start else bounds.start, None if sl.stop is None else sl.stop if sl.stop < bounds.stop else bounds.stop, ) for bounds, sl in zip(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bounds_check(session):\n\n max_ = session.field.opts.max\n min_ = session.field.opts.min\n\n if max_ is not None and len(session.data) > max_:\n raise session.field.invalid(error_type='out_of_bounds')\n if min_ is not None and len(session.data) < min_:\n raise session.field.invalid(er...
[ "0.6602181", "0.6080322", "0.6009947", "0.58865243", "0.5859374", "0.58201975", "0.5789012", "0.5721227", "0.57208735", "0.5718724", "0.57048976", "0.56970465", "0.5676501", "0.5634508", "0.56173533", "0.5591261", "0.55905306", "0.55605984", "0.5525332", "0.5519201", "0.55180...
0.5321856
49
Returns a list of nonintersecting slices that is excluded by the requested borders. Borders is a list of
def core_slices(self, borders=None): if borders is None: borders = self.all_borders core_slices = list(self.slices) for border, direction in borders: core_slice = core_slices[border] if direction < 0: core_slice = slice(core_slice.start + self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def border_slices(self, borders=None, nonintersecting=True):\n if borders is None:\n borders = self.all_borders\n\n border_slices = []\n\n processed_dimensions = set()\n remainders = list(self.slices)\n\n for border, direction in borders:\n if direction < 0:...
[ "0.75457764", "0.7447111", "0.6527729", "0.6378502", "0.6101177", "0.6000043", "0.5765825", "0.5726665", "0.56692195", "0.5611783", "0.553484", "0.54689896", "0.54406506", "0.54248977", "0.5424186", "0.54162234", "0.5387684", "0.5375195", "0.5367564", "0.53559786", "0.5343183...
0.6515465
3
Get the path in which to save master study files
def add_master_path(self, widget): default_dir = get_default_dir() # Save path path = QFileDialog.getExistingDirectory(self, 'Select a directory to save master study data files') # Check path was chosen if path: widget.setText(path.replace("/","\\"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def masterPath(self):\n\t\treturn fl.File( self._path + '/master.data' )", "def get_file_save_path(self):\n return self.out", "def _getSavePath(self):\n path, filename = os.path.split(self.path)\n savePath = os.path.join(path, os.path.splitext(filename)[0])\n return savePath", "de...
[ "0.7455229", "0.7454142", "0.73630625", "0.71795094", "0.71795094", "0.7126229", "0.6900633", "0.6747192", "0.6726044", "0.66167843", "0.6591362", "0.64815474", "0.646219", "0.64227", "0.6415766", "0.6409976", "0.6401701", "0.6369487", "0.6345562", "0.63437194", "0.6325163", ...
0.6611666
10
Decide what the default directory should be when selecting files
def get_default_dir(): # If S drive exists or C:\Users or C: if os.path.isdir("S:"): default_dir = r"S:/" elif os.path.isdir("C:/Users"): default_dir = r"C:/Users" else: default_dir = r"C:/" return default_dir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pickAFolder():\n folder = _tkCall(tkFileDialog.askdirectory)\n if folder == '':\n folder = myro.globvars.mediaFolder\n return folder", "def select_dir(self):\n prev_val = self.var_path.get()\n if self.conf_dir == \"dir_app\" or self.conf_dir == \"urls\":\n dir_ = fd.a...
[ "0.69911045", "0.6967909", "0.6801412", "0.6774351", "0.6764916", "0.67333776", "0.67283434", "0.6693511", "0.6670849", "0.6626629", "0.6623619", "0.65649277", "0.6536886", "0.6489924", "0.64855385", "0.64514804", "0.64514804", "0.6445261", "0.6443599", "0.6443599", "0.644000...
0.6493311
13
Clean up/format path string(filename)
def getPath(filename): if os.path.isabs(filename): pathfile = filename else: filename = filename.lstrip('/\.') filename = filename.replace('/', '\\') pathfile = os.path.join(os.getcwd(), filename) return pathfile
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_file_path(path):\r\n\r\n return path.split(\"/\")[-1]", "def clean_path(file_path):\n\n pass", "def fix_filename(self):\n if not self.remove_path:\n return\n self.filename = re.sub(\".+\\/\", \".../\", self.filename)", "def format_path(file: str) -> str:\n return o...
[ "0.76946825", "0.755464", "0.7446214", "0.7425013", "0.7403168", "0.7218468", "0.7173356", "0.71269345", "0.7095074", "0.70726657", "0.7072312", "0.7055951", "0.70524645", "0.70066494", "0.6908009", "0.6902472", "0.6892691", "0.6883626", "0.68799984", "0.6876378", "0.68185765...
0.0
-1
The CloudFormation resource type name for this resource class.
def CFN_RESOURCE_TYPE_NAME(cls) -> str: return jsii.sget(cls, "CFN_RESOURCE_TYPE_NAME")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type_name(self):\n return self.TYPE_NAMES[self.type]", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(cls):\n pass", "def r...
[ "0.7601105", "0.74413085", "0.74413085", "0.7362736", "0.7266477", "0.7266477", "0.7266477", "0.7266477", "0.7266477", "0.72509474", "0.72293", "0.7220092", "0.72052693", "0.720053", "0.71431375", "0.70865375", "0.7031305", "0.7019909", "0.70180243", "0.70180243", "0.7006957"...
0.8607663
5
The CloudFormation resource type name for this resource class.
def CFN_RESOURCE_TYPE_NAME(cls) -> str: return jsii.sget(cls, "CFN_RESOURCE_TYPE_NAME")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type_name(self):\n return self.TYPE_NAMES[self.type]", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(cls):\n pass", "def r...
[ "0.76011145", "0.7440825", "0.7440825", "0.73609734", "0.72659373", "0.72659373", "0.72659373", "0.72659373", "0.72659373", "0.72502506", "0.72293425", "0.72199106", "0.7204601", "0.72016066", "0.7142778", "0.70866466", "0.7031452", "0.70189905", "0.70189905", "0.7018087", "0...
0.86081845
3
The CloudFormation resource type name for this resource class.
def CFN_RESOURCE_TYPE_NAME(cls) -> str: return jsii.sget(cls, "CFN_RESOURCE_TYPE_NAME")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type_name(self):\n return self.TYPE_NAMES[self.type]", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(cls):\n pass", "def r...
[ "0.76009375", "0.74411887", "0.74411887", "0.736185", "0.7266344", "0.7266344", "0.7266344", "0.7266344", "0.7266344", "0.72498155", "0.72292495", "0.72199696", "0.7204877", "0.7200894", "0.7142586", "0.70863235", "0.7030732", "0.7018468", "0.70182574", "0.70182574", "0.70058...
0.8607571
2
The CloudFormation resource type name for this resource class.
def CFN_RESOURCE_TYPE_NAME(cls) -> str: return jsii.sget(cls, "CFN_RESOURCE_TYPE_NAME")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type_name(self):\n return self.TYPE_NAMES[self.type]", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(cls):\n pass", "def r...
[ "0.76011145", "0.7440825", "0.7440825", "0.73609734", "0.72659373", "0.72659373", "0.72659373", "0.72659373", "0.72659373", "0.72502506", "0.72293425", "0.72199106", "0.7204601", "0.72016066", "0.7142778", "0.70866466", "0.7031452", "0.70189905", "0.70189905", "0.7018087", "0...
0.86081845
6
The CloudFormation resource type name for this resource class.
def CFN_RESOURCE_TYPE_NAME(cls) -> str: return jsii.sget(cls, "CFN_RESOURCE_TYPE_NAME")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type_name(self):\n return self.TYPE_NAMES[self.type]", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(cls):\n pass", "def r...
[ "0.7601105", "0.74413085", "0.74413085", "0.7362736", "0.7266477", "0.7266477", "0.7266477", "0.7266477", "0.7266477", "0.72509474", "0.72293", "0.7220092", "0.72052693", "0.720053", "0.71431375", "0.70865375", "0.7031305", "0.7019909", "0.70180243", "0.70180243", "0.7006957"...
0.8607663
4
The log destination target's ARN.
def target_arn(self) -> str: return self._values.get('target_arn')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destination_arn(self) -> str:\n return jsii.get(self, \"destinationArn\")", "def log_stream_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"log_stream_arn\")", "def delivery_channel_target_arn(self) -> str:\n return pulumi.get(self, \"delivery_channel_target_arn\")", "def...
[ "0.7645746", "0.61177236", "0.60807616", "0.60807616", "0.60807616", "0.6016361", "0.6016361", "0.60099787", "0.59180486", "0.5914126", "0.5914126", "0.5903032", "0.5807205", "0.5751828", "0.5751828", "0.5740897", "0.5740897", "0.5740897", "0.5740897", "0.5740897", "0.5740897...
0.696166
1
A JSON log pattern that matches if the field exists and has the special value 'null'.
def is_null(cls, json_field: str) -> "JsonPattern": return jsii.sinvoke(cls, "isNull", [json_field])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_exists(cls, json_field: str) -> \"JsonPattern\":\n return jsii.sinvoke(cls, \"notExists\", [json_field])", "def format_field(self, value, format_spec):\n if value is None:\n return format(value)\n else:\n return super(NoneFormatter, self).format_field(value, for...
[ "0.5878139", "0.56265867", "0.5604002", "0.55538833", "0.5520844", "0.5520844", "0.54334104", "0.5405967", "0.53711385", "0.5319649", "0.5311641", "0.5267477", "0.5200273", "0.51776904", "0.51756495", "0.51263714", "0.5110735", "0.5077457", "0.50746524", "0.5069502", "0.50679...
0.768074
0
A JSON log pattern that matches if the field does not exist.
def not_exists(cls, json_field: str) -> "JsonPattern": return jsii.sinvoke(cls, "notExists", [json_field])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_null(cls, json_field: str) -> \"JsonPattern\":\n return jsii.sinvoke(cls, \"isNull\", [json_field])", "def exists(cls, json_field: str) -> \"JsonPattern\":\n return jsii.sinvoke(cls, \"exists\", [json_field])", "def test_single_not_match_returns_none(self):\n eq_(None,line_matches_g...
[ "0.61354196", "0.5712146", "0.5422379", "0.54013026", "0.5144117", "0.5123416", "0.51148605", "0.5098008", "0.50942874", "0.5005373", "0.5003702", "0.49710926", "0.49577314", "0.49396378", "0.48608354", "0.48381683", "0.48280367", "0.48182744", "0.4817717", "0.48084936", "0.4...
0.72986364
0
The ARN of this log group.
def log_group_arn(self) -> str: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_group_arn(self) -> str:\n return jsii.get(self, \"logGroupArn\")", "def log_group_arn(self) -> str:\n return jsii.get(self, \"logGroupArn\")", "def group_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"group_arn\")", "def arn(self) -> pulumi.Output[str]:\n retu...
[ "0.79912275", "0.79912275", "0.7122371", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", ...
0.7313869
2
The name of this log group.
def log_group_name(self) -> str: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_group_name(self) -> str:\n return jsii.get(self, \"logGroupName\")", "def log_group_name(self) -> str:\n return jsii.get(self, \"logGroupName\")", "def log_group_name(self):\n return self._get_param(CW_LOGS_CFN_PARAM_NAME)", "def group_name(self) -> str:\n return pulumi.ge...
[ "0.9136262", "0.9136262", "0.8655463", "0.8550921", "0.8438631", "0.84040636", "0.83887416", "0.83118314", "0.8154874", "0.80352634", "0.8006751", "0.78112084", "0.7653105", "0.7619722", "0.7619722", "0.7587538", "0.7587538", "0.75402695", "0.7472334", "0.74613464", "0.744429...
0.89797765
2
Create a new Log Stream for this Log Group.
def add_stream(self, id: str, *, log_stream_name: typing.Optional[str]=None) -> "LogStream": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_stream(self):\n pass", "def new_log_stream(self, log_name):\n try:\n if log_name == 'logging':\n logstream = self.logging\n if logstream.closed:\n raise ValueError('Attempting to open closed logstream %r' % log_name)\n return logstream\n\n return self....
[ "0.67229676", "0.6680853", "0.6163643", "0.61235994", "0.61235994", "0.61039865", "0.58228946", "0.58214366", "0.5749753", "0.5669507", "0.5593199", "0.55923766", "0.5519698", "0.5518229", "0.5509406", "0.5470016", "0.5463339", "0.5430699", "0.54277545", "0.5421926", "0.54090...
0.6612181
2
The ARN of this log group.
def log_group_arn(self) -> str: return jsii.get(self, "logGroupArn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_group_arn(self) -> str:\n ...", "def group_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"group_arn\")", "def arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"arn\")", "def arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"arn\")", "de...
[ "0.7313869", "0.7122371", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "...
0.79912275
1
The name of this log group.
def log_group_name(self) -> str: return jsii.get(self, "logGroupName")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_group_name(self) -> str:\n ...", "def log_group_name(self):\n return self._get_param(CW_LOGS_CFN_PARAM_NAME)", "def group_name(self) -> str:\n return pulumi.get(self, \"group_name\")", "def log_group_name(self) -> typing.Optional[str]:\n return self._values.get('log_group_...
[ "0.89797765", "0.8655463", "0.8550921", "0.8438631", "0.84040636", "0.83887416", "0.83118314", "0.8154874", "0.80352634", "0.8006751", "0.78112084", "0.7653105", "0.7619722", "0.7619722", "0.7587538", "0.7587538", "0.75402695", "0.7472334", "0.74613464", "0.74442965", "0.7351...
0.9136262
1
Create a new Log Stream for this Log Group.
def add_stream(self, id: str, *, log_stream_name: typing.Optional[str]=None) -> "LogStream": props = StreamOptions(log_stream_name=log_stream_name) return jsii.invoke(self, "addStream", [id, props])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_stream(self):\n pass", "def new_log_stream(self, log_name):\n try:\n if log_name == 'logging':\n logstream = self.logging\n if logstream.closed:\n raise ValueError('Attempting to open closed logstream %r' % log_name)\n return logstream\n\n return self....
[ "0.67229676", "0.6680853", "0.6612181", "0.6163643", "0.61039865", "0.58228946", "0.58214366", "0.5749753", "0.5669507", "0.5593199", "0.55923766", "0.5519698", "0.5518229", "0.5509406", "0.5470016", "0.5463339", "0.5430699", "0.54277545", "0.5421926", "0.5409054", "0.5406502...
0.61235994
4
The name of this log stream.
def log_stream_name(self) -> str: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_stream_name(self) -> str:\n return jsii.get(self, \"logStreamName\")", "def log_stream_name(self) -> str:\n return jsii.get(self, \"logStreamName\")", "def stream_name(self):\n return self._stream_name", "def stream_name(self):\n return self._stream_name", "def log_strea...
[ "0.91405326", "0.91405326", "0.8525302", "0.8525302", "0.83709335", "0.83709335", "0.7762914", "0.77031213", "0.7395333", "0.72404534", "0.7236545", "0.71626735", "0.70438075", "0.7039199", "0.70132226", "0.6972243", "0.694468", "0.694468", "0.6944156", "0.6939089", "0.693312...
0.9060321
2
The name of this log stream.
def log_stream_name(self) -> str: return jsii.get(self, "logStreamName")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_stream_name(self) -> str:\n ...", "def stream_name(self):\n return self._stream_name", "def stream_name(self):\n return self._stream_name", "def log_stream_name(self) -> typing.Optional[str]:\n return self._values.get('log_stream_name')", "def log_stream_name(self) -> ty...
[ "0.9060321", "0.8525302", "0.8525302", "0.83709335", "0.83709335", "0.7762914", "0.77031213", "0.7395333", "0.72404534", "0.7236545", "0.71626735", "0.70438075", "0.7039199", "0.70132226", "0.6972243", "0.694468", "0.694468", "0.6944156", "0.6939089", "0.6933126", "0.6923711"...
0.91405326
1
The ARN of this CrossAccountDestination object.
def destination_arn(self) -> str: return jsii.get(self, "destinationArn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"arn\")", "def arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"arn\")", "def arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"arn\")", "def arn(self) -> pulumi.Output[str]:\n return pulumi.get...
[ "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "0.6788388", "...
0.74903655
0
The name of this CrossAccountDestination object.
def destination_name(self) -> str: return jsii.get(self, "destinationName")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self) -> str:\n return getattr(\n self.auth_accounts[-1], \"name\" # pylint: disable=unsubscriptable-object\n )", "def destination_name(self) -> typing.Optional[str]:\n return self._values.get('destination_name')", "def event_destination_name(self) -> pulumi.Output[str...
[ "0.7321307", "0.70257443", "0.696008", "0.68350106", "0.68254656", "0.678787", "0.67735845", "0.67495817", "0.67355794", "0.6719665", "0.6719665", "0.6714958", "0.6686929", "0.6686425", "0.6686425", "0.6686425", "0.6686425", "0.66714877", "0.66714877", "0.66691136", "0.666911...
0.8011416
0
Create a new Log Stream for this Log Group.
def add_stream(self, id: str, *, log_stream_name: typing.Optional[str]=None) -> "LogStream": props = StreamOptions(log_stream_name=log_stream_name) return jsii.invoke(self, "addStream", [id, props])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_stream(self):\n pass", "def new_log_stream(self, log_name):\n try:\n if log_name == 'logging':\n logstream = self.logging\n if logstream.closed:\n raise ValueError('Attempting to open closed logstream %r' % log_name)\n return logstream\n\n return self....
[ "0.67238563", "0.66817474", "0.6612342", "0.61622745", "0.6104361", "0.5823432", "0.5821175", "0.57515556", "0.567071", "0.5594954", "0.5590502", "0.55210644", "0.5517552", "0.5509986", "0.5470443", "0.5461131", "0.5429872", "0.54278916", "0.5422853", "0.5410455", "0.5407274"...
0.6123445
5
The ARN of this log group.
def log_group_arn(self) -> str: return jsii.get(self, "logGroupArn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_group_arn(self) -> str:\n ...", "def group_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"group_arn\")", "def arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"arn\")", "def arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"arn\")", "de...
[ "0.7313869", "0.7122371", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "0.6746292", "...
0.79912275
0
The name of this log group.
def log_group_name(self) -> str: return jsii.get(self, "logGroupName")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_group_name(self) -> str:\n ...", "def log_group_name(self):\n return self._get_param(CW_LOGS_CFN_PARAM_NAME)", "def group_name(self) -> str:\n return pulumi.get(self, \"group_name\")", "def log_group_name(self) -> typing.Optional[str]:\n return self._values.get('log_group_...
[ "0.89797765", "0.8655463", "0.8550921", "0.8438631", "0.84040636", "0.83887416", "0.83118314", "0.8154874", "0.80352634", "0.8006751", "0.78112084", "0.7653105", "0.7619722", "0.7619722", "0.7587538", "0.7587538", "0.75402695", "0.7472334", "0.74613464", "0.74442965", "0.7351...
0.9136262
0
The name of this log stream.
def log_stream_name(self) -> str: return jsii.get(self, "logStreamName")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_stream_name(self) -> str:\n ...", "def stream_name(self):\n return self._stream_name", "def stream_name(self):\n return self._stream_name", "def log_stream_name(self) -> typing.Optional[str]:\n return self._values.get('log_stream_name')", "def log_stream_name(self) -> ty...
[ "0.9060806", "0.8527285", "0.8527285", "0.83711624", "0.83711624", "0.77601904", "0.7704864", "0.7391692", "0.723914", "0.72349834", "0.7161232", "0.70422435", "0.7037387", "0.7013903", "0.69699997", "0.6943326", "0.6943326", "0.6942978", "0.693789", "0.69318014", "0.69224197...
0.9141026
0
The ARN of the subscription's destination.
def arn(self) -> str: return self._values.get('arn')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destination_arn(self) -> str:\n return jsii.get(self, \"destinationArn\")", "def arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"arn\")", "def arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"arn\")", "def arn(self) -> pulumi.Output[str]:\n return pulu...
[ "0.82508", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0.6463854", "0....
0.6037701
42
The name of the metric to emit.
def metric_name(self) -> str: return self._values.get('metric_name')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metric_name(self) -> str:\n return self._metric_name", "def metric_name(self) -> str:\n return pulumi.get(self, \"metric_name\")", "def metric_name(self) -> str:\n return pulumi.get(self, \"metric_name\")", "def metric_name(self) -> pulumi.Input[str]:\n return pulumi.get(self,...
[ "0.8626403", "0.8521298", "0.8521298", "0.83399993", "0.83399993", "0.83399993", "0.83399993", "0.83399993", "0.83399993", "0.83399993", "0.83399993", "0.83399993", "0.80376554", "0.7901949", "0.7901949", "0.78050834", "0.7544334", "0.73637307", "0.72800136", "0.7110954", "0....
0.8455942
3
The name of the metric to emit.
def metric_name(self) -> str: return self._values.get('metric_name')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metric_name(self) -> str:\n return self._metric_name", "def metric_name(self) -> str:\n return pulumi.get(self, \"metric_name\")", "def metric_name(self) -> str:\n return pulumi.get(self, \"metric_name\")", "def metric_name(self) -> pulumi.Input[str]:\n return pulumi.get(self,...
[ "0.86257905", "0.8520309", "0.8520309", "0.8339259", "0.8339259", "0.8339259", "0.8339259", "0.8339259", "0.8339259", "0.8339259", "0.8339259", "0.8339259", "0.80364287", "0.7900588", "0.7900588", "0.7804922", "0.7544573", "0.7364626", "0.72797066", "0.7111653", "0.69457", ...
0.84548897
4
Gets an User by id.
def get_user(user_id): user = storage.get("User", user_id) if user is None: abort(404) return user.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_by_id(self, id):\n\t\treturn self.users.get(id)", "def getUser(self, id : int) -> bbUser.bbUser:\n id = self.validateID(id)\n return self.users[id]", "def get(id):\n return User.query.filter_by(id=id).first()", "def get_user_by_id(id):\n user = session.query(User).get(id)...
[ "0.90623766", "0.86554486", "0.86322147", "0.8575629", "0.8514232", "0.8497333", "0.8470894", "0.8446206", "0.83782727", "0.83592993", "0.832013", "0.8306841", "0.8305565", "0.8286508", "0.8286508", "0.8286508", "0.8286508", "0.82514036", "0.8242851", "0.8234708", "0.8171887"...
0.0
-1
Write training summary to TensorBoard
def write_log(callback, name, loss, batch_no): tf.summary.scalar(name,loss) tf.summary.scalar(name,batch_no) callback.flush()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_training_summaries(self):\n for metric, epochs in self._training_summaries.items():\n self._write_scalar_to_tensorboard(\n name=f\"{self._Sections.SUMMARY}/training_{metric}\",\n value=epochs[-1],\n step=self._epochs,\n )", "def ...
[ "0.79990983", "0.7321154", "0.73091215", "0.72830033", "0.7269789", "0.72659063", "0.7239493", "0.72079915", "0.7184671", "0.71566856", "0.7118748", "0.7095401", "0.7037337", "0.6957854", "0.695489", "0.6912428", "0.690195", "0.6850028", "0.6834222", "0.6824667", "0.6814706",...
0.6923977
15
Loads the index page.
def index(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(self):\n return self.load_view('index.html')", "def show_index_page():\n\n return render_template('index.html')", "def index():\n return render_template('pages/index.html', isNav=True)", "def index():\n return render_template('index.html')", "def index():\r\n re...
[ "0.7746312", "0.75516826", "0.748082", "0.74801135", "0.74704796", "0.74696386", "0.74696386", "0.73745745", "0.73697233", "0.7360792", "0.7355324", "0.7354594", "0.7354594", "0.7350133", "0.7350133", "0.7350133", "0.7335511", "0.7322372", "0.7321155", "0.72751564", "0.725143...
0.0
-1
Eliminate Variables present in list V
def Marginalize(self,V): var = scipy.setdiff1d(self.var,V) map1 = [scipy.where(self.var==i)[0][0] for i in var] card = self.card[map1] assignments = I2A(range(len(self.val)), self.card) indx = A2I(assignments[:, map1], card) val = scipy.ndimage.sum(self.va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eliminate_variable(variable, factors):\r\n containing_var = []\r\n not_containing_var = []\r\n for fac in factors:\r\n if variable in fac.get_variables():\r\n containing_var.append(fac)\r\n else:\r\n not_containing_var.append(fac)\r\n\r\n...
[ "0.6315741", "0.63064235", "0.6120104", "0.60593855", "0.6053966", "0.60110414", "0.5997281", "0.59512764", "0.5913095", "0.58059555", "0.5764125", "0.5748173", "0.57368344", "0.570586", "0.5687914", "0.5658923", "0.5652914", "0.56304115", "0.562714", "0.55884355", "0.5586199...
0.0
-1
Eliminate Variables present in list V
def MaxMarginalize(self,V): var = scipy.setdiff1d(self.var,V) map1 = [scipy.where(self.var==i)[0][0] for i in var] card = self.card[map1] assignments = I2A(range(len(self.val)), self.card) indx = A2I(assignments[:, map1], card) val = scipy.ndimage.maximum(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eliminate_variable(variable, factors):\r\n containing_var = []\r\n not_containing_var = []\r\n for fac in factors:\r\n if variable in fac.get_variables():\r\n containing_var.append(fac)\r\n else:\r\n not_containing_var.append(fac)\r\n\r\n...
[ "0.6315741", "0.63064235", "0.6120104", "0.60593855", "0.6053966", "0.60110414", "0.5997281", "0.59512764", "0.5913095", "0.58059555", "0.5764125", "0.5748173", "0.57368344", "0.570586", "0.5687914", "0.5658923", "0.5652914", "0.56304115", "0.562714", "0.55884355", "0.5586199...
0.0
-1
returns min neighbor node
def min_neighbor_node(g): return min(g.degree_iter(),key = lambda item:item[1])[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMinNode(self):\n currentNode = self.openList[0]\n for node in self.openList:\n if node.g + node.h < currentNode.g + currentNode.h:\n currentNode = node\n return currentNode", "def _node_lowest_neighbour(self, node):\n\n lowest = self.neighbour_array_lo...
[ "0.8050202", "0.78511584", "0.77705765", "0.76949775", "0.74825335", "0.7425818", "0.7376723", "0.73192996", "0.73192996", "0.72742736", "0.72184336", "0.7045829", "0.7041476", "0.70033556", "0.6993871", "0.6986018", "0.69824743", "0.6980929", "0.69779533", "0.6958489", "0.69...
0.8309103
0
Retrieves argmax assignment from MaxMarginals
def max_decode(M): return scipy.array([ f.val.argmax() for f in M])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def argmax(self, evidence={}):\n if len(evidence)==0:\n return self.v.ind2sub(self.t.argmax())\n ax = tuple([ evidence[v] if v in evidence else slice(None) for v in self.v ])\n return self.v.ind2sub( self.t[ax].argmax() )", "def argmax(module, x, axes=None):\n return module.argmax(x, axes)", "...
[ "0.7218265", "0.6811807", "0.6720208", "0.66932434", "0.66838837", "0.66141677", "0.65940654", "0.65522134", "0.6543997", "0.64843035", "0.64582795", "0.6438125", "0.6435685", "0.6425308", "0.6402006", "0.63806605", "0.63785934", "0.63664633", "0.63648343", "0.63401145", "0.6...
0.6035953
57
Check whether points belong to a list of points
def check_point(point,points): if point in points: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_point_inside(self, points):\n return all([self._domain.check_point_inside(point) for point in points])", "def pnt_in_list(pnt, pnts_list):\r\n is_in = np.any([np.isclose(pnt, i) for i in pnts_list])\r\n return is_in", "def __contains__(self, point):\n if not isinstance(point, np.n...
[ "0.7488707", "0.7452603", "0.7408827", "0.7307151", "0.7288895", "0.6988018", "0.6973343", "0.68778825", "0.6860784", "0.68375564", "0.68198454", "0.67362493", "0.67000514", "0.6677208", "0.6673606", "0.6668798", "0.6649849", "0.662717", "0.6584718", "0.65600467", "0.65600467...
0.78411937
0
apply rules to eliminate keywords that are bit actually keywords
def _removeKeywords(self,candidates,candidates_predictors): return candidatesUtils.removeKeywords(candidates,candidates_predictors)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_keywords(self, keywords):\n\t\tself.keywords += self._coerce_list(keywords)", "def test_queryUnkeywordFlag(self):\n self._keywordFilteringTest(\"unkeyword\")", "def removekeywords(self, keywords):\n if isinstance(keywords, str):\n keywords = [keywords]\n for kw in key...
[ "0.6676975", "0.63801986", "0.61708754", "0.61526126", "0.610945", "0.6091161", "0.6074237", "0.5996481", "0.59755343", "0.59652007", "0.58624566", "0.58543533", "0.584333", "0.5833298", "0.58185536", "0.5807501", "0.5797801", "0.573244", "0.57270813", "0.5715532", "0.5712515...
0.62016386
2
Sets the number of legs
def set_legs(self, number_of_legs): self.legs = number_of_legs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def legs(self, legs):\n\n self._legs = legs", "def set_numpins(self, n):\n self.numpins = n", "def setCount(self, num):\n self.count=num", "def set_number_of_sentences(self):\n self.number_of_sentences = int(self.num_sentences.get())", "def _set_number_of_levels(self, number_of_...
[ "0.6807533", "0.6514318", "0.6462361", "0.6382604", "0.6310556", "0.619761", "0.6126486", "0.60719293", "0.60661674", "0.60234404", "0.6023327", "0.5957856", "0.59369713", "0.59099823", "0.5905541", "0.58954114", "0.58493984", "0.5846713", "0.5838053", "0.57888526", "0.578116...
0.8402664
0
Customizes the queryset for improved performance.
def queryset(self, request): qs = super(SiteAdmin, self).queryset(request) qs = Site.admin.select_related().filter(id__in=qs) ordering = self.ordering or () if ordering: qs = qs.order_by(*ordering) return qs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self, request, queryset):\n\n return queryset", "def get_queryset(self):\n return self._queryset_class(\n model=self.model,\n using=self._db,\n hints=self._hints,\n query=CustomQuery(self.model)\n )", "def queryset(self, request,...
[ "0.723267", "0.6939212", "0.6902374", "0.68250877", "0.67118365", "0.67093515", "0.66570276", "0.6636668", "0.65979254", "0.659091", "0.65868956", "0.65868956", "0.656779", "0.65547997", "0.65174365", "0.65138125", "0.6502949", "0.64835054", "0.64381456", "0.64264464", "0.642...
0.61307377
48
Customizes the queryset for improved performance.
def queryset(self, request): qs = super(TwitterAccountAdmin, self).queryset(request) qs = TwitterAccount.objects.select_related().filter(id__in=qs ).defer('site__envelope', 'site__geom', 'site__point') return qs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self, request, queryset):\n\n return queryset", "def get_queryset(self):\n return self._queryset_class(\n model=self.model,\n using=self._db,\n hints=self._hints,\n query=CustomQuery(self.model)\n )", "def queryset(self, request,...
[ "0.723267", "0.6939212", "0.6902374", "0.68250877", "0.67118365", "0.67093515", "0.66570276", "0.6636668", "0.65979254", "0.659091", "0.65868956", "0.65868956", "0.656779", "0.65547997", "0.65174365", "0.65138125", "0.6502949", "0.64835054", "0.64381456", "0.64264464", "0.642...
0.6077334
57
Checks whether a 'Source' > 'Sink' path exists and if there are negative edge cycles in the graph. Also covers nodes missing and other standard networkx exceptions
def _check_path(G, max_res, min_res, direction, algorithm): try: if not has_path(G, "Source", "Sink"): raise NetworkXException("Disconnected Graph") except NetworkXException as e: raise Exception("An error occurred: {}".format(e))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_path(self, source, sink, path):\n\n if source == sink:\n return path\n for edge in self.adjacents[source]:\n if edge not in path:\n if edge.capacity - self.edges[edge] > 0:\n return self.valid_path(edge.sink, sink, path + [edge])\n\n ...
[ "0.7259922", "0.6240388", "0.6221724", "0.611535", "0.6047745", "0.60255075", "0.60242426", "0.5997116", "0.59739345", "0.5940472", "0.5862027", "0.5855785", "0.58238274", "0.58177286", "0.5801583", "0.5790655", "0.57333314", "0.5730171", "0.571273", "0.57103246", "0.57028306...
0.73054975
0
mutate every line with 66% probability
def decision(): return random.random() > 0.5
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_probs(result):\n for i in range(TOP_E):\n p = result.data[i][1]\n p = round(p, 4)\n # p_str = str(p)[1:]\n result.data[i][1] = p\n\n return result", "def mutate1(self, probability):\n for i in range(self.number_of_transitions):\n shape = np.shape(self....
[ "0.6210129", "0.59839225", "0.5888793", "0.5863098", "0.58464193", "0.58039266", "0.579592", "0.57905674", "0.57470787", "0.5723754", "0.5720027", "0.5643125", "0.55965304", "0.5573852", "0.55658245", "0.55487156", "0.5513637", "0.5501575", "0.54829854", "0.54806346", "0.5470...
0.0
-1
Return True if the tile (m, n) has been cleaned. Assumes that (m, n) represents a valid tile inside the room.
def isTileCleaned(self, m, n): if (m, n) in self.clean_tiles: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isTileCleaned(self, m, n):\n return self.tiles[n][m] == True", "def isTileCleaned(self, m, n):\n \n if self.tiles[Position(m, n)] == 'clean':\n return True\n else:\n return False", "def isTileCleaned(self, m, n):\n if (m, n) in self.CleanBlocks:\n ...
[ "0.8856028", "0.859945", "0.8532139", "0.85152173", "0.8470234", "0.84699076", "0.71464753", "0.63944775", "0.6344244", "0.63229275", "0.62683165", "0.6255048", "0.6247071", "0.62337136", "0.6221572", "0.6210931", "0.6194297", "0.6128868", "0.6124036", "0.6123438", "0.6098326...
0.88598907
0
Return the total number of tiles in the room.
def getNumTiles(self): return (self.width) * (self.height)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNumTiles(self):\n return self.height * self.width", "def getNumTiles(self):\n return len(list(product(list(range(self.width+1))[1:], list(range(self.height+1))[1:])))", "def num_tiles(self):\n return self.num_row_tiles * self.num_col_tiles", "def getNumTiles(self):\n\t\treturn self.nu...
[ "0.8205867", "0.81903553", "0.8046322", "0.8039323", "0.79811716", "0.7871275", "0.78123623", "0.7472709", "0.7407938", "0.7151273", "0.7067083", "0.6982381", "0.69224", "0.6857802", "0.6832814", "0.6813225", "0.67038375", "0.66893554", "0.66816777", "0.6676057", "0.66583914"...
0.81504375
2
Return a random position inside the room.
def getRandomPosition(self): posX = np.random.uniform(0, self.width) posY = np.random.uniform(0, self.height) return Position(posX, posY)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRandomPosition(self):\n return Position(random.random()*self.w, random.random()*self.h)", "def getRandomPosition(self):\n x = random.randint(0, self.width - 1)\n y = random.randint(0, self.height - 1)\n return Position(x, y)", "def getRandomPosition(self):\n return Pos...
[ "0.84095305", "0.8408874", "0.8339333", "0.8331419", "0.83306754", "0.8253471", "0.8129327", "0.79893064", "0.79634804", "0.78944933", "0.76948863", "0.74812585", "0.74559724", "0.73774105", "0.73208076", "0.730955", "0.7219106", "0.7115554", "0.7098047", "0.70740753", "0.701...
0.7975111
8
Return True if pos is inside the room.
def isPositionInRoom(self, pos): posX = pos.getX() posY = pos.getY() if posX >= 0 and posX < self.width and posY >= 0 and posY < self.height: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isPositionInRoom(self, pos):\n if pos.getX() >= 0 and pos.getX() < self.w:\n if pos.getY() >= 0 and pos.getY() < self.h:\n return True\n return False\n return False", "def isPositionInRoom(self, pos):\n\t\tif pos.getX() >= 0.0 and pos.getX() < float(self.width):...
[ "0.85817254", "0.85003966", "0.83934516", "0.8269163", "0.8152179", "0.79456955", "0.76631075", "0.7576975", "0.72438776", "0.71323836", "0.7053277", "0.703298", "0.6899419", "0.68909436", "0.68628466", "0.6828246", "0.6827737", "0.6821316", "0.6807734", "0.6803902", "0.67977...
0.85839504
0
Return a local path to inference data. Data is downloaded to a temp directory if on GCS.
def get_local_inference_path(args): if args.inference_path.startswith('gs'): inference_path = os.path.join(temp_dir, os.path.basename(args.inference_path)) if not os.path.exists(inference_path): subprocess.check_call( ['gsutil', 'cp',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data_path():\n return os.getcwd() + \"/data/\"", "def local_data_dir():\r\n assert sys.argv\r\n prefix_path = os.path.dirname(sys.argv[0])\r\n local_data = os.path.join(prefix_path, \"data\")\r\n return local_data", "def dataset_path(cls):\n basepath = os.path.dirname(__file__)\n ...
[ "0.69454926", "0.65234524", "0.6438647", "0.6393987", "0.6362297", "0.63599175", "0.63327223", "0.6299964", "0.61847365", "0.6136756", "0.61364686", "0.60970277", "0.6088938", "0.60839975", "0.60650396", "0.6041449", "0.6040904", "0.60392123", "0.6027364", "0.60201085", "0.59...
0.73608166
0
Asserts that m1 == m2 to precision (per element)
def matrices_are_equal(m1,m2, precision = 10e-12): premise1 = np.abs(L2norm(m1)-L2norm(m2))/m1.size<=precision premise2 = np.abs(L2norm(m1-m2))/m1.size<=precision return premise1*premise2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def almost_equal(self, other, precision):\n if isinstance(other, self.__class__):\n # Check that all elements in both arrays are almost\n # equal within given precision\n almost_equal = all(map(lambda x, y:\n self.almost_equal_values(x, y, p...
[ "0.71672726", "0.7073063", "0.7057761", "0.6967602", "0.68283737", "0.6802623", "0.6761224", "0.6752329", "0.6745638", "0.67161804", "0.6627313", "0.65948695", "0.65037155", "0.6487138", "0.6452505", "0.6448447", "0.64409685", "0.64346576", "0.6428187", "0.64267254", "0.63775...
0.7711843
0
A view to return the about page
def about_page(request): return render(request, 'about_page/about_page.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about_page(request):\r\n return render(request, 'ez_main/about_page.html')", "def about(request):\n context = {'client_id': settings.OPENHUMANS...
[ "0.85121936", "0.84644175", "0.8398645", "0.83938193", "0.83880013", "0.83632725", "0.832724", "0.8318544", "0.8303451", "0.8292643", "0.8292643", "0.8292643", "0.8292643", "0.8292643", "0.8292643", "0.8292643", "0.8292643", "0.8292643", "0.8292643", "0.8292643", "0.8292643",...
0.8241617
29
Test setting up Cast loads the media player.
async def test_creating_entry_sets_up_media_player(hass): with patch( "homeassistant.components.cast.media_player.async_setup_entry", return_value=True, ) as mock_setup, patch( "pychromecast.discovery.discover_chromecasts", return_value=(True, None) ), patch( "pychromecast.di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testPlayback(self):\n \n pass", "def setUp(self):\n self.player = Player()", "def test_plays_get(self):\n pass", "def test_init(self, config: HandlerConfig) -> None:\n # Arrange and act done by fixture.\n # Assert.\n # It should have registered the...
[ "0.69631934", "0.6549711", "0.6289172", "0.6258608", "0.6179011", "0.60709614", "0.60482484", "0.59974766", "0.59972894", "0.5906919", "0.58883595", "0.5840251", "0.5830389", "0.5820063", "0.5802481", "0.5743995", "0.57428616", "0.5736861", "0.5732936", "0.5729933", "0.572428...
0.6831989
1
Test that specifying config will create an entry.
async def test_configuring_cast_creates_entry(hass): with patch( "homeassistant.components.cast.async_setup_entry", return_value=True ) as mock_setup: await async_setup_component( hass, cast.DOMAIN, {"cast": {"some_config": "to_trigger_import"}} ) await hass.async_blo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_entry(hass: HomeAssistant, device_id: str = DEVICE_UNIQUE_ID) -> ConfigEntry:\n entry = MockConfigEntry(\n domain=DOMAIN,\n title=\"Anova\",\n data={\n CONF_USERNAME: \"sample@gmail.com\",\n CONF_PASSWORD: \"sample\",\n \"devices\": [(device_id, \...
[ "0.69009966", "0.6896754", "0.6873157", "0.68300706", "0.68250245", "0.6591273", "0.6557409", "0.65292424", "0.6505222", "0.6497703", "0.64933616", "0.64733815", "0.64298403", "0.63369524", "0.63257957", "0.6298902", "0.6250628", "0.6249283", "0.622548", "0.6217322", "0.62161...
0.6097157
22
Check if a post can be reposted by a user.
def check_repost(post, user): if not user.is_authenticated(): return 'not_auth' # no user to repost as if user.pk == post.author.pk: return 'own_post' # don't repost own post existing_repost = Post.objects.filter(author=user, repost_original=post).exists() if existing_repost: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_can_post(self, user):\n if not user.is_active or user.is_anonymous():\n return False\n\n membership = self.check_membership(user)\n\n if ((self.type != 'O' or self.post_membership_required or self.post_admin_required) and\n (membership is None or\n ...
[ "0.73073834", "0.712262", "0.712262", "0.712262", "0.70810664", "0.69219375", "0.69219375", "0.6776656", "0.6594504", "0.6416671", "0.64134073", "0.64129347", "0.6402563", "0.63826454", "0.6374379", "0.6353737", "0.6213298", "0.62132645", "0.6164873", "0.6146464", "0.6077263"...
0.812577
0
Returns a prefiltered query object containing all posts visible for the specified user.
def visible_posts_for(user): own = Post.objects.filter(author=user) public = Post.objects.filter(circles=PUBLIC_CIRCLE) my_circle = Post.objects.filter(circles__owner=user.pk) in_circle = Post.objects.filter(circles__members=user.pk) return own | public | my_circle | in_circle
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n return Post.objects.filter(\n user_id=self.kwargs['user_id'], status='published', visibility='public'\n )", "def viewable_only(self, user):\n # TODO: integrate this into questions() probably as standard and have\n # TODO: a separate all_questions()...
[ "0.7478919", "0.65987265", "0.64748675", "0.6470928", "0.63437873", "0.6330473", "0.62960607", "0.62712866", "0.6270188", "0.6067091", "0.6020587", "0.60094047", "0.5909708", "0.5858006", "0.5854867", "0.5851968", "0.58464825", "0.57868713", "0.57838094", "0.578152", "0.57505...
0.7581948
0
Checks if a post can be replied to
def check_reply(user): if not user.is_authenticated(): return 'not_auth' return 'ok'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_can_post(self, user):\n if not user.is_active or user.is_anonymous():\n return False\n\n membership = self.check_membership(user)\n\n if ((self.type != 'O' or self.post_membership_required or self.post_admin_required) and\n (membership is None or\n ...
[ "0.6948113", "0.6734822", "0.6510254", "0.6457405", "0.64436567", "0.63283587", "0.629916", "0.62268597", "0.62177384", "0.62177384", "0.62177384", "0.6202091", "0.60958153", "0.60850716", "0.60803705", "0.60803705", "0.6029233", "0.5987241", "0.5985692", "0.5977989", "0.5933...
0.5350562
83
Check if the user is allowed to edit the post this way. The user must be logged in and the post content must be at most 256 python characters long.
def form_valid(self, form): if not self.request.user.is_authenticated: return self.form_invalid(form) if not post_content_is_valid(self.request.POST['content']): return self.form_invalid(form) circle_pk = int(self.request.POST['circle']) if circle_pk not in (ME_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_to_edit(user):\n return allow_to_edit_well(user)", "def test_has_perm_post_edit(self):\n self.context['request'].user = User.objects.get(pk=47963)\n allowed = has_perm(self.context, 'forums_forum.post_edit_forum',\n self.forum_1)\n eq_(allowed, True)\n ...
[ "0.74183667", "0.7415422", "0.7375451", "0.7304749", "0.7272201", "0.71629953", "0.7049953", "0.7049326", "0.6923557", "0.69083977", "0.68593013", "0.68335843", "0.6818221", "0.6806213", "0.6758253", "0.67326397", "0.6723748", "0.6717205", "0.6703653", "0.6645862", "0.6549154...
0.0
-1
Reply to a post. Redirects to the post page.
def post_reply(request, pk=None): user = request.user reply_original = Post.objects.get(pk=pk) check = check_reply(user) if check == 'not_auth': return redirect('posts:post', pk=reply_original.pk) reply = Post(content=request.POST['content_reply'], author=user, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_repost(request, pk=None):\n user = request.user\n repost_original = Post.objects.get(pk=pk).original_or_self()\n\n check = check_repost(repost_original, user)\n if check == 'not_auth':\n return redirect('posts:post', pk=repost_original.pk)\n if check != 'ok':\n return redirect...
[ "0.72567445", "0.7186478", "0.69962406", "0.69774383", "0.677248", "0.6638979", "0.65608585", "0.654845", "0.6523553", "0.6429825", "0.642121", "0.6404795", "0.6364289", "0.63005376", "0.628658", "0.62745255", "0.6228825", "0.6213329", "0.61739594", "0.6168647", "0.6103093", ...
0.79075885
0
Creates and returns instance of quality_severity_type enum.
def _quality_severity_type(): return { 'name' : 'quality_severity_type', 'is_open' : False, 'doc' : None, 'members' : [ ('cosmetic', None), ('minor', None), ('major', None), ], }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _quality_status_type():\n return {\n 'name' : 'quality_status_type',\n 'is_open' : False,\n 'doc' : None,\n 'members' : [\n ('reported', None),\n ('confirmed', None),\n ('partially_resolved', None),\n ('resolved', None),\n ],\n ...
[ "0.6440207", "0.6016247", "0.5667926", "0.5643714", "0.5643714", "0.5643714", "0.5577132", "0.5475856", "0.5475856", "0.54562587", "0.54562587", "0.54562587", "0.5443779", "0.53409725", "0.5299403", "0.526096", "0.5252221", "0.5231991", "0.521383", "0.52124697", "0.51605105",...
0.7319907
0
Creates and returns instance of quality_status_type enum.
def _quality_status_type(): return { 'name' : 'quality_status_type', 'is_open' : False, 'doc' : None, 'members' : [ ('reported', None), ('confirmed', None), ('partially_resolved', None), ('resolved', None), ], }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeStatusValue(self, name, status, description):\n return StatusValue(name=name, status=status, description=description,\n geography=self.geography, valueType=self.valueType)", "def create_qualification_type(self,\r\n name,\r\n ...
[ "0.5812444", "0.58054715", "0.58037627", "0.5652147", "0.56053346", "0.555433", "0.55450326", "0.55203545", "0.5518867", "0.54934084", "0.5388258", "0.535524", "0.5272408", "0.5265789", "0.5265145", "0.52485", "0.5222278", "0.51967174", "0.5191218", "0.5191218", "0.51837313",...
0.75735044
0
Calculates the distance from (x_one, y_one) to (x_two, y_two)
def distance_to(x_one, y_one, x_two, y_two): x_dist = abs(x_one - x_two) y_dist = abs(y_one - y_two) return x_dist + y_dist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(x1, y1, x2, y2):\n return ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5", "def getDistanceBetweenTwoPoints(self, one, two):\n dx = one.x - two.x\n dy = one.y - two.y\n return math.sqrt(dx * dx + dy * dy)", "def get_distance(x1, y1, x2, y2):\n return math.sqrt((x1 - x2) ** 2 +...
[ "0.82694054", "0.81532896", "0.8097513", "0.8090258", "0.7956121", "0.78508484", "0.78500295", "0.783978", "0.7678001", "0.76428443", "0.76240647", "0.76178664", "0.7589654", "0.7576643", "0.75185215", "0.7489371", "0.7478127", "0.746977", "0.746501", "0.7446213", "0.74366474...
0.8834094
0
The shape of the full array that results from broadcasting the arrays of the given shapes.
def full_shape(shapes): #return tuple(np.array(shapes).max(0)) temp = np.array(shapes) temp1 = np.where((temp==0).any(0), 0, temp.max(0)) return tuple(temp1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def broadcast_shapes(*shapes: Tuple[int, ...]) -> Tuple[int, ...]:\n\n arrays = [np.empty(shape) for shape in shapes]\n return np.broadcast(*arrays).shape", "def broadcast_shape(*shapes, **kwargs):\n strict = kwargs.pop(\"strict\", False)\n reversed_shape = []\n for shape in shapes:\n for i...
[ "0.78900456", "0.6775112", "0.66357285", "0.6586319", "0.64638305", "0.6405403", "0.6402697", "0.6402697", "0.6402697", "0.6402697", "0.6402697", "0.6402697", "0.6371098", "0.63642585", "0.6364175", "0.6360731", "0.63093525", "0.630146", "0.62809944", "0.6211697", "0.62040806...
0.56079113
83
Takes a list of arrays a_1, ..., a_n where the elements of the first n dimensions line up. For every possible index into the first n dimensions, apply fn to the corresponding slices, and combine the results into an ndimensional array. Supports broadcasting but does not prepend 1's to the shapes.
def array_map(fn, arrs, n): # we shouldn't need a special case for n == 0, but NumPy complains about indexing into a zero-dimensional # array a using a[(Ellipsis,)]. if n == 0: return fn(*arrs) full_shape = tuple(np.array([a.shape[:n] for a in arrs]).max(0)) result = None for full_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generalized_broadcast(arrays):\n arrays1 = np.broadcast_arrays(*[A[..., 0] for A in arrays])\n shapes_b = [A1.shape + (A.shape[-1],) for A1, A in zip(arrays1, arrays)]\n strides_b = [A1.strides + (A.strides[-1],) for A1, A in zip(arrays1, arrays)]\n arrays_b = [as_strided(A, shape=shape_Ab, strides...
[ "0.68104404", "0.63964707", "0.6081392", "0.6051632", "0.60212815", "0.5967548", "0.59290934", "0.58771795", "0.5834669", "0.5834669", "0.5834669", "0.5834669", "0.5780112", "0.57471573", "0.5736673", "0.57244664", "0.5714925", "0.5685731", "0.56694907", "0.5664331", "0.56643...
0.7464303
0
Takes a slice and returns the appropriate slice into an array that's being broadcast (i.e. by
def process_slice(slc, shape, n): if not isinstance(slc, tuple): slc = (slc,) slc = list(slc) ndim = len(shape) - n assert ndim >= 0 shape_idx = 0 for slice_idx, s in enumerate(slc): if s == nax: continue if shape[shape_idx] == 1: if type(s) == int...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def broadcast_offset_param(data):\n return np.array([[data[int(i / 16)][(j + i * 32) % 128]\n for j in range(32)] \n for i in range(32)])", "def getslice(arr: tf.Tensor, slice: tf.Tensor, axis: int) -> tf.Tensor:\n if arr is None:\n return None\n return tf.boole...
[ "0.6050044", "0.59098095", "0.5847919", "0.58310276", "0.5822759", "0.57809955", "0.57028466", "0.56876695", "0.5616758", "0.5563621", "0.5563304", "0.555398", "0.5550755", "0.5532698", "0.54809904", "0.5477276", "0.5465422", "0.5461865", "0.5458945", "0.5435947", "0.54038566...
0.0
-1
Integration test for the DiscussionTopicsAPI.list_discussion_topics_courses method.
def test_list_discussion_topics_courses(self): course_id = None # Change me!! r = self.client.list_discussion_topics_courses(course_id, exclude_context_module_locked_topics=None, include=None, only_announcements=None, order_by=None, scope=None, search_term=None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list_topic_entries_courses(self):\r\n course_id = None # Change me!!\r\n topic_id = None # Change me!!\r\n\r\n r = self.client.list_topic_entries_courses(topic_id, course_id)", "def test_get_single_topic_courses(self):\r\n course_id = None # Change me!!\r\n topic_id...
[ "0.78150135", "0.7605192", "0.75265145", "0.7492697", "0.7171584", "0.7120954", "0.6936304", "0.68416816", "0.6650174", "0.6637132", "0.65641344", "0.6496056", "0.6447229", "0.6402629", "0.63153356", "0.6304872", "0.6294627", "0.62789047", "0.6269747", "0.6176281", "0.6146128...
0.8811598
0
Integration test for the DiscussionTopicsAPI.create_new_discussion_topic_courses method.
def test_create_new_discussion_topic_courses(self): # This method utilises the POST request method and will make changes to the Canvas instance. This needs consideration. pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_new_discussion_topic_groups(self):\r\n # This method utilises the POST request method and will make changes to the Canvas instance. This needs consideration.\r\n pass", "def test_create_course(self):\r\n self.assert_created_course()", "def _create_course(test, course_key, c...
[ "0.7156872", "0.7084351", "0.705016", "0.69820404", "0.6970328", "0.69688", "0.69394886", "0.6879583", "0.66452175", "0.66438746", "0.66101795", "0.6604357", "0.64930207", "0.6446333", "0.6441186", "0.6409576", "0.64012897", "0.6375679", "0.6352629", "0.62609553", "0.6246268"...
0.86293244
0
Integration test for the DiscussionTopicsAPI.update_topic_courses method.
def test_update_topic_courses(self): # This method utilises the PUT request method and will make changes to the Canvas instance. This needs consideration. pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_subscribe_to_topic_courses(self):\r\n # This method utilises the PUT request method and will make changes to the Canvas instance. This needs consideration.\r\n pass", "def test_update_entry_courses(self):\r\n # This method utilises the PUT request method and will make changes to the...
[ "0.7871544", "0.7542796", "0.7512507", "0.73731536", "0.7207261", "0.71569645", "0.70085955", "0.67999375", "0.6781728", "0.6733625", "0.670745", "0.67051595", "0.66216123", "0.6546569", "0.6520916", "0.65032387", "0.6467964", "0.6437681", "0.6348859", "0.6222558", "0.6197880...
0.87479043
0
Integration test for the DiscussionTopicsAPI.delete_topic_courses method.
def test_delete_topic_courses(self): course_id = None # Change me!! topic_id = None # Change me!! r = self.client.delete_topic_courses(topic_id, course_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unsubscribe_from_topic_courses(self):\r\n course_id = None # Change me!!\r\n topic_id = None # Change me!!\r\n\r\n r = self.client.unsubscribe_from_topic_courses(topic_id, course_id)", "def test_delete_entry_courses(self):\r\n course_id = None # Change me!!\r\n topi...
[ "0.81028116", "0.7875253", "0.71264255", "0.7123433", "0.7015974", "0.7012077", "0.70071626", "0.69159913", "0.68602306", "0.67616904", "0.67329895", "0.6726152", "0.668069", "0.6661851", "0.6648676", "0.65424633", "0.65356266", "0.6451006", "0.6406659", "0.64023024", "0.6400...
0.90676284
0
Integration test for the DiscussionTopicsAPI.delete_topic_groups method.
def test_delete_topic_groups(self): group_id = None # Change me!! topic_id = None # Change me!! r = self.client.delete_topic_groups(group_id, topic_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_groups(self):\n pass", "def test_unsubscribe_from_topic_groups(self):\r\n group_id = None # Change me!!\r\n topic_id = None # Change me!!\r\n\r\n r = self.client.unsubscribe_from_topic_groups(group_id, topic_id)", "def test_delete_entry_groups(self):\r\n gro...
[ "0.7732409", "0.7716812", "0.76733726", "0.7500265", "0.73477244", "0.7332655", "0.7332655", "0.7227561", "0.7192955", "0.7192955", "0.7096119", "0.7076859", "0.70393515", "0.7013727", "0.6987288", "0.6962892", "0.69583964", "0.6900707", "0.6897479", "0.6895411", "0.6887034",...
0.8933008
0
Integration test for the DiscussionTopicsAPI.reorder_pinned_topics_courses method.
def test_reorder_pinned_topics_courses(self): # This method utilises the POST request method and will make changes to the Canvas instance. This needs consideration. pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_reorder_pinned_topics_groups(self):\r\n # This method utilises the POST request method and will make changes to the Canvas instance. This needs consideration.\r\n pass", "def test_list_discussion_topics_courses(self):\r\n course_id = None # Change me!!\r\n\r\n r = self.clien...
[ "0.73407114", "0.6063856", "0.5939831", "0.5833714", "0.5790323", "0.57625467", "0.5631188", "0.56134856", "0.556784", "0.54647565", "0.539614", "0.5361601", "0.53580827", "0.5341284", "0.5328138", "0.52631265", "0.52310723", "0.51415765", "0.5126514", "0.5101588", "0.5097452...
0.84475464
0
Integration test for the DiscussionTopicsAPI.update_entry_courses method.
def test_update_entry_courses(self): # This method utilises the PUT request method and will make changes to the Canvas instance. This needs consideration. pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_topic_courses(self):\r\n # This method utilises the PUT request method and will make changes to the Canvas instance. This needs consideration.\r\n pass", "def test_delete_entry_courses(self):\r\n course_id = None # Change me!!\r\n topic_id = None # Change me!!\r\n ...
[ "0.80847067", "0.7368336", "0.7000483", "0.6980918", "0.692903", "0.6827086", "0.6768439", "0.6712037", "0.6578654", "0.6570717", "0.6388914", "0.6347924", "0.6346059", "0.6280812", "0.6212161", "0.62053615", "0.6202632", "0.61923826", "0.6188038", "0.61450565", "0.6073788", ...
0.8273051
0
Integration test for the DiscussionTopicsAPI.delete_entry_courses method.
def test_delete_entry_courses(self): course_id = None # Change me!! topic_id = None # Change me!! id = None # Change me!! r = self.client.delete_entry_courses(id, topic_id, course_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_topic_courses(self):\r\n course_id = None # Change me!!\r\n topic_id = None # Change me!!\r\n\r\n r = self.client.delete_topic_courses(topic_id, course_id)", "def test_list_topic_entries_courses(self):\r\n course_id = None # Change me!!\r\n topic_id = None #...
[ "0.77911955", "0.69768363", "0.69027257", "0.6874631", "0.68492544", "0.68365175", "0.68191266", "0.65781707", "0.6528738", "0.64726454", "0.6461437", "0.63585454", "0.6350716", "0.6295595", "0.62859297", "0.62392724", "0.6220814", "0.6193089", "0.6192837", "0.6177621", "0.61...
0.8981093
0