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 |
|---|---|---|---|---|---|---|
Return a tuple of the shortest distance on the geometry boundary to a point, and the vertex at that location. If necessary, project coordinates to the local coordinate system. | def _nearest_to_point(self, point):
ptvertex = point.get_vertex(crs=self.crs)
segments = zip(self.vertices.slice(0, -1), self.vertices.slice(1, 0))
if isinstance(self.crs, CartesianCRS):
func = _cvectorgeo.pt_nearest_planar
def func(seg):
return _cvectorg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vertex(self):\n if self.a != 0.0:\n # Find x where f'(x) = 2ax + b = 0\n x = -0.5 * self.b / self.a\n return (x, self.f(x))\n else:\n # Quadratic is actually a line, no minimum!\n return (None, None)",
"def nearest_vertex_to(self, point):\n... | [
"0.6327832",
"0.63200974",
"0.62450075",
"0.6190293",
"0.616065",
"0.61353123",
"0.59961027",
"0.59861755",
"0.5968286",
"0.59256595",
"0.5924805",
"0.59187776",
"0.5859679",
"0.5840402",
"0.58189106",
"0.5799556",
"0.5797328",
"0.5769938",
"0.5762889",
"0.574463",
"0.5726566... | 0.6739551 | 0 |
Returns the distance between the first and last vertex. | def displacement(self):
return self[0].distance(self[-1]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vertex_distance(self, v1, v2):\n return utils.real_distance(self.node_locations[v1], self.node_locations[v2])",
"def dist(first, other):\n if isinstance(first,FreeCAD.Vector) and isinstance(other,FreeCAD.Vector):\n return length(sub(first,other))",
"def length(self):\n points = [Poi... | [
"0.6857695",
"0.66868705",
"0.6566895",
"0.64527345",
"0.63993585",
"0.62935674",
"0.6278556",
"0.6263611",
"0.6260827",
"0.62543386",
"0.623835",
"0.6210776",
"0.6209238",
"0.6151493",
"0.61401",
"0.6101558",
"0.6079494",
"0.60700047",
"0.60523826",
"0.60396624",
"0.6037349"... | 0.59266436 | 27 |
Returns a generator of adjacent line segments as coordinate tuples. | def segment_tuples(self):
return ((self.vertices[i-1], self.vertices[i])
for i in range(len(self.vertices))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def segment_tuples(self):\n return ((self.vertices[i], self.vertices[i+1])\n for i in range(len(self.vertices)-1))",
"def lines(self):\n for pair in pairs(self.points):\n yield Line(pair, shape=self)",
"def iter_coords():\n yield (0, 0)\n incr = 0\n x = 1\n y... | [
"0.715293",
"0.67410505",
"0.6620828",
"0.6367525",
"0.6346879",
"0.6254025",
"0.6209958",
"0.6191048",
"0.61157435",
"0.6104955",
"0.61017865",
"0.59952706",
"0.59926134",
"0.5985285",
"0.5961862",
"0.59376603",
"0.5917845",
"0.5901189",
"0.58752346",
"0.58511436",
"0.585050... | 0.7031273 | 1 |
Return the twodimensional area of the polygon, excluding subpolygons. | def area(self):
if isinstance(self.crs, GeographicalCRS):
major_axis = self.crs.ellipsoid.a
minor_axis = self.crs.ellipsoid.b
area = 0.0
if major_axis == minor_axis: # Sphere
for seg in self.segment_tuples:
x1, y1 = seg[0]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def polygon_area_2d(polygon):\r\n return geometry.gmPolygonArea(polygon)",
"def area(self):\n if len(self.exterior) < 3:\n raise Exception(\"Cannot compute the polygon's area because it contains less than three points.\")\n poly = self.to_shapely_polygon()\n return poly.area",
... | [
"0.82838786",
"0.78885007",
"0.7749108",
"0.77087003",
"0.75359327",
"0.75354177",
"0.71762806",
"0.7051876",
"0.69602925",
"0.6953876",
"0.694045",
"0.6885501",
"0.68535036",
"0.6834796",
"0.67967415",
"0.6772502",
"0.6749825",
"0.6748884",
"0.6736813",
"0.67028683",
"0.6688... | 0.6676159 | 21 |
Returns True if point is inside or on the boundary of the polygon, and False otherwise. Uses a crossing number scheme. | def contains(self, point):
x, y = point.get_vertex(crs=self.crs)[:2]
if isinstance(self.crs, GeographicalCRS) and self.ispolar():
return _ccontains.contains_proj(x, y, self.vertices, self.crs) \
and not any(p.contains(point) for p in self.subs)
else:
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_in_polygon(self, point):\n reference_point = self.get_reference_point()\n \n reference_segment = DirectedEdge(point, reference_point)\n\n num_crossings = 0\n \n left_idx = 0\n while left_idx != len(self):\n right_idx = (left_idx + 1) % len(self)\n ... | [
"0.80341524",
"0.7828804",
"0.7446616",
"0.7424855",
"0.72766674",
"0.72661376",
"0.72632563",
"0.7246796",
"0.7243189",
"0.7213297",
"0.7206804",
"0.7206804",
"0.71901834",
"0.7168044",
"0.71017915",
"0.7100958",
"0.7043165",
"0.70241463",
"0.6987308",
"0.6941616",
"0.691531... | 0.0 | -1 |
Return vertices as a list of arrays. | def get_vertices(self, crs=None):
if crs is None:
return [np.array(v) for v in self.vertices]
else:
vertices = []
for line in self.vertices:
line_vertices = [_reproject(v[:2], self.crs, crs) for v in line]
vertices.append(np.array(line_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vertices(self) -> list[Point]:\n a = Point(self.array[..., 0, :], copy=False)\n b = Point(self.array[..., 1, :], copy=False)\n return [a, b]",
"def vertices(self):\n try:\n return self._vertices\n except:\n self._vertices = [list(x) for x in self.verte... | [
"0.81024337",
"0.79321367",
"0.7888331",
"0.779744",
"0.77051806",
"0.75885123",
"0.7552615",
"0.74188983",
"0.74117184",
"0.7380387",
"0.7346458",
"0.72955436",
"0.72847754",
"0.72494227",
"0.7220087",
"0.7220087",
"0.7173088",
"0.7165102",
"0.7152394",
"0.7028097",
"0.69500... | 0.78280973 | 3 |
Return vertices as a list of arrays. | def get_vertices(self, crs=None):
if crs is None:
vertices = []
for poly_vertices in self.vertices:
vertices.append([np.array(v) for v in poly_vertices])
return vertices
else:
vertices = []
for poly_vertices in self.vertices:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vertices(self) -> list[Point]:\n a = Point(self.array[..., 0, :], copy=False)\n b = Point(self.array[..., 1, :], copy=False)\n return [a, b]",
"def vertices(self):\n try:\n return self._vertices\n except:\n self._vertices = [list(x) for x in self.verte... | [
"0.81024337",
"0.79321367",
"0.7888331",
"0.78280973",
"0.779744",
"0.77051806",
"0.7552615",
"0.74188983",
"0.74117184",
"0.7380387",
"0.7346458",
"0.72955436",
"0.72847754",
"0.72494227",
"0.7220087",
"0.7220087",
"0.7173088",
"0.7165102",
"0.7152394",
"0.7028097",
"0.69500... | 0.75885123 | 6 |
Return product of matrix A and vector x | def _matmult(A, x):
b = []
for a in A:
b.append(sum([ai * xi for ai, xi in zip(a, x)]))
return b | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def matrix_mult_vec(matrix_a, x):\n m = len(matrix_a)\n b = [0 for i in xrange(m)]\n for i in xrange(m):\n b[i] = dot_product(matrix_a[i], x)\n return b",
"def matvec(self, x):\n return self * x",
"def matrix_vector_prod(m,u):\n each_product = []\n for v in m:\n each_prod... | [
"0.77956825",
"0.7771983",
"0.6860147",
"0.68422246",
"0.6840384",
"0.6809908",
"0.67714584",
"0.6755289",
"0.6727001",
"0.6662585",
"0.6601417",
"0.6563192",
"0.6556353",
"0.6462672",
"0.6430135",
"0.6415393",
"0.6375817",
"0.63664067",
"0.6363727",
"0.6352136",
"0.6350038",... | 0.7576437 | 2 |
Close the connection to the backend. | def __exit__(self, *args):
from osp.core.cuds import Cuds
Cuds._session = self._previous_session
self.close() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close_connection(self):\n self.session.close()",
"def close_connection(self):\n\t\tself.session.close()",
"def close(self):\n self._backend.disconnect()",
"def close_connection(self):\n self.conn.close()",
"def close_connection(self):\n self._conn.close()",
"def close(self... | [
"0.799076",
"0.79684424",
"0.7913219",
"0.78593427",
"0.77929413",
"0.7790635",
"0.7765999",
"0.7765999",
"0.7762756",
"0.77303797",
"0.76862943",
"0.7669942",
"0.7657479",
"0.7657479",
"0.7657479",
"0.76417816",
"0.7621386",
"0.7603908",
"0.75970066",
"0.75970066",
"0.759700... | 0.0 | -1 |
Turn the phrase into a list of skipgrams and index them with their offset(s) as values. | def _index_skipgrams(self) -> None:
for skipgram in self.skipgrams:
self.skipgram_index[skipgram.string] += [skipgram]
for skipgram in self.skipgrams_lower:
self.skipgram_index_lower[skipgram.string] += [skipgram] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skipgram_offsets(self, skipgram_string: str) -> Union[None, List[int]]:\n if not self.has_skipgram(skipgram_string):\n return None\n return [skipgram.offset for skipgram in self.skipgram_index[skipgram_string]]",
"def skipgram(line, vocab, ws):\n\tinputs = []; labels = []\n\tword_lis... | [
"0.6860445",
"0.64783335",
"0.63394105",
"0.6057104",
"0.596561",
"0.5767387",
"0.5752549",
"0.5712053",
"0.5712053",
"0.5712053",
"0.5709039",
"0.5708961",
"0.55494267",
"0.5515065",
"0.54880863",
"0.5461672",
"0.5452784",
"0.54478645",
"0.5431396",
"0.5427048",
"0.5403709",... | 0.7520621 | 0 |
Perform an evaluation of `model` on the examples from `dataset`. | def _test(self,model, dataset):
avg_loss = tfe.metrics.Mean('loss')
accuracy = tfe.metrics.Accuracy('accuracy')
for (images, labels) in tfe.Iterator(dataset):
logits = model(images, training=False)
avg_loss(self._loss(logits, labels))
accuracy(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def evaluate(args, dev_dataset, model):\n\n if args.dynamic_batching:\n dev_sampler = CustomBatchSampler(dev_dataset, args.dev_batch_size)\n dev_dataloader = DataLoader(\n dev_dataset,\n batch_sampler=dev_sampler,\n num_workers=0,\n collate_fn=dynamic_pa... | [
"0.72181267",
"0.7108579",
"0.70713145",
"0.70055586",
"0.69053817",
"0.68982685",
"0.68886787",
"0.688355",
"0.6877118",
"0.6847444",
"0.6824051",
"0.68158346",
"0.6803803",
"0.67946285",
"0.66654414",
"0.6650477",
"0.66181237",
"0.6611885",
"0.65464664",
"0.648689",
"0.6467... | 0.0 | -1 |
Convert (list of )+ tokens to a padded LongTensor. | def get_long_tensor(tokens_list, batch_size, pad_id=PAD_ID):
sizes = []
x = tokens_list
while isinstance(x[0], list):
sizes.append(max(len(y) for y in x))
x = [z for y in x for z in y]
tokens = torch.LongTensor(batch_size, *sizes).fill_(pad_id)
for i, s in enumerate(tokens_lis... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_long_tensor(tokens_list, batch_size, pad_id=constant.PAD_ID):\n sizes = []\n x = tokens_list\n while isinstance(x[0], list):\n sizes.append(max(len(y) for y in x))\n x = [z for y in x for z in y]\n tokens = torch.LongTensor(batch_size, *sizes).fill_(pad_id)\n for i, s in enumer... | [
"0.82005394",
"0.8014137",
"0.7413235",
"0.6460052",
"0.6340751",
"0.6146796",
"0.60953116",
"0.6057259",
"0.59972954",
"0.597745",
"0.5963818",
"0.5939974",
"0.5921533",
"0.58514607",
"0.57604337",
"0.57345676",
"0.56887496",
"0.5680914",
"0.56642675",
"0.5639345",
"0.563502... | 0.8212152 | 0 |
Keep only the topk rows of grads. | def keep_partial_grad(grad, topk):
assert topk < grad.size(0)
grad.data[topk:].zero_()
return grad | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def k_truss(G, k):\n H = G.copy()\n\n n_dropped = 1\n while n_dropped > 0:\n n_dropped = 0\n to_drop = []\n seen = set()\n for u in H:\n nbrs_u = set(H[u])\n seen.add(u)\n new_nbrs = [v for v in nbrs_u if v not in seen]\n for v in new... | [
"0.6236729",
"0.6202846",
"0.5995939",
"0.5952917",
"0.57921153",
"0.5631274",
"0.5598667",
"0.55834585",
"0.5561743",
"0.5541929",
"0.5538895",
"0.5519918",
"0.54459053",
"0.5440998",
"0.54382324",
"0.54304534",
"0.5421804",
"0.5396311",
"0.5375047",
"0.53641903",
"0.5290516... | 0.5289445 | 21 |
returns an allletter version of the input string s | def clean_word( s ):
words = ''
for i in s:
if i.isalpha():
words += i
else:
words = words
return words | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toChar(s):\n s = s.lower()\n ans = \"\"\n for c in s:\n if c in \"abcdefghijklmnopqrstuvwxyz\":\n ans+=c\n return ans",
"def _only_letters(s):\r\n\treturn _regex_non_letters.sub('', s)",
"def one_pass(self, s: str) -> str:\n alpha_map = {\n '1':... | [
"0.7446234",
"0.73400116",
"0.7230626",
"0.6939016",
"0.68502325",
"0.678562",
"0.6607033",
"0.6594211",
"0.6542864",
"0.650545",
"0.6453921",
"0.6419391",
"0.6418148",
"0.64079654",
"0.64069784",
"0.6406844",
"0.6405462",
"0.6381357",
"0.63048196",
"0.63048196",
"0.63048196"... | 0.66237456 | 6 |
Dot product of two iterables. Stops when the shorter one is exhausted. | def dotproduct(vec1, vec2):
import operator
return sum(map(operator.mul, vec1, vec2)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dotproduct(x, y):\n return sum(imap(operator.mul, x, y))",
"def dot_product(a, b):\n if len(a) != len(b):\n raise ValueError('Arrays are of different lengths')\n else:\n return [a[i] * b[i] for i in range(len(a))]",
"def dotproduct(v1, v2):\n\treturn sum(imap(operator.mul, v1, v2))",... | [
"0.74057645",
"0.73878074",
"0.73670685",
"0.71203166",
"0.70413727",
"0.7007098",
"0.69932437",
"0.69448596",
"0.6935571",
"0.69011235",
"0.6867998",
"0.67921585",
"0.6790238",
"0.6732949",
"0.67308366",
"0.6718248",
"0.665564",
"0.66376626",
"0.66229826",
"0.6616137",
"0.65... | 0.6825296 | 11 |
Uses a workaround b/c of Keras limitations. Incorporates penultimate layer into model output so it is exposed for public use. | def get_penultimate_layer(self):
return self.model.outputs[1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_new_last_layer(base_model, nb_classes):\n x = base_model.output\n x = GlobalAveragePooling2D()(x)\n x = Dense(FC_SIZE, activation='relu')(x) #new FC layer, random init\n\n predictions = Dense(nb_classes, activation='softmax')(x) #new softmax layer\n\n model = Model(inputs=base_model.input, o... | [
"0.69938946",
"0.69910014",
"0.68412274",
"0.68089837",
"0.67884284",
"0.65863574",
"0.641834",
"0.63666993",
"0.62695515",
"0.6264127",
"0.6196534",
"0.61808765",
"0.6180046",
"0.6171499",
"0.617027",
"0.61648875",
"0.61433196",
"0.61404645",
"0.61209136",
"0.612045",
"0.611... | 0.6493947 | 6 |
List all usage details of the subscription | def cli_consumption_list_usage(client, invoice_name=None, billing_period_name=None, top=None, include_additional_properties=False, include_meter_details=False, start_date=None, end_date=None):
if include_additional_properties and include_meter_details:
expand = 'additionalProperties,meterDetails'
elif i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getUsageInfo(self):\n return self.jsonRequest(\"/api/v1/usage\", { \"apiKey\": self._apiKey })",
"def list(cls, **kwargs):\n response = Yola().list_subscriptions(**kwargs)\n return [cls(**sub) for sub in response['results']]",
"def getAllSubscriptions(self):\n return self.reques... | [
"0.6745734",
"0.64215827",
"0.6382752",
"0.63634324",
"0.6341067",
"0.62802404",
"0.62371355",
"0.6210107",
"0.62015396",
"0.6195449",
"0.61619675",
"0.61604875",
"0.6100262",
"0.60542333",
"0.60002846",
"0.5973317",
"0.5973151",
"0.593546",
"0.5905405",
"0.5887627",
"0.58875... | 0.64977574 | 1 |
Return the date of last SACPI entry day + 5 months | def _get_first_end_date(self):
ins = acm.FInstrument['SACPI']
market = "internal"
start_year = acm.Time.DateAddDelta(acm.Time.FirstDayOfYear(self.start_date), 0, 0, -1)
this_year_prices = acm.FPrice.Select("instrument='%s' and market='%s' and day>'%s' and day<'%s'"
% (in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_month_day():\r\n return (datetime.now().replace(day=1) + relativedelta(months=1) + timedelta(days=-1)).strftime(\r\n '%d-%m-%Y')",
"def last_month():\n return datetime.now() + relativedelta(months=-1)",
"def max_drawdown_date(self) -> dt.date:\n mdd_date = (self.tsdf / self.tsdf.ex... | [
"0.6461281",
"0.60802233",
"0.5939588",
"0.59278756",
"0.5841653",
"0.58129823",
"0.5812028",
"0.57855666",
"0.5779908",
"0.57398164",
"0.5734636",
"0.57267845",
"0.57267845",
"0.57261086",
"0.55936295",
"0.5569988",
"0.55674237",
"0.55626094",
"0.55486155",
"0.5507776",
"0.5... | 0.6318057 | 1 |
Returns a filename inside the output dir that contains modifier. For example, if test name is "fast/dom/foo.html" and modifier is "expected.txt", the return value is "//fast/dom/fooexpected.txt". | def output_filename(self, modifier):
fs = self._filesystem
output_filename = fs.join(self._root_output_dir, self._test_name)
return fs.splitext(output_filename)[0] + modifier | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def out_filename(self, filetype, dir, format='old'):\n filename = self.filename(filetype=filetype, format=format)\n return Path(dir) / filename",
"def modifier(self) -> str:\n match = RE_MODIFIER.match(self.string.split(\".\")[-1])\n return match.group(1) if match else None",
"def n... | [
"0.58207613",
"0.5751061",
"0.56657475",
"0.56599396",
"0.5654314",
"0.55837417",
"0.55719894",
"0.5552638",
"0.55237275",
"0.5506235",
"0.54401886",
"0.5409135",
"0.53879833",
"0.5328823",
"0.5316454",
"0.5291592",
"0.5287656",
"0.5282221",
"0.5279094",
"0.5277583",
"0.52505... | 0.8293363 | 0 |
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments. | def __init__(self, *args, **kwds):
if args or kwds:
super(PanTiltFdbk, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.header is None:
self.header = std_msgs.msg.Header()
if self.pan is None:
self.pan = movo_msgs.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ... | [
"0.7794795",
"0.77207875",
"0.77207875",
"0.7687243",
"0.7625947",
"0.7564293",
"0.7440383",
"0.74175525",
"0.7352349",
"0.7308313",
"0.72808266",
"0.722805",
"0.7225032",
"0.7225032",
"0.7219433",
"0.72120637",
"0.72120637",
"0.72120637",
"0.72120637",
"0.72120637",
"0.72120... | 0.72378874 | 11 |
Checks that auth provider allows password changes and current_password matches. | def check_change_password(self, user, current_password):
for provider, options in self.active_authenticators(user.email, user.username, current_password):
if provider is None:
log.debug( "Unable to find module: %s" % options )
else:
auth_result = provider.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def old_password_check(form, field):\n old_password = field.data\n password = current_user.password\n r = pwd_context.verify(old_password, current_user.password)\n if not r:\n raise validators.ValidationError('old password is wrong')",
"def clean_current_password(self):\n if not self.us... | [
"0.7481303",
"0.73336846",
"0.7174981",
"0.7134431",
"0.7075722",
"0.70290816",
"0.6981715",
"0.6932496",
"0.6923515",
"0.6892524",
"0.6880183",
"0.6819773",
"0.6771059",
"0.6756742",
"0.669096",
"0.668823",
"0.6686865",
"0.6674609",
"0.66698617",
"0.66646445",
"0.6656603",
... | 0.77227116 | 0 |
Check and coerce input data. Method used to check the input and convert Series/Panel input to internally used format, as defined in X_inner_mtype tag | def _pairwise_panel_x_check(self, X, var_name="X"):
check_res = check_is_scitype(
X, ["Series", "Panel"], return_metadata=True, var_name=var_name
)
X_valid = check_res[0]
metadata = check_res[2]
X_scitype = metadata["scitype"]
if not X_valid:
msg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_data(data, dset_attrs):\n dtype = dset_attrs['dtype']\n float_to_int = (np.issubdtype(dtype, np.integer)\n and np.issubdtype(data.dtype, np.floating))\n if float_to_int:\n attrs = dset_attrs['attrs']\n scale_factor = [c for c in attrs if ... | [
"0.62297374",
"0.6043739",
"0.60126317",
"0.5946539",
"0.59304476",
"0.59045684",
"0.5892825",
"0.57969373",
"0.5764221",
"0.575244",
"0.5699566",
"0.5676077",
"0.5635283",
"0.5617007",
"0.56128883",
"0.5592067",
"0.55570465",
"0.55518",
"0.5503736",
"0.55009216",
"0.54999655... | 0.5321978 | 33 |
Given the ECS cluster name and the region, get the ECS ClusterARN. | def ecs_getClusterArn(region, cluster):
client = boto3.client('ecs', region_name=region)
response = client.describe_clusters(clusters=[cluster])
logging.debug("ECS Cluster Details: %s", response)
if len(response['clusters']) == 1:
return (response['clusters'][0]['clusterArn'])
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_name(self) -> str:\n return pulumi.get(self, \"cluster_name\")",
"def cluster_name(self) -> str:\n return pulumi.get(self, \"cluster_name\")",
"def cluster_name(self):\n return self._data['cluster_name']",
"def cluster_name(self):\n return self.name",
"def cluster_na... | [
"0.60887766",
"0.60887766",
"0.5989389",
"0.596026",
"0.59062946",
"0.5844373",
"0.58062553",
"0.5748585",
"0.5748585",
"0.5662371",
"0.5662371",
"0.5662371",
"0.5662371",
"0.5662371",
"0.554368",
"0.55225235",
"0.55225235",
"0.54336554",
"0.54336554",
"0.5412958",
"0.5392277... | 0.8022224 | 0 |
Get the duration for which the task's cost needs to be calculated. This will vary depending on the CLI's input parameter (task lifetime, particular month, last N days etc.) and how long the task has run. | def duration(startedAt, stoppedAt, startMeter, stopMeter, runTime, now):
mRunTime = 0.0
task_start = datetime.datetime.strptime(startedAt, '%Y-%m-%dT%H:%M:%S.%fZ')
task_start = task_start.replace(tzinfo=datetime.timezone.utc)
if (stoppedAt == 'STILL-RUNNING'):
task_stop = now
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def duration(self):\n return int(sum(t.duration for t in self.tasks) / 3600)",
"def estimate_duration(self):\n if self.completion_ts:\n # Task is already complete. Return the exact duration timedelta.\n return defer.succeed(self.duration)\n if not self.package:\n ... | [
"0.71925",
"0.6903817",
"0.67351425",
"0.66901046",
"0.6689487",
"0.66391677",
"0.6553783",
"0.6528054",
"0.6467396",
"0.64614105",
"0.62362707",
"0.6234401",
"0.62340534",
"0.62203664",
"0.6210725",
"0.6205074",
"0.61775374",
"0.6156006",
"0.6156006",
"0.6156006",
"0.6144366... | 0.66619873 | 5 |
The ID of the Product. | def product_id(self) -> pulumi.Input[str]:
return pulumi.get(self, "product_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self) -> pulumi.Output[str]:\n return pulumi.get(self... | [
"0.8916573",
"0.8916573",
"0.8916573",
"0.8916573",
"0.85305613",
"0.82466954",
"0.7799852",
"0.76235795",
"0.76235795",
"0.7566756",
"0.7472993",
"0.7343766",
"0.73037314",
"0.7265833",
"0.7258287",
"0.72423846",
"0.72423846",
"0.72423846",
"0.72423846",
"0.72423846",
"0.724... | 0.8337819 | 5 |
The ID of the Product. | def product_id(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "product_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self) -> pulumi.Output[str]:\n return pulumi.get(self... | [
"0.8916573",
"0.8916573",
"0.8916573",
"0.8916573",
"0.85305613",
"0.8337819",
"0.7799852",
"0.76235795",
"0.76235795",
"0.7566756",
"0.7472993",
"0.7343766",
"0.73037314",
"0.7265833",
"0.7258287",
"0.72423846",
"0.72423846",
"0.72423846",
"0.72423846",
"0.72423846",
"0.7242... | 0.82466954 | 6 |
Get an existing App resource's state with the given name, id, and optional extra properties used to qualify the lookup. | def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
app_name: Optional[pulumi.Input[str]] = None,
bundle_id: Optional[pulumi.Input[str]] = None,
encoded_icon: Optional[pulumi.Input[str]] = None,
industr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def a_state(id):\n state = storage.get(State, id)\n if state is not None:\n return jsonify(state.to_dict())\n abort(404)",
"def get_state_by_id(state_id):\n for key, value in storage.all(\"State\").items():\n if state_id == value.id:\n return jsonify(value.to_dict())\n abo... | [
"0.61080384",
"0.60962945",
"0.6086946",
"0.60233724",
"0.601088",
"0.5983915",
"0.5979712",
"0.58301634",
"0.57650995",
"0.5743062",
"0.5649459",
"0.56280476",
"0.56177074",
"0.5602301",
"0.5584664",
"0.55736",
"0.55704504",
"0.55493164",
"0.55110854",
"0.551043",
"0.545657"... | 0.6481312 | 0 |
The ID of the Product. | def product_id(self) -> pulumi.Output[str]:
return pulumi.get(self, "product_id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self):\n return self._product_id",
"def product_id(self) -> pulumi.Input[str]:\n return pulumi.get(self,... | [
"0.8916573",
"0.8916573",
"0.8916573",
"0.8916573",
"0.8337819",
"0.82466954",
"0.7799852",
"0.76235795",
"0.76235795",
"0.7566756",
"0.7472993",
"0.7343766",
"0.73037314",
"0.7265833",
"0.7258287",
"0.72423846",
"0.72423846",
"0.72423846",
"0.72423846",
"0.72423846",
"0.7242... | 0.85305613 | 4 |
Ensure that the app is in testing mode. | def test__decompress(filename):
with open(filename, mode="rb") as file_handle:
name, content = Submit._decompress(filename, file_handle)
assert name.endswith("EcoliCore.xml")
assert len(content.read()) >= 494226 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_app_is_testing(self):\n self.assertTrue(current_app.config['TESTING'])",
"def test_app_is_testing(self):\n self.assertTrue(current_app.config['TESTING'])",
"def test_app_is_testing(self):\n self.assertFalse(app.config['SECRET_KEY'] == 'my_precious')\n self.assertTrue(app.co... | [
"0.83574677",
"0.83574677",
"0.7859315",
"0.7849473",
"0.7350702",
"0.73238325",
"0.7275374",
"0.72144544",
"0.7121797",
"0.70557374",
"0.7008395",
"0.6961573",
"0.6925202",
"0.6795298",
"0.6782685",
"0.67808384",
"0.67417955",
"0.6723618",
"0.67094034",
"0.6676019",
"0.66559... | 0.0 | -1 |
Ensure that the app is in testing mode. | def test__load_model(filename):
file_storage = FileStorage(stream=open(filename, mode="rb"),
filename=filename, name="model")
model = Submit()._load_model(file_storage)
assert len(model.reactions) == 95
assert len(model.metabolites) == 72
assert file_storage.closed | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_app_is_testing(self):\n self.assertTrue(current_app.config['TESTING'])",
"def test_app_is_testing(self):\n self.assertTrue(current_app.config['TESTING'])",
"def test_app_is_testing(self):\n self.assertFalse(app.config['SECRET_KEY'] == 'my_precious')\n self.assertTrue(app.co... | [
"0.83580196",
"0.83580196",
"0.7859287",
"0.7849439",
"0.7350841",
"0.7323817",
"0.7275431",
"0.7214475",
"0.71219856",
"0.7055876",
"0.70088553",
"0.696169",
"0.6925355",
"0.6795791",
"0.6782344",
"0.6781234",
"0.674172",
"0.67242146",
"0.67093164",
"0.6675879",
"0.6655944",... | 0.0 | -1 |
Given an array of 1D indicies into the image, return an Nx3 ??? array of the x,y,z coordinates | def get_crds(self,ind):
try:
ind = na.array(ind)
nx = self.dim[0]
ny = self.dim[1]
nxny = self.dim[0]*self.dim[1]
crd = na.transpose(na.array([ (ind % nx), (ind / nx)%ny,ind / nxny]))
return crd
except Exception as error:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cvt2array(tuples):\n rc = []\n for t in tuples:\n rc.append(point3d(np.float32(t[X]), np.float32(t[Y]), np.float32(t[Z])))\n return rc",
"def split_3d_array_into_channels(arr):\n return [arr[:, :, i] for i in range(arr.shape[-1])]",
"def _extract_array(tiffs: list[np.ndarra... | [
"0.6728512",
"0.6489615",
"0.6478636",
"0.6406588",
"0.62943083",
"0.62777793",
"0.626341",
"0.6229589",
"0.6223744",
"0.62199664",
"0.6195617",
"0.6194691",
"0.6055673",
"0.6037436",
"0.6018287",
"0.5997276",
"0.5940661",
"0.5924474",
"0.5921169",
"0.5908155",
"0.58992994",
... | 0.0 | -1 |
Gets the metricDataName and stores it in inputDict. @ In, metricDataName, string, the name of the metric data to find in currentInputs @ In, currentInputs, list of inputs to the step. @ Out, metricData, (data, probability) or Distribution | def __getMetricSide(self, metricDataName, currentInputs):
origMetricDataName = metricDataName
metricData = None
if metricDataName.count("|") == 2:
#Split off the data name and if this is input or output.
dataName, inputOrOutput, metricDataName = metricDataName.split("|")
inputOrOutput = [i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def metric_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"metric_name\")",
"def metric_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"metric_name\")",
"def metric_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"metric_name\")",
"def metric_name(se... | [
"0.624774",
"0.624774",
"0.624774",
"0.624774",
"0.624774",
"0.624774",
"0.624774",
"0.624774",
"0.624774",
"0.6004401",
"0.60013425",
"0.5968178",
"0.59263635",
"0.5769216",
"0.57137525",
"0.5678455",
"0.5656198",
"0.5650079",
"0.5625243",
"0.56057525",
"0.5547415",
"0.542... | 0.7487086 | 0 |
Dotproduct the features and current weights and return the best label. | def predict(self, features):
scores = self.predict_proba(features)
return self.classes[np.argmax(scores)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_weights(self):\n return self.X.dot(self.get_weights())",
"def comp_probs_and_labels(self, x_feats):\n scores = sparse.dot(x_feats, self.W) + self.Wb # [l, d] x [d, m] + [m] => [l, m]\n relation_probs = T.nnet.softmax(scores)\n labels = T.argmax(scores, axis=1) # [l, m] => ... | [
"0.64709884",
"0.62710226",
"0.5867083",
"0.5826588",
"0.57693255",
"0.5756743",
"0.57193357",
"0.57193357",
"0.57193357",
"0.56700444",
"0.5659396",
"0.5648412",
"0.56426966",
"0.56349194",
"0.5583931",
"0.55647486",
"0.55130947",
"0.54810303",
"0.5447642",
"0.5427752",
"0.5... | 0.524737 | 49 |
Dotproduct the features and current weights and return the best label. | def predict_proba(self, features):
scores = np.zeros(len(self.classes))
for feat, value in features.items():
if value == 0:
continue
weights = self.weights.get(feat)
if weights is None:
continue
scores += (value * weights)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_weights(self):\n return self.X.dot(self.get_weights())",
"def comp_probs_and_labels(self, x_feats):\n scores = sparse.dot(x_feats, self.W) + self.Wb # [l, d] x [d, m] + [m] => [l, m]\n relation_probs = T.nnet.softmax(scores)\n labels = T.argmax(scores, axis=1) # [l, m] => ... | [
"0.64709884",
"0.62710226",
"0.5867083",
"0.5826588",
"0.57693255",
"0.5756743",
"0.57193357",
"0.57193357",
"0.57193357",
"0.56700444",
"0.5659396",
"0.5648412",
"0.56426966",
"0.56349194",
"0.5583931",
"0.55647486",
"0.55130947",
"0.54810303",
"0.5447642",
"0.5427752",
"0.5... | 0.51014376 | 85 |
Add a new item to the top of our stack. | def push(self, item):
self.stack.append(item)
if not self.max or item >= self.max[-1]: # add if empty or if greater
self.max.append(item) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def push(self, item):\r\n self.stack.insert(0, item)",
"def push(self, item):\n self.stack.append(item)",
"def push(self, item):\n self.stack.append(item)",
"def push(self, item):\n super().add_item_to_front(item)",
"def push(self, item):\n # Reassign the link to top of t... | [
"0.86131185",
"0.8350371",
"0.8350371",
"0.82063144",
"0.8169893",
"0.80554295",
"0.7906704",
"0.7900811",
"0.78551334",
"0.7847313",
"0.7841573",
"0.7812312",
"0.77714646",
"0.7698743",
"0.7631913",
"0.7609149",
"0.75127417",
"0.7507851",
"0.748951",
"0.74806553",
"0.7480563... | 0.7491869 | 18 |
Remove and return the top item from our stack. | def pop(self):
item = self.stack.pop()
if item == self.max[-1]: # pop if the same element
self.max.pop()
return item | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pop(self):\n try:\n if self.size() > 0:\n top = self.top()\n self.items.pop()\n return top\n else:\n raise IndexError('Cannot pop item, stack is empty.')\n except IndexError as err:\n print(err)\n ... | [
"0.87957346",
"0.85759664",
"0.8559679",
"0.83127123",
"0.82553434",
"0.8204941",
"0.8165231",
"0.81395555",
"0.8128583",
"0.81095225",
"0.8108789",
"0.8068022",
"0.8064487",
"0.80618995",
"0.8053891",
"0.80387515",
"0.8038348",
"0.796708",
"0.795906",
"0.7957087",
"0.7939340... | 0.7828671 | 30 |
The last item in max is the max item in our stack. | def get_max(self):
return self.max[-1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_stack(self):\n if self.maxx == []:\n return None\n return self.maxx[-1]",
"def get_max(self):\n # 0(1)\n return self.max_stack.peek()\n\n # Don't need find_max we returned max_stack.peek()",
"def max(self):\n assert self.__stack\n return self.... | [
"0.8223666",
"0.81320584",
"0.8114541",
"0.80508286",
"0.76636064",
"0.75587475",
"0.7330097",
"0.7235333",
"0.7199902",
"0.70251775",
"0.70172393",
"0.7013688",
"0.6992615",
"0.69638574",
"0.694721",
"0.69457346",
"0.6941453",
"0.68973905",
"0.6857501",
"0.68508315",
"0.6840... | 0.7687186 | 4 |
Returns a list of unique words which that appear together with word in the dependency_list. | def get_linked_words(dependency_list, word):
words = set() # Unique words, so first a set
for (rel, gov, dep) in dependency_list:
if gov == word:
words.add(dep)
elif dep == word:
words.add(gov)
return list(words) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wordset(word_list):\n\n unique_words = []\n\n for word in word_list:\n\n if word not in unique_words:\n unique_words.append(word)\n\n unique_words.sort()\n\n return unique_words",
"def known(words: list[str]) -> list[str]:\n return [z for z in list(set(words)) if z in... | [
"0.7397748",
"0.7332242",
"0.6955943",
"0.68045413",
"0.6680356",
"0.6583253",
"0.6573687",
"0.65147394",
"0.6503563",
"0.6490802",
"0.6450996",
"0.6449669",
"0.6428956",
"0.64201736",
"0.6405528",
"0.6399228",
"0.6366292",
"0.6344379",
"0.6321502",
"0.6304007",
"0.6293037",
... | 0.84802175 | 0 |
Determine if this adjustment is old enough that we can assume it's no longer needed. | def is_expired(self):
return timeutils.utcnow_ts() > self.expire_ts | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_old(self):\n return self.age > self.lifespan",
"def use_older(self) -> bool:\n return self._action == 'older'",
"def is_outdated(self):\n today = datetime.datetime.today()\n day = datetime.datetime.combine(self.date, self.start_time)\n return day <= today",
"def exte... | [
"0.68397313",
"0.62868214",
"0.6081539",
"0.60370785",
"0.59843177",
"0.5975423",
"0.596125",
"0.5959067",
"0.5919537",
"0.59194493",
"0.5896765",
"0.58203894",
"0.5796046",
"0.57801825",
"0.5778547",
"0.57633764",
"0.57181084",
"0.5716448",
"0.570537",
"0.5704538",
"0.570432... | 0.0 | -1 |
Method to begin a resource claim for a new instance. | def begin_instance_resource_claim(self, context, instance_ref, *args,
**kwargs):
memory_mb = instance_ref['memory_mb']
disk_gb = instance_ref['root_gb'] + instance_ref['ephemeral_gb']
claim = self._do_begin_resource_claim(context, memory_mb, disk_gb,
*args, **kwargs)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__,\n resource_name: str,\n args: AuthServerClaimDefaultArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...",
"def create(self):\n raise WufooException(\"InstanceResource creation not supported\")",
"def begin_resource_c... | [
"0.62509257",
"0.60371166",
"0.5969876",
"0.5818339",
"0.5743511",
"0.571801",
"0.571801",
"0.571801",
"0.571801",
"0.571801",
"0.571801",
"0.5654904",
"0.56244344",
"0.5619872",
"0.56168664",
"0.5578573",
"0.5573552",
"0.55535185",
"0.55503863",
"0.55503863",
"0.5525074",
... | 0.7002623 | 0 |
Get the list of vertex coordinates for an edge. | def edge_coord_list(self,edge_name):
coord_list = list(np.array(self.edges[edge_name].coords.xy).T)[:]
return coord_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def edge_vertices(edge):\n return [edge.vertex1, edge.vertex2]",
"def vertices_from_edge(self, edge):\n assert isinstance(edge, Edge)\n return map(Vertex, self._top_exp.vertices_from_edge(edge.topods_shape()))",
"def get_edge_coords(self):\n return self.coords",
"def get_edge_ids(self... | [
"0.8280774",
"0.77096665",
"0.744324",
"0.70164496",
"0.69808906",
"0.6954093",
"0.68951213",
"0.67977554",
"0.67594576",
"0.6726835",
"0.6689108",
"0.6666376",
"0.66438687",
"0.6643371",
"0.6640205",
"0.66248316",
"0.66205746",
"0.661167",
"0.6602474",
"0.6597047",
"0.659399... | 0.7957288 | 1 |
converts farenheit to celcius | def conToCelc(faren):
return (faren - 32)*(5/9) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_f_to_c(temp_in_farenheit): ## ##\n celsiustemp = round((temp_in_farenheit - 32) * 5/9, 1) ##\n return celsiustemp ##",
"def convert_f_to_c(temp_in_f... | [
"0.80833304",
"0.79071164",
"0.78782123",
"0.78239393",
"0.77643573",
"0.76808286",
"0.75874096",
"0.7583946",
"0.7524361",
"0.7401036",
"0.7401036",
"0.7348955",
"0.73330903",
"0.7248",
"0.7192899",
"0.7160771",
"0.7142256",
"0.70540285",
"0.7012243",
"0.6880764",
"0.6857772... | 0.62633044 | 43 |
initalize the Portfolio object with a PositionHandler, an event history, along with cash balance. Make sure the portfolio denomination currency is also set. | def __init__(
self,
start_dt,
starting_cash=0.0,
currency = "USD",
portfolio_id=None,
name=None
):
self.start_dt = start_dt
self.current_dt = start_dt
self.starting_cash = starting_cash
self.currency = currency
self.portfolio_id... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _initalize_portfolio_with_cash(self):\n self.cash = copy.copy(self.starting_cash)\n\n if self.starting_cash > 0.0:\n self.history.append(\n PortfolioEvent.create_subscription(\n self.current_dt, self.starting_cash, self.starting_cash\n )... | [
"0.7173111",
"0.6831782",
"0.67134976",
"0.6678022",
"0.65675235",
"0.6527908",
"0.6390145",
"0.6258053",
"0.62282896",
"0.62212044",
"0.6000357",
"0.59435725",
"0.5930339",
"0.5854626",
"0.5842731",
"0.5830696",
"0.579761",
"0.57606167",
"0.57326436",
"0.57089895",
"0.569233... | 0.71243984 | 1 |
initalize the portfolio with a (default) currency Cash Asset with quantity equal to 'starting_cash'. | def _initalize_portfolio_with_cash(self):
self.cash = copy.copy(self.starting_cash)
if self.starting_cash > 0.0:
self.history.append(
PortfolioEvent.create_subscription(
self.current_dt, self.starting_cash, self.starting_cash
)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_cash(self, cash):\n portfolio = self.get_portfolio_object()\n if portfolio is not None:\n portfolio.cash += cash\n portfolio.initial_cash += cash",
"async def init(self, ctx, *amount_and_symbol : str):\n user = ctx.message.author\n portfolio = GetPortfolio(user.i... | [
"0.72195965",
"0.6654873",
"0.6479836",
"0.62634933",
"0.6254535",
"0.6159562",
"0.61312175",
"0.6044168",
"0.5925858",
"0.5922093",
"0.5849026",
"0.5737447",
"0.5727892",
"0.5719678",
"0.56384236",
"0.5622496",
"0.56089795",
"0.56013167",
"0.5577498",
"0.5574091",
"0.5544536... | 0.80738497 | 0 |
Obtain the total market value of the portfolio including cash. | def total_equity(self):
return self.total_market_value + self.cash | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_market_value(self):\n return self.pos_handler.total_market_value()",
"def total_value(self):\n total = 0.0\n for account in self.accounts():\n total += account.available_cash()\n for asset in account.assets():\n total += asset.adjusted_value()\n... | [
"0.7671627",
"0.75416785",
"0.7099624",
"0.6975173",
"0.67064476",
"0.66260713",
"0.6544043",
"0.6533217",
"0.6508555",
"0.6503629",
"0.64636236",
"0.6411057",
"0.64103353",
"0.6406251",
"0.63845277",
"0.6358938",
"0.63136154",
"0.6281191",
"0.62557274",
"0.6252469",
"0.62497... | 0.80464536 | 0 |
Calculate the sum of all the positions' unrealised P&Ls. | def total_unrealised_pnl(self):
return self.pos_handler.total_unrealised_pnl() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calc(self):\n np = 0\n for cell in self.cells:\n n = self.cell_np[cell]\n np += n\n self.dnp = np - self.np\n self.np = np",
"def game_nim_sum():\n global piles\n global num_piles \n nim_sum = 0\n for x in piles:\n nim_sum = nim_sum^x\n ... | [
"0.6138382",
"0.5988451",
"0.5985783",
"0.5948424",
"0.5917901",
"0.588325",
"0.58515394",
"0.5802395",
"0.5777268",
"0.57663465",
"0.57444376",
"0.57424444",
"0.573149",
"0.56927526",
"0.5680383",
"0.56786084",
"0.56773674",
"0.56495285",
"0.5636211",
"0.5627178",
"0.5618784... | 0.5724155 | 13 |
Calculate the sum of all the positions' total P&Ls. | def total_pnl(self):
return self.pos_handler.total_pnl() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def grand_total(self):\n return sum(self.grid[pos][1] for pos in assignable_positions if self.grid[pos][0]) + self.grid[\"nb\"][1]",
"def total_charge(particles: list[Particle]) -> int:\n total_charge = 0\n for particle in particles:\n if particle.isotope:\n total_c... | [
"0.6674888",
"0.65747386",
"0.656115",
"0.6408351",
"0.6244071",
"0.62093467",
"0.62072265",
"0.6200046",
"0.6199953",
"0.6150999",
"0.61397165",
"0.6101902",
"0.60751224",
"0.6067845",
"0.60376614",
"0.59906673",
"0.5978963",
"0.5949327",
"0.5943739",
"0.59337807",
"0.593269... | 0.61587644 | 9 |
convert yyyymm as date object, last day of the month | def as_date(inp):
out = datetime.datetime.strptime(str(inp), "%Y%m")
out = out.replace(day = 28) + datetime.timedelta(days=4)
return out - datetime.timedelta(days = out.day) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_month_day():\r\n return (datetime.now().replace(day=1) + relativedelta(months=1) + timedelta(days=-1)).strftime(\r\n '%d-%m-%Y')",
"def end_month(d):\n return date(d.year, d.month, monthrange(d.year, d.month)[1])",
"def floor_end_month(date):\n return datetime(date.year, date.month, 1)... | [
"0.78613883",
"0.78331536",
"0.7679891",
"0.75576544",
"0.75576544",
"0.7424104",
"0.72581494",
"0.7187047",
"0.7136545",
"0.7118",
"0.7076194",
"0.7022085",
"0.6971994",
"0.6962207",
"0.69447607",
"0.69043535",
"0.68437845",
"0.65625334",
"0.6523635",
"0.64279246",
"0.640960... | 0.59052914 | 41 |
scatter plot to visualise knn clusters | def scatter_plot(x_all, labels):
color = labels.iloc[:,1].apply(lambda x: "green" if x == 0 else "red" if x == 1 else "blue")
plt.figure(figsize = (6,4))
plt.scatter(x_all.iloc[:,1], x_all.iloc[:,2], c = color)
plt.xlabel('Title Polarity', fontsize = 15)
plt.ylabel('Content Polarity', font... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cluster_plot(self):\r\n train = StandardScaler().fit_transform(self.X)\r\n pca = PCA(n_components=3)\r\n pca_component = pca.fit_transform(self.X)\r\n fig = plt.figure(figsize=(10,8))\r\n sns.set_palette(sns.color_palette(\"cubehelix\", 8))\r\n ax ... | [
"0.7747962",
"0.7716111",
"0.7538723",
"0.7446795",
"0.72035843",
"0.71824634",
"0.7149324",
"0.699142",
"0.6981986",
"0.6890416",
"0.68548346",
"0.6853959",
"0.68033546",
"0.67985046",
"0.67467767",
"0.6722409",
"0.6676758",
"0.66609615",
"0.66543454",
"0.66532516",
"0.66198... | 0.0 | -1 |
Returns a batch from data set according to its' index | def getBatchFromTrainSet(self, batchNumber):
if batchNumber > self.getNumberOfBatchesTrainSet():
print("Batch Number requested bigger than total number of batches.")
return -1
batchStartinIndex = self.batchSize * batchNumber
batchEndIndex = batchStartinIndex + self.batch... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __getitem__(self, index):\r\n\r\n # Generate indexes of the batch\r\n indexes = self.indexes[index * self.batch_size:(index + 1) * self.batch_size]\r\n\r\n # Find list of IDs\r\n list_ids_temp = [self.list_IDs[k] for k in indexes]\r\n\r\n # Calls function to load batch of dat... | [
"0.7588744",
"0.7478985",
"0.7478985",
"0.74274486",
"0.74183136",
"0.74183136",
"0.7416465",
"0.7414807",
"0.7340913",
"0.726303",
"0.72282183",
"0.7143944",
"0.7083753",
"0.705192",
"0.692392",
"0.68744177",
"0.66877234",
"0.6666997",
"0.6646818",
"0.66342145",
"0.6623923",... | 0.0 | -1 |
Create a new Node. Parent can be either the parent's Node, or the tree (for the root Node). If you override __init__(), you must call Node.__init__(parent), AT THE END OF YOUR __init__() ! | def __init__(self, parent):
if isinstance(parent, Node):
self.parent = parent
self.tree = parent.tree
self.depth = parent.depth + 1
else:
self.parent = None
self.tree = parent
self.depth = 0
self.children = []
sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_node(self, name, parent):\n\n try:\n node = self.map[name]\n return node\n except:\n node = Node(name,parent=parent.name)\n parent.children.add(node)\n\n node.parent = parent.name\n\n self.map[name] = node\n\n ret... | [
"0.76639163",
"0.73757106",
"0.71867186",
"0.7139515",
"0.70810753",
"0.7072079",
"0.6969169",
"0.69666064",
"0.69666064",
"0.6952852",
"0.691518",
"0.6791299",
"0.6791299",
"0.6791299",
"0.67450833",
"0.6701225",
"0.66884553",
"0.6686236",
"0.6647217",
"0.6647217",
"0.663237... | 0.72969025 | 2 |
Returns the value to which the specified key is mapped, or 1 if this map contains no mapping for the key | def get(self, key: int) -> int:
if key not in self.map:
return -1
return self.map[key] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, key: int) -> int:\n if key in self.hashmap.keys():return self.hashmap[key]\n else:return -1",
"def get(self, key: int) -> int:\n sh = key % 37\n if self.map[sh] == None:\n return -1\n for i in range(len(self.map[sh])):\n kv = self.map[sh][i]\... | [
"0.79098475",
"0.762993",
"0.75650334",
"0.7556994",
"0.7529803",
"0.75259614",
"0.7493149",
"0.73738897",
"0.7294419",
"0.72940016",
"0.72216845",
"0.72175443",
"0.7181078",
"0.71774393",
"0.71633786",
"0.6980779",
"0.69289523",
"0.67850846",
"0.6757027",
"0.6734023",
"0.661... | 0.800388 | 0 |
Returns the value to which the specified key is mapped, or 1 if this map contains no mapping for the key | def get(self, key: int) -> int:
if key in self.hashmap.keys():return self.hashmap[key]
else:return -1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, key: int) -> int:\n if key not in self.map:\n return -1\n return self.map[key]",
"def get(self, key: int) -> int:\n sh = key % 37\n if self.map[sh] == None:\n return -1\n for i in range(len(self.map[sh])):\n kv = self.map[sh][i]\n ... | [
"0.800388",
"0.762993",
"0.75650334",
"0.7556994",
"0.7529803",
"0.75259614",
"0.7493149",
"0.73738897",
"0.7294419",
"0.72940016",
"0.72216845",
"0.72175443",
"0.7181078",
"0.71774393",
"0.71633786",
"0.6980779",
"0.69289523",
"0.67850846",
"0.6757027",
"0.6734023",
"0.66126... | 0.79098475 | 1 |
If the email address and confirmation_code match a row in the people table, and the confirmation_code_set field isn't too far in the past, then insert a new session and return it. The max_age_confirmation_code should be a datetime.timedelta. Also, update the confirmation_code to NULL and the confirmation_code_set to NU... | def maybe_start_new_session_after_checking_email_and_confirmation_code(
cls, pgconn, email_address, confirmation_code,
max_age_confirmation_code):
qry = textwrap.dedent("""
with updated_person as (
update people
set confirmation_code = NULL,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maybe_start_new_session_after_checking_email_and_password(cls,\n pgconn, email_address, password):\n\n cursor = pgconn.cursor()\n\n cursor.execute(textwrap.dedent(\"\"\"\n insert into webapp_sessions\n (person_uuid)\n select person_uuid\n from pe... | [
"0.60392874",
"0.5681908",
"0.5451615",
"0.5417981",
"0.5366344",
"0.5240246",
"0.5230094",
"0.5170933",
"0.51691353",
"0.51681817",
"0.5118041",
"0.51156867",
"0.5023955",
"0.5006434",
"0.49894702",
"0.49657902",
"0.49437103",
"0.48913294",
"0.4865624",
"0.48327735",
"0.4811... | 0.8278633 | 0 |
Get a feature based on its index, like geojfile[7]. | def __getitem__(self, index):
return Stop(self._data["features"][index]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _getFIdx(self, featureName):\n return np.where(self.featureNames == featureName)[0][0]",
"def __return_feature_index__(self, tup):\n index = self._features_index.get(tup, False)\n return index",
"def __getitem__(self, feature_name):\n return self.get_feature_by_name(feature_name... | [
"0.70270425",
"0.6939968",
"0.68989456",
"0.6825057",
"0.6825057",
"0.6756342",
"0.6445459",
"0.6385401",
"0.6329417",
"0.63072646",
"0.62352085",
"0.62266725",
"0.62103474",
"0.620381",
"0.61840034",
"0.6173716",
"0.612962",
"0.6091679",
"0.60909986",
"0.60748136",
"0.606674... | 0.5754033 | 42 |
Return the time in the maps timezone. | def now(self):
if 'timezone' in self._data:
return pytz.utc.localize(datetime.datetime.utcnow()).astimezone(pytz.timezone(self._data['timezone']))
else:
return pytz.utc.localize(datetime.datetime.utcnow()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def timezone():\n\n return time.timezone",
"def time_zone():\n return timezone('Etc/GMT-10')",
"def time_zone(self):\n\n\t\tg = geocoders.GoogleV3()\n\n\t\t#Gives the name of the timezone, ex: Africa/Luanda\n\t\ttimezone_name = str(g.timezone((self.latitude_value(), self.longitude_value())))\n\n\t\t#... | [
"0.77458173",
"0.75449455",
"0.74255836",
"0.7382991",
"0.73272073",
"0.72874886",
"0.7286596",
"0.72376335",
"0.71268165",
"0.7092585",
"0.708504",
"0.70804554",
"0.70730954",
"0.70302224",
"0.70247185",
"0.70023483",
"0.70023483",
"0.70023483",
"0.6986536",
"0.68674624",
"0... | 0.64761084 | 36 |
Returns a default Policy class to use, given a config. This class will be used by an Algorithm in case the policy class is not provided by the user in any single or multiagent PolicySpec. | def get_default_policy_class(
cls,
config: AlgorithmConfig,
) -> Optional[Type[Policy]]:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_default_policy(worker_type, policy_name):\n default_policies = {\n 'assignment_policy': {'policy': 'anyone_certified'},\n 'review_policy': {'policy': 'sampled_review',\n 'rate': 1,\n 'max_reviews': 1}\n }\n if worker_type == Step.Work... | [
"0.6311315",
"0.5729347",
"0.56618005",
"0.5506984",
"0.54978967",
"0.5444962",
"0.5404679",
"0.5362682",
"0.5354706",
"0.53364164",
"0.5313896",
"0.53083",
"0.5271808",
"0.526701",
"0.5238172",
"0.52150375",
"0.52150375",
"0.5179932",
"0.5179932",
"0.5179932",
"0.5176115",
... | 0.876256 | 0 |
Return policy for the specified id, or None. | def get_policy(self, policy_id: PolicyID = DEFAULT_POLICY_ID) -> Policy:
return self.workers.local_worker().get_policy(policy_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_policy_by_id(self, id):\n for service, policy_list in self.remote_store.get_policy_list().items():\n for policy in policy_list:\n if policy.id == id:\n return policy",
"def get_sp_policy(self, context, id):\n # handling policy method in RPC\n ... | [
"0.8195919",
"0.77299577",
"0.75044537",
"0.6999399",
"0.6937139",
"0.6846598",
"0.68390167",
"0.67756456",
"0.67569816",
"0.67055607",
"0.6670871",
"0.6530853",
"0.6530853",
"0.65043503",
"0.6430231",
"0.6430231",
"0.6430231",
"0.6392584",
"0.6322479",
"0.6291166",
"0.628162... | 0.8019719 | 1 |
Sync "main" weights to given WorkerSet or list of workers. | def _sync_weights_to_workers(
self,
*,
worker_set: WorkerSet,
) -> None:
# Broadcast the new policy weights to all remote workers in worker_set.
logger.info("Synchronizing weights to workers.")
worker_set.sync_weights() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_weights(self, weights: Dict[PolicyID, dict]):\n self.workers.local_worker().set_weights(weights)",
"def set_weight(self):\n\n for _, s in self.servers.items():\n self._set_server_weight(s)\n\n for _, g in self.groups.items():\n self._set_server_weight(g)\n\n ... | [
"0.7415235",
"0.62137634",
"0.60029346",
"0.5975668",
"0.5956228",
"0.5927176",
"0.5906956",
"0.58806175",
"0.5873325",
"0.5845702",
"0.5845702",
"0.58380777",
"0.5835373",
"0.57719904",
"0.5764665",
"0.5748021",
"0.57451636",
"0.5717775",
"0.5690156",
"0.5668649",
"0.5667609... | 0.87334454 | 0 |
Determines whether we need to create evaluation workers. Returns False if we need to run offline evaluation (with ope.estimate_on_dastaset API) or when local worker is to be used for | def _should_create_evaluation_rollout_workers(cls, eval_config: "AlgorithmConfig"):
run_offline_evaluation = (
eval_config.off_policy_estimation_methods
and not eval_config.ope_split_batch_by_episode
)
return not run_offline_evaluation and (
eval_config.evalua... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _workers_available(self) -> bool:\n total_compute_power = sum(self.client.nthreads().values())\n if len(self.futures) < total_compute_power:\n return True\n return False",
"def evaluationManagerExists():\n\n pass",
"def _in_multi_worker_mode(self):\n return False",
"... | [
"0.69867367",
"0.6750227",
"0.65190905",
"0.6204362",
"0.60276794",
"0.6008399",
"0.60004455",
"0.59838545",
"0.5982903",
"0.5968737",
"0.5966784",
"0.59494275",
"0.5947787",
"0.5880935",
"0.5866724",
"0.58357304",
"0.5815615",
"0.5801928",
"0.57745457",
"0.5712537",
"0.56984... | 0.80267185 | 0 |
Take features and labels and expand them into labelled examples for the model. | def expand_features_and_labels(x_feat, y_labels):
x_expanded = []
y_expanded = []
for x, y in zip(x_feat, y_labels):
for segment in x:
x_expanded.append(segment)
y_expanded.append(y)
return x_expanded, y_expanded | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def train(self, features, labels):\n pass",
"def batch_features_labels(features, labels, batch_size):\n for start in range(0, len(features), batch_size):\n end = min(start + batch_size, len(features))\n #print(labels[start:end])\n yield features[start:end], labels[start:end]",
"d... | [
"0.70349824",
"0.68972695",
"0.6896075",
"0.6843909",
"0.6753165",
"0.6723895",
"0.6698124",
"0.6696624",
"0.6696624",
"0.6696624",
"0.66622084",
"0.66512835",
"0.66372955",
"0.66372955",
"0.6585688",
"0.65664846",
"0.6552065",
"0.6544043",
"0.6524538",
"0.6518095",
"0.651359... | 0.738075 | 0 |
Given units, return the number of days as a float. | def __get_number_of_day(units):
multiplier = DAYS_IN_A_YEAR
if units:
if units.lower().startswith("w"):
multiplier = DAYS_IN_A_WEEK
elif units.lower().startswith("m"):
multiplier = DAYS_IN_A_MONTH
return multiplier | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_seconds_in_days(days):\n return int(days * 86400)",
"def get_number_days(self):\r\n return 1",
"def daysinunit(self, unit):\n\t\treturn float(self.daysinbase)/self.unitsize(unit)",
"def get_total_days(x):\n if not isinstance(x, dt.timedelta):\n raise TypeError(str(type(x)))\... | [
"0.6842742",
"0.66279376",
"0.65096146",
"0.64563215",
"0.6441921",
"0.6411838",
"0.6360568",
"0.63437134",
"0.6317742",
"0.6294341",
"0.62746185",
"0.61432064",
"0.6067217",
"0.6014479",
"0.5979685",
"0.59133446",
"0.59019345",
"0.58854306",
"0.5880806",
"0.5880806",
"0.5880... | 0.7700852 | 0 |
Takes a list ["a", "b", "c"] and returns a string "a, b & c" | def join_list(
object_list: list, delimiter: str = ", ", last_delimiter: str = " & "
) -> str:
if not object_list:
return ""
list_copy = list(object_list)
last = list_copy.pop()
if list_copy:
return f"{delimiter.join(list_copy)}{last_delimiter}{last}"
return f"{last}" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rejoin(textList):\n return ','.join(textList)",
"def list_string(join_list):\n joined_list = '[{}]'.format(join_list, join_list)\n return joined_list",
"def list_to_string(inputlist):\n outstring = \"\"\n numusers = len(inputlist)\n if numusers == 1: # foo\n outstring += inputlist[... | [
"0.7322794",
"0.7226486",
"0.71739113",
"0.71678036",
"0.7139772",
"0.70491207",
"0.6987208",
"0.6975621",
"0.687572",
"0.68674576",
"0.6860652",
"0.68113303",
"0.67705745",
"0.67073786",
"0.6671819",
"0.6643516",
"0.6639437",
"0.6636453",
"0.6597404",
"0.65919954",
"0.657760... | 0.6336179 | 34 |
takes a Binary String Tree and returns the sum of the lengths of all the leaves. BST > num | def total_len(BST):
if isinstance(BST,tuple):
return total_len(BST[0]) + total_len(BST[1])
else:
return len(BST) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bst_count_leaves(tree):\n leaves = 0\n\n def _walk(node=None):\n nonlocal leaves\n if node is None:\n return\n\n if node.left is not None:\n _walk(node.left)\n\n if node.left is None and node.right is None:\n leaves += 1\n\n if node.righ... | [
"0.7068906",
"0.67276716",
"0.6592653",
"0.6562969",
"0.6536931",
"0.65101594",
"0.6485907",
"0.648363",
"0.64446527",
"0.63749784",
"0.6345081",
"0.6339996",
"0.6286512",
"0.6281552",
"0.6275853",
"0.6275338",
"0.6256959",
"0.62358624",
"0.6233116",
"0.6224606",
"0.6214529",... | 0.7558169 | 0 |
that takes a BST and returns a copy of that tree with all the leaves replaced by their first characters BST > str | def initialize_tree(BST):
if isinstance(BST,tuple):
return (initialize_tree(BST[0]),initialize_tree(BST[1]))
else:
return BST[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n # Tricky to do iteratively so we do it recursively.\n return BST._str(\"\", self.root)",
"def sequence_to_tree(s):\n return partial_tree(s, len(s))[0]",
"def serialize(node, tree=\"\"):\n \n \n if (not node): #Base case\n tree += \"# \"\n return tree\n... | [
"0.6375644",
"0.6195448",
"0.6017574",
"0.59081036",
"0.58997935",
"0.5868004",
"0.5812249",
"0.5791793",
"0.57854337",
"0.57643193",
"0.57426614",
"0.5727494",
"0.57235396",
"0.5677281",
"0.5672069",
"0.5669008",
"0.5664082",
"0.56430715",
"0.5630196",
"0.56074417",
"0.56039... | 0.52777714 | 70 |
Splits text by sentences. | def extract(self, text: str) -> List[Extraction]:
doc = self._parser(text)
extractions = list()
for sent in doc.sents:
this_extraction = Extraction(value=sent.text,
extractor_name=self.name,
start_tok... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sentence_split(self, text):\n return split_into_sentences(text)",
"def split_sentences(text):\n # sentence_delimiters = re.compile(r'(?<!\\w\\.\\w.)(?<![A-Z][a-z]\\.)(?<=\\.|\\?)\\s')\n # sentences = sentence_delimiters.split(text)\n sentences = nltk.sent_tokenize(text)\n return sentences"... | [
"0.8591312",
"0.8463891",
"0.830895",
"0.824216",
"0.8223932",
"0.81387705",
"0.79170114",
"0.7883451",
"0.77430445",
"0.7718218",
"0.7645844",
"0.75872874",
"0.75845367",
"0.7566527",
"0.7566527",
"0.73208463",
"0.7228293",
"0.7199005",
"0.7178234",
"0.71557724",
"0.7147786"... | 0.0 | -1 |
Try and find a document by various criteria. | def by_keys(cls, parent_id=None, collection_id=None, foreign_id=None,
content_hash=None):
q = cls.all()
q = q.filter(Document.collection_id == collection_id)
if parent_id is not None:
q = q.filter(Document.parent_id == parent_id)
if foreign_id is not None:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_document(self):\n pass",
"async def _find(self, document: str) -> Union[List[pq], None]:\n doc = pq(document)\n data = doc(self.selector)\n if not data and self.raise_not_found:\n raise InformationError(\"No matches for '{selector}' found in document\".format(selec... | [
"0.69850135",
"0.69720745",
"0.68757623",
"0.6738735",
"0.67325044",
"0.6697067",
"0.6694277",
"0.66787994",
"0.66675776",
"0.6496688",
"0.6425214",
"0.63371915",
"0.6317889",
"0.6208751",
"0.6164415",
"0.616352",
"0.6147236",
"0.6125187",
"0.6124362",
"0.6076006",
"0.6060732... | 0.0 | -1 |
Return a result between 1 and 0 using a sigmoid function | def activation(self, z):
denominator = 1 + np.exp(-z)
result = 1/denominator
return result | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sigmoid(x):\n return 1 / (1 + exp(-x))",
"def sigmoid(x):\n return 1 / (1 + exp(-x))",
"def sigmoid(x):\n return 1 / (1 + math.exp(-x))",
"def sigmoid(x):\n return 1 / (1 + math.exp(-x))",
"def sigmoid(x):\r\n return 1 / (1 + np.exp(-x))",
"def sigmoid(x):\n\treturn 1 / (1 + m.exp(-x))",... | [
"0.8726892",
"0.8726892",
"0.8693726",
"0.864971",
"0.86333054",
"0.8632544",
"0.86240435",
"0.86240435",
"0.86110497",
"0.86110497",
"0.86110497",
"0.86110497",
"0.86110497",
"0.86110497",
"0.8608294",
"0.8599766",
"0.85885125",
"0.85728616",
"0.8561277",
"0.85425025",
"0.85... | 0.0 | -1 |
Sample initial states by taking random number of noops on reset. Noop is assumed to be action 0. | def __init__(self, env, noop_max=30):
gym.Wrapper.__init__(self, env)
self.noop_max = noop_max
self.override_num_noops = None
self.noop_action = 0
assert env.unwrapped.get_action_meanings()[0] == 'NOOP' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset(self, **kwargs):\n self.env.reset(**kwargs)\n noops = self.unwrapped.np_random.randint(1, self.noop_max + 1)\n obs = None\n for _ in range(noops):\n obs, _, done, _ = self.env.step(self.noop_action)\n if done:\n obs = self.env.reset(**kwarg... | [
"0.7219723",
"0.72187144",
"0.70726216",
"0.7021141",
"0.7017971",
"0.69458",
"0.6894687",
"0.6889921",
"0.6793108",
"0.6787878",
"0.66379833",
"0.6548487",
"0.6545404",
"0.6478773",
"0.64702266",
"0.6465461",
"0.64284664",
"0.64275134",
"0.6427446",
"0.6419816",
"0.6376056",... | 0.0 | -1 |
Bin reward to {+1, 0, 1} by its sign. | def reward(self, reward):
return np.sign(reward) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reward(self, reward):\r\n return np.sign(reward)",
"def reward(self, reward):\n return float(np.sign(reward))",
"def sign(x):\n return(copysign(1, x))",
"def sign(self):\n return 1 - 2 * self._ltz()",
"def sign(self, inputs):\n pass",
"def sign(self, inputs):\n pass"... | [
"0.7170663",
"0.6652758",
"0.6516397",
"0.61955494",
"0.60499823",
"0.60499823",
"0.6048698",
"0.60147136",
"0.5961627",
"0.5949438",
"0.59057444",
"0.5822291",
"0.5816496",
"0.57978296",
"0.57128024",
"0.5707449",
"0.56889117",
"0.56587505",
"0.5643741",
"0.56297874",
"0.562... | 0.70812565 | 4 |
Stack k last frames. Returns lazy array, which is much more memory efficient. See Also baselines.common.atari_wrappers.LazyFrames | def __init__(self, env, k):
gym.Wrapper.__init__(self, env)
self.k = k
self.frames = deque([], maxlen=k)
shp = env.observation_space.shape
self.observation_space = spaces.Box(low=0, high=255, shape=(shp[0], shp[1], shp[2] * k), dtype=np.uint8) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stack_context(features, k=10, labels=None):\n n_feats, n_frames = features.shape[0], features.shape[1]\n stacked_features = np.array([features[:,frame-k:frame+k+1] for frame in range(k,n_frames-k-1)])\n stacked_features = np.reshape(stacked_features, [-1, (2*k+1)*n_feats]).T\n\n if labels is not No... | [
"0.5785088",
"0.57418305",
"0.5727743",
"0.56725866",
"0.5657102",
"0.56533515",
"0.562567",
"0.5530811",
"0.5496529",
"0.5494264",
"0.53636014",
"0.5313162",
"0.53079146",
"0.5287681",
"0.52842236",
"0.5281449",
"0.52532285",
"0.52426165",
"0.52383834",
"0.5215902",
"0.51987... | 0.0 | -1 |
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). | def zigzagLevelOrder(self, root):
if not root:
return []
# create direction variable
going_right = False
# initialize a level stack
level_stack = [root]
# initialize a result array
result = []
# loop while level stack is not empry
w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zig_zag_traversal(root):\n return",
"def zigzak_using_bfs(root):\n current_level = [root]\n next_level = []\n while current_level:\n node = current_level.pop()\n print(node.data, end=\" \")\n if node.right:\n next_level.append(node.right)\n if node.left:\n ... | [
"0.76472515",
"0.6974045",
"0.6966052",
"0.69008505",
"0.6631278",
"0.65696484",
"0.6472859",
"0.64711165",
"0.6433989",
"0.63938385",
"0.6313777",
"0.6285579",
"0.6284691",
"0.627963",
"0.6279272",
"0.6256373",
"0.62071615",
"0.61616915",
"0.61511487",
"0.6136975",
"0.613019... | 0.81539404 | 0 |
Get the next cell from the processing queue. | def get_next_cell(self):
cell = self.cells_to_process.pop(0)
return cell | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_next_cell(self):\r\n if len(self.queue) == 0:\r\n return\r\n val = self.peek_queue()\r\n self.queue.remove(val)\r\n return val[0]",
"def next(self):\n try:\n return self.queue.get()\n except Empty:\n raise StopIteration",
"def n... | [
"0.8887116",
"0.75175375",
"0.74384785",
"0.7436739",
"0.7257795",
"0.6763209",
"0.67374814",
"0.67179966",
"0.67179966",
"0.6650444",
"0.6641934",
"0.66329914",
"0.66136074",
"0.6612331",
"0.6570229",
"0.6490648",
"0.6462279",
"0.6451531",
"0.64372516",
"0.6433434",
"0.64283... | 0.8064473 | 1 |
Get all open cells. | def get_all_open_cells(self):
num_rows = len(self.mine_field)
num_cols = len(self.mine_field[0])
open_cells = [(row, col)
for row in range(num_rows)
for col in range(num_cols)
if not self.mine_field[row][col] == '?']
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_open_cells(field: MineField, cell: Cell) -> List[Cell]:\n # TODO re-implement iteratively to safe stack space (especially for large boards)\n if cell.is_flag or cell.is_mine or not field.cell_is_safe(cell):\n return [cell]\n \n if cell.visited:\n return\n\n open_cells: list = l... | [
"0.71365005",
"0.7095869",
"0.69036734",
"0.6763179",
"0.6711646",
"0.6556367",
"0.6549689",
"0.65410686",
"0.6419314",
"0.64158624",
"0.63626695",
"0.6293136",
"0.62435544",
"0.62284225",
"0.6202099",
"0.60618067",
"0.60603946",
"0.60271055",
"0.6018301",
"0.5981838",
"0.596... | 0.76410484 | 0 |
Tests if overriden __eq__ method works correctly | def test__eq__() -> None:
point_1 = Point(1, 2)
point_2 = Point(-2, -4)
point_3 = Point(3, 3)
point_4 = Point(0, 0)
line_segment_1 = LineSegment(first=point_1, second=point_2)
line_segment_2 = LineSegment(first=point_1, second=point_2)
line_segment_3 = LineSegment(first=point_3, second=point... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self,*args):\r\n pass",
"def __eq__(self,*args):\r\n pass",
"def __eq__(self,*args):\r\n pass",
"def __eq__(self,*args):\r\n pass",
"def __eq__(self,*args):\r\n pass",
"def __eq__(self,*args):\r\n pass",
"def __eq__(self,*args):\r\n pass",
"def __eq__(self,*args):\r\n pass",
"def... | [
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826",
"0.85242826"... | 0.0 | -1 |
Renders the home page. | def home(request):
assert isinstance(request, HttpRequest)
wh = WorkHistory.objects.get(is_current='True')
return render(
request,
'app/index.html',
context_instance = RequestContext(request,
{
'title': 'Home Page',
'year': datetime.now().year... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_home():\r\n\treturn render_template(\"index.html\")",
"def home():\n\n return render_template('home_page.html')",
"def home():\n\n return render_template(\"home.html\")",
"def home():\n return render_template('home.html')",
"def home():\n return render_template('home.html')",
"def ... | [
"0.85574406",
"0.853399",
"0.8351404",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.82762724",
"0.827363",
"... | 0.0 | -1 |
Renders the about page. | def about(request):
assert isinstance(request, HttpRequest)
return render(
request,
'app/about.html',
context_instance = RequestContext(request,
{
'title': 'About',
'message': 'Your application description page.',
'year': datetime.now(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def about():\n return render_template('about.html', title='About')",
"def about():\n\n return render_template('about_page.html', title='About')",
"def about():\n\n\treturn render_template(\"about.html\")",
"def on_about(self):\n render_about_window()",
"def about():\n return render_temp... | [
"0.85650355",
"0.85034525",
"0.84489655",
"0.84044397",
"0.8394454",
"0.82935613",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82680845",... | 0.7597973 | 77 |
Renders the about page. | def history(request):
assert isinstance(request, HttpRequest)
return render(
request,
'app/history.html',
context_instance=RequestContext(request,
{
'title': 'Work History',
'contact': Contact.objects.get(pk=1),
'work_histories': WorkH... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def about():\n return render_template('about.html', title='About')",
"def about():\n\n return render_template('about_page.html', title='About')",
"def about():\n\n\treturn render_template(\"about.html\")",
"def on_about(self):\n render_about_window()",
"def about():\n return render_temp... | [
"0.85650355",
"0.85034525",
"0.84489655",
"0.84044397",
"0.8394454",
"0.82935613",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82680845",... | 0.0 | -1 |
Renders the about page. | def workhistory(request, id, slug):
assert isinstance(request, HttpRequest)
wh = get_object_or_404(WorkHistory, pk=id)
return render(
request,
'app/workhistory.html',
context_instance = RequestContext(request,
{
'title': 'Work History Detail',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def about():\n return render_template('about.html', title='About')",
"def about():\n\n return render_template('about_page.html', title='About')",
"def about():\n\n\treturn render_template(\"about.html\")",
"def on_about(self):\n render_about_window()",
"def about():\n return render_temp... | [
"0.85650355",
"0.85034525",
"0.84489655",
"0.84044397",
"0.8394454",
"0.82935613",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82680845",... | 0.0 | -1 |
Determine if there are more items in the data source. | def has_more_pages(self):
return self._has_more | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_for_more_pages(self):\n self._has_more = len(self._items) > self.per_page\n\n self._items = self._items[0:self.per_page]",
"def has_next(self):\n return self.count < len(self)",
"def more(self) -> bool:\n return self.__more",
"def has_more(self):\n return bool(se... | [
"0.7345127",
"0.7116989",
"0.70161515",
"0.68318427",
"0.67888224",
"0.67825514",
"0.6751578",
"0.6674409",
"0.6631319",
"0.6631319",
"0.6631319",
"0.6595824",
"0.6511024",
"0.6507249",
"0.65030056",
"0.64958227",
"0.64814097",
"0.6476219",
"0.6436921",
"0.6424674",
"0.639353... | 0.72596 | 1 |
Collect and collate the license rules in the Qlik Sense Site | def licenserules():
section = document.add_section()
new_width, new_height = section.page_height, section.page_width
section.orientation = WD_ORIENT.LANDSCAPE
section.page_width = 10058400
section.page_height = 7772400
document.add_heading('License Rules', level=1)
systemrules = get... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def qs_license():\r\n paragraph = document.add_paragraph('')\r\n document.add_heading('License', level=1)\r\n lic_metric = ['lef', 'serial', 'name', 'organization', 'product', 'numberOfCores', 'isExpired', 'expiredReason', 'isBlacklisted', 'isInvalid']\r\n qs_lic = get_qlik_sense.get_license()\r\n n... | [
"0.61655337",
"0.5896988",
"0.58003104",
"0.56167525",
"0.55918413",
"0.55918413",
"0.5583374",
"0.54813075",
"0.5342495",
"0.53192645",
"0.5305253",
"0.5246317",
"0.5171956",
"0.51501316",
"0.5114723",
"0.50939006",
"0.50508994",
"0.5037162",
"0.5032238",
"0.49831823",
"0.49... | 0.66415656 | 0 |
Gets the type of this InitLabeler. Required property to deserialize the JSON string correctly | def type(self):
return self._type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type(self):\n return self.get(\"type\")",
"def type(self):\n return self.raw.get(\"type\")",
"def type(self):\n return self.config['type']",
"def type(self):\n return self.properties.get('type')",
"def type(self):\n return self._getValue('type')",
"def type(self):\n... | [
"0.66663367",
"0.6553353",
"0.64687556",
"0.64569205",
"0.6368232",
"0.623508",
"0.623508",
"0.62114835",
"0.6172099",
"0.61282295",
"0.61282295",
"0.609451",
"0.609451",
"0.609451",
"0.609451",
"0.609451",
"0.609451",
"0.609451",
"0.609451",
"0.609451",
"0.609451",
"0.6094... | 0.0 | -1 |
Sets the type of this InitLabeler. Required property to deserialize the JSON string correctly | def type(self, type):
if type is None:
raise ValueError("Invalid value for `type`, must not be `None`")
self._type = type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type(self, type: str):\n\n self._type = type",
"def set_type(self, type):\n self.type = type",
"def set_type(self, type):\n self.type = type",
"def setType(self, type):\n\t\tif not self.Loaded:\n\t\t\tself.type = type\n\t\t\tself.loader = NetLoader.getNetwork(type)\n\t\t\tself.isType... | [
"0.6646275",
"0.64745486",
"0.64745486",
"0.64434385",
"0.643283",
"0.643283",
"0.63833445",
"0.63833445",
"0.63833445",
"0.63833445",
"0.63833445",
"0.63833445",
"0.63833445",
"0.63833445",
"0.63833445",
"0.63833445",
"0.63833445",
"0.63833445",
"0.63833445",
"0.63833445",
"... | 0.60425323 | 44 |
Gets the description of this InitLabeler. Description of the labeler | def description(self):
return self._description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def description(self):\n if self._description is None:\n self._load()\n return self._description",
"def getInstDescription(self):\n return self.name()",
"def get_description(self):\r\n return self.__description",
"def get_description(self):\n return self.__descri... | [
"0.68142813",
"0.68047225",
"0.68027186",
"0.67849994",
"0.6781453",
"0.6781453",
"0.6687821",
"0.66844124",
"0.66844124",
"0.6657763",
"0.66518414",
"0.6650588",
"0.6650588",
"0.6594453",
"0.658534",
"0.6541264",
"0.6541264",
"0.6541264",
"0.6541264",
"0.6541264",
"0.6541264... | 0.6512494 | 85 |
Sets the description of this InitLabeler. Description of the labeler | def description(self, description):
self._description = description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_description(self, description):\r\n self.__description = description",
"def set_description(self, description):\n self.__description = description",
"def setLabel(self, desc):\n self.label = desc",
"def description(self, description: ConfigNodePropertyString):\n\n self._de... | [
"0.7725438",
"0.76624113",
"0.75396353",
"0.7475944",
"0.74724615",
"0.74058354",
"0.74058354",
"0.74058354",
"0.74058354",
"0.7367029",
"0.72860944",
"0.7200818",
"0.7191123",
"0.7191123",
"0.7191123",
"0.7191123",
"0.715886",
"0.7040807",
"0.70013094",
"0.6998271",
"0.68990... | 0.7350169 | 44 |
Gets the ground_truth_label_facet of this InitLabeler. Name of the answer field that contains correct labels of a document | def ground_truth_label_facet(self):
return self._ground_truth_label_facet | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ground_truth_label_facet(self, ground_truth_label_facet):\n if ground_truth_label_facet is None:\n raise ValueError(\"Invalid value for `ground_truth_label_facet`, must not be `None`\")\n\n self._ground_truth_label_facet = ground_truth_label_facet",
"def predicted_label_facet(self):\... | [
"0.64058954",
"0.6398718",
"0.5678945",
"0.5402182",
"0.53986764",
"0.52721345",
"0.525732",
"0.51976234",
"0.5189911",
"0.51846415",
"0.50814915",
"0.5080447",
"0.50804085",
"0.50763154",
"0.5059579",
"0.5059329",
"0.5059329",
"0.5059329",
"0.5059329",
"0.50496393",
"0.50486... | 0.8000839 | 0 |
Sets the name of this InitLabeler. Name | def name(self, name):
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(self, name):\n self.name = name\n self.labels.change_name(name)",
"def set_name(self,name):\r\n self._name = __name",
"def set_name(self, name):\r\n self.__name = name",
"def set_name(self, name):\n self.__name = name",
"def set_name(self, name):\n sel... | [
"0.77249616",
"0.7643542",
"0.7632853",
"0.7577815",
"0.7577815",
"0.7577139",
"0.7530883",
"0.75213057",
"0.75213057",
"0.75213057",
"0.75213057",
"0.75213057",
"0.75057065",
"0.74845195",
"0.7471873",
"0.7380526",
"0.73658216",
"0.7335203",
"0.7285636",
"0.7285636",
"0.7267... | 0.0 | -1 |
Gets the predicted_label_facet of this InitLabeler. Name of the field that contains predicted labels given by this labeler | def predicted_label_facet(self):
return self._predicted_label_facet | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predicted_label_facet(self, predicted_label_facet):\n if predicted_label_facet is None:\n raise ValueError(\"Invalid value for `predicted_label_facet`, must not be `None`\")\n\n self._predicted_label_facet = predicted_label_facet",
"def fetch_prediction_field(field_name, detection_ou... | [
"0.7003048",
"0.6013016",
"0.5928259",
"0.58429396",
"0.577328",
"0.57585025",
"0.5739451",
"0.56821287",
"0.5679959",
"0.5608851",
"0.56087565",
"0.5606495",
"0.5592472",
"0.5573915",
"0.54889584",
"0.54815644",
"0.5460392",
"0.54346955",
"0.53997445",
"0.5394923",
"0.539411... | 0.8545138 | 0 |
Gets the source_dataset_id of this InitLabeler. ID of the training dataset provided when creating this labeler | def source_dataset_id(self):
return self._source_dataset_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_datasetID(self):\n\t\treturn self.prDoc['inputs']['data'][0]['datasetID']",
"def dataset_id(self) -> str:\n return self._dataset_id",
"def get_dataset_id(self) -> int:\n return self.dataset_id",
"def dataset_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"dat... | [
"0.7079057",
"0.70491135",
"0.6999271",
"0.6955414",
"0.6947558",
"0.6947558",
"0.6947558",
"0.68748766",
"0.6505131",
"0.64706624",
"0.6420219",
"0.64168334",
"0.64168334",
"0.63360655",
"0.62492007",
"0.61858046",
"0.61627793",
"0.61627793",
"0.61552244",
"0.61244136",
"0.6... | 0.82416457 | 0 |
Sets the source_dataset_id of this InitLabeler. ID of the training dataset provided when creating this labeler | def source_dataset_id(self, source_dataset_id):
if source_dataset_id is None:
raise ValueError("Invalid value for `source_dataset_id`, must not be `None`")
self._source_dataset_id = source_dataset_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def training_dataset_id(self, training_dataset_id):\n\n self._training_dataset_id = training_dataset_id",
"def set_data_source(self, source_id):\n self.data_source = source_id",
"def source_dataset_id(self):\n return self._source_dataset_id",
"def source_id(self, source_id):\n\n s... | [
"0.7308875",
"0.7185567",
"0.69619113",
"0.65255225",
"0.65255225",
"0.6503603",
"0.6205126",
"0.5868833",
"0.57515097",
"0.5720664",
"0.5696255",
"0.5653682",
"0.5644761",
"0.5632821",
"0.56248754",
"0.5624335",
"0.55882126",
"0.55662537",
"0.5540013",
"0.55359524",
"0.55203... | 0.8046208 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, InitLabeler):
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.8455985",
"0.83913255",
"0.81440157",
"0.8140831",
"0.8132328",
"0.80937284",
"0.809181",
"0.809181",
"0.809181",
"0.808509",
"0.808509",
"0.8076134",
"0.8076134",
"0.8065528"
] | 0.0 | -1 |
Sets the resource_type of this Store. | def resource_type(self, resource_type):
if self.local_vars_configuration.client_side_validation and resource_type is None: # noqa: E501
raise ValueError("Invalid value for `resource_type`, must not be `None`") # noqa: E501
allowed_values = ["store"] # noqa: E501
if self.local_vars... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_type(self, resource_type):\n\n self._resource_type = resource_type",
"def resource_type(self, resource_type):\n\n self._resource_type = resource_type",
"def resource_type(self, resource_type):\n\n self._resource_type = resource_type",
"def resource_type(self, resource_type):... | [
"0.86240023",
"0.86240023",
"0.86240023",
"0.86240023",
"0.7338772",
"0.69725984",
"0.6678329",
"0.6551751",
"0.6551751",
"0.65448344",
"0.65447205",
"0.64974",
"0.6358008",
"0.63285065",
"0.63285065",
"0.62742484",
"0.62742484",
"0.62742484",
"0.62742484",
"0.62742484",
"0.6... | 0.8245621 | 4 |
Sets the id of this Store. | def id(self, id):
if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501
raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
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 setID(self, id):\n self._id = id\n return self.callRemote('setID', id)",
"def id... | [
"0.7907811",
"0.78843355",
"0.77982295",
"0.77058196",
"0.7621136",
"0.754381",
"0.753061",
"0.753061",
"0.753061",
"0.75291526",
"0.75046504",
"0.75046504",
"0.75046504",
"0.75046504",
"0.75046504",
"0.75046504",
"0.75046504",
"0.75046504",
"0.75046504",
"0.75046504",
"0.750... | 0.0 | -1 |
Sets the name of this Store. | def name(self, name):
if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(self, name):\n self._name = name",
"def set_name(self, name: str):\n self._name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name... | [
"0.81576943",
"0.8135313",
"0.80709887",
"0.80709887",
"0.80709887",
"0.80709887",
"0.80709887",
"0.80563974",
"0.798304",
"0.79656994",
"0.7939258",
"0.7931816",
"0.7931816",
"0.78667134",
"0.78667134",
"0.7858379",
"0.77976096",
"0.77955943",
"0.77874064",
"0.77874064",
"0.... | 0.0 | -1 |
Sets the chain_id of this Store. | def chain_id(self, chain_id):
if self.local_vars_configuration.client_side_validation and chain_id is None: # noqa: E501
raise ValueError("Invalid value for `chain_id`, must not be `None`") # noqa: E501
allowed_values = ["kcitymarket", "ksupermarket", "kmarket", "nokm", "kmyllypuro"] # no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_chain_id(self, chain_id):\n assert isinstance(chain_id, str)\n for atm in self.iter_alt_loc():\n atm.chain_id = chain_id",
"def set_chain_id(self, chain_id):\n assert isinstance(chain_id, str)\n self.chain_id = chain_id\n\n for frag in self.iter_fragments():\... | [
"0.8206772",
"0.81620795",
"0.80925614",
"0.7693511",
"0.75942457",
"0.6473633",
"0.60571414",
"0.60111403",
"0.5637565",
"0.56149256",
"0.55096316",
"0.55053407",
"0.5421371",
"0.5402196",
"0.53709364",
"0.53217435",
"0.5311686",
"0.52557963",
"0.5228715",
"0.5228715",
"0.51... | 0.7845837 | 3 |
Sets the chainless_name of this Store. | def chainless_name(self, chainless_name):
if self.local_vars_configuration.client_side_validation and chainless_name is None: # noqa: E501
raise ValueError("Invalid value for `chainless_name`, must not be `None`") # noqa: E501
self._chainless_name = chainless_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def payee_name(self, payee_name):\n\n self._payee_name = payee_name",
"def bag_store_name(self, bag_store_name):\n self._bag_store_name = bag_store_name",
"def name_lt(self, name_lt):\n\n self._name_lt = name_lt",
"def name_lt(self, name_lt):\n\n self._name_lt = name_lt",
"def n... | [
"0.57843184",
"0.574307",
"0.57156235",
"0.57156235",
"0.57156235",
"0.5697522",
"0.56938577",
"0.5589818",
"0.5589367",
"0.5564885",
"0.5564885",
"0.5557617",
"0.55232495",
"0.5489957",
"0.5489957",
"0.5489957",
"0.5489957",
"0.5476035",
"0.54643434",
"0.5459666",
"0.5448295... | 0.79591095 | 0 |
Sets the store_url of this Store. | def store_url(self, store_url):
self._store_url = store_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_store(self, store):\n self.store = store",
"def store_id(self, store_id):\n self._store_id = store_id\n return self",
"def setSessionStore(self, store):\n pass",
"def set_url(self, url):\n if url is not None:\n self.url = url",
"def setStoreFile(self, s... | [
"0.7277412",
"0.69013417",
"0.6443822",
"0.6309332",
"0.6260817",
"0.62520427",
"0.6178541",
"0.6100852",
"0.60375935",
"0.5912678",
"0.5878173",
"0.58502275",
"0.5843122",
"0.5838608",
"0.5838608",
"0.5838608",
"0.58214325",
"0.58214325",
"0.58214325",
"0.58214325",
"0.58214... | 0.8621277 | 0 |
Sets the facebook_url of this Store. | def facebook_url(self, facebook_url):
self._facebook_url = facebook_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def facebook(self, facebook):\n\n self._facebook = facebook",
"def store_url(self, store_url):\n\n self._store_url = store_url",
"def set_url(self, url):\n if url is not None:\n self.url = url",
"def set_url(self, url):\n self.url = url",
"def set_callback_url(self, c... | [
"0.7451394",
"0.64548784",
"0.6403968",
"0.6264542",
"0.6178021",
"0.6169172",
"0.61437374",
"0.59905916",
"0.59198505",
"0.5803089",
"0.56586987",
"0.56586987",
"0.56586987",
"0.56586987",
"0.56586987",
"0.56586987",
"0.56586987",
"0.5657963",
"0.5634285",
"0.5586955",
"0.55... | 0.8450506 | 0 |
Sets the post_code of this Store. | def post_code(self, post_code):
self._post_code = post_code | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def postcode(self, postcode):\n\n self._postcode = postcode",
"def postcode(self, postcode):\n\n self._postcode = postcode",
"def postcode(self, postcode):\n\n self._postcode = postcode",
"def zip_post_code(self, zip_post_code):\n\n self._zip_post_code = zip_post_code",
"def pos... | [
"0.8406642",
"0.8406642",
"0.8406642",
"0.76782346",
"0.7138129",
"0.7138129",
"0.7138129",
"0.636026",
"0.636026",
"0.62204677",
"0.58452845",
"0.58027375",
"0.57463694",
"0.5735147",
"0.57157296",
"0.5633661",
"0.56183386",
"0.55307376",
"0.54895484",
"0.5360986",
"0.536098... | 0.8728648 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.