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
Test that endpoint returns 200 to successfully get an existing issue
def test_get_existing_issue_passes(self): response = self.client.get(self.url) response_json = response.get_json() self.assertEqual(response.status_code, 200) self.assertEqual(response_json["name"], TEST_ISSUE_NAME)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_non_existent_issue_fails(self):\n response = self.client.get(self.non_existent_url)\n response_json = response.get_json()\n error_details = response_json[\"error\"]\n self.assertEqual(response.status_code, 404)\n self.assertEqual(error_details[\"message\"], ISSUE_NOT...
[ "0.75867414", "0.73902005", "0.73643064", "0.73238534", "0.72854304", "0.72854304", "0.72405005", "0.7184897", "0.7139815", "0.7139815", "0.70511526", "0.70130855", "0.69772947", "0.6941858", "0.6915399", "0.69113547", "0.6906659", "0.68878627", "0.68749183", "0.6872209", "0....
0.832497
0
Test that endpoint returns 404 to get a non existent issue
def test_get_non_existent_issue_fails(self): response = self.client.get(self.non_existent_url) response_json = response.get_json() error_details = response_json["error"] self.assertEqual(response.status_code, 404) self.assertEqual(error_details["message"], ISSUE_NOT_FOUND_MESSAGE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_non_existing(self):\n\n response = self.client.get('/auth/non-existing-resource')\n\n self.assert404(response)\n self.assertEqual('not found', response.json['error'])", "def test_not_found(self):\n self._error_test(fitbit_exceptions.HTTPNotFound)", "def test_errors(self...
[ "0.8440809", "0.84043115", "0.83460724", "0.83089256", "0.826493", "0.8206802", "0.8186839", "0.8177326", "0.8158737", "0.8137278", "0.80837154", "0.804013", "0.8034312", "0.8028318", "0.7958969", "0.7926939", "0.79143566", "0.7911083", "0.79110503", "0.79093486", "0.78991246...
0.82862127
4
Test that endpoint returns 401 to update an issue by an unauthenticated user
def test_update_issue_by_unauthenticated_user_fails(self): response = self.client.patch( self.url, json={"description": TEST_ISSUE_DESCRIPTION, "name": TEST_ISSUE_NAME}, ) response_json = response.get_json() self.assertEqual(response.status_code, 401) self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unauthenticated_request(self):\n url = self.get_url(self.active_user.id)\n response = self.client.get(url)\n\n expected_status_code = 401\n self.assertEqual(response.status_code, expected_status_code)", "def test_create_issue_by_unauthenticated_user_fails(self):\n resp...
[ "0.7516022", "0.7390298", "0.7305012", "0.7240846", "0.72042036", "0.71837735", "0.71655804", "0.7158354", "0.71411246", "0.71174425", "0.7115708", "0.7115267", "0.71067286", "0.71047646", "0.71047646", "0.70501995", "0.7048268", "0.70121765", "0.69896954", "0.6960274", "0.69...
0.8461089
0
Test that endpoint returns 400 to update an issue with an invalid request
def test_update_issue_with_invalid_request_data_fails(self): response = self.client.patch( self.url, headers={"Authorization": self.test_user_token}, json={"issue_description": TEST_ISSUE_DESCRIPTION, "issue_name": ""}, ) response_json = response.get_json() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bad_requests_give_400(self):\n self.assertEqual(self._request({}), 400)", "def bad_request():\n return HttpError(400)", "def test_update_issue_with_invalid_request_data_fails(self):\n response = self.client.post(\n self.url,\n headers={\"Authorization\": self.tes...
[ "0.77987164", "0.76850784", "0.7648718", "0.7367075", "0.73580146", "0.7346528", "0.729571", "0.7294784", "0.7268057", "0.725128", "0.72369045", "0.7213078", "0.717171", "0.70821875", "0.7068439", "0.7041047", "0.7026098", "0.70238805", "0.7023123", "0.7019675", "0.69905686",...
0.77710116
1
Test that endpoint returns 404 to update a non existent issue
def test_update_non_existent_issue_fails(self): response = self.client.patch( self.non_existent_url, headers={"Authorization": self.test_user_token}, json={"description": TEST_ISSUE_DESCRIPTION, "name": TEST_ISSUE_NAME}, ) response_json = response.get_json() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testNotFound(self):\n data = {'text': 'toto'}\n response = requests.put(url=self.invalid_url, json=data)\n headers = response.headers\n json_data = response.json()\n\n self.assertEqual(response.status_code, 404, WRONG_STATUS_CODE_MSG)\n self.assertEqual(\n h...
[ "0.75109035", "0.74866414", "0.74578464", "0.7419704", "0.73854923", "0.73162496", "0.727284", "0.7267581", "0.7203608", "0.71740806", "0.7172531", "0.7153326", "0.714389", "0.7107214", "0.7075401", "0.7074183", "0.70677465", "0.7053139", "0.7043897", "0.703817", "0.7036448",...
0.8417235
0
Test that endpoint returns 200 to successfully update an issue
def test_update_mapping_issue_passes(self): response = self.client.patch( self.url, headers={"Authorization": self.test_user_token}, json={ "name": "New issue name", "description": TEST_ISSUE_DESCRIPTION, }, ) respon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_non_existent_issue_fails(self):\n response = self.client.patch(\n self.non_existent_url,\n headers={\"Authorization\": self.test_user_token},\n json={\"description\": TEST_ISSUE_DESCRIPTION, \"name\": TEST_ISSUE_NAME},\n )\n response_json = resp...
[ "0.7483877", "0.7447535", "0.72125095", "0.71508306", "0.70341915", "0.7032272", "0.70106524", "0.6930996", "0.68832344", "0.6849793", "0.6808051", "0.67885125", "0.67684555", "0.6744646", "0.6727808", "0.67262805", "0.6720259", "0.6711522", "0.6697998", "0.6687337", "0.66558...
0.7371013
2
Test that endpoint returns 401 to delete an issue by an unauthenticated user
def test_delete_issue_by_unauthenticated_user_fails(self): response = self.client.delete( self.url, ) response_json = response.get_json() self.assertEqual(response.status_code, 401) self.assertEqual(response_json["SubCode"], "InvalidToken")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_users_unauthenticated(client: FlaskClient) -> None:\n # Unauthenticated users are not allowed to make the request\n response = delete_users(client)\n assert_error_response(response, HTTPStatus.UNAUTHORIZED)", "def test_delete_unauthenticated(self):\n\n url = reverse('file')\n\n ...
[ "0.7733872", "0.77042085", "0.7531653", "0.7487137", "0.74677473", "0.7453291", "0.73845005", "0.7363246", "0.7293821", "0.72863674", "0.724811", "0.72416186", "0.72339964", "0.71999305", "0.7198206", "0.7182199", "0.7163438", "0.715405", "0.7144855", "0.7144765", "0.7142823"...
0.86269015
0
Test that endpoint returns 404 to delete a nonexistent issue
def test_delete_non_existent_issue_fails(self): response = self.client.delete( self.non_existent_url, headers={"Authorization": self.test_user_token} ) response_json = response.get_json() error_details = response_json["error"] self.assertEqual(response.status_code, 40...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_not_found(self):\n resp = self.client.delete(\n \"/tracking?repo=not_found1&branch=not_found1\", content_type=\"application/json\", headers=self.auth\n )\n resp_dict = json.loads(resp.data)\n self.assertIn(\"code\", resp_dict, msg=\"Error in data format return...
[ "0.7706101", "0.7693295", "0.74782056", "0.74614143", "0.74124074", "0.7393357", "0.7392625", "0.73672146", "0.7346239", "0.73245335", "0.73038", "0.7288201", "0.7203828", "0.7168691", "0.7166301", "0.7163927", "0.7158053", "0.7135521", "0.71196383", "0.71181154", "0.7103441"...
0.8426744
0
Test that endpoint returns 401 to create a new issue by an unauthenticated user
def test_create_issue_by_unauthenticated_user_fails(self): response = self.client.post( self.url, json={"description": TEST_ISSUE_DESCRIPTION, "name": TEST_ISSUE_NAME}, ) response_json = response.get_json() self.assertEqual(response.status_code, 401) self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unauthorized_create_user(self):\n res = self.submit()\n\n assert res.status_code == 401", "def test_update_issue_by_unauthenticated_user_fails(self):\n response = self.client.patch(\n self.url,\n json={\"description\": TEST_ISSUE_DESCRIPTION, \"name\": TEST_ISS...
[ "0.7725986", "0.7681252", "0.7239422", "0.71773916", "0.71711415", "0.71470416", "0.71207446", "0.71150017", "0.70923895", "0.70384675", "0.7037222", "0.7032824", "0.70011616", "0.7000968", "0.69924366", "0.69902384", "0.69893515", "0.6978107", "0.69578373", "0.69578373", "0....
0.8437491
0
Test that endpoint returns 400 to create a new issue with an invalid request
def test_update_issue_with_invalid_request_data_fails(self): response = self.client.post( self.url, headers={"Authorization": self.test_user_token}, json={"issue_description": TEST_ISSUE_DESCRIPTION, "issue_name": ""}, ) response_json = response.get_json() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bad_requests_give_400(self):\n self.assertEqual(self._request({}), 400)", "def bad_request():\n return HttpError(400)", "def test_api_request_can_handle_errors(self):\n # wrong repo name to test error handling.\n payload = request_github_issues('razat249', 'wrong_repo')\n ...
[ "0.7651997", "0.73523086", "0.72475755", "0.71681696", "0.71125066", "0.7052414", "0.7043843", "0.70184535", "0.6996116", "0.6989306", "0.69476026", "0.69162565", "0.69134265", "0.6907433", "0.6871", "0.68564343", "0.68493795", "0.68314785", "0.68268216", "0.67989933", "0.678...
0.7286541
2
Test that endpoint returns 200 to successfully create a new issue
def test_create_mapping_issue_passes(self): response = self.client.post( self.url, headers={"Authorization": self.test_user_token}, json={ "name": TEST_ISSUE_NAME, "description": TEST_ISSUE_DESCRIPTION, }, ) response...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_issue_create_issue(self):\n pass", "def test_new_Issue(self, requests_post, get_landowner):\n #requests_post.status_code.return_value = 200\n requests_post.json.return_value = {'features': []}\n get_landowner.return_value = 'TEST landowner'\n cat = Category(name=\"test...
[ "0.7769022", "0.7747227", "0.76838297", "0.76219213", "0.74288315", "0.6986586", "0.6889764", "0.68781835", "0.6863135", "0.6863135", "0.6854407", "0.6786854", "0.67582124", "0.6754434", "0.6752411", "0.6746272", "0.6722742", "0.6715619", "0.6706549", "0.66828096", "0.6681843...
0.681527
11
True if the instruction only reads from its operands. Otherwise, the first operand is considered as the destination and others are source.
def is_read_only(self): return (self.get_name().startswith("b") or self.get_name() == "jump_cond" # meta-instruction or self.get_name() == "j" or self.get_name() == "ld" or self.get_name() == "lw" or self.get_name() == "lb")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_moving_liquid_command(_command):\n _has_source_and_dest = ('source' in _command['payload'] and\n 'dest' in _command['payload'])\n return _has_source_and_dest", "def is_allow(self, src: Vertex, dst: Vertex) -> bool:\n if self.link == Link.NONE:\n return ...
[ "0.57451916", "0.5607157", "0.5600904", "0.55296487", "0.5529514", "0.5493596", "0.5435821", "0.53819245", "0.5297405", "0.52914536", "0.52188677", "0.516619", "0.5158601", "0.5120437", "0.507584", "0.5038547", "0.5033689", "0.502784", "0.50264645", "0.5025062", "0.49994087",...
0.5025502
19
Utility function to get both the instruction name and the operands
def unfold(self): return self.get_name(), self.args
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assembler_op_name(s):\n\n global _assembler_index\n\n if s in _trans:\n result = _trans[s][_assembler_index]\n if result == None:\n utils.error(\"Assembler can't handle operator \" + s)\n return result\n return s", "def convert_instruction(instruction: str) -> Tuple[i...
[ "0.64491075", "0.62868893", "0.6278969", "0.6163245", "0.6118727", "0.59813124", "0.5978179", "0.5944512", "0.59131163", "0.58806497", "0.58782506", "0.577577", "0.5767858", "0.5743887", "0.5695029", "0.56827444", "0.56631994", "0.56456876", "0.56456375", "0.5640928", "0.5634...
0.0
-1
Gets the distance for two points (i and j) from the condensed matrix such that for a square matrix (n x n) it would correspond to ith row and jth col
def get_dist(dist, i, j): n = int(np.ceil(np.sqrt(2 * len(dist)))) if i == j: return 0 elif i > j: return dist[n * j - j * (j + 1) / 2 + i - 1 - j] else: return dist[n * i - i * (i + 1) / 2 + j - 1 - i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_distance(self, i, j):\n row_i = i // 5\n column_i = i % 5\n row_j = j // 5\n column_j = j % 5\n distance = abs(row_i-row_j) + abs(column_i-column_j)\n return distance", "def distance_matrix(n_row, n_col):\n\n n_pop = int(n_row * n_col)\n center = int(n_row/2*(n_col+1))\n\n po...
[ "0.7334973", "0.7294429", "0.6861218", "0.65034413", "0.6500538", "0.6474288", "0.64035195", "0.6394679", "0.6341193", "0.6340586", "0.6308979", "0.6308661", "0.62672013", "0.62577003", "0.6239615", "0.6234131", "0.6204371", "0.6197187", "0.61649257", "0.61576843", "0.6157186...
0.6675357
3
Tests that an expired token is rejected.
def test_rejects_expired_token(self): config.set(xsrf_token_key='abcdef') tool = utils.XsrfTool() token = tool.generate_token(12345, 'test_action') utils.set_utcnow_for_test(XsrfToolTests.TEST_NOW + datetime.timedelta(hours=4, minutes=1)) self.as...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_raises_token_expired_when_applicable(self):\n\n badgr = self.get_badgr_setup()\n with vcr.use_cassette('tests/vcr_cassettes/no_valid_auth_token.yaml'):\n with self.assertRaises(exceptions.TokenAndRefreshExpiredError):\n badgr.get_from_server(self._sample_url)", "d...
[ "0.7818172", "0.7548095", "0.7417047", "0.7357766", "0.7188758", "0.7184504", "0.70577645", "0.7048784", "0.7038498", "0.7019122", "0.6993201", "0.69926786", "0.69330657", "0.6910855", "0.68841475", "0.6876042", "0.68597424", "0.68528163", "0.6845937", "0.67801154", "0.675982...
0.8659471
0
obj can be a PartialTime, datetime.datetime, datetime.date, datetime.time, or dictionary.
def from_object(obj): if isinstance(obj, PartialTime): return obj d = {} for attr in partialtime_attrs: try: d[attr] = getattr(obj, attr) continue except AttributeError: pass try: d[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize_obj(obj: Any) -> Any:\n if isinstance(obj, (datetime.date, datetime.datetime)):\n return obj.isoformat()\n else:\n return obj", "def serialize_obj(obj: Any) -> Any:\n if isinstance(obj, (datetime.date, datetime.datetime)):\n return obj.isoformat()\n else:\n r...
[ "0.68085885", "0.68085885", "0.65015125", "0.64940405", "0.64926344", "0.6421956", "0.64154804", "0.628555", "0.62833035", "0.6281725", "0.6259862", "0.62515557", "0.61389625", "0.611342", "0.6029079", "0.6004232", "0.597295", "0.59600604", "0.59587055", "0.5953708", "0.59535...
0.7220175
0
Endpoint for getting a posts , optionally filtering by title and/or body
def posts_get(): title_like = request.args.get("title_like") body_like = request.args.get("body_like") posts = session.query(Post) if title_like: if body_like: posts = posts.filter( Post.title.contains(title_like), Post.body.contains(body_like)) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_posts():\n url = app.config['POSTS_ENDPOINT']\n response = requests.get(url, params={})\n if response.status_code == 200:\n return parse_posts(response.json())\n raise RuntimeError('Error in retrieving posts.')", "def posts_get():\n \n\n # Get and filter the posts from the databa...
[ "0.69784904", "0.6897439", "0.6682452", "0.64733714", "0.647116", "0.64384276", "0.64301986", "0.64056396", "0.63871115", "0.6280851", "0.6247125", "0.62147796", "0.6195686", "0.61450994", "0.6144", "0.61002445", "0.60592014", "0.6029914", "0.6007665", "0.596298", "0.5931895"...
0.7861696
0
Find whether this host is offline.
def is_offline(self): return not self.is_online
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_offline(self):\n\n\t\treturn self.__offline", "def can_detect_offline(self):\n raise NotImplementedError(\"Abstract method, must be overridden\")", "def is_online(self) -> bool:\n return self.data[Attribute.ONLINE]", "def am_i_offline(self):\n # -num_of_last_check_rounds_consider...
[ "0.7266479", "0.7186407", "0.6736314", "0.6714472", "0.6586879", "0.64810205", "0.6474933", "0.64588964", "0.64490753", "0.6334723", "0.6151179", "0.6090766", "0.60387033", "0.60159165", "0.59867877", "0.59785944", "0.5955263", "0.59521246", "0.59268737", "0.5923758", "0.5923...
0.8027574
0
Turn off this host.
def shutdown(self): self.action('shutdown')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_off(self, **kwargs):\n set_sonoff_state(self._host, \"off\")\n self._state = False", "def turn_off(self):\n self.handleCommand(1)\n self._state = STATE_OFF", "def turn_off(self):\n self._state = False\n self.write_state(bytes([1]))\n self.schedule_updat...
[ "0.8333077", "0.7584832", "0.7504433", "0.7494498", "0.7492745", "0.74628145", "0.74278384", "0.7416117", "0.7327841", "0.7272425", "0.7268601", "0.72667813", "0.7195046", "0.717799", "0.71602327", "0.7150706", "0.71466994", "0.7146114", "0.71273917", "0.71191937", "0.7108236...
0.0
-1
Create a MACJoinRequestMessage object from binary representation.
def decode(cls, mhdr, data): # Message (PHYPayload) must be 23 bytes if len(data) != 23: raise DecodeError() (appeui, deveui, devnonce, mic) = struct.unpack('<QQHL', data[1:]) m = JoinRequestMessage(mhdr, appeui, deveui, devnonce, mic) return m
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_bin(cls, bin):\n raw = msgpack.unpackb(bin, raw=False)\n event_msg = EventMessage.from_text(raw[\"event_message\"])\n msg = cls(\n uri_name=raw[\"uri_name\"],\n event_message=event_msg,\n publisher_connection_id=raw[\"publisher_connection_id\"]\n ...
[ "0.552725", "0.5425762", "0.5368403", "0.5270291", "0.5156768", "0.5145092", "0.5138449", "0.5028855", "0.4996436", "0.499491", "0.49865356", "0.4965446", "0.49050772", "0.48789808", "0.48702258", "0.48655793", "0.48603487", "0.48333448", "0.48247728", "0.47453198", "0.474390...
0.6068377
0
Returns the first XSD component child, excluding the annotation.
def get_xsd_component(elem, required=True, strict=True): components_iterator = iter_xsd_components(elem) try: xsd_component = next(components_iterator) except StopIteration: if required: raise XMLSchemaValueError("missing XSD component") return None else: if n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_first_element_child(self):\n\n pass", "def get_first_node_child(self):\n\n pass", "def firstElementChild(self):\n ret = libxml2mod.xmlFirstElementChild(self._o)\n if ret is None:return None\n __tmp = xmlNode(_obj=ret)\n return __tmp", "def childless_first(res...
[ "0.6681601", "0.62954074", "0.62391526", "0.60230845", "0.5968966", "0.5960721", "0.5854238", "0.57777613", "0.5759878", "0.5695268", "0.5658328", "0.5598681", "0.55389684", "0.547224", "0.545138", "0.5396392", "0.53573334", "0.5316904", "0.526931", "0.52446526", "0.5242232",...
0.6105907
3
Test apply_deletion_policy on users that have been invited to join the learner group.
def test_apply_deletion_policy_on_invited_users(self) -> None: self.assertTrue( learner_group_models.LearnerGroupModel .has_reference_to_user_id('invited_user_1')) learner_group_models.LearnerGroupModel.apply_deletion_policy( 'invited_user_1') self.assertFal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_apply_deletion_policy_on_learners(self) -> None:\n self.assertTrue(\n learner_group_models.LearnerGroupModel\n .has_reference_to_user_id('learner_1'))\n\n learner_group_models.LearnerGroupModel.apply_deletion_policy(\n 'learner_1')\n\n self.assertFalse...
[ "0.79934746", "0.74297476", "0.62506926", "0.62506926", "0.61869216", "0.61869216", "0.60836464", "0.6055344", "0.6010275", "0.5990391", "0.59842926", "0.5982131", "0.5980436", "0.5966811", "0.59628314", "0.59582776", "0.5957713", "0.5931597", "0.5922003", "0.59136575", "0.59...
0.86765325
0
Test that `is_expired` works correctly when only using time based expiration.
def test_is_expired_time_based(self): expired_dt = datetime.now() + timedelta(hours=-1) good_dt = datetime.now() + timedelta(hours=1) expired_pass = DoorPassFactory.create(device=self.device, expires_at=expired_dt) good_pass = DoorPassFactory.create(device=self.device, expires_at=good_dt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_expired(self):\n return self.expiration_date <= self._now()", "def is_expired(self):\n return utcnow() >= self.expires", "def is_expired(self) -> bool:\n return now() > self.expires", "def is_expired(self):\n return timeutils.utcnow_ts() > self.expire_ts", "def has_expire...
[ "0.810299", "0.80347586", "0.7965115", "0.7939916", "0.7937447", "0.7911585", "0.7794946", "0.7765188", "0.7733985", "0.76858866", "0.7651386", "0.76299185", "0.7628304", "0.75381833", "0.7531072", "0.7483425", "0.74437714", "0.7441658", "0.738121", "0.73680216", "0.7322497",...
0.8274048
0
Test that `is_expired` works correctly when only using use based expiration.
def test_is_exipred_use_base(self): expired_pass = DoorPassFactory.create(device=self.device, use_limit=2, uses=2) good_pass = DoorPassFactory.create(device=self.device, use_limit=2, uses=0) self.assertTrue(expired_pass.is_expired()) self.assertFalse(good_pass.is_expired())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_expired(self) -> bool:\n raise NotImplementedError() # pragma: nocover", "def is_expired(self):\n return self.expiration_date <= self._now()", "def test_is_expired_time_based(self):\n expired_dt = datetime.now() + timedelta(hours=-1)\n good_dt = datetime.now() + timedelta(h...
[ "0.79696226", "0.7882386", "0.78707445", "0.7841603", "0.78175616", "0.7788905", "0.76912534", "0.7656347", "0.7563987", "0.75301653", "0.7506589", "0.74297076", "0.74097025", "0.74046665", "0.7372149", "0.7365714", "0.73532194", "0.7351587", "0.7309412", "0.72896993", "0.724...
0.6691052
46
Base class for SKOptbased Optimization Protocols
def __init__( self, target_metric=None, iterations=1, verbose=1, read_experiments=True, reporter_parameters=None, #################### Optimizer Class Parameters #################### base_estimator="GP", n_initial_points=10, acquisition_fun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, optimizer):\n super(ShardedOptimizer, self).__init__(optimizer, name=\"ShardedOptimizer\")", "def __init__(self, opts: dict, solver_opts: dict):\n self.name = opts.get(\"name\", \"Undefined\") # Name of the problem\n self.gp = opts.get(\"grid_points\") # Number of grid point...
[ "0.6822057", "0.62605596", "0.6255509", "0.62220025", "0.6168975", "0.61536145", "0.6110569", "0.6057991", "0.59946007", "0.59903705", "0.5980041", "0.59790206", "0.59696037", "0.595077", "0.59318346", "0.58539397", "0.5843081", "0.58415806", "0.5828049", "0.5793036", "0.5771...
0.61232305
6
A trivial test importing a package which does not exist in python3
def test_urlparse(py2venv): up = sux.to_use('urlparse') assert {} == up.parse_qs("") assert 'http://www.cwi.nl/%7Eguido/FAQ.html' == \ up.urljoin('http://www.cwi.nl/%7Eguido/Python.html', 'FAQ.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_qm_project_python_testing_imported():\n assert \"qm_project_python_testing\" in sys.modules", "def test_import_nothandled():\n sys.meta_path.append(TaskImporter())\n with pytest.raises(ImportError):\n import_module('not.exist')", "def test_molecool_imported():\n assert \"molecool\" ...
[ "0.7549952", "0.7446633", "0.732905", "0.7296307", "0.7268099", "0.7236958", "0.71821105", "0.71387315", "0.7084815", "0.7064571", "0.7049984", "0.70226306", "0.69872355", "0.6954062", "0.6920657", "0.6909464", "0.6892596", "0.68793696", "0.6803328", "0.67913884", "0.6784874"...
0.0
-1
Updates a group. All fields in the request body are optional. The `add_members` and `remove_members` fields can be used together, but the `members` cannot be used in conjunction with `add_members` and `remove_members`. Requires a clearance level of 9 or more of for the user to be the owner of the group.
def put_group( group_id: BSONObjectId, data: PutGroupIn, tkn: Token = Depends(from_authotization_header_nondyn), ): grp: Group = Group.objects.get(pk=group_id) if not ( tkn.owner == grp.owner or has_clearance(tkn.owner, "sni.update_group") ): raise PermissionError logging.deb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_group():\n _id = request.form['_id']\n name = request.form['name']\n data, code, message = FIELD_SERVICE.update_group(_id, name)\n return __result(data, code, message)", "def groups_update(self, mar, request):\n group_id = mar.viewed_user_auth.user_id\n member_ids_dict, owner_ids_dic...
[ "0.7374693", "0.73317206", "0.7170657", "0.67869467", "0.6736518", "0.66802436", "0.6483753", "0.6463577", "0.6445061", "0.6425458", "0.6422473", "0.63844025", "0.6376402", "0.63150907", "0.6290644", "0.618617", "0.61524504", "0.5990803", "0.5987446", "0.5949013", "0.59297556...
0.6708564
5
Compute overlap between detect box and gt boxes
def overlapSelf(Reframe,GTframe): x1 = Reframe[0] y1 = Reframe[1] width1 = Reframe[2] - Reframe[0] height1 = Reframe[3] - Reframe[1] x2 = GTframe[0] y2 = GTframe[1] width2 = GTframe[2] - GTframe[0] height2 = GTframe[3] - GTframe[1] endx = max(x1 + width1, x2 + width2) startx = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cal_overlaps(boxes1, boxes2):\n area1 = (boxes1[:, 0] - boxes1[:, 2]) * (boxes1[:, 1] - boxes1[:, 3]) # (Nsample, 1)\n area2 = (boxes2[:, 0] - boxes2[:, 2]) * (boxes2[:, 1] - boxes2[:, 3]) # (Msample, 1)\n\n overlaps = np.zeros((boxes1.shape[0], boxes2.shape[0])) # (Nsample, Msample)\n\n # calcu...
[ "0.7283634", "0.7218402", "0.7199422", "0.71364045", "0.70920205", "0.70920205", "0.70920205", "0.70632565", "0.6997163", "0.6994117", "0.68997455", "0.6855474", "0.68003446", "0.6763374", "0.6753509", "0.6723456", "0.6722802", "0.6699715", "0.66582924", "0.66474557", "0.6618...
0.0
-1
Returns the first few lines of a file.
def head(filename, lines=5): from itertools import islice with open(filename, "r") as f: return list(islice(f, lines))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def head(file_name):\n #from itertools import islice\n with open('../test_files/' + file_name, 'r') as infile:\n list = infile.readlines()\n #printing the 1st 10 lines\n print('list of first 10 lines',list[:10])", "def read_file_first_line(filename):\n result = None\n with open(filename,...
[ "0.7563068", "0.7150089", "0.7069498", "0.7031684", "0.7002547", "0.700077", "0.69989806", "0.69676536", "0.6960286", "0.6866039", "0.68151474", "0.6755719", "0.6711644", "0.66920006", "0.6667594", "0.6606857", "0.6604088", "0.6467503", "0.64642733", "0.6448474", "0.6445988",...
0.8027319
0
List of ftrace tracers supported by the target's kernel.
def available_tracers(self): return self.target.read_value(self.available_tracers_file).split(' ')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_trace_list(self) -> List[Trace]:\n traces = self.CONFch.TRACe.CATalog.q()\n return [\n self.get_trace(tr_name) for _tr_no, tr_name in traces.comma_list_pairs()\n ]", "def available_functions(self):\n return self.target.read_value(self.available_functions_file).spl...
[ "0.5155804", "0.50418574", "0.49876532", "0.4854254", "0.483255", "0.48173532", "0.48074782", "0.47781605", "0.47650316", "0.47434604", "0.47068202", "0.4687243", "0.46697566", "0.46637073", "0.4634404", "0.46293625", "0.46089062", "0.4605567", "0.45630094", "0.45514292", "0....
0.5978413
0
this is where we'll generate the cannonical output name from a function name. right now that just means that we strip the 'make_' from the beginning of the function name, add INPUTS_DIR, and tack EXTENSION on to the end
def input_name_from_func_name(func_name): return os.path.join(INPUTS_DIR, ''.join(func_name.split('make_')[1:])) \ + '.%s' % EXTENSION
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_file_name_maker(args):\n log.debug(\"Entering output_file_name_maker()\")\n path = os.getcwd() + '/out_files/'\n if not os.path.isdir(path):\n os.mkdir(path)\n\n if args.output is None:\n out_file_name = path + args.input[:-4] + '_' + args.type + '_' + args.layer\n else:\n ...
[ "0.6630721", "0.66192883", "0.6388481", "0.637673", "0.6374839", "0.6334956", "0.63235456", "0.631591", "0.6311602", "0.6281102", "0.62400967", "0.62400967", "0.6230614", "0.620073", "0.6154631", "0.613816", "0.61082274", "0.6094512", "0.6085123", "0.60691476", "0.6050784", ...
0.81121916
0
add company data to every template context
def company_context(request): return {'COMPANY': settings.COMPANY}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_context_data(self, **kwargs):\n context = super().get_context_data(**kwargs)\n needle = self.kwargs.get('needle', None)\n if needle == 'Customers':\n context['object_list'] = self.object.company_set.all()\n elif needle == 'Domains':\n context['object_list']...
[ "0.59769374", "0.5878992", "0.5803282", "0.57501537", "0.5741075", "0.5703858", "0.570355", "0.5700627", "0.5565555", "0.5557163", "0.55502367", "0.54978806", "0.5474082", "0.5456616", "0.5455256", "0.5454932", "0.54474753", "0.5446852", "0.5443428", "0.5426705", "0.53685", ...
0.7447639
0
Sessionwide test `Flask` application.
def app(request) -> Flask: app = create_app() context = app.app_context() context.push() def teardown(): context.pop() request.addfinalizer(teardown) return app
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app():\n os.environ[\"FLASK_ENV\"] = \"test\"\n return create_app()", "def app() -> flask.Flask:\n test_app: flask.Flask = create_app(\"tests.conftest.TestConfig\")\n test_app.logger.setLevel(\"CRITICAL\")\n test_context = test_app.test_request_context()\n test_context.push()\n\n yield t...
[ "0.8047767", "0.75766337", "0.7453325", "0.7448997", "0.7378813", "0.7361134", "0.7335257", "0.7256735", "0.7174306", "0.7166491", "0.714767", "0.714767", "0.714767", "0.7147354", "0.7145838", "0.7138676", "0.71294713", "0.71052396", "0.70688695", "0.7067603", "0.7002536", ...
0.6723139
49
draws one random card from the deck and returns it
def deal_one(self): return self.deck.pop(randint(0, len(self.deck) - 1))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_a_card(cards):\n import random\n card_drawn = random.choices(card_deck)\n cards.append(card_drawn[0])\n return", "def _random_card(self) -> Cards.Card:\n\t\tif len(self.drawstack) < 1:\n\t\t\tfor col in list(Cards.CardColour):\n\t\t\t\t# Numbers 1-9 + Skip, Reverse, Draw2\n\t\t\t\tfor typ in...
[ "0.8149901", "0.7816289", "0.7407869", "0.7315001", "0.7306925", "0.7267437", "0.7252322", "0.72074425", "0.71777976", "0.7148348", "0.70956683", "0.7090318", "0.7075349", "0.7074859", "0.7065889", "0.7032502", "0.70314044", "0.7011141", "0.70110774", "0.6969344", "0.6853707"...
0.6622879
27
Get a random string.
def random_string(min_length: int = 5, max_length: int = 10) -> str: length = random.randint(min_length, max_length) return "".join( random.choice(string.ascii_uppercase + string.digits) for _ in range(length) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetRandomString(self):\n\n head = {\"content-type\": \"application/json-rpc\"}\n body = {\n \"jsonrpc\": \"2.0\",\n \"method\": \"generateStrings\",\n \"params\": [self.creds.randomAPIkey,\n 3,\n 16,\n \"abcdefghijklmno...
[ "0.8151106", "0.79691875", "0.7800456", "0.7728102", "0.76784295", "0.76164514", "0.7573819", "0.74909294", "0.7459922", "0.74476165", "0.744219", "0.7435981", "0.73742074", "0.7328814", "0.73145825", "0.7314018", "0.7311239", "0.7309643", "0.727563", "0.72671115", "0.7259680...
0.0
-1
Setter for grouping strategy class name.
def setGroupingStrategyFactory(self, groupSubscriptionStrategyFactory: cern.japc.core.spi.group.GroupSubscriptionStrategyFactory) -> None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _group_name(cls, group=None):\n suffix = f\"{cls.__module__}.{cls.__qualname__}\"\n if group is not None:\n suffix += \"-\" + group\n\n # Wrap the suffix into SHA256 to guarantee that the length of\n # the group name is limited. Otherwise Channels will complain\n #...
[ "0.6685318", "0.64206433", "0.6239823", "0.62090784", "0.6165498", "0.61312747", "0.6070135", "0.60434514", "0.60277456", "0.59668624", "0.5925897", "0.5925897", "0.5918849", "0.5916652", "0.5916652", "0.5777529", "0.57495826", "0.57432085", "0.5706014", "0.56976837", "0.5683...
0.6078432
6
Getter for service name.
def getServiceName(self) -> str: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def service_name(self) -> str:\n return pulumi.get(self, \"service_name\")", "def service_name(self) -> str:\n return pulumi.get(self, \"service_name\")", "def service_name(self):\n return self._service_name", "def service_name(self) -> pulumi.Output[str]:\n return pulumi.get(self...
[ "0.88019526", "0.88019526", "0.86254233", "0.85198915", "0.85198915", "0.85198915", "0.82421756", "0.82421756", "0.82421756", "0.8193178", "0.8193178", "0.8193178", "0.7893858", "0.7744526", "0.7376811", "0.7264741", "0.72288126", "0.7156122", "0.71441686", "0.7143552", "0.71...
0.8218741
9
create a dataframe for selected period and centre to reflect the percentage of units met the targets
def chart_data(indicator, start, period, centre='all', lim=2020): x = pd.DataFrame() logging.info((indicator, centre)) d = [t.strftime("%Y%m") for t in pd.date_range(start=start, periods=period/3, freq='-3M')] for date in d: x = x.append(met(indicator, date, cent=centre, lim=lim)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize_df(self, df):\n df['values'] = (self.tc.instrument_returns['cumulative'] *\n self.tc.starting_cash).mul(self.target_weights, axis=1).values * (1 - self.tc.commission)\n df['allocations'] = self.df['values'].div(df['values'].sum(axis=1), axis=0)\n df['retu...
[ "0.55154985", "0.53978485", "0.528577", "0.5283913", "0.526154", "0.5241061", "0.52362907", "0.5204985", "0.51255184", "0.5116088", "0.5088253", "0.50761104", "0.5063824", "0.5042515", "0.50090724", "0.4999344", "0.4994999", "0.4994919", "0.4944404", "0.49217716", "0.4920829"...
0.6477169
0
return a list of model_var given a vector of rules (according to the structure)
def transformListRulesToModelVar(model_path, list_rules): dict_var_qty = {} for rule in list_rules: variables_in_rule = rule[0] for variable in variables_in_rule: if variable[0] in dict_var_qty: dict_var_qty[variable[0]] = dict_var_qty[variable[0]] + 1 els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transformModelsToModelVarObj(list_models_path):\n list_models_vars = []\n for file_name_path in list_models_path:\n list_rules = getListRulesPerModel(file_name_path)\n model_var = transformListRulesToModelVar(file_name_path,list_rules)\n list_models_vars.append(model_var)\n return...
[ "0.67565286", "0.6175802", "0.5925038", "0.59124666", "0.57842046", "0.5718866", "0.5654402", "0.5637661", "0.5632623", "0.55979496", "0.5581548", "0.5537441", "0.5516785", "0.5491804", "0.54700035", "0.5467291", "0.5460307", "0.543591", "0.53885514", "0.5370467", "0.53584355...
0.6685036
1
Takes n values from a collection.
def take(n): def _take_xducer(step): outer_vars = {"counter": n} def _take_step(r=Missing, x=Missing): if r is Missing: return step() if x is Missing: return step(r) n = outer_vars["counter"] outer_vars["counter"] -= 1 r = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_n(self, n):\n \n return [self.get_values() for _ in range(n)]", "def take(n, iterable):\n return list(islice(iterable, n))", "def take(n, iterable):\n return list(islice(iterable, n))", "def take(n, iterable):\n return list(itertools.islice(iterable, n))", "def take(n, iterab...
[ "0.66616744", "0.6317616", "0.6317616", "0.627903", "0.627903", "0.6245617", "0.6128452", "0.6099519", "0.6033992", "0.59836906", "0.5975964", "0.5950458", "0.5948624", "0.5940565", "0.59275514", "0.5923068", "0.5851554", "0.5832658", "0.5829002", "0.5757956", "0.57387936", ...
0.0
-1
Do we get the expected 4xx response when we provide post POST body that doesn't validate
def test_pollination04(self): data = u'{"type":100}' result = self.init_test_app().post( '/pollination', data=data, content_type='application/json', headers={'accept': 'application/json'}) self.assertEqual(result.status_code, 400)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_missing_body(self):\n self.is_authenticated()\n response = self.post_without_body()\n self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)", "def test_POST(self):\n if not self.url:\n return\n response = self.client.post(self.url, {}, format='...
[ "0.7503146", "0.74045604", "0.73931885", "0.73931885", "0.7296342", "0.7257325", "0.72550946", "0.718477", "0.7128048", "0.7082223", "0.7022241", "0.70183444", "0.69805694", "0.6965229", "0.69422936", "0.6917144", "0.6913814", "0.6897702", "0.6895655", "0.6854882", "0.6842719...
0.0
-1
Do we get the expected 4xx response when we provide Contenttype != application/json
def test_pollination05(self): data = u'<blah>Not json</blah>' result = self.init_test_app().post( '/pollination', data=data, content_type='application/xml', headers={'accept': 'application/json'}) self.assertEqual(result.status_code, 415)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_content_type():\n return request.content_type == \"application/json\"", "def test_return_content_type(self):\n connection = self.get_connection()\n\n # Default\n connection.request('GET', '/api/notes/', headers={'Accept': 'application/json'})\n response = connection.getre...
[ "0.80479157", "0.73987037", "0.7332106", "0.7239976", "0.7226658", "0.7163515", "0.7107988", "0.7106063", "0.7031552", "0.6884946", "0.68774325", "0.6876216", "0.6873495", "0.6822044", "0.67813057", "0.66763985", "0.66651547", "0.6653047", "0.663921", "0.6622451", "0.6582271"...
0.0
-1
Do we get the expected 4xx response when we provide post POST body that has a farm field but doesn't validate
def test_pollination08(self): data = u'{"farm": {"type":100} }' result = self.init_test_app().post( '/pollination', data=data, content_type='application/json', headers={'accept': 'application/json'}) self.assertEqual(result.status_code, 400)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_POST2(self):\n payload = {\n \"id\": \"222\",\n \"make\": \"Wolkswagen\",\n \"model\": \"Golf\",\n \"year\": 2011,\n \"price\": 8600\n }\n r = requests.post(self.address, json=payload)\n self.assertEqual(r.status_code, 400)...
[ "0.6651218", "0.6527956", "0.6513634", "0.6512113", "0.6467218", "0.6451021", "0.6429019", "0.6421058", "0.63763595", "0.63763595", "0.63484925", "0.63340795", "0.6333534", "0.6300485", "0.62926745", "0.62863785", "0.62721485", "0.6268421", "0.62624806", "0.6261974", "0.62366...
0.5980024
51
Get bottom right on the screen
def get_bottom_right(left, right): x = right.x - (right.x - left.x) / 8 y = right.y - (right.y - left.y) / 8 return (x, y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bottom(self):\n return self.points['bottomRight'].y", "def bottom(self):\n return self.points['bottomRight'].y", "def bottom_right(self):\n return Point(self.right, self.bottom)", "def bottom(self):\n return self.top + self.height", "def bottomRightCorner(self):\n sel...
[ "0.79408973", "0.79408973", "0.7688371", "0.7356993", "0.73343635", "0.72078836", "0.7189966", "0.70640445", "0.70074105", "0.70074105", "0.7006438", "0.696601", "0.69335186", "0.6916524", "0.69058484", "0.6900546", "0.6900546", "0.68194574", "0.6797574", "0.67826897", "0.677...
0.7002868
11
Returns the associated isolate server.
def isolate_server(self): assert self._server return self._server
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isolate_server(self):\n return self._isolate_server", "def get_server():\n\n instance = Ceic._get_instance()\n\n return instance._ceic_configuration.server", "def get_server(self):\n return self.__server", "def get_server(self):\n\n pass", "def server(self):\n retu...
[ "0.82752734", "0.73025125", "0.71850723", "0.6969313", "0.68301916", "0.68301916", "0.6823826", "0.66718084", "0.6631983", "0.65645224", "0.64063483", "0.64063483", "0.64063483", "0.6386203", "0.63352203", "0.63291883", "0.6287141", "0.6282834", "0.6258896", "0.60610104", "0....
0.8056107
1
Returns the associated namespace.
def namespace(self): assert self._namespace return self._namespace
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def namespace(self):\n return self._namespace", "def namespace (self) :\n\n return self.__namespace__", "def get_namespace(self) -> str:\n return self._namespace", "def namespace(self):\n return self.__key.namespace()", "def namespace(self) -> Optional[str]:\n return pulumi.g...
[ "0.8301226", "0.82265085", "0.818686", "0.8104186", "0.801612", "0.801612", "0.801612", "0.7965273", "0.79465747", "0.79465747", "0.79465747", "0.79465747", "0.79465747", "0.7858032", "0.7766813", "0.7728095", "0.76953185", "0.7662718", "0.76589555", "0.7560276", "0.7560276",...
0.823305
1
Give a id for this Player.
def set_id(self, player_id): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_player_id(self, player_id):\n self.player_id = player_id", "def player_id(self, player_id):\n\n self._player_id = player_id", "def player_id(self, player_id):\n\n self._player_id = player_id", "def set_id(self, id):\n self.id = id\n print(\"self id = \" + str(self.i...
[ "0.74370134", "0.72394824", "0.72394824", "0.6987468", "0.69843906", "0.69656116", "0.69278145", "0.68677753", "0.68520963", "0.68513745", "0.6809674", "0.6807274", "0.6807274", "0.6807274", "0.6807274", "0.6807274", "0.6807274", "0.6807274", "0.6807274", "0.6807274", "0.6807...
0.8435845
0
Takes in the unigram and bigram count matrices. Creates dictionary containing the transition bigram
def generate_transition_bigram_probabilities(transition_unigram_counts, transition_bigram_counts): transition_bigram_probabilities = dict() for tag_bigram in transition_bigram_counts: transition_bigram_probabilities[tag_bigram] = float(transition_bigram_counts[tag_bigram])/transition_unigram_counts[tag_bigram[0]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bigram_model(list_of_words, unigram_count, bigram_count):\n if start_phrase not in list_of_words:\n list_of_words.insert(0, start_phrase)\n if end_phrase not in list_of_words:\n list_of_words.append(end_phrase)\n uni_count = pd.read_csv(unigram_count)\n bigram_count = pd.read_csv(bigr...
[ "0.72702533", "0.69034755", "0.6802402", "0.66034377", "0.62110776", "0.61765456", "0.6174871", "0.607641", "0.5864018", "0.5857016", "0.5842667", "0.58232355", "0.57563543", "0.57563114", "0.57395864", "0.5716679", "0.5686787", "0.56306404", "0.5616057", "0.5615956", "0.5606...
0.6879797
2
Exports the dictionary that contains labels and corresponding indices of words to a csv file.
def export_label_index_dict(label_index_dict): csv_file = open('output.csv', 'w') writer = csv.writer(csv_file) row = '' header = 'Type,Prediction\n' csv_file.write(header) for key in label_index_dict.keys(): row = key + ',' + label_index_dict[key] + '\n' csv_file.write(row)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_csv_label(labels, csv_file):\n with open(csv_file, 'w') as f:\n writer = csv.writer(f)\n for key, value in labels.items():\n writer.writerow([key, value])", "def writeFeatures(features, labels, output_filename):\n\twith open(output_filename, 'w') as csvfile:\n\t fieldname...
[ "0.69237185", "0.6917255", "0.6597108", "0.64524686", "0.6431126", "0.6369213", "0.6276799", "0.6133733", "0.6117025", "0.6115065", "0.60727835", "0.5991292", "0.59355754", "0.5916147", "0.5897449", "0.58910143", "0.5890916", "0.587915", "0.58785033", "0.5864244", "0.58566916...
0.80066663
0
Abort all waiting clients.
def abort(self): for key in self.listeners: sem = self.listeners[key] self.listeners[key] = None # TODO: Received data and semahore should be stored separately if isinstance(sem, asyncio.Semaphore): sem.release()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def terminateAll(self):\n with self.__queueLock:\n for queue in [self.__queue, self.__clientQueue]:\n queue.clear()\n\n for runList in [self.__running, self.__clientRunning]:\n unfinishedRuns = [run for run in runList if run is not None]\n for run in unfinishedRuns:\n run...
[ "0.71192616", "0.68579257", "0.6754822", "0.67002094", "0.6634478", "0.63861495", "0.63679624", "0.6363871", "0.6342832", "0.63143057", "0.63125604", "0.6268111", "0.6227206", "0.62240595", "0.620849", "0.6165955", "0.61580366", "0.61528635", "0.61461234", "0.6129989", "0.611...
0.6749697
3
Calculate the u and v wind components from wind speed and direction.
def spddir_to_uv(wspd, wdir): if isinstance(wspd, list) or isinstance(wdir, list): wspd = np.array(wspd, dtype=float) wdir = np.array(wdir, dtype=float) rad = 4.0 * np.arctan(1) / 180.0 u = -wspd * np.sin(rad * wdir) v = -wspd * np.cos(rad * wdir) # If the speed is zero, then u and...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_wdir(u,v):\n wdir = np.arctan2(u,v) * dper + 180.\n return wdir", "def wind_uv_to_spd(U, V):\n WSPD = np.sqrt(np.square(U) + np.square(V))\n return WSPD", "def windcal(v,u):\r\n \r\n ws = (u**2 + v**2)**0.5\r\n wd = np.arctan2(u,v)\r\n wd_ang = wd *180/np.pi\r\n wd_ang = wd_...
[ "0.6676565", "0.6648414", "0.64769393", "0.64678985", "0.64521706", "0.61794984", "0.6178912", "0.61161715", "0.6090697", "0.60595447", "0.6014731", "0.5993724", "0.5987498", "0.594977", "0.58914006", "0.58911014", "0.5884545", "0.5880258", "0.5867097", "0.5857762", "0.584073...
0.690899
0
Return a unit vector for a 2D vector.
def unit_vector(i, j): magnitude = np.sqrt(i ** 2 + j ** 2) unit_i = i / magnitude unit_j = j / magnitude return unit_i, unit_j
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit():\n return Vec2d(0, 1)", "def unit_vector(vector):\n unit_vector = np.zeros((len(vector), vector.shape[1]))\n norm = np.linalg.norm(vector, axis=1)\n ndim = vector.ndim\n\n if ndim == 1: # Handling of 1-dimensional array\n unit_vector = vector / norm\n elif ndim == 2: # H...
[ "0.80911076", "0.7583953", "0.75649786", "0.75649786", "0.75649786", "0.75540024", "0.75316215", "0.74928737", "0.74928737", "0.74928737", "0.74928737", "0.74928737", "0.74928737", "0.74928737", "0.74928737", "0.74928737", "0.74928737", "0.74928737", "0.7483679", "0.7442536", ...
0.7385416
23
generates a list of numbers between initial and final. eg. input fill_between(0,10) output [1,2,...,9]
def fill_between(initial,final): return np.arange(initial + 1, final)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_list(start: int, stop: int, step: int = 1) -> List[int]:\n # if start == stop:\n # print(start)\n # else:\n # res = []\n # while start < (stop + 1):\n # res.append(start)\n # start += step\n # print(res)\n\n return [item for item in range(star...
[ "0.6757427", "0.6554503", "0.6540405", "0.64606386", "0.6450871", "0.64365226", "0.63656837", "0.63607585", "0.63012767", "0.6230167", "0.62118906", "0.6154418", "0.6078806", "0.60544646", "0.6024539", "0.5990913", "0.5986559", "0.5980868", "0.59468067", "0.59426254", "0.5931...
0.83161664
0
Get the list of DatePoints this manager stores
def date_list(self): if self._date_list is None or self._file_modified: with open(self.data_filepath, 'r', newline='') as reader: reader = csv.reader(reader) self._date_list = [DatePoint.unfreeze(date[0]) for date in reader] self._file_modified = False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPurchaseDates(self):\n\t\treturn self.dateList", "def get_dates(self):\r\n return self.__dates", "def dates(self):\n pass", "def Dates(self):\n data = self.DictData()\n dates = [ row[ \"Date\"] for row in data ]\n return dates", "def points(self) -> PointList:\n ...
[ "0.6967293", "0.66155666", "0.608138", "0.6018917", "0.60054725", "0.5962662", "0.5852591", "0.5747891", "0.5712978", "0.57113594", "0.5700927", "0.5697336", "0.5677278", "0.56532454", "0.56502384", "0.56502384", "0.56502384", "0.56502384", "0.56502384", "0.56385374", "0.5624...
0.63666064
2
Get the start time of the current timerange (if it exists)
def start_time(self): start_time = self.cache.get('start_time') if start_time is not None: return DatePoint.unfreeze(start_time)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_time(self):\n # TODO: use pd.Timestamp instead\n return self.time[0].to_pydatetime()", "def start_time(self):\n return self.time_parser.start_time", "def start_time(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"start_time\")", "def start_time(self) ->...
[ "0.7471696", "0.74060816", "0.7357406", "0.7357406", "0.72568667", "0.72385174", "0.72187257", "0.7209534", "0.7197765", "0.71631676", "0.7160946", "0.71568507", "0.71568507", "0.71568507", "0.71568507", "0.71568507", "0.71568507", "0.71568507", "0.71568507", "0.715249", "0.7...
0.71024173
26
Set the start time for a new timerange
def start_time(self, value): if value is not None: value = value.freeze() self.cache['start_time'] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_time(self, start_time):\n self._start_time = start_time", "def start_time(self, start_time):\n self._start_time = start_time", "def start_time(self, start_time):\n\n self._start_time = start_time", "def start_time(self, start_time):\n\n self._start_time = start_time", ...
[ "0.7656718", "0.7656718", "0.75529903", "0.75529903", "0.75529903", "0.75529903", "0.75529903", "0.7463562", "0.7462333", "0.7107791", "0.70714456", "0.70532817", "0.701449", "0.70138264", "0.70021623", "0.6959222", "0.68422043", "0.68266857", "0.68042713", "0.6728841", "0.66...
0.64139956
27
Initialize from a frozen dict
def unfreeze(cls, frozen): timeframe = frozen.get('timeframe') finished_threshold = frozen.get('finished_threshold') if finished_threshold is not None: finished_threshold = timedelta(seconds=finished_threshold) # if there's no data or cache config an error has occurred ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _from_dict(cls, _dict):\n return cls.from_dict(_dict)", "def _from_dict(cls, _dict):\n return cls.from_dict(_dict)", "def _from_dict(cls, _dict):\n return cls.from_dict(_dict)", "def _from_dict(cls, _dict):\n return cls.from_dict(_dict)", "def _from_dict(cls, _dict):\n ...
[ "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395", "0.71415395"...
0.0
-1
Extracts list of strings(text property of QPushButton in self.buttons) for one given row.
def extractValuesColumn(self, row): ret = [] for j in range(self.shapeColumn): ret.append(self.buttons[row][j].text()) return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_results(self) -> List[str]:\n output = []\n for row in self.row_layout.children():\n if self.possible_values is None:\n text = row.itemAt(0).widget().text()\n else:\n text = row.itemAt(0).widget().currentText()\n\n if text != \"\"...
[ "0.6112099", "0.609661", "0.594698", "0.574644", "0.56583315", "0.56475604", "0.5609093", "0.5601508", "0.55659944", "0.549222", "0.5457595", "0.54499114", "0.5398269", "0.53693503", "0.5359774", "0.53166217", "0.5315597", "0.5313688", "0.52665055", "0.5211151", "0.5202507", ...
0.74068636
0
Resets the value of text property of QPushButtons in self.buttons to the initial value
def reset(self): for i in range(self.shapeRow): for j in range(self.shapeColumn): self.buttons[i][j].setText(" ")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\r\n\r\n self.make_board()\r\n\r\n # configure each buttons text option to an empty string\r\n for row in range(3):\r\n for column in range(3):\r\n self.board[row][column][0]['text'] = ''", "def clear_text(self):\n # use the .children attribut...
[ "0.6957211", "0.6805629", "0.66721416", "0.66121054", "0.6475105", "0.6377304", "0.63075817", "0.6248069", "0.6224556", "0.61870503", "0.6175603", "0.6147187", "0.6140553", "0.60580295", "0.5933571", "0.5933337", "0.5932643", "0.59222335", "0.58841836", "0.5836833", "0.583167...
0.6927504
1
Tests retrieving comments by post.
def test_retrieve_comment_by_post(self): self.factory.force_authenticate(user=self.user) response = self.factory.get(self.comment_by_post_url) self.assertEqual(1, response.data.get('count'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_comments_by_post(self):\n\n CommentFactory(author=self.user, body='Test comment 2', post=self.post)\n data = {\n 'post': self.post.id,\n }\n response = self.client.get(reverse('api:comments-list'), data)\n self.assertEqual(response.status_code, status.HTTP...
[ "0.8731827", "0.7249414", "0.7116133", "0.6883682", "0.6843346", "0.68232113", "0.67878413", "0.67185014", "0.667185", "0.6663989", "0.6632818", "0.6631826", "0.659794", "0.6547392", "0.6530747", "0.65231174", "0.64825916", "0.6480644", "0.63485324", "0.6344378", "0.6305463",...
0.8269749
1
Tests retrieving child comment.
def test_retrieve_child_comment(self): self.factory.force_authenticate(user=self.user) response = self.factory.get(self.child_comment_url) self.assertEqual(1, response.data.get('count'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_issue_get_comment(self):\n pass", "def test_post_matches_parent_when_parent_is_comment(self):\n post = create_a_post()\n parent = Comment.create(body=\"I'm a parent comment\", post=post)\n comment = Comment.create(body=\"I'm a child comment\", parent=parent)\n self.ass...
[ "0.67906404", "0.6775625", "0.66820216", "0.66153044", "0.6589334", "0.64227855", "0.64161164", "0.6391682", "0.625861", "0.6256233", "0.62547976", "0.62407607", "0.6169852", "0.6104241", "0.6091013", "0.60809535", "0.60560757", "0.6047148", "0.6045318", "0.59804225", "0.5978...
0.7927583
0
Plots the (smoothed) average for many time series plots, as well as plotting the min/max on the same figure Designed mostly to make good looking reward curves You can either pass in an Axes object you want us to draw on (useful if you are making subplots for example), otherwise we make a new one for you. We return whic...
def smooth_bounded_curve( data, time_steps=None, label=None, ax=None, window=100, color='k', alpha=.2 ): data = np.asarray(data) if ax is None: fig, ax = plt.subplots(1, 1) else: fig = None avg_data = np.zeros(data.shape[0]) for i in range(data.shape[1]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_average(*args, **kwargs):\n pyplot.figure(figsize=(15, 5))\n plot_average_impl(*args, **kwargs)\n pyplot.legend()", "def plot(self, ax=None, savefile=None, shells=None, color='b', title=None,\n xlabel=None, ylabel=None, withavg=False):\n import matplotlib.pyplot as plt\n ...
[ "0.67386675", "0.6129929", "0.61201936", "0.6118425", "0.60945594", "0.6060985", "0.59969354", "0.5970849", "0.596766", "0.591444", "0.59100664", "0.5844644", "0.58332294", "0.58100003", "0.57655126", "0.57497424", "0.57488143", "0.57265455", "0.5719692", "0.5703485", "0.5683...
0.0
-1
Returns all courses in the given queryset, plus Sections, Periods, and SectionPeriod data. Optionally can have all related data to be filtered by semester year and month. Since this operation performs multiple selects and merges the resulting queries, the queryset is actively evaluated.
def full_select(self, year=None, month=None, amount=None): from courses.models import SectionPeriod sps = SectionPeriod.objects.by_courses(self, year, month).select_related( 'period', 'section', 'section__course__id' ) # TODO: optimize into one loop sid2sps = dict_by...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_courses(self) -> None:\n\n courses_content: NavigableString = self.soup.find(\"div\", \n {\"class\": \"coursesContent\"})\n course_items: ResultSet = courses_content.find_all(\"div\", \n {\"class\": \"courseItem\"})\n\n for item in course_items:\n cour...
[ "0.56945807", "0.5608934", "0.55728096", "0.55554354", "0.54784656", "0.5406834", "0.53803873", "0.5341636", "0.52954787", "0.5284727", "0.5273403", "0.5241605", "0.5236115", "0.52102524", "0.52040535", "0.514425", "0.5136502", "0.5108133", "0.51016325", "0.50860673", "0.5084...
0.67250794
0
Loads PatchSets from a directory Loads patchsets for a whole dataset stored in subdirectories of patchsets_dir
def load_patchsets_from_directory(patchsets_dir: Path): patchset_dir_list = [x for x in Path(patchsets_dir).iterdir() if x.is_dir()] patchset_list = [PatchSet.load(p) for p in patchset_dir_list] return patchset_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadSets(self, indir=\"\"):\n\n if indir==\"\":\n print(\"specify folder\")\n return -1\n\n self.train = pd.read_pickle(\"{}/train.pkl\".format(indir))\n self.valid = pd.read_pickle(\"{}/valid.pkl\".format(indir))\n self.test = pd.read_pickle(\"{}/test.pkl\".fo...
[ "0.6319724", "0.62242323", "0.6157851", "0.60138506", "0.59787524", "0.5950172", "0.5950172", "0.5852212", "0.58365333", "0.5813799", "0.58093363", "0.5803925", "0.57615", "0.55967456", "0.5591764", "0.55741495", "0.55371463", "0.5518638", "0.551647", "0.55142206", "0.5506752...
0.8648056
0
Convenience function to load a json file; replacing some escaped characters.
def load_json(jsonfile): with open(jsonfile) as f: return json.load(f)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _loadf(fname):\n with open(fname, encoding=\"ISO-8859-1\") as f:\n return json.load(f)", "def load_from_json_file(filename):\n with open(filename, 'r') as f:\n json_string = json.load(f)\n return json_string", "def load_from_json_file(filename):\n with open(filename, encoding=...
[ "0.698979", "0.6444407", "0.64089966", "0.6394381", "0.6359974", "0.63434005", "0.63377756", "0.6334849", "0.6296286", "0.6242546", "0.6242434", "0.62273556", "0.62150127", "0.6181063", "0.61619115", "0.6147712", "0.61434597", "0.6139516", "0.6136372", "0.61289054", "0.609793...
0.60236245
24
Load yaml file into a dictionary.
def load_yml(yml_file): with open(yml_file) as src: cfg = yaml.load(src, Loader=yaml.Loader) return cfg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_yaml(file_path: str) -> dict:\n assert file_path.endswith(\".yaml\")\n with open(file_path) as file:\n return yaml.load(file, Loader=yaml.FullLoader)", "def load_yaml(path: str) -> Dict[str, Any]:\n with open(path, \"r\", encoding=\"utf8\") as fp:\n data = yaml.safe_load(fp)\n ...
[ "0.82135695", "0.8057586", "0.80450475", "0.7953633", "0.79486805", "0.7932278", "0.7908288", "0.78912544", "0.7841148", "0.78342724", "0.7746715", "0.770056", "0.7689767", "0.75456744", "0.75171316", "0.74319065", "0.7431888", "0.74032205", "0.7396535", "0.7394529", "0.73743...
0.7238204
26
checks if a value exceeds the maximum allowed
def exceeds_max(value, max_): if isinstance(value, (float, int)): val_ = value else: try: val_ = int(value) except: val_ = value if isinstance(max_, (float, int)): return (val_ > max_) else: if max_.isalnum(): try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_value(self, value):\n return (self.maximum_value is None) or (value <= self.maximum_value)", "def validate_value(value):\n if value > MAX_VALID_VALUE:\n raise ValueError(\"Invalid value, greater than MAX_VALID_VALUE: \" + str(value))", "def validate_maximum(value, maximum...
[ "0.7589242", "0.7588609", "0.7573441", "0.7452438", "0.744495", "0.7365776", "0.724542", "0.71891725", "0.7142924", "0.70393145", "0.69756645", "0.69311017", "0.69027686", "0.6817354", "0.6815962", "0.6790919", "0.67798704", "0.6731844", "0.66927695", "0.6654197", "0.66489196...
0.7549569
3
checks if a value exceeds the minimum allowed
def exceeds_min(value, min_): if isinstance(value, (float, int)): val_ = value else: try: val_ = int(value) except: val_ = value if isinstance(min_, (float, int)): return (val_ < min_) else: if min_.isalnum(): try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_value(self, value):\n return (self.maximum_value is None) or (value <= self.maximum_value)", "def _validate_value(self, value):\n if self.limits[0] <= value <= self.limits[1]:\n return True\n else:\n return False", "def validate_value(value):\n if...
[ "0.74899644", "0.74718946", "0.7316254", "0.73131645", "0.7310277", "0.72784644", "0.7259544", "0.71765536", "0.70416796", "0.6962093", "0.6946339", "0.6935235", "0.69337463", "0.69168234", "0.68843687", "0.6843558", "0.68088406", "0.6793784", "0.67766905", "0.6731918", "0.67...
0.73014504
5
Return whether a value is actually None (not falsey)
def is_none(obj): return obj is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_none(value):\n return not value is None", "def is_null(value: Any) -> bool:\n return not value", "def is_null(val):\n return (val is None)", "def _val_is_null(self, val):\r\n return val is None", "def is_null(self):\n return self.value is None", "def is_not_none(e):\n ...
[ "0.8786901", "0.83408076", "0.82544285", "0.82207644", "0.81948555", "0.8191309", "0.80587894", "0.8001875", "0.78156435", "0.78156435", "0.78156435", "0.78156435", "0.78156435", "0.7748051", "0.7736036", "0.7685862", "0.7646514", "0.7450564", "0.7404006", "0.73252124", "0.73...
0.8141926
6
Returns true if the user is an admin.
def is_staff(request): if request: if hasattr(request, 'user') and request.user.is_authenticated(): return request.user.is_staff return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_admin_user(self):\n if \"is_admin\" in self._properties and self.is_admin == 'YES':\n return True\n return False", "def is_admin(user):\n return user.is_authenticated and user.id == app.config.get('ADMIN')", "def is_admin(self, user):\n return user.name in self.adm...
[ "0.9000988", "0.8752404", "0.8724204", "0.8696026", "0.8686347", "0.8632643", "0.8601007", "0.8564637", "0.8517409", "0.8460239", "0.8458223", "0.83938295", "0.83872217", "0.833834", "0.83263", "0.8306745", "0.8306413", "0.82894474", "0.82636935", "0.82636935", "0.82521045", ...
0.0
-1
determines whether or not the site is a testserver. looks for 'test.welbornprod' domains. returns True/False.
def is_test_site(request_object): if (request_object is None or request_object.META is None or (not request_object)): # happens on errors, # Should always do what the live site does in case of error. return False # Get current server name for this instance. # Could be ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __matchDomain(self, cookieDomain, siteDomain):\n if not siteDomain:\n # empty URLs always match\n return True\n \n if cookieDomain.startswith(\".\"):\n cookieDomain = cookieDomain[1:]\n if siteDomain.startswith(\".\"):\n siteDomain = siteD...
[ "0.61874837", "0.6138271", "0.6063733", "0.58472294", "0.5844848", "0.58347887", "0.58227885", "0.57552624", "0.57399696", "0.57175887", "0.57092845", "0.57033116", "0.56786674", "0.56685036", "0.56659365", "0.5657037", "0.56339794", "0.5629722", "0.5628374", "0.5624892", "0....
0.7685936
0
returns repr(object_) to the template
def repr_(object_): return repr(object_)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def srepr(obj):\n return repr(str(obj))", "def get_str(self, obj):\n if self.pretty:\n return pprint.pformat(obj)\n else:\n return str(obj)", "def repr(space, w_object):\n return space.repr(w_object)", "def str_(object_):\n return str(object_)", "def __repr__(se...
[ "0.7416736", "0.723864", "0.72172844", "0.70896786", "0.7067116", "0.7040995", "0.70001686", "0.6887471", "0.6868755", "0.6816098", "0.6787675", "0.678411", "0.6782005", "0.6725407", "0.67083853", "0.67083853", "0.67083853", "0.67003375", "0.66359305", "0.6622372", "0.6593867...
0.83090186
0
Generator for returning an iterable of a sorted dict.
def sortdict(d): for skey in sorted(d.keys()): yield (skey, d[skey])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n if self._len_keys == 1:\n yield from self._dict.keys()\n else:\n for key in self._dict.keys():\n yield tuple(sorted(list(key)))", "def __iter__(self):\n for x in sorted(self.keys()):\n yield self[x]", "def __iter__(self)...
[ "0.7537245", "0.72960615", "0.72165626", "0.71541697", "0.6642028", "0.66383135", "0.64042133", "0.6370134", "0.63476074", "0.6317583", "0.62270194", "0.6214877", "0.6211422", "0.61927253", "0.6180829", "0.61189735", "0.60705745", "0.6050395", "0.60336286", "0.6028797", "0.60...
0.6448831
6
Get the department the employee is a manager of, if any. Returns None if the employee doesn't manage a department.
def is_manager(employee_id: int) -> Optional[str]: conn = database_connect() if(conn is None): return None cur = conn.cursor() try: # SQL statement and execute sql = """SELECT Department.name FROM Employee JOIN Department ON(Employee.empid = Department.manager)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def department(self):\n if \"department\" in self._prop_dict:\n return self._prop_dict[\"department\"]\n else:\n return None", "def department(self):\n if \"department\" in self._prop_dict:\n return self._prop_dict[\"department\"]\n else:\n ...
[ "0.72740996", "0.72740996", "0.6594332", "0.61883795", "0.56572664", "0.5618016", "0.55715513", "0.5471895", "0.53778946", "0.5298661", "0.5221295", "0.51791936", "0.51788175", "0.51264024", "0.5109757", "0.5070963", "0.50634587", "0.50572014", "0.5049087", "0.5036665", "0.50...
0.65743965
3
Get all models available.
def get_all_models() -> list: conn = database_connect() if(conn is None): return None cur = conn.cursor() try: # SQL statement and execute sql = """SELECT manufacturer, description, modelnumber, weight FROM Model""" cur.execute(sql, ()) # Attem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def availablemodels(self):\n return self.__models.keys()", "def get_models(self):\n self.load()\n return self._models", "def opt_get_all_models_rest_api():\n return retrieve_all_models()", "def models(self):\n \n # Call the Razor RESTful API to get a list of models\n ...
[ "0.8002594", "0.7855868", "0.7845527", "0.7506153", "0.7466212", "0.74539614", "0.740148", "0.7372067", "0.7362613", "0.72674173", "0.72212875", "0.7198061", "0.7198061", "0.7198061", "0.7198061", "0.71963716", "0.71325076", "0.7097075", "0.70757264", "0.7059527", "0.705927",...
0.67068106
36
Get model information about a device.
def get_device_model(device_id: int) -> Optional[dict]: conn = database_connect() if(conn is None): return None cur = conn.cursor() try: # SQL statement and execute sql = """SELECT M.manufacturer, M.modelNumber, M.description, M.weight FROM Device D JOIN Model ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_model(self):\n\n # Display info message\n log.info(\"get_model\")\n\n # Get model\n output = await self.send_command(self.cmd_get_model)\n\n # Display info message\n log.info(f\"get_model: output: '{output}'\")\n\n # Remove the useless information in t...
[ "0.7858946", "0.7565804", "0.7422205", "0.72161776", "0.7186269", "0.7038454", "0.70187384", "0.7007267", "0.6998547", "0.6994701", "0.69377434", "0.69189143", "0.688412", "0.6869331", "0.68622524", "0.68370205", "0.6824757", "0.67956823", "0.67872536", "0.67740077", "0.67394...
0.72861385
3
Constructs a ResNet32 model.
def sphere_resnet32(**kwargs): model = ResNet(32, **kwargs) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet34(**kwargs):\n model = ResNet(BasicBlock, [3, 4, 6, 3], **kwargs)\n\n return model", "def resnet34(**kwargs):\n model = ResNet(BasicBlock, [3, 4, 6, 3], **kwargs)\n return model", "def resnet34(pretrained=False):\n model = ResNet(BasicBlock, [3, 4, 6, 3])\n if pretrained:\n ...
[ "0.6857811", "0.68577653", "0.6768416", "0.67630184", "0.67630184", "0.67630184", "0.6720212", "0.6706112", "0.66980666", "0.66313994", "0.6602754", "0.65995735", "0.6594192", "0.6594192", "0.6594192", "0.6594192", "0.6594192", "0.65856785", "0.6577216", "0.6555677", "0.65235...
0.64462066
27
Constructs a ResNet20 model.
def sphere_resnet20(**kwargs): model = ResNet(20, **kwargs) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet18(**kwargs):\n model = ResNet(BasicBlock, [2, 2, 2, 2], **kwargs)\n return model", "def resnet10(**kwargs):\n model = ResNet(BasicBlock, [1, 1, 1, 1], **kwargs)\n return model", "def _init_model(self):\r\n\r\n self.model = ResNet152V2(weights='imagenet')", "def resnet18(pretrain...
[ "0.68054265", "0.6769135", "0.6736109", "0.66332465", "0.6598781", "0.65358216", "0.65358216", "0.65358216", "0.65358216", "0.65358216", "0.65321076", "0.6504928", "0.6504928", "0.6504928", "0.6490016", "0.6484339", "0.6465462", "0.63809526", "0.63374937", "0.63250715", "0.63...
0.5914259
66
Constructs a Wide ResNet20 model.
def sphere_wresnet20(**kwargs): model = ResNet(20, nfilter = [64,128,256], **kwargs) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wide_resnet50_2(pretrained=False, **kwargs):\n kwargs['width_per_group'] = 64 * 2\n model = ResNetFeatures(BottleneckFeatures, [3, 4, 6, 3], **kwargs)\n\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['wide_resnet50_2']))\n\n return model", "def wide_resnet50_2(pretr...
[ "0.6833108", "0.6772432", "0.677235", "0.666254", "0.6633174", "0.6633174", "0.6563137", "0.6563137", "0.60196525", "0.5959286", "0.59559304", "0.59548557", "0.5911998", "0.5892415", "0.58883816", "0.58730966", "0.5868275", "0.58521926", "0.58372015", "0.58035576", "0.5788725...
0.5742422
22
Constructs a Wide ResNet44 model.
def sphere_wresnet44(**kwargs): model = ResNet(44, nfilter = [64,128,256], **kwargs) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wide_resnet50_2(pretrained=False, progress=True, **kwargs):\n kwargs['width_per_group'] = 64 * 2\n return _resnet('wide_resnet50_2', BottleNeck, [3, 4, 6, 3], pretrained, progress, **kwargs)", "def wide_resnet50_2(pretrained=False, **kwargs):\n kwargs['width_per_group'] = 64 * 2\n model = ResNetF...
[ "0.6098681", "0.6098171", "0.5969081", "0.59660935", "0.592562", "0.5921091", "0.5879132", "0.5879132", "0.5775911", "0.5774355", "0.5774355", "0.57625824", "0.5719752", "0.5700402", "0.5624355", "0.5614046", "0.56058073", "0.5536847", "0.5529712", "0.5529712", "0.55279803", ...
0.6096573
2
Constructs a Wide ResNet110 model.
def sphere_wresnet110(**kwargs): model = ResNet(110, nfilter = [64,128,256], **kwargs) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wide_resnet101_2(pretrained=False, progress=True, **kwargs):\n kwargs['width_per_group'] = 64 * 2\n model = ResNetFeatures(BottleneckFeatures, [3, 4, 23, 3], **kwargs)\n\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['wide_resnet101_2']))\n\n return model", "def wid...
[ "0.6737875", "0.66705483", "0.6517462", "0.6517462", "0.6467853", "0.6423226", "0.63912845", "0.637803", "0.6310753", "0.6307391", "0.622101", "0.61968845", "0.61968845", "0.61850816", "0.6181025", "0.6181025", "0.6176833", "0.6130034", "0.6097025", "0.6082337", "0.6079806", ...
0.6051629
21
Returns an unpacked list of paramter vectors.
def slice_parameter_vectors(parameter_vector, components, no_parameters=3): return [ parameter_vector[:, i * components : (i + 1) * components] for i in range(no_parameters) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lfParams2paramsVec(params):\n paramsDict = params.valuesdict()\n paramsVec = [value for value in paramsDict.itervalues()]\n return paramsVec", "def getParamsToVector(self):\n #vectorise and concat weights arrays\n weights = np.concatenate( ( self.w_ih.flatten(), self.w_ho.flatten() ) )...
[ "0.72025543", "0.6694467", "0.66488713", "0.6574816", "0.6558012", "0.65054816", "0.645992", "0.64347994", "0.64329356", "0.63964003", "0.63870996", "0.63540524", "0.6345111", "0.6313194", "0.62959224", "0.6295262", "0.62132514", "0.6116678", "0.6113482", "0.610607", "0.61056...
0.6110365
19
How AI players shoot the ball
def ai_shoot(self, gk, goal_x): angles = { 1: { # For team 1 'SHOOT_E': math.pi/4, 'SHOOT_D': 0, 'SHOOT_C': -math.pi/4, }, 2: { # For team 2 'SHOOT_Q': math.pi*3/4, 'SHOOT_A': math.pi, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tick():\n move_balls(targets_speed)\n move_super_balls(targets_speed * 2)", "def run(self):\n ball = memory.world_objects.getObjPtr(core.WO_BALL)\n if not ball.seen or not ball.fromTopCamera:\n return\n \n # Ball coordinates\n ball_x, ball_y = ball.imageCen...
[ "0.71090597", "0.69444674", "0.69055235", "0.6872964", "0.68694293", "0.68297464", "0.6827642", "0.67595047", "0.67386496", "0.6598933", "0.6585952", "0.6570961", "0.6505021", "0.65034133", "0.64692724", "0.6465018", "0.640891", "0.6386491", "0.63763165", "0.6367294", "0.6363...
0.6118921
42
Apply 2D conv with weights shared only along rows. Adapted from K.local_conv2d by Arguments
def row_conv2d(inputs, kernel, kernel_size, strides, output_shape, data_format=None): data_format = K.normalize_data_format(data_format) stride_row, stride_col = strides output_row, output_col = output_shape out = [] for i in range(output_row): # Slice the rows with the neighbors they need...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv2d(args):\n inp_ = args[0]\n kernel = args[1]\n stride = args[2]\n padding = args[3]\n (batch_size, in_channels, H, W) = inp_.shape\n (out_channels, in_channels_t, Hk, Wk) = kernel.shape\n Hc = int((H - Hk)/stride)+1\n Wc = int((W - Wk)/stride)+1\n conv_layer = np.zeros((batch_s...
[ "0.75226367", "0.71647537", "0.71405834", "0.70397615", "0.70210564", "0.70210564", "0.6987808", "0.6963665", "0.69625884", "0.6953092", "0.69434124", "0.69271654", "0.6888202", "0.6882761", "0.6882761", "0.6882761", "0.6882761", "0.68627733", "0.6768935", "0.673708", "0.6711...
0.6130628
88
Initialize a weighted loss.
def __init__(self, loss_function, lats, data_format='channels_last', weighting='cosine'): self.loss_function = loss_function self.lats = lats self.data_format = K.normalize_data_format(data_format) if weighting not in ['cosine', 'midlatitude']: raise ValueError("'weighting' m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights_(self):\n raise NotImplementedError", "def _initialize_weights(self):\n pass", "def init_weights(self):\n # Initialize weights\n self.apply(self._init_weights)", "def loss_weights(self):\n return None", "def _weighted_loss(loss, weight):\n with ops.name_...
[ "0.7208863", "0.70746666", "0.6999407", "0.69561917", "0.69126636", "0.6837753", "0.68303114", "0.6815834", "0.68052065", "0.680438", "0.6783912", "0.6767571", "0.6767571", "0.67479706", "0.67407846", "0.6694107", "0.66802275", "0.6679501", "0.666942", "0.66458565", "0.663392...
0.0
-1
Check if certain position is cross
def is_cross(self, row, col): return self.field[row, col] == 'O'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crossunder(x, y):\n return x[-1] < y[-1] and x[-2] > y[-2]", "def crossover(x, y):\n return x[-1] > y[-1] and x[-2] < y[-2]", "def check_inside(self, pos):\n x,y = pos\n return x >= self.posx and x <= self.posx + self.sizex and y >= self.posy and y <= self.posy + self.sizey", "def is_in_colli...
[ "0.6963292", "0.69521195", "0.6877735", "0.67772996", "0.6722552", "0.66963834", "0.6661036", "0.662266", "0.6619683", "0.6601838", "0.6597616", "0.65967333", "0.6576726", "0.65745586", "0.6564663", "0.6517698", "0.6500501", "0.6483487", "0.6455018", "0.64377636", "0.6433994"...
0.7387848
0
Convert categorical data into vector.
def to_vector(mat): out = np.zeros((mat.shape[0],mat.shape[1])) out2 = np.zeros((mat.shape[0])) for i in range(mat.shape[0]): for n, j in enumerate(mat[i]): if j == np.amax(mat[i]): out[i][n] = 1 out2[i] = n return out2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_categorical(data, categories=[\"Silencer\", \"Inactive\", \"Weak enhancer\", \"Strong enhancer\"]):\n data = pd.Categorical(data, categories=categories, ordered=True)\n return data", "def categoricals(self):\n return base_64_to_object(self.categorical_hyperparameters_64)", "def _to_...
[ "0.7228695", "0.6804415", "0.66916335", "0.6679407", "0.6627832", "0.6536828", "0.6522575", "0.6455397", "0.6439088", "0.6396894", "0.63245434", "0.63245434", "0.62990606", "0.62917405", "0.62795585", "0.62512755", "0.6218438", "0.61958694", "0.6189332", "0.6184726", "0.61826...
0.0
-1
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`. From sklearn.com.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): plt.imshow(cm, interpolation='nearest', cmap=cmap) plt.title(title) plt.colorbar() tick_marks = np.arange(len(classes)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.81419444", "0.8108785", "0.80827504", "0.806871", "0.79542994", "0.795335", "0.7942482", "0.7940193", "0.793918", "0.79387665", "0.7930488", "0.79188406", "0.79145974", "0.79089075", "0.7904151", "0.7898085", "0.78872883", "0.787946", "0.78774655", "0.78770685", "0.7876012...
0.78030133
54
Return ``True`` if the sync map fragments which are the leaves of the sync map tree are all adjacent.
def has_adjacent_leaves_only(self): leaves = self.leaves() for i in range(len(leaves) - 1): current_interval = leaves[i].interval next_interval = leaves[i + 1].interval if not current_interval.is_adjacent_before(next_interval): return False ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leaves_are_consistent(self):\n self.log(u\"Checking if leaves are consistent\")\n leaves = self.leaves()\n if len(leaves) < 1:\n self.log(u\"Empty leaves => return True\")\n return True\n min_time = min([l.interval.begin for l in leaves])\n self.log([u\"...
[ "0.7319423", "0.6530777", "0.6509751", "0.6461713", "0.6363584", "0.6335099", "0.61958694", "0.6194637", "0.61618984", "0.61597484", "0.61222214", "0.61071444", "0.609492", "0.60827684", "0.607346", "0.60706186", "0.60676575", "0.6059726", "0.6024598", "0.60201997", "0.601431...
0.7376981
0
Return a JSON representation of the sync map.
def json_string(self): def visit_children(node): """ Recursively visit the fragments_tree """ output_fragments = [] for child in node.children_not_empty: fragment = child.value text = fragment.text_fragment output_fragments.appe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dump_map(self) -> str:\n return utils.to_json(self.mapping)", "def to_json(self):\n return json.dumps(self.dict)", "def to_json(self) -> str:\n\n return json.dumps({self._entry.key: self.to_dict()},\n separators=(',', ':'),\n ensure_asc...
[ "0.6738205", "0.66079587", "0.6498746", "0.64684904", "0.64524096", "0.6440455", "0.64316076", "0.64118135", "0.64021397", "0.6398541", "0.63971645", "0.63971645", "0.6379234", "0.63783246", "0.63570625", "0.63523465", "0.63383055", "0.6335061", "0.6323325", "0.63155055", "0....
0.0
-1
Return a deep copy of this sync map.
def clone(self): return deepcopy(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self) -> 'Map':\n return self.__class__(self)", "def copy(self):\n return self.from_dict(self.to_dict(True))", "def copy(self):\n return self.__class__(*self.maps[:-1], self.maps[-1].copy())", "def copy(self):\n return self.update({})", "def __copy__(self):\n d =...
[ "0.7486255", "0.74690014", "0.72880363", "0.72096294", "0.7171165", "0.70941067", "0.7062199", "0.70510286", "0.7047342", "0.70400524", "0.70242065", "0.69730014", "0.6968648", "0.6968648", "0.6968648", "0.6968648", "0.6968648", "0.6968648", "0.6968648", "0.6968648", "0.69686...
0.6817725
49
Gets the infer_from_volume of this V1InstancetypeMatcher. InferFromVolume lists the name of a volume that should be used to infer or discover the instancetype to be used through known annotations on the underlying resource. Once applied to the InstancetypeMatcher this field is removed.
def infer_from_volume(self): return self._infer_from_volume
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def infer_from_volume(self, infer_from_volume):\n\n self._infer_from_volume = infer_from_volume", "def volume_type(self) -> Optional['ImageRecipeEbsInstanceBlockDeviceSpecificationVolumeType']:\n return pulumi.get(self, \"volume_type\")", "def volume_type(self) -> pulumi.Input[str]:\n retu...
[ "0.67935944", "0.5259939", "0.52572536", "0.52572536", "0.52572536", "0.5202766", "0.5198747", "0.5057213", "0.48220143", "0.45793012", "0.45634255", "0.45050117", "0.4460283", "0.44045213", "0.4394361", "0.43930328", "0.43930328", "0.43533045", "0.43070012", "0.42998278", "0...
0.6860095
0
Gets the kind of this V1InstancetypeMatcher.
def kind(self): return self._kind
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kind(self):\r\n return TypeKind.from_id(self._kind_id)", "def kind(self):\n return self._kind()", "def get_kind(self):\n\n return self._kind", "def kind(self) -> Optional[pulumi.Input[Union[str, 'Kind']]]:\n return pulumi.get(self, \"kind\")", "def instance_type(self) -> Opt...
[ "0.68519145", "0.6798443", "0.6776659", "0.6745071", "0.6632163", "0.6616803", "0.6570146", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0...
0.68037
1
Sets the kind of this V1InstancetypeMatcher.
def kind(self, kind): self._kind = kind
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type(self, kind):\n self.type = kind", "def SetKind(self, new_kind):\r\n\r\n self.kind = new_kind", "def setKind(self, *args):\n return _libsbml.Group_setKind(self, *args)", "def set_animal_type(self, type):\n self.__animal_type = type", "def kind(self):\r\n return Ty...
[ "0.6455525", "0.6433481", "0.54713297", "0.5424579", "0.5371051", "0.5353109", "0.5353109", "0.52752435", "0.52738905", "0.52656156", "0.5262199", "0.5230913", "0.51952267", "0.5185055", "0.5125558", "0.5102749", "0.50909984", "0.50909984", "0.5090743", "0.50399154", "0.50182...
0.6711593
0
Gets the name of this V1InstancetypeMatcher. Name is the name of the VirtualMachineInstancetype or VirtualMachineClusterInstancetype
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getName(self):\n return _libsbml.SpeciesTypeInstance_getName(self)", "def name(self):\n return self._client.project_name + '/instances/' + self.instance_id", "def type_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"type_name\")", "def name(self) -> str:\n ...
[ "0.6641133", "0.6453844", "0.6434938", "0.6413062", "0.64030796", "0.63933057", "0.6367003", "0.6367003", "0.63240635", "0.6320656", "0.62780607", "0.62427205", "0.61970764", "0.61956644", "0.61552864", "0.61552864", "0.60923237", "0.6068694", "0.6068694", "0.6068694", "0.606...
0.0
-1
Sets the name of this V1InstancetypeMatcher. Name is the name of the VirtualMachineInstancetype or VirtualMachineClusterInstancetype
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_instance_name(self, name):\n self.__instance_name = name", "def set_name(self, name):\n self.class_name = name", "def SetName(self, name):\n self.name = name", "def setName(self, *args):\n return _libsbml.SpeciesTypeInstance_setName(self, *args)", "def set_name(self, na...
[ "0.6831256", "0.6577869", "0.6465755", "0.63801515", "0.63528067", "0.63407886", "0.6324441", "0.6324441", "0.6324441", "0.6324441", "0.6324441", "0.63214266", "0.63214266", "0.63214266", "0.63214266", "0.6293642", "0.6293642", "0.6270298", "0.6246205", "0.62237436", "0.62221...
0.5989871
96
Gets the revision_name of this V1InstancetypeMatcher. RevisionName specifies a ControllerRevision containing a specific copy of the VirtualMachineInstancetype or VirtualMachineClusterInstancetype to be used. This is initially captured the first time the instancetype is applied to the VirtualMachineInstance.
def revision_name(self): return self._revision_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_revision(self) -> str:\n raise NotImplementedError", "def revision_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"revision_id\")", "def revision_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"revision_id\")", "def revision_name(self, revision_na...
[ "0.5930421", "0.5832373", "0.56634843", "0.5642108", "0.56332916", "0.5617286", "0.5599239", "0.5599239", "0.55049074", "0.5437495", "0.53946596", "0.53627014", "0.52907014", "0.5288136", "0.5269732", "0.5256777", "0.5225539", "0.5221635", "0.5187551", "0.51847583", "0.517289...
0.7437482
0
Sets the revision_name of this V1InstancetypeMatcher. RevisionName specifies a ControllerRevision containing a specific copy of the VirtualMachineInstancetype or VirtualMachineClusterInstancetype to be used. This is initially captured the first time the instancetype is applied to the VirtualMachineInstance.
def revision_name(self, revision_name): self._revision_name = revision_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def revision_name(self):\n return self._revision_name", "def revision(self, revision):\n\n self._revision = revision", "def revision(self, revision):\n\n self._revision = revision", "def version_name(self, version_name):\n\n self._version_name = version_name", "def revision_date...
[ "0.6077396", "0.5887768", "0.5887768", "0.5557397", "0.5485677", "0.53572", "0.5241066", "0.5112764", "0.50767004", "0.5017641", "0.4926791", "0.4926791", "0.4926791", "0.4926791", "0.49181154", "0.48859185", "0.48621053", "0.48197612", "0.48039836", "0.47604755", "0.47476882...
0.765607
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, V1InstancetypeMatcher): 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