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 |
|---|---|---|---|---|---|---|
Tests that an empty context (with is_admin set to True) can access an image with is_public set to True. | def test_empty_public(self):
self.do_visible(True, None, True, is_admin=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_visible(self, exp_res, img_owner, img_public, **kwargs):\n\n img = FakeImage(img_owner, img_public)\n ctx = context.RequestContext(**kwargs)\n\n self.assertEqual(ctx.is_image_visible(img), exp_res)",
"def test_aws_service_api_private_images_get(self):\n pass",
"def test_aws_s... | [
"0.6889831",
"0.67943805",
"0.67671615",
"0.6649116",
"0.66382194",
"0.6531554",
"0.64865774",
"0.6406382",
"0.6406382",
"0.62943596",
"0.6245481",
"0.62123114",
"0.6179777",
"0.61140406",
"0.6112191",
"0.6104334",
"0.61026704",
"0.6068213",
"0.605546",
"0.6054745",
"0.599086... | 0.65038705 | 6 |
Tests that an empty context (with is_admin set to True) can access an image with is_public set to False. | def test_empty_private(self):
self.do_visible(True, None, False, is_admin=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_visible(self, exp_res, img_owner, img_public, **kwargs):\n\n img = FakeImage(img_owner, img_public)\n ctx = context.RequestContext(**kwargs)\n\n self.assertEqual(ctx.is_image_visible(img), exp_res)",
"def test_aws_service_api_private_images_get(self):\n pass",
"def test_aws_s... | [
"0.6836172",
"0.6736128",
"0.67086965",
"0.6513356",
"0.65056294",
"0.6466665",
"0.64133674",
"0.6399818",
"0.6399818",
"0.63390875",
"0.6302523",
"0.6226055",
"0.61997557",
"0.6121848",
"0.6118551",
"0.6102106",
"0.6089454",
"0.6087831",
"0.6057525",
"0.6023837",
"0.5988064"... | 0.6399744 | 9 |
Tests that an empty context (with is_admin set to True) can not share an image, with or without membership. | def test_empty_shared(self):
self.do_sharable(False, 'pattieblack', None, is_admin=True)
self.do_sharable(False, 'pattieblack', FakeMembership(True),
is_admin=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_un_logged_in_user_can_not_upload_picture(self):\n tmp_file = generate_image_for_testing()\n response = self.client.post(self.user_passport_url,\n data={'passport': tmp_file})\n\n self.assertEqual(403, response.status_code)",
"def test_auth_sharable... | [
"0.6628714",
"0.65942466",
"0.6389793",
"0.63213843",
"0.6221423",
"0.6164767",
"0.6150678",
"0.6041313",
"0.6000155",
"0.5972449",
"0.597103",
"0.5943589",
"0.59278715",
"0.59188557",
"0.59188557",
"0.5916836",
"0.59154505",
"0.5850877",
"0.58333635",
"0.5827698",
"0.5801319... | 0.60693204 | 7 |
Tests that an anonymous context (with is_admin set to False) cannot access an owned image with is_public set to False. | def test_anon_private_owned(self):
self.do_visible(False, 'pattieblack', False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_auth_public_unowned(self):\n self.do_visible(True, 'pattieblack', True, tenant='froggy')",
"def test_auth_private_unowned(self):\n self.do_visible(False, 'pattieblack', False, tenant='froggy')",
"def test_get_user_template_as_anonymous_with_access_right_raises_access_control_error(\n ... | [
"0.7152943",
"0.7109335",
"0.70072263",
"0.69585896",
"0.69585896",
"0.68980104",
"0.6817293",
"0.6704428",
"0.66895926",
"0.64946806",
"0.64736044",
"0.64594865",
"0.645942",
"0.644374",
"0.64420414",
"0.6405941",
"0.6374608",
"0.6368752",
"0.6364217",
"0.6354941",
"0.634457... | 0.6603411 | 9 |
Tests that an empty context (with is_admin set to True) can not share an image, with or without membership. | def test_anon_shared(self):
self.do_sharable(False, 'pattieblack', None)
self.do_sharable(False, 'pattieblack', FakeMembership(True)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_un_logged_in_user_can_not_upload_picture(self):\n tmp_file = generate_image_for_testing()\n response = self.client.post(self.user_passport_url,\n data={'passport': tmp_file})\n\n self.assertEqual(403, response.status_code)",
"def test_auth_sharable... | [
"0.6629645",
"0.6598161",
"0.6393106",
"0.6323076",
"0.62207663",
"0.61628443",
"0.61534476",
"0.6073732",
"0.6038234",
"0.6002864",
"0.5974506",
"0.5970309",
"0.5945625",
"0.5925215",
"0.5923474",
"0.5923474",
"0.59200865",
"0.59187025",
"0.5852431",
"0.58361256",
"0.5830204... | 0.54502434 | 86 |
Tests that an authenticated context (with is_admin set to False) can access an image (which it does not own) with is_public set to True. | def test_auth_public_unowned(self):
self.do_visible(True, 'pattieblack', True, tenant='froggy') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_visible(self, exp_res, img_owner, img_public, **kwargs):\n\n img = FakeImage(img_owner, img_public)\n ctx = context.RequestContext(**kwargs)\n\n self.assertEqual(ctx.is_image_visible(img), exp_res)",
"def test_aws_service_api_private_images_get(self):\n pass",
"def test_aws_s... | [
"0.7225246",
"0.7020056",
"0.7001125",
"0.6687295",
"0.6627152",
"0.6603058",
"0.6603058",
"0.6587212",
"0.6518558",
"0.6515378",
"0.64673233",
"0.63507557",
"0.63226664",
"0.63195735",
"0.6267392",
"0.6243786",
"0.6220447",
"0.62151307",
"0.6181711",
"0.61252385",
"0.6124277... | 0.6331947 | 12 |
Tests that an authenticated context (with is_admin set to False) can access an image with is_public set to False. | def test_auth_private(self):
self.do_visible(True, None, False, tenant='froggy') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_visible(self, exp_res, img_owner, img_public, **kwargs):\n\n img = FakeImage(img_owner, img_public)\n ctx = context.RequestContext(**kwargs)\n\n self.assertEqual(ctx.is_image_visible(img), exp_res)",
"def test_aws_service_api_private_image_get(self):\n pass",
"def test_aws_se... | [
"0.7295332",
"0.69605845",
"0.69604754",
"0.67785037",
"0.66477525",
"0.6625932",
"0.65665686",
"0.6512257",
"0.65008277",
"0.65008277",
"0.6442916",
"0.62628233",
"0.62376827",
"0.6148696",
"0.6145751",
"0.6145588",
"0.61448425",
"0.61161464",
"0.6112119",
"0.60931945",
"0.6... | 0.66329974 | 5 |
Tests that an authenticated context (with is_admin set to False) cannot access an image (which it does not own) with is_public set to False. | def test_auth_private_unowned(self):
self.do_visible(False, 'pattieblack', False, tenant='froggy') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_no_images_unauthorized(self):\n res = self.client.get(IMAGE_URL)\n self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)",
"def test_unauthenticated_resource_allowed(self):\n raise NotImplementedError # FIXME",
"def test_un_logged_in_user_can_not_upload_picture(self):\n... | [
"0.72276163",
"0.69970745",
"0.6978492",
"0.68080735",
"0.6803085",
"0.6803085",
"0.67497104",
"0.6643472",
"0.6630605",
"0.6568257",
"0.65023047",
"0.64936197",
"0.6412895",
"0.6403637",
"0.6389285",
"0.6367777",
"0.6367777",
"0.6348167",
"0.6298395",
"0.6289524",
"0.6269371... | 0.6672808 | 7 |
Tests that an authenticated context (with is_admin set to False) can access an image (which it does own) with is_public set to False. | def test_auth_private_owned(self):
self.do_visible(True, 'pattieblack', False, tenant='pattieblack') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_visible(self, exp_res, img_owner, img_public, **kwargs):\n\n img = FakeImage(img_owner, img_public)\n ctx = context.RequestContext(**kwargs)\n\n self.assertEqual(ctx.is_image_visible(img), exp_res)",
"def test_aws_service_api_private_image_get(self):\n pass",
"def test_aws_se... | [
"0.72539985",
"0.70253825",
"0.7010216",
"0.66228914",
"0.65394044",
"0.652322",
"0.649416",
"0.649245",
"0.649245",
"0.6490199",
"0.6474233",
"0.64500856",
"0.64078796",
"0.6296748",
"0.6282635",
"0.6253098",
"0.6213612",
"0.61675084",
"0.61526585",
"0.60946745",
"0.6082156"... | 0.61762923 | 17 |
Tests that an authenticated context (with is_admin set to False) cannot share an image it neither owns nor is shared with it. | def test_auth_sharable(self):
self.do_sharable(False, 'pattieblack', None, tenant='froggy') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_auth_sharable_cannot_share(self):\n self.do_sharable(False, 'pattieblack', FakeMembership(False),\n tenant='froggy')",
"def cant_share_photo(request, ttl=None,*args, **kwargs):\n\tif ttl:\n\t\ttry:\n\t\t\tttl = int(ttl)\n\t\texcept ValueError:\n\t\t\tttl = None\n\tphoto_id... | [
"0.73269576",
"0.66646326",
"0.662856",
"0.6424367",
"0.6423024",
"0.63863295",
"0.62619466",
"0.6225412",
"0.62130284",
"0.62111557",
"0.62085885",
"0.61964643",
"0.61871755",
"0.60659873",
"0.6040665",
"0.59974575",
"0.59781015",
"0.59628546",
"0.5954561",
"0.59475374",
"0.... | 0.5450656 | 81 |
Tests that an authenticated context (with is_admin set to False) cannot share an image it does not own even if it is shared with it, but with can_share = False. | def test_auth_sharable_cannot_share(self):
self.do_sharable(False, 'pattieblack', FakeMembership(False),
tenant='froggy') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ensure_share(self, context, share, share_server=None):\n pass",
"def ensure_share(self, context, share, share_server=None):\r\n LOG.debug(\"Ensure share.\")",
"def cant_share_photo(request, ttl=None,*args, **kwargs):\n\tif ttl:\n\t\ttry:\n\t\t\tttl = int(ttl)\n\t\texcept ValueError:\n\t\t\ttt... | [
"0.6938848",
"0.6857029",
"0.68210304",
"0.67752564",
"0.6616296",
"0.63722545",
"0.6287799",
"0.6185038",
"0.61454177",
"0.6070145",
"0.6063103",
"0.6063056",
"0.59651726",
"0.5954177",
"0.5950448",
"0.58537835",
"0.5789933",
"0.57651097",
"0.5743968",
"0.57354796",
"0.57342... | 0.74366206 | 0 |
Add vertex to DCEL if it doesn't already exists, otherwise return the existing vertex. | def add_vertex(self, vertex):
try:
vertex_idx = self.vertices.index(vertex)
# print "{} already in {}".format(vertex, self.vertices)
return self.vertices[vertex_idx]
except Exception:
self.vertices.append(vertex)
# print "adding {} to {}".forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_vertex(self, vertex):\n if vertex.id not in self.vertices.keys():\n self.vertices[vertex.id] = vertex",
"def _add_vertex(self, x, y):\n v = Vertex2(x, y)\n i = bisect(self.vertices, v)\n \n # if vertex at these coordinates exists just return it\n if le... | [
"0.7698422",
"0.75747514",
"0.7562474",
"0.75239784",
"0.7504211",
"0.7403369",
"0.7356343",
"0.7279313",
"0.71772546",
"0.7124853",
"0.70904213",
"0.7066278",
"0.7066278",
"0.7043618",
"0.70346177",
"0.7016917",
"0.69948727",
"0.6946342",
"0.6899464",
"0.6882716",
"0.6859618... | 0.8166046 | 0 |
Return all faces where the circumcentre is not infinity. | def get_bounded_faces(self):
return [face for face in self.faces if face.is_bounded()] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def faces_only(self):\n return self._faces_only",
"def get_filtered_faces(self, faces):\n filtered_faces = []\n for face in faces:\n i, j, k = face\n thresh = 100.0\n if self.get_distance_between_points(i, j) > thresh:\n continue\n e... | [
"0.6049252",
"0.6032412",
"0.5654293",
"0.5523289",
"0.55073357",
"0.5405898",
"0.5375053",
"0.53417516",
"0.52805036",
"0.52619165",
"0.52610266",
"0.5258601",
"0.5257462",
"0.5247194",
"0.5216561",
"0.52134645",
"0.5212665",
"0.5200357",
"0.5186478",
"0.51604086",
"0.515638... | 0.5622148 | 3 |
Add a face to DCEL if it doesn't already exists, otherwise return the existing face. | def add_face(self, face):
try:
face_idx = self.faces.index(face)
return self.faces[face_idx]
except Exception:
self.faces.append(face)
return face | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_face(self, face):\n\n if face.uuid is None:\n face.uuid = self._generate_uuid()\n\n if face.uuid in self._faces:\n error_str = \"Trying to add an already existing face with uuid: \"\\\n + str(face.uuid)\n raise KeyError(error_str)\n\n sel... | [
"0.7516604",
"0.62119764",
"0.61790365",
"0.5979341",
"0.5872748",
"0.5751965",
"0.5587595",
"0.539488",
"0.5394591",
"0.5375931",
"0.53083056",
"0.5234154",
"0.52226603",
"0.5124483",
"0.5124483",
"0.5102945",
"0.50553864",
"0.5042418",
"0.5035193",
"0.502191",
"0.5008115",
... | 0.8184843 | 0 |
Return the dual of the current DCEL. | def dual(self):
def set_twins():
for edge_idx in range(0, len(dual_dcel.edges), 2):
dual_dcel.edges[edge_idx].twin = dual_dcel.edges[edge_idx + 1]
dual_dcel.edges[edge_idx + 1].twin = dual_dcel.edges[edge_idx]
def set_next_and_previous():
for face... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dual(self):\n return dual_array(self)",
"def getdualobj(self,whichsol_):\n dualobj_ = ctypes.c_double()\n res = __library__.MSK_XX_getdualobj(self.__nativep,whichsol_,ctypes.byref(dualobj_))\n if res != 0:\n _,msg = self.__getlasterror(res)\n raise Error(rescode(res),msg)\n dualo... | [
"0.68338317",
"0.6423258",
"0.5941094",
"0.5921593",
"0.57853687",
"0.57633495",
"0.5762203",
"0.57469624",
"0.5682356",
"0.5682002",
"0.5639214",
"0.5613858",
"0.55889916",
"0.55681217",
"0.5535743",
"0.5530557",
"0.55077",
"0.54985017",
"0.5457592",
"0.54481125",
"0.5441906... | 0.6778644 | 1 |
Printfriendly representation of the DCEL object. | def __repr__(self):
return (
'<DCEL ('
'vertices:\n {obj.vertices},\n'
'edges:\n {obj.edges},\n'
'faces:\n {obj.faces}>'.format(obj=self)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self):\n cls = self.__class__.__name__\n return '%s(%s)' % (cls, repr(self.d))",
"def __str__(self):\n result=\"curv %f d0 %f z0 %f ctheta %f phi %f barcode %d\"%(self.curv,self.d0,self.z0,self.ctheta,self.phi,self.barcode)\n return result",
"def printObj(self):\n ... | [
"0.71572053",
"0.70599174",
"0.70522857",
"0.69488704",
"0.69239604",
"0.6836956",
"0.6819858",
"0.6812137",
"0.6802802",
"0.6789431",
"0.6776764",
"0.6766797",
"0.6753627",
"0.6751448",
"0.6745186",
"0.67189395",
"0.6699513",
"0.6692117",
"0.6681709",
"0.6676318",
"0.6663971... | 0.74030674 | 0 |
Add padding for unet of given depth | def _pad(x, depth=4):
divisor = np.power(2, depth)
remainder = x.shape[0] % divisor
# no padding because already of even shape
if remainder == 0:
return x
# add zero rows after 1D feature
elif len(x.shape) == 2:
return np.pad(x, [(0, divisor - remainder), (0, 0)], "constant")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def space_to_depth_fixed_padding(inputs, kernel_size,\n data_format='channels_last', block_size=2):\n pad_total = kernel_size - 1\n pad_beg = (pad_total // 2 + 1) // block_size\n pad_end = (pad_total // 2) // block_size\n return _padding(inputs, (pad_beg, pad_end), data_format)"... | [
"0.66942734",
"0.6406283",
"0.61821586",
"0.6131536",
"0.5901226",
"0.5837195",
"0.57383364",
"0.56973714",
"0.56866306",
"0.56743133",
"0.56252444",
"0.551921",
"0.55042475",
"0.5423706",
"0.5403531",
"0.54034203",
"0.5395218",
"0.53895396",
"0.538164",
"0.5379684",
"0.53743... | 0.69494796 | 0 |
Returns the q'th percentile of the distribution given in the argument 'data'. Uses the 'precision' parameter to control the noise level. | def Quantile(data, q, precision=1.0):
N, bins = np.histogram(data, bins=precision*np.sqrt(len(data)))
norm_cumul = 1.0*N.cumsum() / len(data)
for i in range(0, len(norm_cumul)):
if norm_cumul[i] > q:
return bins[i] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Quartiles(data):\n q = np.percentile(data, [25, 50, 75])\n\n return q[0], q[1], q[2]",
"def test__quantile(self):\r\n # regular cases\r\n sample_data = array(range(25, 42))\r\n assert_almost_equal(_quantile(sample_data, 0.5), median(sample_data))\r\n\r\n # sorted data is ass... | [
"0.72270185",
"0.7012418",
"0.6803648",
"0.67029893",
"0.67029893",
"0.669614",
"0.6685391",
"0.65556973",
"0.65500534",
"0.65500534",
"0.65500534",
"0.64803755",
"0.64564687",
"0.64286137",
"0.64046985",
"0.6381233",
"0.6363074",
"0.636056",
"0.6354891",
"0.63055617",
"0.626... | 0.7864236 | 0 |
Return true if light is on. | def is_on(self):
return self._is_on | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def light_is_on(self):\r\n return self._light == \"ON\"",
"def light_is_on(self):\n return self._light == \"ON\"",
"def is_on(self):\n return self._light_on",
"def is_light(self) -> bool:\n return ATTRIBUTE.Light.value in self.type_data.attributes",
"def is_light(self) -> bool:\... | [
"0.9035416",
"0.89275813",
"0.86664206",
"0.8008696",
"0.8008696",
"0.78880787",
"0.7866302",
"0.7610281",
"0.7565963",
"0.7415077",
"0.7345493",
"0.7335999",
"0.73116577",
"0.7303292",
"0.72991306",
"0.7243393",
"0.71792775",
"0.71722543",
"0.7157757",
"0.7157757",
"0.715775... | 0.67288214 | 71 |
Instruct the light to turn off. | def turn_off(self, **kwargs: Any) -> None:
self._device.power_on = False
_LOGGER.debug("Turn off light %s", self._device.ip) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def turn_off(self):\n GPIO.output(self.gpio, False) # turn off light",
"def set_light_off(self):\n self._light = \"OFF\"",
"def set_light_off(self):\r\n self._light = \"OFF\"",
"def lightning_turnoff(self):\n self.turnOff()",
"def turn_off(self, **kwargs: Any) -> None:\n ... | [
"0.9141917",
"0.89695406",
"0.89557284",
"0.89015293",
"0.8897358",
"0.8873913",
"0.8805522",
"0.87862444",
"0.86670524",
"0.86476165",
"0.847877",
"0.8473624",
"0.84669805",
"0.8463841",
"0.8435901",
"0.8370482",
"0.83494097",
"0.8275936",
"0.82717854",
"0.82705396",
"0.8253... | 0.87764317 | 8 |
Calculate dawn time in the UTC timezone. | def dawn_utc(self, date, latitude, longitude):
julianday = self._julianday(date.day, date.month, date.year)
if latitude > 89.8:
latitude = 89.8
if latitude < -89.8:
latitude = -89.8
t = self._jday_to_jcentury(julianday)
eqti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dawn(self, date=None, local=True):\n\n if self.astral is None:\n self.astral = Astral()\n\n if date is None:\n date = datetime.date.today()\n\n dawn = self.astral.dawn_utc(date, self.latitude, self.longitude)\n\n if local:\n return dawn.astimezone(se... | [
"0.628965",
"0.59754497",
"0.58763033",
"0.5851417",
"0.5806555",
"0.5735901",
"0.56585526",
"0.56538594",
"0.55857354",
"0.55760634",
"0.5519843",
"0.55160165",
"0.55128175",
"0.55116653",
"0.53910935",
"0.5379949",
"0.536428",
"0.5360612",
"0.53601545",
"0.5338035",
"0.5333... | 0.76470286 | 0 |
Calculate solar noon time in the UTC timezone. | def solar_noon_utc(self, date, longitude):
julianday = self._julianday(date.day, date.month, date.year)
newt = self._jday_to_jcentury(julianday + 0.5 + longitude / 360.0)
eqtime = self._eq_of_time(newt)
timeUTC = 720.0 + (longitude * 4.0) - eqtime
timeUTC = timeUTC/60... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solar_noon(self, date=None, local=True):\n \n if self.astral is None:\n self.astral = Astral()\n\n if date is None:\n date = datetime.date.today()\n\n noon = self.astral.solar_noon_utc(date, self.longitude)\n\n if local:\n return noon.astimezo... | [
"0.6777714",
"0.6724988",
"0.6343755",
"0.626581",
"0.62460506",
"0.59971875",
"0.59616363",
"0.594989",
"0.5928303",
"0.5893481",
"0.5877765",
"0.58015263",
"0.5749765",
"0.5749219",
"0.5719723",
"0.571865",
"0.571865",
"0.56694263",
"0.5617303",
"0.5612241",
"0.56063336",
... | 0.74279106 | 0 |
Calculate sunset time in the UTC timezone. | def sunset_utc(self, date, latitude, longitude):
julianday = self._julianday(date.day, date.month, date.year)
t = self._jday_to_jcentury(julianday)
eqtime = self._eq_of_time(t)
solarDec = self._sun_declination(t)
try:
hourangle = self._hour_angle_sunset(lat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sunset(self, date=None, local=True):\n \n if self.astral is None:\n self.astral = Astral()\n\n if date is None:\n date = datetime.date.today()\n\n sunset = self.astral.sunset_utc(date, self.latitude, self.longitude)\n\n if local:\n return suns... | [
"0.65699303",
"0.64950114",
"0.63881093",
"0.61808205",
"0.61730003",
"0.6134258",
"0.60923696",
"0.60374415",
"0.60219973",
"0.5875478",
"0.5835468",
"0.5818931",
"0.5818664",
"0.58087045",
"0.5799634",
"0.57659054",
"0.57374483",
"0.5717565",
"0.5715173",
"0.5711675",
"0.57... | 0.74293166 | 0 |
Calculate dusk time in the UTC timezone. | def dusk_utc(self, date, latitude, longitude):
julianday = self._julianday(date.day, date.month, date.year)
if latitude > 89.8:
latitude = 89.8
if latitude < -89.8:
latitude = -89.8
t = self._jday_to_jcentury(julianday)
eqti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def utcTime():\r\n return calendar.timegm(time.gmtime())",
"def _get_tz():\n return 'UTC'",
"def get_time():\n\teastern = timezone('US/Eastern')\n\tnow = datetime.datetime.now(eastern).time()\n\treturn(now)",
"def timezone():\n \n pass",
"def nowUTC():\n return datetime.datetime.now(pytz.utc)... | [
"0.69508314",
"0.6756243",
"0.646933",
"0.64476836",
"0.64054435",
"0.6378315",
"0.6367498",
"0.6344899",
"0.630024",
"0.6293508",
"0.62492496",
"0.62225604",
"0.6172558",
"0.615256",
"0.6152383",
"0.6115891",
"0.61116207",
"0.610577",
"0.6104182",
"0.6066876",
"0.606603",
... | 0.7123817 | 0 |
Calculate ruhakaalam times in the UTC timezone. | def rahukaalam_utc(self, date, latitude, longitude):
if date is None:
date = datetime.date.today()
try:
sunrise = self.sunrise_utc(date, latitude, longitude)
sunset = self.sunset_utc(date, latitude, longitude)
except:
raise AstralError('S... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rahukaalam(self, date=None, local=True):\n\n if self.astral is None:\n self.astral = Astral()\n\n if date is None:\n date = datetime.date.today()\n\n rahukaalam = self.astral.rahukaalam_utc(date, self.latitude, self.longitude)\n\n if local:\n for key... | [
"0.6330134",
"0.61681116",
"0.60523003",
"0.59781736",
"0.5969716",
"0.56076247",
"0.55986744",
"0.55825686",
"0.5552908",
"0.5434768",
"0.53342485",
"0.53334755",
"0.53267014",
"0.5321076",
"0.5287703",
"0.5276938",
"0.5276938",
"0.5272016",
"0.52586037",
"0.5246418",
"0.522... | 0.6230036 | 1 |
Calculate the azimuth of the sun in the UTC timezone. | def solar_azimuth(self, dateandtime, latitude, longitude):
if latitude > 89.8:
latitude = 89.8
if latitude < -89.8:
latitude = -89.8
zone = -dateandtime.utcoffset().seconds / 3600.0
utc_datetime = dateandtime.astimezone(pytz.utc)
tim... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solar_azimuth(self, dateandtime=None):\n\n if self.astral is None:\n self.astral = Astral()\n\n if dateandtime is None:\n dateandtime = datetime.datetime.now(tz=self.tz)\n \n return self.astral.solar_azimuth(dateandtime, self.latitude, self.longitude)",
"... | [
"0.67131555",
"0.6504118",
"0.64523375",
"0.6439935",
"0.6436878",
"0.641925",
"0.6345609",
"0.6120051",
"0.6109093",
"0.6081307",
"0.6055947",
"0.6041341",
"0.6014488",
"0.5996403",
"0.5920246",
"0.5873155",
"0.586566",
"0.5822988",
"0.58073103",
"0.5778373",
"0.573385",
"... | 0.6639568 | 1 |
Calculate the elevation of the sun. | def solar_elevation(self, dateandtime, latitude, longitude):
if latitude > 89.8:
latitude = 89.8
if latitude < -89.8:
latitude = -89.8
zone = -dateandtime.utcoffset().seconds / 3600.0
utc_datetime = dateandtime.astimezone(pytz.utc)
timen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def elevation(self):\n return self.altitude - self.heightAboveGround",
"def elevation(x, y):\n file = os.path.abspath(\"..\") + \"\\Shape\\Shape.vrt\"\n layer = gdal.Open(file)\n gt = layer.GetGeoTransform()\n rasterx = int((x - gt[0]) / gt[1])\n rastery = int((y - gt[3]) / gt[5])\n prin... | [
"0.6999895",
"0.668499",
"0.6425622",
"0.6422953",
"0.6396147",
"0.6377398",
"0.63741803",
"0.61598486",
"0.61377054",
"0.61298066",
"0.5996655",
"0.59889287",
"0.5973628",
"0.58740777",
"0.58685416",
"0.5855382",
"0.58081555",
"0.57917005",
"0.5758174",
"0.5704655",
"0.57044... | 0.5579604 | 27 |
returns ghost layer width. | def ghosts(self):
return self.mesh.discretization.ghosts | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_width(self):\n\t\treturn len(self._background) if self._background else 0",
"def get_dimension_width(self):\n pass",
"def width(self) -> int:\n return self._obj[self.x_dim].size",
"def getWidth(self):\n return _libsbml.Dimensions_getWidth(self)",
"def getWidth(self):\n r... | [
"0.74909455",
"0.73224",
"0.71234566",
"0.7045834",
"0.69717586",
"0.6938515",
"0.69376487",
"0.693364",
"0.693364",
"0.69244164",
"0.692004",
"0.68859637",
"0.6870889",
"0.6870504",
"0.6858993",
"0.6841644",
"0.68349195",
"0.68349195",
"0.68349195",
"0.6833873",
"0.68273956"... | 0.0 | -1 |
returns id of the task that owns this topology | def task_id(self):
return self._mpis.task_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def task_id(self):\n return self._task_id",
"def task_id(self):\n return self._task_id",
"def task_id(self):\n return self._task_id",
"def task_id(self):\n return self._task_id",
"def taskid(self):\n raise NotImplementedError('Must be implemented by subclass.')",
"def t... | [
"0.75476515",
"0.75476515",
"0.75476515",
"0.75476515",
"0.7357828",
"0.72557056",
"0.7198645",
"0.6637944",
"0.6620676",
"0.65653884",
"0.6474",
"0.6436455",
"0.63189775",
"0.6293882",
"0.6293882",
"0.62764555",
"0.6194142",
"0.61492884",
"0.6114325",
"0.611248",
"0.60441566... | 0.75019264 | 4 |
Comparison of two topologies. Two topos are equal if they have the same mesh, shape and domain. | def __eq__(self, other):
if self.__class__ != other.__class__:
return False
return self.mesh == other.mesh and \
npw.equal(self.shape, other.shape).all() and \
self.domain == other.domain | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def have_same_topology(first_mesh, second_mesh):\n return attr_has_same_shape(first_mesh, second_mesh, \"v\") and attr_is_equal(\n first_mesh, second_mesh, \"f\"\n )",
"def equivalent(kls, first, second):\n if first.empty() and second.empty():\n return True\n elif first.vertices.shape[0] ... | [
"0.7391109",
"0.69211054",
"0.66308445",
"0.6267532",
"0.6095765",
"0.5980267",
"0.5966569",
"0.5945673",
"0.59418166",
"0.5940273",
"0.59177405",
"0.5912851",
"0.59052336",
"0.59029365",
"0.5899751",
"0.5899751",
"0.589094",
"0.587771",
"0.58488256",
"0.5842145",
"0.5818348"... | 0.651133 | 3 |
Not equal operator. Seems to be required in addition to __eq__ to avoid 'cornercase' behaviors. | def __ne__(self, other):
result = self.__eq__(other)
if result is NotImplemented:
return result
return not result | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other):\n return not (self == other) # opposite of __eq__",
"def __ne__(self, other):\n return not (self == other) # opposite of __eq__",
"def __ne__(self, rhs):\n return not self.__eq__(rhs)",
"def __ne__(self, other):\r\n return not self.__eq__... | [
"0.8394335",
"0.8386683",
"0.8160081",
"0.81121725",
"0.81121725",
"0.81121725",
"0.81121725",
"0.8075682",
"0.80685496",
"0.80672383",
"0.8056072",
"0.8056072",
"0.8056072",
"0.8056072",
"0.8056072",
"0.8056072",
"0.8056072",
"0.8056072",
"0.8056072",
"0.8056072",
"0.8056072... | 0.0 | -1 |
True if ghost layer length is not zero. | def has_ghosts(self):
return not np.all(self.mesh.discretization.ghosts == 0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def empty(self):\n return len(self.layers) == 0",
"def is_empty(self):\n return ch.prod(ch.tensor(self.x.shape)).item() == 0",
"def is_ghost(self):\n\t\treturn False",
"def is_trivial(self):\n return self.dims == 0",
"def is_empty(self) -> bool:\n return self.num_grna() == 0",
... | [
"0.7561698",
"0.72112876",
"0.7065583",
"0.7046145",
"0.7030016",
"0.69214237",
"0.6830907",
"0.6792221",
"0.67822015",
"0.67809653",
"0.67568576",
"0.6733361",
"0.6685363",
"0.6656976",
"0.6638194",
"0.6637561",
"0.6615059",
"0.660577",
"0.65900713",
"0.6586594",
"0.658374",... | 0.72264445 | 1 |
return the id of the present topology. This id is unique among all defined topologies. | def get_id(self):
return self.__id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_id(self) -> str:\n return str(self.coordinator.gios.station_id)",
"def topology_name(self):\n return self._topology_name",
"def topology(self):\n return self._topology",
"def portlet_id(self):\n return id(self)",
"def establish_id(self):\n if self.config.node_i... | [
"0.69869524",
"0.66642356",
"0.6493194",
"0.6485879",
"0.64025915",
"0.63910806",
"0.6356197",
"0.62523925",
"0.62455714",
"0.62014794",
"0.6190886",
"0.61564124",
"0.6125926",
"0.60740584",
"0.6072235",
"0.60693944",
"0.60588557",
"0.6046706",
"0.60322815",
"0.60287",
"0.602... | 0.0 | -1 |
True if target and current object are equal and have the same parent. Equal means same mesh, same shape and same domain. | def is_consistent_with(self, target):
same_parent = self.parent() == target.parent()
# Note FP. Is it really required to have the
# same parent? Inclusion of all proc may be enough?
return npw.equal(self.shape, target.shape).all() and same_parent | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n if self.__class__ != other.__class__:\n return False\n return self.mesh == other.mesh and \\\n npw.equal(self.shape, other.shape).all() and \\\n self.domain == other.domain",
"def __eq__(self, other):\n parent_same = self.parent1.ri... | [
"0.70844996",
"0.66548616",
"0.66513604",
"0.6646044",
"0.64481336",
"0.6433953",
"0.63558435",
"0.63483995",
"0.6299958",
"0.6295003",
"0.62756413",
"0.6267289",
"0.6267289",
"0.6267289",
"0.6267289",
"0.6267289",
"0.626677",
"0.62649465",
"0.62575334",
"0.6204619",
"0.62005... | 0.7603044 | 0 |
Calculate cumulative probability from a list of probabilities | def cum_sum_prob(prob_dict):
if not math.isclose(sum(prob_dict.values()), 1, rel_tol=1e-3):
ValueError('Input probabilities do not sum to 1.')
out = []
cur_sum = 0
for k, v in prob_dict.items():
cur_sum += v
out.append((k, cur_sum))
return out | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cumulative_probability_distribution(self):\n return list(accumulate(self.probability_distribution()))",
"def cumprob(self):\r\n return self.probabilities.cumsum(-1)",
"def custom_pdf(self, cum_probs, values):\n rnd_num = random()\n for p in range(len(cum_probs)):\n if... | [
"0.7402393",
"0.6922577",
"0.6584128",
"0.6549101",
"0.65145403",
"0.63271004",
"0.62952936",
"0.6243871",
"0.6198528",
"0.6177253",
"0.61713296",
"0.6147572",
"0.6130507",
"0.61138874",
"0.610889",
"0.60820377",
"0.60630465",
"0.6000701",
"0.59468305",
"0.5934774",
"0.592816... | 0.68047005 | 2 |
Find the difference in unique counts of two distributions and return as percentage | def compute_unique_count_drift(df_prob, ref_df_prob):
df_diff = set(df_prob.keys()) - set(ref_df_prob.keys())
ref_df_diff = set(ref_df_prob.keys()) - set(df_prob.keys())
return sum([df_prob[k] for k in df_diff] + [ref_df_prob[k] for k in ref_df_diff]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _distr_stat(col1, col2, f):\n bin_threshold = 10\n vcs1, col1_len = col1.value_counts().to_dict(), float(len(col1))\n vcs1[\"_Empty_\"] = sum(col1.map(lambda x: is_null_flag(x)))\n vcs2, col2_len = col2.value_counts().to_dict(), float(len(col2))\n vcs2[\"_Empty_\"] = sum(col2.map(lambda x: is_nu... | [
"0.6724862",
"0.6445435",
"0.6334011",
"0.6307524",
"0.62770367",
"0.6188019",
"0.61835897",
"0.6182407",
"0.6136989",
"0.60972196",
"0.60946876",
"0.6093589",
"0.60753244",
"0.6063225",
"0.60029024",
"0.5996274",
"0.5993236",
"0.5984397",
"0.5978963",
"0.59674275",
"0.596382... | 0.62579167 | 5 |
Compute drift score as the percentage of overlapping probabilities | def compute_drift_score(ref_col_prob, col_prob):
return sum(abs(np.asarray(ref_col_prob) - np.array(col_prob)) * 100) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate(self):\n\n gt = self.ground_truth.flatten().astype(np.int8)\n seg = self.segmentation.flatten().astype(np.int8)\n\n probability_difference = np.absolute(gt - seg).sum()\n probability_joint = (gt * seg).sum()\n\n if probability_joint != 0:\n return probabi... | [
"0.6732613",
"0.6518283",
"0.6426524",
"0.6424136",
"0.6334499",
"0.6254541",
"0.6188233",
"0.61744064",
"0.6095827",
"0.6077343",
"0.6045876",
"0.5990594",
"0.5986692",
"0.59864265",
"0.59614843",
"0.5960128",
"0.5936167",
"0.5935803",
"0.59078395",
"0.590509",
"0.58760846",... | 0.7712985 | 0 |
take 1D float array of rewards and compute discounted reward | def discount_rewards(self, r, gamma):
discounted_r = np.zeros_like(r)
running_add = 0
for t in reversed(range(0, r.size)):
if r[t] != 0:
running_add = 0 # reset the sum, since this was a game boundary (pong specific!)
running_add = running_add * gamma + r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def discount_rewards(rewards):\r\n discounted_r = np.zeros_like(rewards)\r\n running_add = 0\r\n for t in reversed(range(0, len(rewards))): \r\n running_add = running_add * reward_discount + rewards[t]\r\n discounted_r[t] = running_add\r\n return discounted_r",
"def discoun... | [
"0.8100923",
"0.78397125",
"0.7792625",
"0.7742053",
"0.7653779",
"0.75987715",
"0.7583268",
"0.75820553",
"0.7579539",
"0.7536054",
"0.7519005",
"0.75047183",
"0.7467692",
"0.7456702",
"0.7433794",
"0.7426565",
"0.74062765",
"0.73950297",
"0.7370545",
"0.73564714",
"0.732851... | 0.69414437 | 29 |
Gets the x coordinate of this atom. Returns | def get_x(self):
return self.coords[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Getxcoord(self):\n return self.x_coord",
"def _get_x(self):\n return self.position.x",
"def getXCoordinate(self) -> float:\n return self.x_coord",
"def get_x_position(self):\n return self.actual_coordinates[0]",
"def x(self):\n return self._coords[0]",
"def get_pos_... | [
"0.8656004",
"0.8442269",
"0.84205234",
"0.83736426",
"0.8353082",
"0.83035123",
"0.82412916",
"0.8212211",
"0.82038295",
"0.81553376",
"0.8097587",
"0.80942667",
"0.7829044",
"0.78141165",
"0.78131527",
"0.7794782",
"0.7767253",
"0.77473986",
"0.773306",
"0.76320076",
"0.762... | 0.8588003 | 1 |
Gets the y coordinate of this atom. Returns | def get_y(self):
return self.coords[1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def y(self):\n return self._coords[1]",
"def y(self):\n return _libsbml.Point_y(self)",
"def getYCoordinate(self) -> float:\n return self.y_coord",
"def getY(self):\n return self.__y",
"def GetY(self):\r\n\r\n return self._y",
"def getY(self):\r\n\t\treturn self._y",
... | [
"0.85608596",
"0.8548253",
"0.8522086",
"0.84701955",
"0.84196323",
"0.8416182",
"0.8400373",
"0.8396566",
"0.8396566",
"0.8329309",
"0.8296547",
"0.82906246",
"0.8284484",
"0.82126814",
"0.8207803",
"0.8192792",
"0.81803006",
"0.79841197",
"0.795317",
"0.7928298",
"0.7902805... | 0.8524346 | 2 |
Gets the mass of this atom. Returns | def get_mass(self):
return self.m | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mass(self):\n return self._mass",
"def mass(self):\n return self._mass",
"def get_mass(self):\n _pal.lib.geometry_get_mass.restype = c.c_float\n return _pal.lib.geometry_get_mass(self._geometry)",
"def mass(self):\n return self._getAttribute(Attribute.mass)",
"def getMole... | [
"0.8615101",
"0.8615101",
"0.8449791",
"0.827885",
"0.81125116",
"0.7995724",
"0.7925729",
"0.7887645",
"0.78556985",
"0.78556985",
"0.7763608",
"0.76362807",
"0.7610759",
"0.7542108",
"0.735307",
"0.7303788",
"0.7278605",
"0.7205126",
"0.7170194",
"0.7108265",
"0.7056702",
... | 0.8783727 | 0 |
Gets the euler tensor of this atom. Returns | def get_euler(self):
return array([ coord * self.coords for coord in self.coords ]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def imu_get_euler(self):\n return self.imu.get_euler()",
"def euler_integrator(self, t, y, tau):\n\n return self.plant.rhs(t, y, tau)",
"def getTensor(self):\n\t\treturn self.cur_tensor",
"def get_deltaE(self):\n return self.deltaE",
"def e(self):\n return np.matrix([self.y - se... | [
"0.65126354",
"0.6043174",
"0.59547913",
"0.590338",
"0.5897418",
"0.58401287",
"0.58401287",
"0.5825734",
"0.5797117",
"0.5762484",
"0.572737",
"0.5713381",
"0.5662122",
"0.5651244",
"0.5643783",
"0.56348675",
"0.56310534",
"0.56149095",
"0.56149095",
"0.56149095",
"0.559066... | 0.64894354 | 1 |
Gets the symbol of this atom. Returns | def get_symbol(self):
return self.symbol | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def symbol(self):\n return self._symbol",
"def symbol(self): \n return self.__symbol",
"def symbol_id(self) -> str:\n return self._symbol",
"def getSymbol(self):\n return _libsbml.InitialAssignment_getSymbol(self)",
"def getElementSymbol(self):\n dataDict = self.__dict__\n ... | [
"0.85209036",
"0.8121533",
"0.76356006",
"0.75384325",
"0.73964155",
"0.7318919",
"0.73038465",
"0.7173422",
"0.7173422",
"0.70371056",
"0.69875854",
"0.6953391",
"0.6953391",
"0.6947048",
"0.6933806",
"0.6931096",
"0.68797255",
"0.68131906",
"0.6801363",
"0.6762182",
"0.6737... | 0.85047024 | 1 |
Gets the label of this atom. Returns | def get_label(self):
return self.label | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_label(self):\n\n return self._label",
"def get_label(self):\n return self._label",
"def GetLabel(self):\r\n\r\n return self._label",
"def get_label(self, ):\n return self.attrs.get(self.AttributeNames.LABEL, None)",
"def GetLabel(self) -> str:\n return self._label... | [
"0.844582",
"0.843851",
"0.8382816",
"0.8357652",
"0.8327101",
"0.8326299",
"0.82825094",
"0.8282123",
"0.82630473",
"0.82630473",
"0.82630473",
"0.82630473",
"0.82630473",
"0.82630473",
"0.82630473",
"0.82630473",
"0.82630473",
"0.82630473",
"0.8249067",
"0.8249067",
"0.8157... | 0.8260186 | 19 |
Gets the euclid distance from this atom to the given atom. Returns | def get_euclid_distance_to(self, atom):
return linalg.norm(self.get_coords() - atom.get_coords()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_distance(self) -> int:\n return self.get_measurement_data().distance",
"def distance(cls, atom_1, atom_2):\n\t\t\n\t\treturn np.linalg.norm((atom_1-atom_2).atom_loc)",
"def __get_distance(self, game_object):\n obj_x, obj_y = game_object.get_coordinates()\n self_x, self_y = self._co... | [
"0.66581625",
"0.6649904",
"0.6637657",
"0.6630217",
"0.6601542",
"0.6598605",
"0.6596507",
"0.63966656",
"0.636073",
"0.63055176",
"0.62724113",
"0.62593937",
"0.6219049",
"0.62136334",
"0.62126756",
"0.6210324",
"0.61876845",
"0.61710095",
"0.616928",
"0.61606264",
"0.61590... | 0.8762926 | 0 |
Returns True if the content type is valid. | def is_valid_content_type(cls, content_type: str) -> bool:
return content_type in cls.CONTENT_TYPES.value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _is_valid_ct(content_type: str) -> bool:\n content_type = content_type.strip()\n return _is_valid_regex(CT_CONTENT_TYPE_REGEX_PATTERN, content_type)",
"def _is_valid_content_type_format(content_type: str) -> bool:\n return (\n _is_valid_ct(content_type)\n or _is_valid_pt(content_type)\... | [
"0.7517771",
"0.7417243",
"0.70675975",
"0.6998834",
"0.68573606",
"0.6832993",
"0.67981493",
"0.6714344",
"0.6592863",
"0.6578096",
"0.6575198",
"0.6568513",
"0.6541694",
"0.65321887",
"0.65321887",
"0.6491889",
"0.6491021",
"0.6470095",
"0.6450657",
"0.63938487",
"0.6392137... | 0.8173388 | 0 |
Setup the Binary Sensor platform fo EnOcean. | def setup_platform(hass, config, add_devices, discovery_info=None):
dev_id = config.get(CONF_ID, None)
devname = config.get(CONF_NAME, "EnOcean binary sensor")
add_devices([EnOceanBinarySensor(dev_id, devname)]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_platform(\n hass: HomeAssistant,\n config: ConfigType,\n add_entities: AddEntitiesCallback,\n discovery_info: DiscoveryInfoType | None = None,\n) -> None:\n if discovery_info is None:\n return\n binary_sensors = []\n for name in hass.data[DOMAIN]:\n if name in BINARY_SE... | [
"0.6923445",
"0.6406349",
"0.6367884",
"0.630438",
"0.6297725",
"0.62513864",
"0.61724937",
"0.61561346",
"0.61022043",
"0.60586834",
"0.60506696",
"0.60256183",
"0.59961325",
"0.59727365",
"0.59395474",
"0.5925092",
"0.5920433",
"0.5904643",
"0.58785045",
"0.5876473",
"0.587... | 0.7185503 | 0 |
Cache Bitcoin Core `listtransactions` result | def update_txs(self, txs):
# For now avoid caching orphan transactions. We might want to show them somehow in the future.
cli_txs = {tx["txid"]: tx for tx in txs if tx["category"] != "orphan"}
raw_txs = self.cache_raw_txs(cli_txs)
cached_txs = self.cache_txs(raw_txs)
return cach... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_wallets_get_transaction_list(self):\n pass",
"def load_transactions(self, address, update=True, verbose=False, **kwargs):\n if self.apikey is None:\n update = False\n if verbose:\n print('load_transactions', address)\n fn = os.path.join(self.cache_dir, a... | [
"0.7081673",
"0.69549066",
"0.6773823",
"0.66765434",
"0.66569877",
"0.660985",
"0.64810187",
"0.6435633",
"0.6424816",
"0.64240026",
"0.63761234",
"0.63547444",
"0.6330722",
"0.6327416",
"0.6321605",
"0.6307761",
"0.6297964",
"0.6269112",
"0.62622905",
"0.62056416",
"0.61879... | 0.531083 | 95 |
Set the value of a field of this SugarEntry. | def __setitem__(self, field_name, value):
if field_name in self._module._fields.keys():
self._fields[field_name] = value
if field_name not in self._dirty_fields:
self._dirty_fields.append(field_name)
else:
raise AttributeError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_value(self, field, value):\n field = self.find_first(field)\n if field is not None:\n field.value = value",
"def _setValue(self, field, value):\n self._contents[field] = value",
"def setfield(self, field, value):\n self.__setitem__(field, value)",
"def set_entry... | [
"0.80276215",
"0.7663564",
"0.7361043",
"0.698671",
"0.67777884",
"0.6728715",
"0.6728715",
"0.6699535",
"0.6690918",
"0.66474557",
"0.65780324",
"0.65772873",
"0.65541035",
"0.65541035",
"0.65541035",
"0.6483881",
"0.64639485",
"0.64538443",
"0.6433936",
"0.64043486",
"0.637... | 0.5998666 | 55 |
Asks user to specify a city, month, and day to analyze. | def get_filters():
print('Welcome! Let\'s explore some US bikeshare data!')
# TO DO: get user input for city (chicago, new york city, washington). HINT: Use a while loop to handle invalid inputs
while True:
try:
city = input("Enter the name of the city you want to explore the data of (c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Raw_Data(city,month,day):\n print(\"The city you have entered is: \",city)\n print(\"The month you have entered is: \",month)\n print(\"The day you have entered is: \",day)",
"def get_filters():\n city = None\n month = None\n day = None\n while day == None:\n # TO DO: get user input f... | [
"0.66714007",
"0.65354675",
"0.64593667",
"0.6374057",
"0.6348314",
"0.63097656",
"0.62868035",
"0.6259136",
"0.62316",
"0.62130964",
"0.62050414",
"0.6181105",
"0.6171822",
"0.61686903",
"0.6158568",
"0.61582303",
"0.61532456",
"0.61444426",
"0.6131269",
"0.610484",
"0.61025... | 0.58922184 | 44 |
Loads data for the specified city and filters by month and day if applicable. | def load_data(city, month, day):
df = pd.read_csv(CITY_DATA[city])
df['Start Time'] = pd.to_datetime(df['Start Time'])
df['hour'] = df['Start Time'].dt.hour
df['month'] = df['Start Time'].dt.month
df['day_of_week'] = df['Start Time'].dt.weekday_name
#filter by month if needed and create a new fr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_data(city, month, day):\n df = pd.read_csv(CITY_DATA [city])\n \n # convert the Start Time column to datetime\n df['Start Time'] = pd.to_datetime(df['Start Time'])\n \n # extract month and day of week from Start Time to create new columns\n df['month'] = df['Start Time'].dt.month\n ... | [
"0.81320685",
"0.8108889",
"0.8045821",
"0.8042514",
"0.80090284",
"0.80071104",
"0.79991937",
"0.7998333",
"0.7988789",
"0.797905",
"0.79737365",
"0.79610896",
"0.7956163",
"0.7947432",
"0.79463065",
"0.7908287",
"0.7908229",
"0.7904569",
"0.7900715",
"0.78930074",
"0.788921... | 0.7787979 | 37 |
Displays statistics on the most frequent times of travel. | def time_stats(df, month, day):
print('\nCalculating The Most Frequent Times of Travel...\n')
start_time = time.time()
# TO DO: display the most common month
if month == 'all':
most_common_month = df['month'].mode()[0]
print ("The most frequent month of travel is: ", calendar.month_nam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time_stats(df):\n\n print('\\nDisplaying the statistics on the most frequent times of '\n 'travel...\\n')\n start_time = time.time()\n\n # display the most common month\n most_common_month = df['Month'].mode()[0]\n print('For the selected filter, the month with the most travels is: ' +\... | [
"0.80247396",
"0.80233026",
"0.7915788",
"0.78266186",
"0.7822246",
"0.78143597",
"0.77659196",
"0.7740343",
"0.773628",
"0.77344066",
"0.76867086",
"0.7668633",
"0.7651731",
"0.7644636",
"0.76399267",
"0.76367253",
"0.7625196",
"0.7623158",
"0.7612803",
"0.76002145",
"0.7583... | 0.74564284 | 39 |
Displays statistics on the most popular stations and trip. | def station_stats(df):
print('\nCalculating The Most Popular Stations and Trip...\n')
start_time = time.time()
# TO DO: display most commonly used start station
most_common_start_station = df['Start Station'].mode()[0]
print ("The most frequent start station is:\n ->", most_common_start_station)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def station_stats(df):\n\n print('\\nCalculating The Most Popular Stations and Trip...\\n')\n start_time = time.time()\n\n # display most commonly used start station\n print(popular_start_station(df))\n\n # display most commonly used end station\n print(popular_end_station(df))\n\n # display m... | [
"0.7815675",
"0.7662213",
"0.7553417",
"0.74914914",
"0.74748665",
"0.7446617",
"0.7428588",
"0.74237514",
"0.74177027",
"0.7400495",
"0.7387161",
"0.7385634",
"0.73647535",
"0.735934",
"0.73566747",
"0.73548365",
"0.7351854",
"0.7351274",
"0.735057",
"0.73421645",
"0.7340198... | 0.7134921 | 58 |
Displays statistics on the total and average trip duration. | def trip_duration_stats(df):
print('\nCalculating Trip Duration...\n')
start_time = time.time()
# TO DO: display total travel time
total_travel_time = round(np.sum(df['Trip Duration'])/60/60,2)
print ('Total travel time over the selected period (in hours) is: ', total_travel_time)
# TO DO: di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trip_duration_stats(data):\n print('\\nCalculating Trip Duration...\\n')\n start_time = time.time()\n # display total travel time\n total_trip_time= data['Trip Duration'].sum()\n print('The Total Travel Time is {} Hours'. format(total_trip_time/3600))\n # display mean travel time\n avg_tri... | [
"0.814274",
"0.8025143",
"0.80041367",
"0.79496753",
"0.7937415",
"0.79312176",
"0.7926815",
"0.7915187",
"0.79142886",
"0.7908032",
"0.79055744",
"0.7900715",
"0.7891682",
"0.78894734",
"0.7886722",
"0.78851086",
"0.7884266",
"0.7882474",
"0.78738385",
"0.78686154",
"0.78664... | 0.784452 | 32 |
Automatically generate a basename or else use the one provided. | def _gen_basename(param_dict, clargs):
if param_dict['output_basename'] in ['', 'auto']:
return clargs.input_fname.lower().split('.json')[0]
else:
return param_dict['output_basename'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_fullname(basename, _type=None):\n return '{}.{}'.format(basename, extensions.get(_type, None))",
"def _gen_fname(self, basename, cwd=None, suffix=None, change_ext=True, ext=None):\n if not basename:\n msg = \"Unable to generate filename for command %s. \" % self.cmd\n msg... | [
"0.7162985",
"0.71130204",
"0.71064943",
"0.70725805",
"0.70725805",
"0.6988176",
"0.6869497",
"0.6849551",
"0.672568",
"0.6704061",
"0.66934615",
"0.65571934",
"0.6534404",
"0.64742374",
"0.6473847",
"0.646789",
"0.6352444",
"0.6296653",
"0.6274127",
"0.62643063",
"0.6244662... | 0.77820414 | 0 |
Returns True is string is a number. | def is_number(s):
try:
float(s)
return True
except ValueError:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_number(string):\r\n try:\r\n float(string)\r\n return True\r\n except ValueError: return False",
"def is_number(string):\n try:\n float(string)\n return True\n except ValueError:\n return False",
"def is_number(s):\r\n try:\r\n int(s)\r\n r... | [
"0.8850884",
"0.8807396",
"0.87623763",
"0.87143797",
"0.86495125",
"0.86369324",
"0.8611852",
"0.8602863",
"0.85868895",
"0.8556723",
"0.8540039",
"0.846474",
"0.83899784",
"0.83504224",
"0.82912153",
"0.8217023",
"0.81620115",
"0.81181717",
"0.8040893",
"0.8037833",
"0.8027... | 0.8597067 | 10 |
Returns the requested income range view in full detail. | def GetIncomeRangeView(self, request, context):
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getRange(self):\n return self.range",
"def displayActiveRange(selforcls):\n vRange = selforcls.activeRange()\n try:\n vRange = (selforcls.toDisplay(min(vRange)),\n selforcls.toDisplay(max(vRange)))\n except AttributeError:\n pass # toDisp... | [
"0.5824725",
"0.5612662",
"0.55873716",
"0.54605365",
"0.54605365",
"0.5444421",
"0.5324229",
"0.5322225",
"0.5300629",
"0.5277442",
"0.5269223",
"0.5262803",
"0.5230335",
"0.52228105",
"0.5218109",
"0.51848346",
"0.5179088",
"0.51768607",
"0.5176457",
"0.51640767",
"0.515955... | 0.700728 | 0 |
Returns the path to a package or cwd if that cannot be found. | def _get_package_path(name): # 获取 模块包 路径, Flask() 中 引用
try:
return os.path.abspath(os.path.dirname(sys.modules[name].__file__))
except (KeyError, AttributeError):
return os.getcwd() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_package_path():\n package_name = get_package_name()\n return package_name.replace('.', '/')",
"def get_package_dir():\n return Path(__file__).parent",
"def get_packages_path_from_package(package):\n root = finder.get_package_root(package)\n\n if is_built_package(package):\n packag... | [
"0.7696517",
"0.7690331",
"0.74621767",
"0.7385542",
"0.735868",
"0.7233731",
"0.7224455",
"0.68511313",
"0.6845975",
"0.6718231",
"0.66957945",
"0.6695532",
"0.66928047",
"0.6686478",
"0.66783273",
"0.65905523",
"0.6572487",
"0.6560498",
"0.6526827",
"0.6526827",
"0.6525203"... | 0.7207799 | 7 |
AMAZON.FallbackIntent is only available in enUS locale. This handler will not be triggered except in that locale, so it is safe to deploy on any locale. | def fallback_handler(handler_input):
# type: (HandlerInput) -> Response
speech = (
"The {} skill can't help you with that. "
"I can look up a word in the dictionary for you").format(skill_name)
reprompt = ("I can look up a word in the dictionary, "
"Just say any word in Engli... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fall_back_message():\r\n card_title = \"Fallback Message\"\r\n fallback_string = \"Sorry. I couldn't understood it. Please say again.\"\r\n should_end_session = False\r\n session_attributes = { \r\n \"speech_output\": fallback_string,\r\n \r\n ... | [
"0.5877872",
"0.5590493",
"0.54645765",
"0.54645765",
"0.5408452",
"0.5357488",
"0.5357488",
"0.53020567",
"0.52696717",
"0.5181241",
"0.5174385",
"0.5174385",
"0.5167612",
"0.51544356",
"0.5071739",
"0.5060613",
"0.5031619",
"0.49786136",
"0.4932573",
"0.4868343",
"0.4852090... | 0.5607832 | 1 |
Returns the application directory. | def get_appdir():
return APP_PATH | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def app_dir(self):\n return self._app_dir",
"def appdata_dir(self) -> str:\n return os.path.join(self._project_dir, 'appdata')",
"def thisdir():\n if getattr(sys, 'frozen', False):\n # The application is frozen\n return os.path.dirname(sys.executable)\n else:\n # The applic... | [
"0.8366667",
"0.7430168",
"0.73666745",
"0.7327246",
"0.731593",
"0.73079205",
"0.7295801",
"0.7282597",
"0.7222026",
"0.7218878",
"0.72007245",
"0.7196958",
"0.71940666",
"0.7193182",
"0.71729344",
"0.7168441",
"0.7165291",
"0.7127867",
"0.70903516",
"0.70903516",
"0.708375"... | 0.8947229 | 0 |
Return all of the projects for a given Workspace | def getWorkspaceProjects(self, id):
return self.request(Endpoints.WORKSPACES + '/{0}'.format(id) + '/projects') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_projects(self):\n projects = []\n page = 1\n while not len(projects) % 100:\n projects += self._get('/projects?{0}'.format(urllib.urlencode({'per_page': 100, 'page': page})))\n if not projects:\n break\n page += 1\n return projects... | [
"0.74932694",
"0.7458052",
"0.7392975",
"0.73838377",
"0.737569",
"0.7349293",
"0.730423",
"0.7239146",
"0.72044575",
"0.7192277",
"0.71775115",
"0.71413183",
"0.71402687",
"0.713788",
"0.71083647",
"0.7094535",
"0.7094002",
"0.7023004",
"0.6982993",
"0.6981023",
"0.6948548",... | 0.7177935 | 10 |
Fastest way to just consume an iterator. | def consume(iterator):
deque(iterator, maxlen=0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def consume(iterator, n=None):\n # Use functions that consume iterators at C speed.\n if n is None:\n # feed the entire iterator into a zero-length deque\n collections.deque(iterator, maxlen=0)\n else:\n # advance to the empty slice starting at position n\n next(islice(iterator... | [
"0.72329783",
"0.71654475",
"0.67598706",
"0.606488",
"0.60311234",
"0.60123855",
"0.5925557",
"0.592464",
"0.5869508",
"0.5843964",
"0.5843164",
"0.58100826",
"0.57714164",
"0.5746189",
"0.5739034",
"0.5733739",
"0.57284236",
"0.5727265",
"0.5726913",
"0.5722843",
"0.5719147... | 0.7133738 | 2 |
Creates a Flask application. | def _create_app(self, config={}):
app = Flask('signac-dashboard')
app.config.update({
'SECRET_KEY': os.urandom(24),
'SEND_FILE_MAX_AGE_DEFAULT': 300, # Cache control for static files
})
# Load the provided config
app.config.update(config)
# Enab... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_app() -> Flask:\n logger.info('creating flask application')\n app = Flask(\n 'pasta',\n static_url_path='/static',\n static_folder='./static',\n template_folder='./views')\n config.flask.SECRET_KEY = os.urandom(32)\n config.flask.SERVER_NAME = None\n app.config.f... | [
"0.85773337",
"0.84702384",
"0.8426545",
"0.84196174",
"0.84109616",
"0.8407618",
"0.83920527",
"0.8390233",
"0.83386177",
"0.8315099",
"0.83083576",
"0.8303583",
"0.8263485",
"0.8250034",
"0.8220532",
"0.82113147",
"0.82048184",
"0.81779504",
"0.81760377",
"0.8132556",
"0.81... | 0.0 | -1 |
Test the popxl simple addition example | def test_documentation_popxl_addition(self):
filename = "simple_addition.py"
self.run_python(filename, file_dir=working_dir, working_dir=working_dir) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_add_numbers(self):\n self.assertEqual(add(3, 8), 11)",
"def test_add_numbers(self):\n self.assertEqual(add(3, 8), 11)",
"def test_add_numbers(self):\n self.assertEqual(add(3, 8), 11)",
"def test_and_numbers(self):\n self.assertEqual(add(3,8), 11)",
"def test_add_two_num... | [
"0.65502137",
"0.65502137",
"0.65502137",
"0.64431727",
"0.63226366",
"0.6308587",
"0.628632",
"0.6280519",
"0.6253776",
"0.6226606",
"0.62078625",
"0.61861867",
"0.61754084",
"0.6170412",
"0.61692727",
"0.615465",
"0.6137472",
"0.61353207",
"0.6135082",
"0.6111764",
"0.60554... | 0.70790774 | 0 |
Test the popxl simple addition example | def test_documentation_popxl_addition_variable(self):
filename = "tensor_addition.py"
self.run_python(filename, file_dir=working_dir, working_dir=working_dir) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_documentation_popxl_addition(self):\n filename = \"simple_addition.py\"\n self.run_python(filename, file_dir=working_dir, working_dir=working_dir)",
"def test_add_numbers(self):\n self.assertEqual(add(3, 8), 11)",
"def test_add_numbers(self):\n self.assertEqual(add(3, 8), 1... | [
"0.70790774",
"0.65502137",
"0.65502137",
"0.65502137",
"0.64431727",
"0.63226366",
"0.6308587",
"0.628632",
"0.6280519",
"0.6253776",
"0.6226606",
"0.62078625",
"0.61861867",
"0.61754084",
"0.6170412",
"0.61692727",
"0.615465",
"0.6137472",
"0.61353207",
"0.6135082",
"0.6111... | 0.5998734 | 25 |
Sets the inventory_item_group_key of this MigrateListingResponse. | def inventory_item_group_key(self, inventory_item_group_key):
self._inventory_item_group_key = inventory_item_group_key | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def with_group_key(self, group_key):\n self.group_key = group_key\n return self",
"def add_inventory_group(self, key):\n host_dict = {'hosts': [], 'vars': {}}\n self.inventory[key] = host_dict\n return",
"def group_id(self, group_id):\n\n self._group_id = group_id",
... | [
"0.61608106",
"0.5747907",
"0.5501611",
"0.5501611",
"0.5501611",
"0.5501611",
"0.5501611",
"0.5501611",
"0.54646176",
"0.5375903",
"0.53397626",
"0.53107274",
"0.53079605",
"0.53079605",
"0.53079605",
"0.5276046",
"0.5275524",
"0.5234625",
"0.51415646",
"0.5023584",
"0.50226... | 0.8215857 | 0 |
Sets the listing_id of this MigrateListingResponse. | def listing_id(self, listing_id):
self._listing_id = listing_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_listing(request, listing_id):\n listing = get_object_or_404(Listing, pk=listing_id)\n\n listing.delete()\n messages.success(\n request,\n 'Your listing has been removed from the database.')\n\n return redirect(reverse('addlisting'))",
"def update(self, amz_listing):\n ... | [
"0.54151386",
"0.50424653",
"0.49489492",
"0.49403444",
"0.454123",
"0.4485277",
"0.4483447",
"0.44773117",
"0.44772324",
"0.44687784",
"0.4437293",
"0.44051337",
"0.4390934",
"0.4387617",
"0.43608093",
"0.43608093",
"0.4329542",
"0.430929",
"0.4308864",
"0.4278942",
"0.42528... | 0.8304697 | 0 |
Sets the marketplace_id of this MigrateListingResponse. | def marketplace_id(self, marketplace_id):
self._marketplace_id = marketplace_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_AWSMarketplaceId(self, value):\n super(ListOrdersInputSet, self)._set_input('AWSMarketplaceId', value)",
"def registration_marketplace_id(self, registration_marketplace_id):\n\n self._registration_marketplace_id = registration_marketplace_id",
"def listing_id(self, listing_id):\n\n ... | [
"0.68738204",
"0.60930204",
"0.5767067",
"0.5177802",
"0.5172527",
"0.49900728",
"0.49834523",
"0.49834523",
"0.49834523",
"0.49834523",
"0.49759004",
"0.49217004",
"0.4853357",
"0.48184267",
"0.47949788",
"0.47403908",
"0.4719058",
"0.46994156",
"0.46824563",
"0.4669242",
"0... | 0.7607272 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, MigrateListingResponse):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Return a string representation of the data source. | def __repr__(self):
cls_name = self.__class__.__name__
conn_name = str(self._connection)
tbl_name = self._table
return '{0}({1}, table={2!r})'.format(cls_name, conn_name, tbl_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_source_info(self) -> 'outputs.DatasourceResponse':\n return pulumi.get(self, \"data_source_info\")",
"def __repr__(self):\n return f'{self.data.to_string(max_rows = None)}'",
"def __str__(self):\n \n result = [\"rows: \" + str(self.rows),\n \"columns: \"+st... | [
"0.68854165",
"0.6721115",
"0.6685485",
"0.6684266",
"0.6650188",
"0.6645341",
"0.66202325",
"0.65916854",
"0.65053624",
"0.65022147",
"0.64303386",
"0.64116",
"0.63948935",
"0.6373004",
"0.63408643",
"0.63251483",
"0.6323788",
"0.63087815",
"0.62860817",
"0.62860817",
"0.626... | 0.6042121 | 58 |
Normalize value for use as SQLite column name. | def _normalize_column(column):
if not isinstance(column, str):
msg = "expected column of type 'str', got {0!r} instead"
raise TypeError(msg.format(column.__class__.__name__))
column = column.strip()
column = column.replace('"', '""') # Escape quotes.
if column ==... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalize(self, value):\n return str(value)",
"def _normalize_expanded_field(value):\n\n value = value.strip()\n value = re.sub(r'\\s{2,}', ' ', value)\n value = re.sub(r'/{2,}', '/', value)\n value = re.sub(r'\\\\{2,}', '\\\\\\\\', value)\n value = re.sub(r'-{2,}', '-', value)\n val... | [
"0.67484534",
"0.6414139",
"0.64000803",
"0.6394291",
"0.62145936",
"0.62083966",
"0.62030125",
"0.6104114",
"0.6069231",
"0.604914",
"0.59973955",
"0.5969188",
"0.59618396",
"0.59541255",
"0.5941385",
"0.5940318",
"0.58399045",
"0.5810996",
"0.5807061",
"0.5782344",
"0.57602... | 0.6757992 | 1 |
Handles linear scaling rule and LR decay. Scale learning rate at epoch boundaries provided in LR_SCHEDULE by the provided scaling factor. | def learning_rate_schedule(current_epoch,
current_batch,
batches_per_epoch,
batch_size):
del current_batch, batches_per_epoch # not used
initial_learning_rate = common.BASE_LEARNING_RATE * batch_size / 128
learning_rate = initial_le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def adjust_learning_rate_schedule(optimizer, epoch, initial_lr, decay_factor, decay_epochs):\n\n # Find the index of the current interval:\n interval_index = len([mark for mark in decay_epochs if mark < epoch])\n\n lr = initial_lr * (decay_factor ** interval_index)\n for param_group in optimizer.param_... | [
"0.6678285",
"0.66325784",
"0.6542716",
"0.6416433",
"0.6363528",
"0.63295734",
"0.62856907",
"0.6262307",
"0.62460744",
"0.6218091",
"0.61931515",
"0.6188003",
"0.61465865",
"0.614502",
"0.6144216",
"0.6138332",
"0.6137244",
"0.6130743",
"0.6122289",
"0.6105983",
"0.61007077... | 0.65202194 | 3 |
Initializing Cin as o, l2 as empty list and final as empty string | def add(num1, num2, Cin):
Cin=0
l2=[]
final=""
"""Using for loop for starting addition from the last indexed number"""
for i in range(len(num1)-1,-1,-1):
bit1=num1[i]#storing each indexed() value of num1 in bit1
bit2=num2[i]#storing each indexed() value of num2 in bit2
S1=g.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, o0=(0, 0), o1=(0, 0)):\n self._output = [o0, o1]",
"def __init__(self,l=None,c=True):\r\n\t\t\r\n\t\t# default None to zero\r\n\t\tif l is None:\r\n\t\t\tl = 0\r\n\t\t\t\r\n\t\tif l == []:\r\n\t\t\tl = 0\r\n\t\t\r\n\t\t# attempt to translate from string\r\n\t\ttry:\r\n\t\t\tl = Li._tran... | [
"0.6156051",
"0.60318625",
"0.5904705",
"0.5787834",
"0.5713939",
"0.56481445",
"0.56018484",
"0.5577135",
"0.5547001",
"0.55375147",
"0.54676926",
"0.5461734",
"0.54217833",
"0.5397691",
"0.5375492",
"0.5349343",
"0.53472084",
"0.53472084",
"0.53247607",
"0.53019875",
"0.529... | 0.0 | -1 |
Sets the qos_type of this NetflowFilters. | def qos_type(self, qos_type):
self._qos_type = qos_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def qos(self, qos: int):\n if qos is not None and qos > 2: # noqa: E501\n raise ValueError(\"Invalid value for `qos`, must be a value less than or equal to `2`\") # noqa: E501\n if qos is not None and qos < 0: # noqa: E501\n raise ValueError(\"Invalid value for `qos`, must be... | [
"0.69267035",
"0.665194",
"0.6260876",
"0.6227411",
"0.61854005",
"0.6163835",
"0.61467403",
"0.6086317",
"0.6053018",
"0.60085255",
"0.5876559",
"0.5848173",
"0.56665426",
"0.56485814",
"0.5635002",
"0.559807",
"0.53704786",
"0.52488047",
"0.5220447",
"0.5210421",
"0.5194985... | 0.8767736 | 0 |
Sets the ip_version of this NetflowFilters. | def ip_version(self, ip_version):
self._ip_version = ip_version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vip(self, vip):\n\n self._vip = vip",
"def protocol_version(self, protocol_version):\n\n self._protocol_version = protocol_version",
"def setVersion(self, version) :\n if version is not None :\n try :\n self.version = [int(p) for p in version.split(\".\")]\n ... | [
"0.63388056",
"0.58770186",
"0.5694638",
"0.5656582",
"0.5656582",
"0.56357116",
"0.55922115",
"0.55871147",
"0.5562405",
"0.55404204",
"0.5522308",
"0.55216855",
"0.5502596",
"0.5502596",
"0.5502596",
"0.5491824",
"0.54864305",
"0.54864305",
"0.54864305",
"0.54864305",
"0.54... | 0.8065355 | 0 |
Sets the netflow_devices of this NetflowFilters. | def netflow_devices(self, netflow_devices):
self._netflow_devices = netflow_devices | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def devices(self, devices):\n\n self._devices = devices",
"def devices(self, devices):\n\n self._devices = devices",
"def set_devices(args):\n global devices\n if args is not None:\n devices = [torch.device(i) for i in ast.literal_eval('[' + args + ']')]\n torch.cuda.set_devic... | [
"0.6428995",
"0.6428995",
"0.5585992",
"0.54547",
"0.5365216",
"0.5246433",
"0.51710474",
"0.50898916",
"0.50661755",
"0.5038719",
"0.5004575",
"0.49756554",
"0.4974928",
"0.49667272",
"0.4923213",
"0.48840016",
"0.48089606",
"0.48036066",
"0.47994307",
"0.4792203",
"0.479017... | 0.86378056 | 0 |
Sets the app_type of this NetflowFilters. | def app_type(self, app_type):
self._app_type = app_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _app_type(self):\n return self._event['app_type']",
"def set_type(self, type):\n self.type = type",
"def set_type(self, type):\n self.type = type",
"def setFilter(self, type: int, filter: int) -> None:\n ...",
"def set_type(self, type):\n self._type = type",
"def se... | [
"0.6110402",
"0.6007707",
"0.6007707",
"0.5881547",
"0.5826859",
"0.5705285",
"0.5672125",
"0.5645346",
"0.5516108",
"0.5502036",
"0.5485557",
"0.54566836",
"0.5454073",
"0.5433174",
"0.54322046",
"0.54322046",
"0.54322046",
"0.54322046",
"0.54322046",
"0.54322046",
"0.543220... | 0.8083322 | 0 |
Sets the nbar_application_names of this NetflowFilters. | def nbar_application_names(self, nbar_application_names):
self._nbar_application_names = nbar_application_names | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setNameFilters(self, filters):\n if self._completer:\n self._completer.model().setNameFilters(filters)",
"def set_name(self, application_name):\r\n self._name = application_name",
"def app_names(self):\n return self.get_app_names()",
"def app_name(self, value):\n self._... | [
"0.5579578",
"0.5503502",
"0.51913893",
"0.5184525",
"0.51769996",
"0.5006621",
"0.4993549",
"0.48435128",
"0.48244205",
"0.4778834",
"0.4738988",
"0.47321886",
"0.47280967",
"0.47159183",
"0.4684673",
"0.46767935",
"0.46593088",
"0.46463352",
"0.4644338",
"0.46052152",
"0.46... | 0.86759675 | 0 |
Sets the conversation of this NetflowFilters. | def conversation(self, conversation):
self._conversation = conversation | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_conversation(self, conversation):\r\n self.conversation = conversation",
"def set_gift_conversation(self, conversation_string):\r\n self.gift_conversation = conversation_string",
"def update(self, conversation):\n self.content_type = \"application/json\"\n self.method = \"PA... | [
"0.7668855",
"0.6350055",
"0.52989596",
"0.5078657",
"0.50487155",
"0.50432694",
"0.49181578",
"0.49066126",
"0.4869592",
"0.48333606",
"0.4763982",
"0.47448006",
"0.47074327",
"0.46813306",
"0.46577984",
"0.45800743",
"0.4569655",
"0.45474747",
"0.45351785",
"0.44976678",
"0... | 0.72746265 | 1 |
Sets the direction of this NetflowFilters. | def direction(self, direction):
self._direction = direction | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_direction(self, direction: str) -> None:\n self.wink.set_fan_direction(direction)",
"def set_direction(self, new_dir):\n self.__direction = new_dir",
"def setDirection(self,stepDir = 2):\n pass",
"def setdirection(self, *args, **kwargs):\n return _coordsys.coordsys_setdire... | [
"0.7139598",
"0.7040138",
"0.7006834",
"0.69987583",
"0.6970682",
"0.68825686",
"0.6802282",
"0.6730239",
"0.63998103",
"0.6399511",
"0.6314273",
"0.6307516",
"0.63062197",
"0.63062197",
"0.62925655",
"0.62565696",
"0.6163797",
"0.6163797",
"0.60774386",
"0.60496444",
"0.6030... | 0.7080141 | 1 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, NetflowFilters):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Modify an existing outcome group. Fields not provided are left as is; unrecognized fields are ignored. When changing the parent outcome group, the new parent group must belong to the same context as this outcome group, and must not be a descendant of this outcome group (i.e. no cycles allowed). | def update_outcome_group_global(request_ctx, id, title=None, description=None, vendor_guid=None, parent_outcome_group_id=None, **request_kwargs):
path = '/v1/global/outcome_groups/{id}'
payload = {
'title' : title,
'description' : description,
'vendor_guid' : vendor_guid,
'paren... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_outcome_group_accounts(request_ctx, account_id, id, title=None, description=None, vendor_guid=None, parent_outcome_group_id=None, **request_kwargs):\n\n path = '/v1/accounts/{account_id}/outcome_groups/{id}'\n payload = {\n 'title' : title,\n 'description' : description,\n 've... | [
"0.61605686",
"0.61406356",
"0.5958074",
"0.59414357",
"0.5797429",
"0.5668177",
"0.5624319",
"0.5621426",
"0.561763",
"0.5572149",
"0.5539592",
"0.55051327",
"0.54824334",
"0.5461233",
"0.54360193",
"0.5433018",
"0.53988296",
"0.5368346",
"0.53458875",
"0.52537507",
"0.52454... | 0.67553115 | 0 |
Modify an existing outcome group. Fields not provided are left as is; unrecognized fields are ignored. When changing the parent outcome group, the new parent group must belong to the same context as this outcome group, and must not be a descendant of this outcome group (i.e. no cycles allowed). | def update_outcome_group_accounts(request_ctx, account_id, id, title=None, description=None, vendor_guid=None, parent_outcome_group_id=None, **request_kwargs):
path = '/v1/accounts/{account_id}/outcome_groups/{id}'
payload = {
'title' : title,
'description' : description,
'vendor_guid' ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_outcome_group_global(request_ctx, id, title=None, description=None, vendor_guid=None, parent_outcome_group_id=None, **request_kwargs):\n\n path = '/v1/global/outcome_groups/{id}'\n payload = {\n 'title' : title,\n 'description' : description,\n 'vendor_guid' : vendor_guid,\n ... | [
"0.67553115",
"0.61406356",
"0.5958074",
"0.59414357",
"0.5797429",
"0.5668177",
"0.5624319",
"0.5621426",
"0.561763",
"0.5572149",
"0.5539592",
"0.55051327",
"0.54824334",
"0.5461233",
"0.54360193",
"0.5433018",
"0.53988296",
"0.5368346",
"0.53458875",
"0.52537507",
"0.52454... | 0.61605686 | 1 |
Modify an existing outcome group. Fields not provided are left as is; unrecognized fields are ignored. When changing the parent outcome group, the new parent group must belong to the same context as this outcome group, and must not be a descendant of this outcome group (i.e. no cycles allowed). | def update_outcome_group_courses(request_ctx, course_id, id, title=None, description=None, vendor_guid=None, parent_outcome_group_id=None, **request_kwargs):
path = '/v1/courses/{course_id}/outcome_groups/{id}'
payload = {
'title' : title,
'description' : description,
'vendor_guid' : ve... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_outcome_group_global(request_ctx, id, title=None, description=None, vendor_guid=None, parent_outcome_group_id=None, **request_kwargs):\n\n path = '/v1/global/outcome_groups/{id}'\n payload = {\n 'title' : title,\n 'description' : description,\n 'vendor_guid' : vendor_guid,\n ... | [
"0.67553115",
"0.61605686",
"0.5958074",
"0.59414357",
"0.5797429",
"0.5668177",
"0.5624319",
"0.5621426",
"0.561763",
"0.5572149",
"0.5539592",
"0.55051327",
"0.54824334",
"0.5461233",
"0.54360193",
"0.5433018",
"0.53988296",
"0.5368346",
"0.53458875",
"0.52537507",
"0.52454... | 0.61406356 | 2 |
Deleting an outcome group deletes descendant outcome groups and outcome links. The linked outcomes themselves are only deleted if all links to the outcome were deleted. Aligned outcomes cannot be deleted; as such, if all remaining links to an aligned outcome are included in this group's descendants, the group deletion ... | def delete_outcome_group_global(request_ctx, id, **request_kwargs):
path = '/v1/global/outcome_groups/{id}'
url = request_ctx.base_api_url + path.format(id=id)
response = client.delete(request_ctx, url, **request_kwargs)
return response | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_outcome_group_accounts(request_ctx, account_id, id, **request_kwargs):\n\n path = '/v1/accounts/{account_id}/outcome_groups/{id}'\n url = request_ctx.base_api_url + path.format(account_id=account_id, id=id)\n response = client.delete(request_ctx, url, **request_kwargs)\n\n return response",
... | [
"0.66492325",
"0.6541948",
"0.6461525",
"0.6348538",
"0.633461",
"0.6283196",
"0.6217388",
"0.6203314",
"0.6168106",
"0.61588556",
"0.6150082",
"0.61439496",
"0.6109929",
"0.61078966",
"0.6060277",
"0.60184395",
"0.6001307",
"0.6001307",
"0.59507966",
"0.5928808",
"0.5904541"... | 0.662239 | 1 |
Deleting an outcome group deletes descendant outcome groups and outcome links. The linked outcomes themselves are only deleted if all links to the outcome were deleted. Aligned outcomes cannot be deleted; as such, if all remaining links to an aligned outcome are included in this group's descendants, the group deletion ... | def delete_outcome_group_accounts(request_ctx, account_id, id, **request_kwargs):
path = '/v1/accounts/{account_id}/outcome_groups/{id}'
url = request_ctx.base_api_url + path.format(account_id=account_id, id=id)
response = client.delete(request_ctx, url, **request_kwargs)
return response | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_outcome_group_global(request_ctx, id, **request_kwargs):\n\n path = '/v1/global/outcome_groups/{id}'\n url = request_ctx.base_api_url + path.format(id=id)\n response = client.delete(request_ctx, url, **request_kwargs)\n\n return response",
"def test_080_group_delete(self):\n\n testf... | [
"0.662239",
"0.6541948",
"0.6461525",
"0.6348538",
"0.633461",
"0.6283196",
"0.6217388",
"0.6203314",
"0.6168106",
"0.61588556",
"0.6150082",
"0.61439496",
"0.6109929",
"0.61078966",
"0.6060277",
"0.60184395",
"0.6001307",
"0.6001307",
"0.59507966",
"0.5928808",
"0.5904541",
... | 0.66492325 | 0 |
Deleting an outcome group deletes descendant outcome groups and outcome links. The linked outcomes themselves are only deleted if all links to the outcome were deleted. Aligned outcomes cannot be deleted; as such, if all remaining links to an aligned outcome are included in this group's descendants, the group deletion ... | def delete_outcome_group_courses(request_ctx, course_id, id, **request_kwargs):
path = '/v1/courses/{course_id}/outcome_groups/{id}'
url = request_ctx.base_api_url + path.format(course_id=course_id, id=id)
response = client.delete(request_ctx, url, **request_kwargs)
return response | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_outcome_group_accounts(request_ctx, account_id, id, **request_kwargs):\n\n path = '/v1/accounts/{account_id}/outcome_groups/{id}'\n url = request_ctx.base_api_url + path.format(account_id=account_id, id=id)\n response = client.delete(request_ctx, url, **request_kwargs)\n\n return response",
... | [
"0.66492325",
"0.662239",
"0.6541948",
"0.6461525",
"0.6348538",
"0.6283196",
"0.6217388",
"0.6203314",
"0.6168106",
"0.61588556",
"0.6150082",
"0.61439496",
"0.6109929",
"0.61078966",
"0.6060277",
"0.60184395",
"0.6001307",
"0.6001307",
"0.59507966",
"0.5928808",
"0.5904541"... | 0.633461 | 5 |
Link an outcome into the outcome group. The outcome to link can either be specified by a PUT to the link URL for a specific outcome (the outcome_id in the PUT URLs) or by supplying the information for a new outcome (title, description, ratings, mastery_points) in a POST to the collection. If linking an existing outcome... | def create_link_outcome_global(request_ctx, id, outcome_id=None, title=None, display_name=None, description=None, vendor_guid=None, mastery_points=None, ratings_description=None, ratings_points=None, **request_kwargs):
path = '/v1/global/outcome_groups/{id}/outcomes'
payload = {
'outcome_id' : outcome_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_link_outcome_global_outcome_id(request_ctx, id, outcome_id=None, title=None, display_name=None, description=None, vendor_guid=None, mastery_points=None, ratings_description=None, ratings_points=None, **request_kwargs):\n\n path = '/v1/global/outcome_groups/{id}/outcomes/{outcome_id}'\n payload = {... | [
"0.717459",
"0.7163847",
"0.7061997",
"0.6714336",
"0.66986096",
"0.5106874",
"0.4798102",
"0.47242922",
"0.45309213",
"0.44986874",
"0.44323424",
"0.44262272",
"0.44031692",
"0.4358714",
"0.43203336",
"0.43203336",
"0.43050796",
"0.43030095",
"0.4294811",
"0.42858493",
"0.42... | 0.7362988 | 0 |
Link an outcome into the outcome group. The outcome to link can either be specified by a PUT to the link URL for a specific outcome (the outcome_id in the PUT URLs) or by supplying the information for a new outcome (title, description, ratings, mastery_points) in a POST to the collection. If linking an existing outcome... | def create_link_outcome_global_outcome_id(request_ctx, id, outcome_id=None, title=None, display_name=None, description=None, vendor_guid=None, mastery_points=None, ratings_description=None, ratings_points=None, **request_kwargs):
path = '/v1/global/outcome_groups/{id}/outcomes/{outcome_id}'
payload = {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_link_outcome_global(request_ctx, id, outcome_id=None, title=None, display_name=None, description=None, vendor_guid=None, mastery_points=None, ratings_description=None, ratings_points=None, **request_kwargs):\n\n path = '/v1/global/outcome_groups/{id}/outcomes'\n payload = {\n 'outcome_id' :... | [
"0.7362988",
"0.7163847",
"0.7061997",
"0.6714336",
"0.66986096",
"0.5106874",
"0.4798102",
"0.47242922",
"0.45309213",
"0.44986874",
"0.44323424",
"0.44262272",
"0.44031692",
"0.4358714",
"0.43203336",
"0.43203336",
"0.43050796",
"0.43030095",
"0.4294811",
"0.42858493",
"0.4... | 0.717459 | 1 |
Link an outcome into the outcome group. The outcome to link can either be specified by a PUT to the link URL for a specific outcome (the outcome_id in the PUT URLs) or by supplying the information for a new outcome (title, description, ratings, mastery_points) in a POST to the collection. If linking an existing outcome... | def create_link_outcome_accounts(request_ctx, account_id, id, outcome_id=None, title=None, display_name=None, description=None, vendor_guid=None, mastery_points=None, ratings_description=None, ratings_points=None, **request_kwargs):
path = '/v1/accounts/{account_id}/outcome_groups/{id}/outcomes'
payload = {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_link_outcome_global(request_ctx, id, outcome_id=None, title=None, display_name=None, description=None, vendor_guid=None, mastery_points=None, ratings_description=None, ratings_points=None, **request_kwargs):\n\n path = '/v1/global/outcome_groups/{id}/outcomes'\n payload = {\n 'outcome_id' :... | [
"0.7362988",
"0.717459",
"0.7163847",
"0.7061997",
"0.66986096",
"0.5106874",
"0.4798102",
"0.47242922",
"0.45309213",
"0.44986874",
"0.44323424",
"0.44262272",
"0.44031692",
"0.4358714",
"0.43203336",
"0.43203336",
"0.43050796",
"0.43030095",
"0.4294811",
"0.42858493",
"0.42... | 0.6714336 | 4 |
Link an outcome into the outcome group. The outcome to link can either be specified by a PUT to the link URL for a specific outcome (the outcome_id in the PUT URLs) or by supplying the information for a new outcome (title, description, ratings, mastery_points) in a POST to the collection. If linking an existing outcome... | def create_link_outcome_accounts_outcome_id(request_ctx, account_id, id, outcome_id=None, title=None, display_name=None, description=None, vendor_guid=None, mastery_points=None, ratings_description=None, ratings_points=None, **request_kwargs):
path = '/v1/accounts/{account_id}/outcome_groups/{id}/outcomes/{outcome... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_link_outcome_global(request_ctx, id, outcome_id=None, title=None, display_name=None, description=None, vendor_guid=None, mastery_points=None, ratings_description=None, ratings_points=None, **request_kwargs):\n\n path = '/v1/global/outcome_groups/{id}/outcomes'\n payload = {\n 'outcome_id' :... | [
"0.7362988",
"0.717459",
"0.7061997",
"0.6714336",
"0.66986096",
"0.5106874",
"0.4798102",
"0.47242922",
"0.45309213",
"0.44986874",
"0.44323424",
"0.44262272",
"0.44031692",
"0.4358714",
"0.43203336",
"0.43203336",
"0.43050796",
"0.43030095",
"0.4294811",
"0.42858493",
"0.42... | 0.7163847 | 2 |
Link an outcome into the outcome group. The outcome to link can either be specified by a PUT to the link URL for a specific outcome (the outcome_id in the PUT URLs) or by supplying the information for a new outcome (title, description, ratings, mastery_points) in a POST to the collection. If linking an existing outcome... | def create_link_outcome_courses(request_ctx, course_id, id, outcome_id=None, title=None, display_name=None, description=None, vendor_guid=None, mastery_points=None, ratings_description=None, ratings_points=None, **request_kwargs):
path = '/v1/courses/{course_id}/outcome_groups/{id}/outcomes'
payload = {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_link_outcome_global(request_ctx, id, outcome_id=None, title=None, display_name=None, description=None, vendor_guid=None, mastery_points=None, ratings_description=None, ratings_points=None, **request_kwargs):\n\n path = '/v1/global/outcome_groups/{id}/outcomes'\n payload = {\n 'outcome_id' :... | [
"0.7362988",
"0.717459",
"0.7163847",
"0.7061997",
"0.6714336",
"0.5106874",
"0.4798102",
"0.47242922",
"0.45309213",
"0.44986874",
"0.44323424",
"0.44262272",
"0.44031692",
"0.4358714",
"0.43203336",
"0.43203336",
"0.43050796",
"0.43030095",
"0.4294811",
"0.42858493",
"0.427... | 0.66986096 | 5 |
Link an outcome into the outcome group. The outcome to link can either be specified by a PUT to the link URL for a specific outcome (the outcome_id in the PUT URLs) or by supplying the information for a new outcome (title, description, ratings, mastery_points) in a POST to the collection. If linking an existing outcome... | def create_link_outcome_courses_outcome_id(request_ctx, course_id, id, outcome_id=None, title=None, display_name=None, description=None, vendor_guid=None, mastery_points=None, ratings_description=None, ratings_points=None, **request_kwargs):
path = '/v1/courses/{course_id}/outcome_groups/{id}/outcomes/{outcome_id}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_link_outcome_global(request_ctx, id, outcome_id=None, title=None, display_name=None, description=None, vendor_guid=None, mastery_points=None, ratings_description=None, ratings_points=None, **request_kwargs):\n\n path = '/v1/global/outcome_groups/{id}/outcomes'\n payload = {\n 'outcome_id' :... | [
"0.7362988",
"0.717459",
"0.7163847",
"0.6714336",
"0.66986096",
"0.5106874",
"0.4798102",
"0.47242922",
"0.45309213",
"0.44986874",
"0.44323424",
"0.44262272",
"0.44031692",
"0.4358714",
"0.43203336",
"0.43203336",
"0.43050796",
"0.43030095",
"0.4294811",
"0.42858493",
"0.42... | 0.7061997 | 3 |
Declares an array. Initializes it to zeros. TODO Handle more than two dimensions. | def stmt_dim(executor, stmt:ParsedStatementDim):
for name, value in stmt._dimensions:
initializer = init_array(value)
executor.put_symbol(name, initializer, SymbolType.ARRAY, arg=None) # Not right, but for now. | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zeros_numpy_array(self,\n type_name,\n as_matrix = True):\n if as_matrix:\n return np.zeros((1, self.get_max_id(type_name)), dtype='float32')\n else:\n return np.zeros((self.get_max_id(type_name),), dtype='float32')",
"def zero_init(self, shape):\... | [
"0.66444355",
"0.66228235",
"0.65934485",
"0.65253294",
"0.63993794",
"0.63414425",
"0.6330485",
"0.63030803",
"0.6281445",
"0.62749404",
"0.6273253",
"0.62706274",
"0.62627155",
"0.62333333",
"0.6128069",
"0.6122897",
"0.60999733",
"0.60854125",
"0.6048962",
"0.6042979",
"0.... | 0.0 | -1 |
Take a draft_dict that was already validated by draft_dict_validator then further sanitize, validate, and transform it. Ultimately return this "further validated" draft dict. It will have a slightly different set of keys the values for which can be used to directly create a Draft object. | def further_validated_draft_dict(
draft_dict: Dict[str, Any], user_profile: UserProfile
) -> Dict[str, Any]:
content = normalize_body(draft_dict["content"])
timestamp = draft_dict.get("timestamp", time.time())
timestamp = round(timestamp, 6)
if timestamp < 0:
# While it's not exactly an in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _draft_from_response(data):\n return Draft(\n uuid=UUID(data['uuid']),\n bundle_uuid=UUID(data['bundle_uuid']),\n name=data['name'],\n updated_at=dateutil.parser.parse(data['staged_draft']['updated_at']),\n files={\n path: DraftFile(path=path, **file)\n ... | [
"0.56550765",
"0.56206477",
"0.5450413",
"0.52529806",
"0.52475804",
"0.5194902",
"0.51102144",
"0.51091665",
"0.50821674",
"0.5033902",
"0.5002",
"0.49568045",
"0.4842201",
"0.48251075",
"0.48187992",
"0.48105076",
"0.48069793",
"0.47712836",
"0.47657195",
"0.47256124",
"0.4... | 0.7376656 | 0 |
Get next release version. | def bump_release(
self: _R,
release_type: Literal["major", "minor", "micro"] = VersionParts.MICRO,
inc: int = 1,
) -> _R:
if release_type == VersionParts.MAJOR:
return self.bump_major(inc)
if release_type == VersionParts.MINOR:
return self.bump_minor(i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_version(major=False, minor=False, patch=True):\n try:\n r = Release.objects.latest()\n except Release.DoesNotExist:\n return Version('0.0.0')\n\n v = r.version\n if major:\n v = v.next_major()\n elif minor:\n v = v.next_minor()\n else:\n v = v.next_patc... | [
"0.8136026",
"0.8127919",
"0.7517721",
"0.71033996",
"0.6974199",
"0.6932763",
"0.6864649",
"0.6853223",
"0.6828289",
"0.6774772",
"0.67444694",
"0.6615308",
"0.6605916",
"0.6588041",
"0.65674776",
"0.65634",
"0.65570605",
"0.6548462",
"0.6492869",
"0.64794105",
"0.6404592",
... | 0.0 | -1 |
Get next prerelease version. If version is stable bump `micro` for a proper versioning as well. Defaults to `rc` prereleases. | def bump_prerelease(
self: _R,
inc: int = 1,
release_type: Literal["rc", "alpha", "beta", "a", "b"] = None,
bump_release: Literal["major", "minor", "micro"] = VersionParts.MICRO,
) -> _R:
prerelease_type = release_type or self.prerelease_type or VersionParts.RC
increm... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_version(major=False, minor=False, patch=True):\n try:\n r = Release.objects.latest()\n except Release.DoesNotExist:\n return Version('0.0.0')\n\n v = r.version\n if major:\n v = v.next_major()\n elif minor:\n v = v.next_minor()\n else:\n v = v.next_patc... | [
"0.74618196",
"0.73501813",
"0.72785693",
"0.6688966",
"0.6573726",
"0.6516371",
"0.63295984",
"0.632609",
"0.61778533",
"0.60363823",
"0.60113215",
"0.60052055",
"0.59608686",
"0.59551674",
"0.594888",
"0.5904299",
"0.5897116",
"0.5894186",
"0.5864545",
"0.58246434",
"0.5817... | 0.6240163 | 8 |
Whether version is not prerelease or devrelease. | def is_stable(self) -> bool:
return not self.is_prerelease | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_release():\n return VERSION[-1]",
"def is_release(self):\n # version string: N.N.N.N is for release.\n return bool(re.match(r'^[\\d.]+$', self.version))",
"def is_production(version=None):\n return is_host_google() and is_default_version(version)",
"def is_0_release(release: str) -> ... | [
"0.7988306",
"0.7390222",
"0.72329897",
"0.71225476",
"0.70509773",
"0.674931",
"0.67251575",
"0.66882837",
"0.6623015",
"0.6601849",
"0.65394694",
"0.64932364",
"0.64372605",
"0.639243",
"0.63218457",
"0.6310093",
"0.62938845",
"0.6283808",
"0.6193949",
"0.6171282",
"0.60062... | 0.7183544 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.