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
eq method that perform __ne__ method
def __eq__(self, other): return super().__ne__(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other):\n return not (self == other) # opposite of __eq__", "def __ne__(self, rhs):\n return not self.__eq__(rhs)", "def __ne__(self, other):\n return not (self == other) # opposite of __eq__", "def __ne__(self, other):\r\n return not self.__eq__...
[ "0.88770354", "0.88742405", "0.8809184", "0.8761984", "0.8761984", "0.8761984", "0.8761984", "0.87541413", "0.8751499", "0.87397474", "0.87127596", "0.8711894", "0.8711894", "0.8711894", "0.8711894", "0.8711894", "0.8711894", "0.8711894", "0.8711894", "0.8711894", "0.8711894"...
0.0
-1
ne method that perform __eq__ method
def __ne__(self, other): return super().__eq__(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other):\n return not (self == other) # opposite of __eq__", "def __ne__(self, other):\n return not (self == other) # opposite of __eq__", "def __ne__(self, other):\n return super().__eq__(other)", "def __ne__(self,other):\n return not (self =...
[ "0.8786585", "0.8695068", "0.8662148", "0.86311805", "0.8631078", "0.86138344", "0.8609828", "0.8609828", "0.8609828", "0.8609828", "0.8574487", "0.8574215", "0.8574215", "0.8574215", "0.85555977", "0.85373557", "0.8534955", "0.8534955", "0.8534955", "0.8534955", "0.8534955",...
0.85802174
10
Return the name of the sensor.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._sensor.name", "def get_sensor_name(self):\n return self.data[1]", "def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'", "def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso...
[ "0.91896784", "0.9168378", "0.890185", "0.8770976", "0.8511273", "0.8479953", "0.844435", "0.8299758", "0.8186503", "0.8105667", "0.8079737", "0.8066149", "0.8049647", "0.7700968", "0.7612295", "0.7611456", "0.7600605", "0.7600605", "0.7600605", "0.75392073", "0.75166553", ...
0.0
-1
Return the name of the sensor.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._sensor.name", "def get_sensor_name(self):\n return self.data[1]", "def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'", "def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso...
[ "0.91896784", "0.9168378", "0.890185", "0.8770976", "0.8511273", "0.8479953", "0.844435", "0.8299758", "0.8186503", "0.8105667", "0.8079737", "0.8066149", "0.8049647", "0.7700968", "0.7612295", "0.7611456", "0.7600605", "0.7600605", "0.7600605", "0.75392073", "0.75166553", ...
0.0
-1
Returns energy of signals Input
def energy(data): return np.real(np.mean(np.abs(data)**2, axis=1))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def energy(data):\n return sum(pow(data, 2))", "def energy_func(self):\n i = self.inl[0].to_flow()\n o = self.outl[0].to_flow()\n\n T_m = (T_mix_ph(i, T0=self.inl[0].T.val_SI) +\n T_mix_ph(o, T0=self.outl[0].T.val_SI)) / 2\n\n return (i[0] * (o[2] - i[2]) -\n ...
[ "0.74539125", "0.73668975", "0.734908", "0.7330229", "0.70691025", "0.69918275", "0.6969906", "0.6968526", "0.6925305", "0.6924448", "0.6916342", "0.6916342", "0.6878967", "0.6873875", "0.6851967", "0.68502253", "0.6778989", "0.67653644", "0.67576635", "0.67346144", "0.671166...
0.71532893
4
Returns value of time delayed correlation divided by the autocorrelation value at index 0 Input
def time_lag(data): normalize = [i for i in range(1,len(data[0])+1)] normalize += normalize[-2::-1] idx = len(data[0])//4 def win(sig): res = fftconvolve(sig, np.conj(sig)[::-1])/normalize res[len(res)//2] = 0 return res[idx:idx*7] autocorr = np.apply_along_axis(win, 1, data)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autocorrelation(df,maxt,step,vari,acquisiton_time,division_time):\n maxt = int(maxt/acquisiton_time)\n step = int(step/acquisiton_time)\n df = connect_cells(df,vari)\n return np.vstack([correlation(df,Dt,vari) for Dt in\\\n np.arange(0,maxt,step)]),\\\n np.arange(0,maxt,...
[ "0.75204104", "0.72201633", "0.72201633", "0.68258625", "0.6763687", "0.67410463", "0.67043513", "0.6569533", "0.6553229", "0.65011364", "0.64482677", "0.63403153", "0.6335327", "0.6311573", "0.6292571", "0.62570536", "0.61131376", "0.6104567", "0.60987854", "0.60646856", "0....
0.58983386
30
Initializes and loads pretrained weights into keras model to be used for predictions
def load_model(): with open(JSON_PATH, 'r') as json_file: loaded_model_json = json_file.read() json_model = model_from_json(loaded_model_json) json_model.load_weights(WEIGHT_PATH) return json_model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights(self):\n if isinstance(self.pretrained, str):\n logger = get_root_logger()\n logger.info(f'load model from: {self.pretrained}')\n load_checkpoint(self, self.pretrained, strict=False, logger=logger)\n elif self.pretrained is None:\n pass\n ...
[ "0.7807636", "0.7653893", "0.7606445", "0.75633806", "0.75384676", "0.74907386", "0.74720407", "0.7401177", "0.73937416", "0.7373611", "0.73517513", "0.7344743", "0.731559", "0.7271702", "0.71496797", "0.7135254", "0.7094846", "0.7069883", "0.7056611", "0.7049634", "0.7014838...
0.0
-1
Assumes email has already been run through normalize_email to strip bad chars
def email_domain(email): parts = email.split("@") if len(parts) == 2: return parts[1] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_email(self, email):\n return email", "def clean_email(email: str):\n return email.lower()", "def _normalize_email_address(email_address: str) -> str:\n normalized = email_address.strip().lower()\n\n if not normalized or (' ' in normalized) or ('@' not in normalized):\n raise Va...
[ "0.80541974", "0.78632313", "0.7704175", "0.76417613", "0.73922247", "0.7377972", "0.7285892", "0.7260525", "0.7222684", "0.721462", "0.70276254", "0.69777447", "0.6966539", "0.6951345", "0.69241154", "0.68350315", "0.6834116", "0.67052376", "0.6663346", "0.6617018", "0.65281...
0.0
-1
Set up a course to be used for testing.
def setUpClass(cls): # pylint: disable=super-method-not-called with cls.setUpClassAndTestData(): with cls.store.default_store(ModuleStoreEnum.Type.split): cls.course = CourseFactory.create( org='edX', number='test', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_course(self):\r\n course = CourseFactory(start=datetime(2013, 9, 16, 7, 17, 28))\r\n course = modulestore().get_course(course.id) # pylint: disable=no-member\r\n return course", "def setUp(self):\r\n self.uname = 'testuser'\r\n self.email = 'test+courses@edx.org'\r\...
[ "0.7543318", "0.74609995", "0.74453825", "0.74381506", "0.73233366", "0.73011017", "0.7278321", "0.7246862", "0.72162974", "0.72162974", "0.7191703", "0.71299064", "0.71258765", "0.7067824", "0.70447737", "0.70252365", "0.70240486", "0.7020997", "0.7017215", "0.69380724", "0....
0.69766504
19
Set up and enroll our fake user in the course.
def setUpTestData(cls): super().setUpTestData() cls.staff_user = StaffFactory(course_key=cls.course.id, password=TEST_PASSWORD)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_user(self):\r\n self.email = 'foo@test.com'\r\n self.password = 'bar'\r\n self.username = 'test'\r\n self.create_account(self.username,\r\n self.email, self.password)\r\n self.activate_user(self.email)\r\n self.login(self.email, self.pa...
[ "0.73771185", "0.7309003", "0.73002857", "0.7293236", "0.7274657", "0.7257481", "0.7236017", "0.7222674", "0.71984", "0.7178885", "0.7119808", "0.71079326", "0.7103533", "0.7090852", "0.70875585", "0.70875585", "0.70763123", "0.70687085", "0.70587665", "0.7045516", "0.7044884...
0.0
-1
Ensure that a user accessing a nonlive course sees a redirect to the student dashboard, not a 404.
def test_non_live_course(self): future_course = self.create_future_course() self.create_user_for_course(future_course, CourseUserType.ENROLLED) url = course_home_url(future_course) response = self.client.get(url) start_date = strftime_localized(future_course.start, 'SHORT_DATE')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_non_staff_light(self, course):\r\n urls = [reverse('about_course', kwargs={'course_id': course.id.to_deprecated_string()}),\r\n reverse('courses')]\r\n for url in urls:\r\n check_for_get_code(self, 200, url)", "def _check_staff(self, course):\r\n names = ...
[ "0.72274464", "0.72018546", "0.71529496", "0.7152203", "0.687942", "0.6872075", "0.6864527", "0.68441504", "0.68354946", "0.6781809", "0.6769826", "0.6757323", "0.6723594", "0.672075", "0.66942954", "0.66787547", "0.66766423", "0.66756266", "0.6652672", "0.65802264", "0.64811...
0.61532295
46
Test that users with the above roles for a course do not lose access
def test_course_does_not_expire_for_user_with_course_role(self, role_name): course = CourseFactory.create(start=THREE_YEARS_AGO) url = course_home_url(course) user = UserFactory.create() role = RoleFactory(name=role_name, course_id=course.id) role.users.add(user) # ensu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_org_and_course_roles(self):\r\n OrgInstructorRole(self.course_key.org).add_users(self.student)\r\n CourseInstructorRole(self.course_key).add_users(self.student)\r\n self.assertTrue(\r\n OrgInstructorRole(self.course_key.org).has_user(self.student),\r\n \"Student ...
[ "0.773638", "0.745564", "0.744626", "0.7214766", "0.71743405", "0.7137396", "0.7109235", "0.7108579", "0.7100365", "0.7085288", "0.6937759", "0.6914626", "0.6903327", "0.6866411", "0.66702443", "0.663672", "0.66278666", "0.66277665", "0.6626024", "0.6607813", "0.66031235", ...
0.7542466
1
Ensure that a user accessing an expired course sees a redirect to the student dashboard, not a 404.
def test_expired_course(self): CourseDurationLimitConfig.objects.create(enabled=True, enabled_as_of=datetime(2010, 1, 1, tzinfo=UTC)) course = CourseFactory.create(start=THREE_YEARS_AGO) url = course_home_url(course) for mode in [CourseMode.AUDIT, CourseMode.VERIFIED]: Cours...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_redirection_unenrolled(self):\r\n self.login(self.unenrolled_user)\r\n response = self.client.get(reverse('courseware',\r\n kwargs={'course_id': self.course.id.to_deprecated_string()}))\r\n self.assertRedirects(response,\r\n ...
[ "0.69984317", "0.6886888", "0.67871356", "0.6735313", "0.67191654", "0.6698633", "0.65927035", "0.6569288", "0.6520944", "0.6494992", "0.6464499", "0.6417957", "0.6414027", "0.6375892", "0.6362667", "0.6362265", "0.63492113", "0.6347341", "0.6346042", "0.632864", "0.6306145",...
0.66247153
6
Ensure that a user accessing a course with an expired upgrade deadline will still see the course expiration banner without the upgrade related text.
def test_expiration_banner_with_expired_upgrade_deadline(self): past = datetime(2010, 1, 1, tzinfo=UTC) CourseDurationLimitConfig.objects.create(enabled=True, enabled_as_of=past) course = CourseFactory.create(start=now() - timedelta(days=10)) CourseModeFactory.create(course_id=course.id,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_expired_course(self):\n CourseDurationLimitConfig.objects.create(enabled=True, enabled_as_of=datetime(2010, 1, 1, tzinfo=UTC))\n course = CourseFactory.create(start=THREE_YEARS_AGO)\n url = course_home_url(course)\n\n for mode in [CourseMode.AUDIT, CourseMode.VERIFIED]:\n ...
[ "0.70549315", "0.7037028", "0.69530153", "0.678557", "0.6493238", "0.6158982", "0.6044835", "0.5925833", "0.5909538", "0.589503", "0.5868578", "0.5843426", "0.5760653", "0.57305783", "0.568584", "0.56354064", "0.5613627", "0.5600847", "0.5599188", "0.55946547", "0.5562692", ...
0.7827058
0
Verify that enrolled users are NOT shown the course expiration banner and can access the course home page if course audit only
def test_audit_only_not_expired(self): CourseDurationLimitConfig.objects.create(enabled=True, enabled_as_of=datetime(2010, 1, 1, tzinfo=UTC)) audit_only_course = CourseFactory.create() self.create_user_for_course(audit_only_course, CourseUserType.ENROLLED) response = self.client.get(cour...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_course_does_not_expire_for_verified_user(self):\n course = CourseFactory.create(start=THREE_YEARS_AGO)\n url = course_home_url(course)\n\n user = UserFactory.create(password=self.TEST_PASSWORD)\n CourseEnrollment.enroll(user, self.course.id, mode=CourseMode.VERIFIED)\n S...
[ "0.7282275", "0.70456076", "0.6942318", "0.6898005", "0.6897454", "0.68026537", "0.6783163", "0.6685061", "0.66487503", "0.66321903", "0.66314936", "0.66267633", "0.6583222", "0.6577972", "0.6559998", "0.65554726", "0.65512407", "0.6549875", "0.6517782", "0.65137273", "0.6504...
0.7860571
0
Ensure that a user accessing an expired course that is in the holdback does not get redirected to the student dashboard, not a 404.
def test_expired_course_in_holdback(self): CourseDurationLimitConfig.objects.create(enabled=True, enabled_as_of=datetime(2010, 1, 1, tzinfo=UTC)) course = CourseFactory.create(start=THREE_YEARS_AGO) url = course_home_url(course) for mode in [CourseMode.AUDIT, CourseMode.VERIFIED]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_redirection_unenrolled(self):\r\n self.login(self.unenrolled_user)\r\n response = self.client.get(reverse('courseware',\r\n kwargs={'course_id': self.course.id.to_deprecated_string()}))\r\n self.assertRedirects(response,\r\n ...
[ "0.71588475", "0.6951009", "0.68979967", "0.68744254", "0.68110615", "0.6723449", "0.66910064", "0.6596273", "0.65558255", "0.6538769", "0.6525786", "0.65024704", "0.649321", "0.6466169", "0.6466029", "0.6457578", "0.64539844", "0.64404774", "0.6431558", "0.642494", "0.641806...
0.6862092
4
Ensure that a user accessing a nonlive course sees a redirect to the student dashboard, not a 404, even if the localized date is unicode
def test_non_live_course_other_language(self, mock_strftime_localized): future_course = self.create_future_course() self.create_user_for_course(future_course, CourseUserType.ENROLLED) fake_unicode_start_time = "üñîçø∂é_ßtå®t_tîµé" mock_strftime_localized.return_value = fake_unicode_star...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_none_user_index_access_with_startdate_fails(self):\r\n request = self.factory.get('/')\r\n request.user = AnonymousUser()\r\n student.views.index(request)", "def test_start_date_handling(self):\n # The course home page should 404 for a course starting in the future\n f...
[ "0.63017917", "0.61992204", "0.6144457", "0.61263895", "0.608192", "0.60813487", "0.6058384", "0.6055026", "0.58574253", "0.5835727", "0.58272356", "0.57967734", "0.5771061", "0.5691562", "0.5624477", "0.56204987", "0.56090266", "0.5551723", "0.5550364", "0.5540801", "0.55328...
0.6401521
0
Ensure a nonexistent course results in a 404.
def test_nonexistent_course(self): self.create_user_for_course(self.course, CourseUserType.ANONYMOUS) url = course_home_url_from_string('not/a/course') response = self.client.get(url) assert response.status_code == 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_course_does_not_exist(self):\n self.client.login(username=self.student.username, password=self.password)\n base_url = reverse(\n self.namespaced_url,\n kwargs={\n 'course_id': 'course-v1:MITx+8.MechCX+2014_T1',\n }\n )\n url = f\"...
[ "0.82550013", "0.82004195", "0.81973284", "0.8084267", "0.7920346", "0.77130467", "0.7471071", "0.7455274", "0.73526365", "0.7308986", "0.7066356", "0.70101947", "0.69967324", "0.6933393", "0.68987554", "0.679313", "0.67680156", "0.67572755", "0.6739305", "0.67033225", "0.660...
0.843812
0
Ensure that the following five use cases work as expected. 1) Unenrolled users are not shown the update goal selection field. 2) Enrolled users are not shown the update goal selection field if they have not yet set a course goal. 3) Enrolled users are shown the update goal selection field if they have set a course goal...
def test_course_goal_updates(self): # Create a course with a verified track. verifiable_course = CourseFactory.create() add_course_mode(verifiable_course, upgrade_deadline_expired=False) # Verify that unenrolled users are not shown the update goal selection field. user = self.cr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_course_goals(self):\n # Create a course with a verified track.\n verifiable_course = CourseFactory.create()\n add_course_mode(verifiable_course, upgrade_deadline_expired=False)\n\n # Verify that unenrolled users are not shown the set course goal message.\n user = self.cr...
[ "0.61162734", "0.60500157", "0.5862605", "0.5819683", "0.57155794", "0.57096505", "0.570498", "0.56325775", "0.5628115", "0.56022304", "0.55599767", "0.5535152", "0.55170715", "0.55148154", "0.55023074", "0.5500509", "0.5497572", "0.54873794", "0.54870325", "0.54865664", "0.5...
0.70880234
0
Gets information about a specified resolver rule, such as the domain name that the rule forwards DNS queries for and the ID of the outbound resolver endpoint that the rule is associated with.
def get_resolver_rule(ResolverRuleId=None): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resolver_rule_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"resolver_rule_id\")", "def get_resolver_rule_association(ResolverRuleAssociationId=None):\n pass", "def get_resolver_rule_policy(Arn=None):\n pass", "def get(self, request, id_rule):\n operator = PluginsOperator...
[ "0.66598713", "0.63115674", "0.5940835", "0.5804203", "0.56889963", "0.55630994", "0.55615026", "0.54959", "0.5488592", "0.548049", "0.54780525", "0.5471152", "0.52932155", "0.52744585", "0.5209656", "0.5195144", "0.5160051", "0.5155589", "0.51304007", "0.51199746", "0.511852...
0.75601524
0
Gets information about a resolver rule policy. A resolver rule policy specifies the Resolver operations and resources that you want to allow another AWS account to be able to use.
def get_resolver_rule_policy(Arn=None): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def policy_info(self) -> 'outputs.PolicyInfoResponse':\n return pulumi.get(self, \"policy_info\")", "def get_policy(client, policy_name):\n response = client.describe_firewall_policy(\n FirewallPolicyName=policy_name,\n )\n return response", "def policy_rules(self) -> Sequence[Any]:\n retur...
[ "0.63734883", "0.6212245", "0.6182957", "0.6095137", "0.5914357", "0.58854", "0.5811441", "0.57905704", "0.5756436", "0.5756436", "0.5756436", "0.57122034", "0.56845725", "0.55569136", "0.5523748", "0.5480657", "0.5476058", "0.5387759", "0.5387759", "0.53782386", "0.5334994",...
0.7668693
0
Return the URL from the checkout URL for cart
def get_checkout_url(request): return urlresolvers.reverse('checkout_show')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _cart_url(self):\n if self.settings[\"LIVE\"]:\n base = \"https://checkout.google.com/api/checkout/v2/merchantCheckout/Merchant/%s\"\n else:\n base = \"https://sandbox.google.com/checkout/api/checkout/v2/merchantCheckout/Merchant/%s\"\n return base % self.settings[\"M...
[ "0.8255255", "0.72140896", "0.6362759", "0.62617844", "0.6225975", "0.6071169", "0.604239", "0.5938563", "0.5922205", "0.58993495", "0.58876735", "0.58804446", "0.5831495", "0.5825609", "0.5819463", "0.58012265", "0.57886815", "0.5730025", "0.5725324", "0.5693044", "0.5612978...
0.74933445
1
Mock darksky forecast loading.
def load_forecastMock(key, lat, lon, units, lang): # pylint: disable=invalid-name return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_setup(self, mock_req, mock_get_forecast):\n uri = (\n r\"https://api.(darksky.net|forecast.io)\\/forecast\\/(\\w+)\\/\"\n r\"(-?\\d+\\.?\\d*),(-?\\d+\\.?\\d*)\"\n )\n mock_req.get(re.compile(uri), text=load_fixture(\"darksky.json\"))\n\n assert setup_compo...
[ "0.66724104", "0.64576423", "0.6375792", "0.62206465", "0.59658825", "0.5956589", "0.58672225", "0.5811662", "0.57559365", "0.5750003", "0.5736049", "0.57055634", "0.5664596", "0.562356", "0.56039673", "0.5531112", "0.5494356", "0.54522026", "0.5448444", "0.5431577", "0.54262...
0.66016436
1
Test the platform setup with language configuration.
def test_setup_with_language_config(self): setup_component(self.hass, "sensor", VALID_CONFIG_LANG_DE) self.hass.block_till_done() state = self.hass.states.get("sensor.dark_sky_summary") assert state is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testLanguage(self):\n if self.language in tools.LANGUAGES:\n self.assertEqual(\n self.language,\n self.config.language\n )\n else:\n self.assertNotEqual(\n self.language,\n self.config.language\n ...
[ "0.7163424", "0.71388316", "0.68419224", "0.6686336", "0.66743535", "0.66651946", "0.6650484", "0.6614353", "0.65010756", "0.6498431", "0.64593446", "0.62890476", "0.6275258", "0.6275258", "0.6272785", "0.6270573", "0.62701976", "0.62175596", "0.61904246", "0.61732084", "0.61...
0.71539915
1
Test the platform setup with language configuration.
def test_setup_with_invalid_language_config(self): setup_component(self.hass, "sensor", INVALID_CONFIG_LANG) self.hass.block_till_done() state = self.hass.states.get("sensor.dark_sky_summary") assert state is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testLanguage(self):\n if self.language in tools.LANGUAGES:\n self.assertEqual(\n self.language,\n self.config.language\n )\n else:\n self.assertNotEqual(\n self.language,\n self.config.language\n ...
[ "0.7163424", "0.71539915", "0.71388316", "0.68419224", "0.6686336", "0.66743535", "0.66651946", "0.6650484", "0.6614353", "0.65010756", "0.6498431", "0.64593446", "0.6275258", "0.6275258", "0.6272785", "0.6270573", "0.62701976", "0.62175596", "0.61904246", "0.61732084", "0.61...
0.62890476
12
Test for handling a bad API key.
def test_setup_bad_api_key(self, mock_get_forecast): # The Dark Sky API wrapper that we use raises an HTTP error # when you try to use a bad (or no) API key. url = "https://api.darksky.net/forecast/{}/{},{}?units=auto".format( self.key, str(self.lat), str(self.lon) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_api_key(x_api_key: str = Security(api_key_header_auth)):\n\n if x_api_key != API_KEY:\n raise HTTPException(\n status_code=status.HTTP_401_UNAUTHORIZED,\n detail=\"Invalid API Key\",\n )", "def test_incorrect_api_key(self):\n with self.subTest(\"Missing API...
[ "0.7995882", "0.7873856", "0.7698261", "0.7691335", "0.7440945", "0.7400383", "0.73843676", "0.73843676", "0.7351226", "0.7308071", "0.7277661", "0.72344774", "0.7224452", "0.7182379", "0.70462185", "0.70272976", "0.70122564", "0.69514686", "0.6939561", "0.69393253", "0.69240...
0.71603364
14
padding each sentence to the right
def padding(sentence_list): max_len = max([sentence.size(0) for sentence in sentence_list]) pad_sen = [sen.tolist() + [pad_index] * max(0, max_len - len(sen)) for sen in sentence_list] return torch.LongTensor(pad_sen).transpose(0, 1) # shape of (T, B)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_padding(self, text):\n\n for word in text.split(' '):\n # 5 character blocks added straight\n if len(word) == 5:\n self.output += word + ' '\n # calling the helper method to fill the blocks\n elif len(word) < 5:\n self._helper...
[ "0.72890365", "0.7062323", "0.6936306", "0.6913675", "0.68591684", "0.68588907", "0.67253613", "0.6692744", "0.66767424", "0.6667846", "0.6666633", "0.6631432", "0.657273", "0.65120065", "0.64736766", "0.64541376", "0.64253974", "0.6402162", "0.6392293", "0.6372132", "0.63509...
0.59928536
44
Takes an OverpassResult object as returned by the OSMPythonTools query function.\n Converts OverpassResult result object into a Pandas Geodataframe with initialised geometry attribute. Also returns dict with OSM tags for each way.\n Currently only supports queries for OSM ways (e.g. elementType=['way']).
def ways2geometry(overpass_result_object): tunnel_json = overpass_result_object.toJSON() # Read ['elements'] attribute into a df: df = pd.DataFrame.from_records(tunnel_json['elements']) df.rename(columns={'nodes': 'node_IDs'}, inplace=True) # Clean up the geometry column which contains the coordinat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_query_result(query_result):\n poi_data = []\n for i in range(len(query_result)):\n lat = query_result[i]['geometry']['location']['lat']\n lng = query_result[i]['geometry']['location']['lng']\n\n if not within_boundary_area(lat, lng, min_lat, max_lat, min_lng, max_lng):\n ...
[ "0.62037593", "0.5813783", "0.5812336", "0.5795229", "0.5656649", "0.5620962", "0.5428042", "0.5373831", "0.53113693", "0.52659386", "0.52373546", "0.5229478", "0.521595", "0.52154374", "0.5173139", "0.51397485", "0.513952", "0.51170295", "0.5108736", "0.5060382", "0.5042025"...
0.7199077
0
Get the key name to use for matching in model merge. This includes resolving any variables, and removing delete notation if present.
def _get_merge_match_key(key, variable_map): match_key = variables.substitute_key(key, variable_map) if model_helper.is_delete_name(match_key): match_key = model_helper.get_delete_item_name(match_key) return match_key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"key_name\")", "def key_object_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"key_object_name\")", "def key_name(self) -> Optional[str]:\n return pulumi.get(self, \"key_name\")", "def ke...
[ "0.6558347", "0.65340745", "0.6531424", "0.65219176", "0.6464862", "0.6422357", "0.6415516", "0.64004606", "0.63922155", "0.63732755", "0.6370809", "0.6359784", "0.62608254", "0.6235889", "0.6207047", "0.6190208", "0.6178143", "0.6173859", "0.6158821", "0.6158821", "0.6148363...
0.7798121
0
Add a new vertex(s).
def add_vertex(self, vertex): if vertex not in self.graph_dict: self.graph_dict[vertex] = [] return vertex
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_vertex(self, vertex_id):\n pass # TODO", "def add_vertex(self, vertex):\n raise NotImplementedError", "def add_vertex(self, vertex):\n self.vertices.append(vertex)\n self.vertex_edge[vertex] = []", "def add_vertex(self, vertex):\n if vertex.id not in self.vertices....
[ "0.86618626", "0.8403357", "0.82957166", "0.827803", "0.81245637", "0.81168026", "0.8044007", "0.8041567", "0.8021555", "0.79641473", "0.7930101", "0.7897346", "0.7896317", "0.78611237", "0.7833308", "0.78320616", "0.78000385", "0.77344024", "0.77344024", "0.77095807", "0.770...
0.7563125
35
Check if this context is initialized.
def initialized(self): return self.workspace == find_enclosing_workspace(self.workspace)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_initialized(self) -> bool:\n return len(self) > 0", "def is_initialized(self) -> bool:\n return (\n (self._exchange_params_by_currency_id is not None)\n and (self._utility_params_by_good_id is not None)\n and (self._transaction_fees is not None)\n )",...
[ "0.7720945", "0.73905146", "0.730771", "0.7266745", "0.7236389", "0.7154899", "0.7089603", "0.70302486", "0.70302486", "0.69997096", "0.69040513", "0.69000155", "0.68230176", "0.68132967", "0.67775667", "0.67672", "0.6737759", "0.67078215", "0.6703509", "0.66740406", "0.66738...
0.6461503
26
Get the devel directory for a specific package. This is the root of the FHS layout where products are generated.
def package_devel_space(self, package): if self.merge_devel: return self.devel_space_abs elif self.isolate_devel: return os.path.join(self.devel_space_abs, package.name) elif self.link_devel: return os.path.join(self.private_devel_path, package.name) e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def package_dir(self):\r\n return \".\"", "def GetPackageDirectory():\n return os.path.dirname(__file__)", "def getDesDir(self):\n if self.desdir == None:\n cwd = os.getcwd()\n self.desdir = os.path.join(cwd, self.args.dest)\n return self.desdir", "def get_build_dir(...
[ "0.69888246", "0.6977047", "0.6956069", "0.688974", "0.688759", "0.68670887", "0.6775931", "0.663923", "0.66227126", "0.65438884", "0.6518432", "0.6451958", "0.6349539", "0.6345322", "0.63430315", "0.6336755", "0.629729", "0.6279772", "0.61844087", "0.61740106", "0.61667234",...
0.70503414
0
Get the install directory for a specific package. This is the root of the FHS layout where products are installed.
def package_install_space(self, package): if self.merge_install: return self.install_space_abs elif self.isolate_install: return os.path.join(self.install_space_abs, package.name) else: raise ValueError('Unknown install space layout: {}'.format(self.devel_lay...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_install_dir(self):\n return EventGenerator.get_install_dir(self) + \"/madgraph4/src\"", "def get_install_dir(self):\n return EventGenerator.get_install_dir(self) + \"/madgraph5/src\"", "def install_destination(self):\n # return self.install_dir\n return self.mainmanager.Fold...
[ "0.7664463", "0.76436055", "0.7471542", "0.7369365", "0.729247", "0.71910924", "0.7093502", "0.7087768", "0.7063836", "0.7031152", "0.7008558", "0.6877116", "0.6876912", "0.6870798", "0.68573636", "0.6794905", "0.6786159", "0.6637505", "0.6634177", "0.6629106", "0.66087675", ...
0.71108294
6
Get the intermediate destination into which a specific package is built.
def package_dest_path(self, package): if self.destdir is None: return self.package_final_path(package) else: return os.path.join( self.destdir, self.package_install_space(package).lstrip(os.sep))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_destination(self):\n\n return self.destination", "def get_destination(self):\n return self._destination", "def install_destination(self):\n # return self.install_dir\n return self.mainmanager.Folders['mods'].path / self._install_dirname", "def getDestination(self):\n ...
[ "0.61533856", "0.610433", "0.6102882", "0.60122347", "0.59520066", "0.5950027", "0.58902633", "0.58902633", "0.5881567", "0.58524525", "0.58199453", "0.58085597", "0.5787328", "0.57809746", "0.5773693", "0.57661676", "0.57621104", "0.57556427", "0.5734313", "0.5715866", "0.57...
0.6649821
0
Get the final destination into which a specific package is deployed.
def package_final_path(self, package): if self.install: return self.package_install_space(package) else: if self.link_devel: return self.devel_space_abs else: return self.package_devel_space(package)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def package_dest_path(self, package):\n\n if self.destdir is None:\n return self.package_final_path(package)\n else:\n return os.path.join(\n self.destdir,\n self.package_install_space(package).lstrip(os.sep))", "def install_destination(self):\n ...
[ "0.7036929", "0.64513725", "0.64431083", "0.6412256", "0.6409819", "0.6386109", "0.6364942", "0.61416215", "0.60698146", "0.60427296", "0.60335505", "0.60251904", "0.5974511", "0.5974511", "0.59743", "0.59653676", "0.59420544", "0.5929635", "0.58860004", "0.5809605", "0.57692...
0.6796177
1
Get the path to the metadata directory for this profile.
def metadata_path(self): profile_path, _ = metadata.get_paths(self.workspace, self.profile) return profile_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metadata_path(self):\n return os.path.join(self.path, 'metadata.txt')", "def metadataDirectory(self):\n guid_hash = utils.sha1hash(self.guid)\n return str(Path('Metadata') / 'Movies' / guid_hash[0] / f'{guid_hash[1:]}.bundle')", "def metadataDirectory(self):\n guid_hash = utils....
[ "0.7822971", "0.7339891", "0.7339891", "0.73235637", "0.7314918", "0.72894084", "0.71822673", "0.7089777", "0.7020728", "0.70020103", "0.69667876", "0.6844684", "0.67879033", "0.67232054", "0.65928996", "0.6546555", "0.6516536", "0.6509581", "0.6492533", "0.64481723", "0.6414...
0.8718554
0
Find a large common divisor of the list of integers.
def sat(n: int, nums=[77410, 23223, 54187], lower_bound=2): return all(i % n == 0 for i in nums) and n >= lower_bound
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lcm(\n numbers: List[int]\n) -> int:\n current_product = 1\n current_gcd = 1\n for num in numbers:\n current_gcd = gcd(current_gcd, num)\n current_product *= num\n return current_product // current_gcd", "def lcm(multiple_list):\n res = 1\n for n in multiple_list:\n ...
[ "0.73146087", "0.7296845", "0.7200875", "0.7198929", "0.7198929", "0.71223444", "0.70849836", "0.7009902", "0.698745", "0.6974941", "0.69705564", "0.6960719", "0.6953718", "0.6952888", "0.69310397", "0.69310397", "0.69310397", "0.69310397", "0.69310397", "0.69310397", "0.6931...
0.0
-1
Find a small common multiple of two integers.
def sat(n: int, a=15, b=27, upper_bound=150): return n % a == 0 and n % b == 0 and 0 < n <= upper_bound
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def least_common_multiple(number1, number2):\n return number1 * number2 // math.gcd(number1, number2)", "def lowest_common_multiple(a, b):\n # 两个数字相乘后除以最大公约数 = 两个数字的最小公倍数\n return a * b // gcd(a, b)", "def lcm(a: int, b: int):\n return (a * b) // euclid(a, b)", "def lcm(a: int, b: int) -> int:\n ...
[ "0.78962135", "0.7786683", "0.7533495", "0.7474799", "0.7464257", "0.7464257", "0.73205143", "0.72881365", "0.7243867", "0.7243867", "0.72217757", "0.72217757", "0.72217757", "0.72217757", "0.72217757", "0.72217757", "0.72217757", "0.72217757", "0.72217757", "0.7161139", "0.7...
0.0
-1
Return a LayerView of this NodeFlow.
def layers(self): # -> LayerView: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def layer( self ):\n return self._layer", "def layer(self):\n return self._layer", "def to_layer(self) -> Layer:\n return layer.from_geom(self)", "def layer(self):\n return self.GetLayer()", "def getLayers(self):\n return self.__layers", "def _get_layers(self) :\n ...
[ "0.6752776", "0.67126197", "0.65346366", "0.64155483", "0.62422377", "0.6049727", "0.59717375", "0.58832246", "0.58396524", "0.581675", "0.58117384", "0.58000493", "0.57264656", "0.5573093", "0.5563839", "0.5514726", "0.55140877", "0.5506697", "0.55055636", "0.55005324", "0.5...
0.64009523
4
Return a BlockView of this NodeFlow.
def blocks(self): # -> BlockView: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_block(self):\n return Gumtree.gumtree.getBlock()", "def GetBlock(self):\n return self._block", "def create_block(self):\n return poet_transaction_block.PoetTransactionBlock()", "def getBlock(self) -> ghidra.program.model.correlate.Block:\n ...", "def getBlock(self):\n ...
[ "0.6765791", "0.6748652", "0.66444206", "0.6621105", "0.658768", "0.6407824", "0.6201701", "0.61511534", "0.6146277", "0.61397326", "0.613095", "0.5981459", "0.59251577", "0.58640814", "0.58202165", "0.5788691", "0.57818985", "0.57752204", "0.57750696", "0.575852", "0.5750347...
0.620677
6
Return the number of edges in a specified block.
def block_size(self, block_id): # -> int: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edge_count(self):\r\n return int(sum(self.degree(node) for node in range(self.size))/2)", "def edgecount(self):\n\n raise NotImplementedError", "def compute_num_edges(graph):\n # return the number of edges\n return sum([len(graph[source_node].keys()) for source_node in graph.key...
[ "0.68550444", "0.67415774", "0.6699996", "0.66928583", "0.66501164", "0.6574408", "0.65685886", "0.65530425", "0.6517499", "0.64391804", "0.6430085", "0.642132", "0.64183086", "0.63867885", "0.6376979", "0.63734704", "0.63711846", "0.62919533", "0.62856835", "0.62591493", "0....
0.59212065
34
Return the outdegree of the nodes in the specified layer.
def layer_out_degree(self, layer_id): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def internal_outdegree(self, node_list, link_attribute=None):\n if link_attribute is None:\n return np.sum(self.internal_adjacency(node_list), axis=1)\n else:\n return np.sum(self.internal_link_attribute(link_attribute,\n nod...
[ "0.6594684", "0.631304", "0.5910271", "0.563393", "0.55488783", "0.553327", "0.553214", "0.54905975", "0.5466325", "0.54417586", "0.5435821", "0.5361457", "0.5361457", "0.5361457", "0.53519875", "0.533623", "0.5327829", "0.5313681", "0.5270652", "0.52364135", "0.513633", "0...
0.8003074
0
Get the node Ids of the parent graph in the specified layer layer_parent_nid(1) returns seed vertices for this NodeFlow.
def layer_parent_nid(self, layer_id): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parent_ids(self):\n return self._parent_ids", "def parent_node_edge_point(self) -> List[str]:\n return self._parent_node_edge_point", "def parents(self):\n if self._pedigree is None:\n raise Exception(\"Pedigree is not defined\")\n return [self._pedigree.individual(pi...
[ "0.62657636", "0.62486947", "0.588495", "0.5883371", "0.5851109", "0.5785815", "0.578378", "0.5753566", "0.57462525", "0.57260984", "0.5719478", "0.5715445", "0.5701215", "0.5701215", "0.5692417", "0.5692417", "0.5685808", "0.56582195", "0.56145746", "0.5584146", "0.5574761",...
0.5958711
2
Get the edge Ids of the parent graph in the specified block.
def block_parent_eid(self, block_id): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edges_parent(self):\n return self._edges_parent", "def parent_ids(self):\n return self._parent_ids", "def parent_node_edge_point(self) -> List[str]:\n return self._parent_node_edge_point", "def get_edge_ids(self):\n node_ids = self.node_ids\n return [(node_ids[0], node_...
[ "0.6561591", "0.6538719", "0.64541155", "0.61687964", "0.6165813", "0.58587015", "0.58370656", "0.5822928", "0.581507", "0.581507", "0.5809355", "0.5789875", "0.5787184", "0.5751505", "0.5745166", "0.5745166", "0.5745166", "0.5745166", "0.57159805", "0.57107157", "0.5684461",...
0.7249309
0
Return the edges in a block. If remap_local is True, returned indices u, v, eid will be remapped to local Ids (i.e. starting from 0) in the block or in the layer. Otherwise, u, v, eid are unique in the NodeFlow.
def block_edges(self, block_id, remap_local=...): # -> tuple[Unknown, Unknown, Unknown]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_edge_ids(self):\n node_ids = self.node_ids\n return [(node_ids[0], node_ids[1])]", "def edgeMap (self):\n return self.__edgeMap", "def getEdges(self):\n\n return [(cell, vertice) for cell in self.adjacent.keys() for vertice in self.adjacent[cell]]", "def get_edge_blocks(se...
[ "0.5595605", "0.5527225", "0.55258846", "0.5450906", "0.536565", "0.53302234", "0.5321791", "0.5320251", "0.5295422", "0.52908915", "0.5290661", "0.5261692", "0.52575165", "0.52516407", "0.5250357", "0.51820534", "0.5154297", "0.5147765", "0.5140925", "0.5132946", "0.51213133...
0.70787126
0
Set the initializer for empty edge features. Initializer is a callable that returns a tensor given the shape, data type and device context. When a subset of the edges are assigned a new feature, initializer is used to create feature for rest of the edges.
def set_e_initializer(self, initializer, block_id=..., field=...): # -> None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_edata(self, edata_name, shape, dtype, ctx=F.cpu()):\n if ctx != F.cpu():\n raise Exception(\"graph store only supports CPU context for edge data\")\n init = self._edge_frame.get_initializer(edata_name)\n if init is None:\n self._edge_frame._frame._set_zero_defaul...
[ "0.5862424", "0.56873363", "0.54693145", "0.5448502", "0.5411525", "0.52650493", "0.5249449", "0.52175957", "0.5213767", "0.51867455", "0.5180195", "0.516818", "0.51441216", "0.51001483", "0.5091208", "0.50694305", "0.5056928", "0.5053097", "0.5053097", "0.50328076", "0.50126...
0.52292883
7
(str) > str Return a reversed version of s. >>> reverse('hello') 'olleh' >>> reverse('a') 'a'
def reverse(s): rev = '' for ch in s: rev = ch + rev return rev
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse_string(s):\n s.reverse()", "def reverse(s):\n return s[::-1]", "def reverseString(s):\n return s[::-1]", "def reverse_string( str ):\n return str[::-1]", "def reverse_string(s):\n return \"\".join(reversed(list(s)))", "def reverse_string(sen):\n return sen[::-1]", "def rever...
[ "0.82888746", "0.8105809", "0.78994036", "0.7774885", "0.77133656", "0.7681458", "0.7626759", "0.7533365", "0.750329", "0.7476622", "0.74672276", "0.7441812", "0.7428979", "0.73968756", "0.7390938", "0.7381109", "0.73525107", "0.7338485", "0.73262244", "0.7313811", "0.7312111...
0.750698
8
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, SignTextOptions): 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
Create a schedule with a learning rate that decreases following the values of the cosine function between 0 and `pi cycles` after a warmup period during which it increases linearly between 0 and 1.
def get_cosine_schedule_with_warmup(optimizer, num_warmup_steps, num_training_steps, num_cycles=0.5, last_epoch=-1): def lr_lambda(current_step): if current_step < num_warmup_steps: return float(current_step) / float(max(1, num_warmup_steps)) progress = float(current_step - num_warmup_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def learning_rate_schedule(total_steps):\n learning_rate = learning_schedules.cosine_decay_with_warmup(global_step=tf.train.get_or_create_global_step(),\n learning_rate_base=0.04,\n tota...
[ "0.7111079", "0.6900339", "0.6750259", "0.6750259", "0.66459167", "0.6641998", "0.6588088", "0.6562708", "0.65526444", "0.65367407", "0.65335447", "0.64722043", "0.64450043", "0.64015716", "0.63534755", "0.6331366", "0.6331366", "0.6308364", "0.62266725", "0.62171793", "0.621...
0.66403264
6
Return d packed as 32bit unsigned integer (little endian).
def p32(d): return pack('<I', d)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def u32(d):\n return unpack('<I', d)[0]", "def u32(value: bytes, endian: str = \"little\", sign: bool = False) -> int:\n return unpack(value, 32, endian, sign)", "def unpack32(data):\n\treturn struct.unpack('<I', data)[0]", "def unpack_uint32(data):\n value = unpack(DecodeUtils.UINT32_BYTE_FORMA...
[ "0.8458485", "0.71315116", "0.7124784", "0.6802786", "0.6790899", "0.67507106", "0.6631099", "0.6417889", "0.6378093", "0.63006026", "0.62821305", "0.62821305", "0.6250482", "0.6240768", "0.62299967", "0.6221898", "0.62057257", "0.6168162", "0.6167356", "0.6149424", "0.602687...
0.7734232
1
Return d packed as 64bit unsigned integer (little endian).
def p64(d): return pack('<Q', d)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def u64(d):\n return unpack('<Q', d)[0]", "def u64(value: bytes, endian: str = \"little\", sign: bool = False) -> int:\n return unpack(value, 64, endian, sign)", "def pack_uint64(data: int) -> bytes:\n return struct.pack(\">Q\", data)", "def pack_uint64(data: int) -> bytes:\n return struct.pack(\...
[ "0.8080498", "0.7718023", "0.7296026", "0.7296026", "0.71874493", "0.7162767", "0.7147503", "0.68385816", "0.68070984", "0.67252725", "0.66534895", "0.6599219", "0.65887624", "0.64893615", "0.6442953", "0.6399468", "0.63327706", "0.61840695", "0.6181534", "0.61501896", "0.614...
0.7589983
2
Return the number represented by d when interpreted as a 64bit unsigned integer (little endian).
def u64(d): return unpack('<Q', d)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def u64(value: bytes, endian: str = \"little\", sign: bool = False) -> int:\n return unpack(value, 64, endian, sign)", "def uint64_t(n):\n return int(n).to_bytes(8, byteorder='little', signed=False)", "def ReadUInt64(self, endian=\"<\"):\n return self.unpack('%sQ' % endian, 8)", "def p64(d):\n ...
[ "0.7721167", "0.73888075", "0.720838", "0.71961963", "0.70348424", "0.70095813", "0.6868349", "0.6858462", "0.6858462", "0.6755599", "0.67403", "0.66654736", "0.6631011", "0.6532378", "0.6527128", "0.643332", "0.6432193", "0.6416337", "0.6295023", "0.62777114", "0.62065077", ...
0.8080936
0
Return true if the given byte is a printable ASCII character.
def is_printable(b): return b in e(string.printable)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_printable(c):\n return ord(c)>=32 or c in ['\\r','\\n', '\\t']", "def ascii_printable(s: str) -> bool:\n return frozenset(s).issubset(_ascii_pa)", "def is_printable(s):\n for c in s:\n if c not in PRINTABLE_CHARACTERS:\n return False\n return True", "def is_ascii(token):\...
[ "0.8063285", "0.7428942", "0.7384203", "0.72409034", "0.7160824", "0.7160824", "0.7055795", "0.7021248", "0.69952625", "0.6969861", "0.6846586", "0.6836922", "0.678393", "0.672706", "0.67178553", "0.6713574", "0.66913164", "0.66913164", "0.66250706", "0.6498613", "0.6466205",...
0.79354054
1
Construct an ANSI terminal escape code.
def ansi(*args): code = Term.ESCAPE_START code += ';'.join(args) code += Term.ESCAPE_END return code
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __termcode(num):\r\n return \"\\033[%sm\" % num", "def ansi_escape(text: object) -> str:\n return str(text).replace(\"\\x1b\", \"?\").replace(\"\\b\", \"?\")", "def ANSIIcode(color='black', style='normal'):\n\n colorCode = colorCodes[color]\n styleCode = styleCodes[style]\n\n return '\\033['...
[ "0.6722756", "0.6653756", "0.64397824", "0.6352434", "0.62843865", "0.61813813", "0.6142702", "0.60265326", "0.59757423", "0.59424394", "0.5856099", "0.58553594", "0.58508587", "0.5785551", "0.5756168", "0.5690514", "0.5681752", "0.5672013", "0.5640468", "0.5494562", "0.54860...
0.75485194
0
makes 4 Boxplots that show the first component of the dataframe (mean, median, etc) of the 4 classes
def boxplots_of_classes(self, title:str, y_axis: str="mean activity over all neurons", second_path: str=r'D:\Dataframes\double_skip_mean', show:bool=True, dest_path:str=None, show_outliers: bool=False): data = [] counter = 0 for pop in self.populations: df = pd.read_csv(self.path + '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boxplots(self, groups, nrows, ncols, type):\n fig, axs = plt.subplots(nrows=nrows, ncols=ncols, figsize=(6, 9.3), sharey=\"row\")\n\n fig.subplots_adjust(left=0.03, right=0.97, hspace=0.3, wspace=0.05)\n\n for ax, (effs, dat) in zip(axs, groups):\n ax[0].boxplot(dat[\"perm\"])\n...
[ "0.7076751", "0.67842495", "0.67558223", "0.6616856", "0.65577877", "0.6433188", "0.63394195", "0.6275727", "0.62616676", "0.60996395", "0.6091878", "0.6075363", "0.6007542", "0.59308016", "0.58823246", "0.58548385", "0.5837253", "0.5832396", "0.5831901", "0.5808949", "0.5805...
0.6560889
4
Before each test, set up a blank database
def tempdb(): fd, minitwit.app.config['DATABASE'] = tempfile.mkstemp() minitwit.init_db() try: yield finally: os.close(fd) os.unlink(minitwit.app.config['DATABASE'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n db.create_all()", "def setUp(self):\n INFLUX_DB_NAME = 'test_device_parameters'\n EmptyDBTestCase.client.create_database(INFLUX_DB_NAME)\n EmptyDBTestCase.client.drop_database(INFLUX_DB_NAME)\n EmptyDBTestCase.client.create_database(INFLUX_DB_NAME)", "def s...
[ "0.84847945", "0.8479566", "0.84005684", "0.8322551", "0.83078533", "0.8287008", "0.82728577", "0.8267613", "0.81266093", "0.80993634", "0.8042919", "0.80200016", "0.79937464", "0.79836535", "0.7974095", "0.79731756", "0.79731756", "0.79731756", "0.796644", "0.7962328", "0.79...
0.0
-1
Tests the GetAttributeContainerByIndex function.
def testGetAttributeContainerByIndex(self): redis_client = self._CreateRedisClient() event_data_stream = events.EventDataStream() test_store = redis_store.RedisStore( storage_type=definitions.STORAGE_TYPE_TASK) test_store.Open(redis_client=redis_client) container = test_store.GetAttribute...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_container_attribute(self):\n self.add_pool()\n self.add_container(self.pool)\n self.container.open()\n self.daos_cmd = DaosCommand(self.bin)\n\n expected_for_param = []\n name = self.params.get(\"name\", '/run/attrtests/name_handles/*/')\n expected_for_para...
[ "0.6377996", "0.635342", "0.5984155", "0.5975023", "0.5823141", "0.5801416", "0.5759074", "0.5659412", "0.56261283", "0.56100166", "0.55499303", "0.54374903", "0.54043674", "0.5327528", "0.53003913", "0.528377", "0.52760684", "0.52712744", "0.5260165", "0.5241577", "0.5230366...
0.75789773
0
Tests the GetAttributeContainers method.
def testGetAttributeContainers(self): redis_client = self._CreateRedisClient() test_store = redis_store.RedisStore( storage_type=definitions.STORAGE_TYPE_TASK) test_store.Open(redis_client=redis_client) for _, event_data, _ in containers_test_lib.CreateEventsFromValues( self._TEST_EVEN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_container_attribute(self):\n self.add_pool()\n self.add_container(self.pool)\n self.container.open()\n self.daos_cmd = DaosCommand(self.bin)\n\n expected_for_param = []\n name = self.params.get(\"name\", '/run/attrtests/name_handles/*/')\n expected_for_para...
[ "0.73791873", "0.69798714", "0.69262904", "0.6801142", "0.67491823", "0.64485687", "0.64399344", "0.63582736", "0.6355032", "0.621487", "0.61887103", "0.61625737", "0.6157284", "0.61449665", "0.59200144", "0.58607996", "0.5858989", "0.58264047", "0.5790608", "0.574462", "0.57...
0.7875106
0
Tests the GetSerializedAttributeContainers method.
def testGetSerializedAttributeContainers(self): redis_client = self._CreateRedisClient() test_store = redis_store.RedisStore( storage_type=definitions.STORAGE_TYPE_TASK) test_store.Open(redis_client=redis_client) for _, event_data, _ in containers_test_lib.CreateEventsFromValues( self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testGetAttributeContainers(self):\n redis_client = self._CreateRedisClient()\n\n test_store = redis_store.RedisStore(\n storage_type=definitions.STORAGE_TYPE_TASK)\n test_store.Open(redis_client=redis_client)\n\n for _, event_data, _ in containers_test_lib.CreateEventsFromValues(\n se...
[ "0.71963716", "0.6659312", "0.63484555", "0.63049203", "0.60766137", "0.60342824", "0.6009412", "0.5942492", "0.58824474", "0.5870336", "0.5811853", "0.5733358", "0.5661414", "0.5610872", "0.55950135", "0.5562966", "0.55600244", "0.555705", "0.5550118", "0.5533333", "0.553244...
0.82739806
0
Tests the UpdateAttributeContainer function.
def testUpdateAttributeContainer(self): redis_client = self._CreateRedisClient() event_data_stream = events.EventDataStream() test_store = redis_store.RedisStore( storage_type=definitions.STORAGE_TYPE_TASK) test_store.Open(redis_client=redis_client) number_of_containers = test_store.GetNu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_container(self):\n pass", "def test_update_attribute_data(self):\n pass", "def test_update_metadata_by_attribute(self):\n pass", "def test_update_metadata_by_attribute1(self):\n pass", "def test_container_attribute(self):\n self.add_pool()\n self.ad...
[ "0.7612595", "0.73633355", "0.71287155", "0.69922054", "0.6607932", "0.641185", "0.6409671", "0.63782984", "0.63782984", "0.63782984", "0.6346146", "0.62607443", "0.6211011", "0.61506295", "0.61331815", "0.6078399", "0.6072202", "0.6068954", "0.60475475", "0.60034466", "0.596...
0.7492601
1
Set an empty deque as an attribute of the instantiation
def __init__(self): self.deque = deque()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n \n self.elements = deque()", "def __init__(self):\n self._deque = []", "def __init__(self):\n self.deque = []", "def __init__(self):\n self.container = collections.deque()", "def __init__(self):\n self.queue = deque()", "def __init__(self):\...
[ "0.78118587", "0.77857304", "0.77634585", "0.76884", "0.73265195", "0.73265195", "0.73265195", "0.73265195", "0.73098433", "0.7292202", "0.7260001", "0.7187403", "0.7183288", "0.71644115", "0.7104485", "0.7100994", "0.7079904", "0.7021223", "0.69949406", "0.69566166", "0.6953...
0.7583522
4
Checks to make sure that the other is the same class
def is_same_type_as_other(cls, other): return isinstance(other, cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_equal_same_type(self, other):\n return True", "def __eq__(self, other) -> bool:\n if not isinstance(other, type(self)):\n return False\n for attribute in self.classes:\n if getattr(self, attribute) != getattr(other, attribute):\n return False\n ...
[ "0.7329382", "0.7142863", "0.70382947", "0.70382947", "0.70239526", "0.7010973", "0.70050365", "0.6961176", "0.6939133", "0.6939133", "0.6937196", "0.6911721", "0.6896603", "0.6885087", "0.686873", "0.6832603", "0.6830648", "0.68212044", "0.68130165", "0.673939", "0.6689765",...
0.73825145
0
Determines whether or not the deque contained by this object is the same as the other
def __eq__(self, other): # make sure that self and other are # of the same type. Otherwise, a stack # and a queue of the same elements are considered # equal if not self.is_same_type_as_other(other): return False elif len(self) != len(other): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self,other):\n try: \n if not self.size == other.size and self.reference == other.reference: return False\n except: return False\n self_pointer, other_pointer = self.reference, other.reference\n for i in range(self.size):\n self_pointer, other_pointer = ...
[ "0.72361267", "0.7057272", "0.69936764", "0.6993099", "0.6899336", "0.6895459", "0.6859485", "0.6847174", "0.68294036", "0.68143535", "0.681406", "0.6812435", "0.6804756", "0.6766587", "0.67661124", "0.6755633", "0.67409253", "0.67409253", "0.67409253", "0.67409253", "0.67409...
0.74573594
0
Define not being equal as the negation of being equal
def __ne__(self, other): return not self.__eq__(other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_equal(lhs, rhs):\n return _make.not_equal(lhs, rhs)", "def __neq__(self, other): \n return not self == other", "def ne (self, other):\n return not (self == other) # opposite of eq", "def __ne__(self, rhs):\n return not self.__eq__(rhs)", "def __ne__(self,...
[ "0.7901489", "0.78702813", "0.78586507", "0.7800149", "0.7792607", "0.7753081", "0.77438134", "0.77145195", "0.75878143", "0.7542512", "0.75332236", "0.75332236", "0.75293326", "0.75293326", "0.75227624", "0.7500692", "0.7487239", "0.7481469", "0.74795693", "0.74795693", "0.7...
0.75308937
15
Return the itag for this object. This is an ID code identifying the media type.
def itag(self): return self.__itag
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _type(self):\n return self._id[1]", "def media_type(self) -> str:\n return self._media_type", "def typeID(self) -> int:\n\t\t# pylint: disable=invalid-name\n\t\treturn self._ot", "def media_type(self):\n return self._media_type", "def getTypeID(self) -> int:\n ...", "def g...
[ "0.66211104", "0.65449053", "0.654305", "0.649046", "0.6287158", "0.62864566", "0.6250159", "0.62316674", "0.62061214", "0.61764157", "0.6149461", "0.61458725", "0.6104053", "0.6099607", "0.6083735", "0.60329694", "0.6026799", "0.60114104", "0.60099953", "0.6008445", "0.60020...
0.7107075
0
Return the resolution of the video. This is a pair width, height.
def resolution(self): assert self.has_video return self.__resolution
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_video_window_size(self):\n alloc = self.drawingarea.get_allocation()\n return (alloc.width, alloc.height)", "def get_video_size(self):\n # Get original size of video stream\n caps = self.imagesink.sinkpad.get_current_caps()\n if caps is None:\n return None\n\...
[ "0.7719169", "0.77020586", "0.76141137", "0.7611579", "0.7574462", "0.74399185", "0.74152625", "0.73286045", "0.72063863", "0.7107743", "0.7080699", "0.70789635", "0.70789635", "0.7067001", "0.70639503", "0.69653153", "0.69606704", "0.685394", "0.6754326", "0.67188704", "0.67...
0.79534537
0
Return a base filename for a YouTube feed item. This is returned in the format _
def base_filename_for_feed_item(feed_item): return "{}_{}".format( int(to_epoch(feed_item.upload_time)), feed_item.video_id )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_filename(self) -> str:\n fname = self.url.split(\"/\")[-1]\n if \",\" in fname:\n _fname, _i = fname.split(\",\")\n _split_fname = _fname.split(\".\")\n _name = _split_fname[0]\n _extension = _split_fname[-1]\n return _name + _i + \".\" +...
[ "0.67675644", "0.66538197", "0.6611807", "0.6544529", "0.6500045", "0.64375883", "0.64337116", "0.6419721", "0.64094496", "0.6398533", "0.6365141", "0.63421315", "0.6316608", "0.62886417", "0.62428266", "0.6235728", "0.621773", "0.62164116", "0.6207857", "0.62005097", "0.6191...
0.8637209
0
Write a json file.
def write_json_file(jsonfile, data): json_str = json.dumps(data, indent=2) with jsonfile.open('w') as conf_file: conf_file.write(json_str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(self, _filepath=None):\n _json_txt = json.dumps(self.json_dict, indent=2)\n self._write_json_text(_json_txt, _filepath)", "def write_json(dict_to_write, path, file_name):\n with open(path + \"/\" + file_name + \".json\", \"w\") as fp:\n json.dump(dict_to_write, fp)\n return N...
[ "0.82896584", "0.82350725", "0.82150507", "0.82150507", "0.82082295", "0.8202183", "0.8038919", "0.80205274", "0.8003454", "0.798986", "0.7983297", "0.79825854", "0.79825467", "0.7908652", "0.79006904", "0.78946656", "0.78827", "0.787163", "0.7858913", "0.78541845", "0.782733...
0.8173332
6
Read a json file and return a dict.
def read_json_file(jsonfile): with jsonfile.open('r') as cfile: return json.loads(cfile.read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_json_file(file_name: str) -> Dict[str, Any]:\n with open(file_name) as file:\n return json.load(file)", "def parse_json(json_file: str) -> dict:\n json_data = {}\n\n if not os.path.isfile(json_file):\n error_log(os.path.basename(json_file) + ' does not exist.')\n sys.exit(1...
[ "0.85493284", "0.83970827", "0.8297555", "0.8292413", "0.8237224", "0.82232034", "0.8182804", "0.81584173", "0.812069", "0.81202406", "0.8116486", "0.80639005", "0.80398357", "0.8036172", "0.80145735", "0.80101484", "0.7991269", "0.7990517", "0.7975514", "0.7973933", "0.79627...
0.79611737
21
Returns `True` iff on the current index of the parser's token stream a token exists on the `HIDDEN` channel which either is a line terminator, or is a multi line comment that contains a line terminator.
def lineTerminatorAhead(self): # Get the token ahead of the current index. possibleIndexEosToken = self.getCurrentToken().tokenIndex - 1 ahead = self._input.get(possibleIndexEosToken) if ahead.channel != Lexer.HIDDEN: # We're only interested in tokens on the HIDDEN channel. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_comment_line(self):\n pattern = re.compile(r\"^(\\s)*(//)+\")\n return pattern.search(self._line)", "def eol(self):\n return self.pos == len(self.tokens)", "def _is_comment_or_blank(line):\n return re.sub(\"#.*\", \"\", line).rstrip() == \"\"", "def here(self, type):\n ...
[ "0.6327187", "0.63020664", "0.60913473", "0.59002215", "0.5880648", "0.5834091", "0.58242476", "0.577776", "0.57172185", "0.56223494", "0.5609715", "0.55721027", "0.5543537", "0.5543537", "0.5540172", "0.55089307", "0.54948086", "0.54750824", "0.5439183", "0.54104865", "0.540...
0.67523986
0
get min row of sheet
def excel_min_row(self, sheet_name): return self.wb[sheet_name].min_row
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_min_row(self):\n return (None if self.is_raw() else self.structure.min_row)", "def head(self, sheet_name):\n min_row = self.excel_min_row(sheet_name)\n head = tuple(self.wb[sheet_name].iter_rows(max_row=min_row, values_only=True))[0]\n return head", "def minimum_f_cell(self)...
[ "0.7487987", "0.7386636", "0.6983382", "0.67109907", "0.6683393", "0.6683393", "0.66611224", "0.6612868", "0.659789", "0.6571903", "0.64858645", "0.64563805", "0.63541013", "0.63443124", "0.6337312", "0.63193953", "0.6307747", "0.6288673", "0.624963", "0.62395746", "0.6234239...
0.8722036
0
get max column of sheet
def excel_max_col(self, sheet_name): return self.wb[sheet_name].max_column
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_col(self):\n return self.screen.getmaxyx()[1]", "def get_max(self):\n max_value= self.df[self.col_name].max()\n return max_value", "def max_score_column(self, scores):\r\n m = max(scores)\r\n lc = []\r\n for i in range(len(scores)):\r\n if scores[i] == m:\r\...
[ "0.7676402", "0.73684686", "0.7255744", "0.72384435", "0.7004572", "0.6961094", "0.67676896", "0.66737276", "0.6654263", "0.6616", "0.6504985", "0.64982283", "0.6490829", "0.6361453", "0.633034", "0.63010895", "0.6274748", "0.6269162", "0.6267467", "0.62645787", "0.62556183",...
0.8548476
0
get min column of sheet
def excel_min_col(self, sheet_name): return self.wb[sheet_name].min_column
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_minimum_column(self):\n min_col = self.root.right\n current_col = min_col.right\n while current_col != self.root:\n if current_col.sum < min_col.sum:\n min_col = current_col\n # Move on to the next column\n current_col = current_col.right...
[ "0.7353189", "0.70566094", "0.6811838", "0.6794458", "0.6774065", "0.6720852", "0.6606467", "0.6590865", "0.64798427", "0.64098257", "0.6387989", "0.6248376", "0.6181982", "0.6149169", "0.61238635", "0.6117936", "0.61054873", "0.60898334", "0.60898334", "0.6052726", "0.604995...
0.86467814
0
add_samplewise_zero_center. Zero center each sample by subtracting it by its mean.
def add_samplewise_zero_center(self): self.methods.append(self._samplewise_zero_center) self.args.append(None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_samplewise_zero_center(self, per_channel=False):\n self.methods.append(self._samplewise_zero_center)\n self.args.append([per_channel])", "def add_featurewise_zero_center(self, mean=None):\n self.global_mean.is_required = True\n self.global_mean.value = mean\n self.metho...
[ "0.7766185", "0.6866753", "0.6626346", "0.62702847", "0.58323604", "0.54206717", "0.5345598", "0.5312956", "0.5230514", "0.50782096", "0.5036646", "0.5033816", "0.50322515", "0.50114244", "0.49635583", "0.49539846", "0.49211645", "0.4911382", "0.4908928", "0.48937753", "0.487...
0.85039115
0
Compute std of a dataset. A limit can be specified for faster computation, considering only 'limit' first elements.
def _compute_global_std(self, dataset, session, limit=None): _dataset = dataset std = 0. if isinstance(limit, int): _dataset = _dataset[:limit] if isinstance(_dataset, np.ndarray): std = np.std(_dataset) else: for i in range(len(dataset)): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_global_std(self, dataset, session, limit=None):\n _dataset = dataset\n std = 0.\n if isinstance(limit, int):\n _dataset = _dataset[:limit]\n if isinstance(_dataset, np.ndarray) and not self.global_std_pc:\n std = np.std(_dataset)\n else:\n ...
[ "0.7543515", "0.72513413", "0.6976131", "0.69385237", "0.6901091", "0.6898209", "0.68910617", "0.6861914", "0.6831042", "0.6762018", "0.67585737", "0.6750885", "0.675071", "0.6681826", "0.66782653", "0.66713285", "0.66689706", "0.6664979", "0.6606886", "0.65836686", "0.655864...
0.76335365
0
add_samplewise_zero_center. Zero center each sample by subtracting it by its mean.
def add_samplewise_zero_center(self, per_channel=False): self.methods.append(self._samplewise_zero_center) self.args.append([per_channel])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_samplewise_zero_center(self):\n self.methods.append(self._samplewise_zero_center)\n self.args.append(None)", "def add_featurewise_zero_center(self, mean=None):\n self.global_mean.is_required = True\n self.global_mean.value = mean\n self.methods.append(self._featurewise_...
[ "0.85042584", "0.68662345", "0.66264266", "0.62691146", "0.5832283", "0.54198456", "0.5347357", "0.5312225", "0.5230079", "0.50776285", "0.5037255", "0.5033309", "0.50314224", "0.5011614", "0.49651495", "0.49557716", "0.4920939", "0.49111465", "0.49092337", "0.48961127", "0.4...
0.7766816
1
Compute std of a dataset. A limit can be specified for faster computation, considering only 'limit' first elements.
def _compute_global_std(self, dataset, session, limit=None): _dataset = dataset std = 0. if isinstance(limit, int): _dataset = _dataset[:limit] if isinstance(_dataset, np.ndarray) and not self.global_std_pc: std = np.std(_dataset) else: for i i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_global_std(self, dataset, session, limit=None):\n _dataset = dataset\n std = 0.\n if isinstance(limit, int):\n _dataset = _dataset[:limit]\n if isinstance(_dataset, np.ndarray):\n std = np.std(_dataset)\n else:\n for i in range(len(da...
[ "0.7632736", "0.72524333", "0.6976694", "0.6938957", "0.6901595", "0.6897955", "0.6892295", "0.6862798", "0.68318427", "0.6762627", "0.67598206", "0.6751128", "0.6749657", "0.6682415", "0.66788936", "0.66715616", "0.6669228", "0.66649157", "0.6607939", "0.6584401", "0.6558742...
0.7542912
1
Update provided default values.
def _update_default(self, default_value): if self.type == "uri_folder" or self.type == "uri_file": self.default = default_value return else: if isinstance(default_value, float) and not math.isfinite(default_value): # Since nan/inf cannot be stored in t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_with_defaults(**kwargs):\n # Update the defaults with the input values\n with open(DEFAULTS, \"r\") as f:\n defaults = json.load(f)\n return _update(kwargs, defaults)", "def set_default_values_as_needed(self):\n if self.verbose:\n click.echo('Updating required default...
[ "0.7525808", "0.7474591", "0.6905548", "0.67220205", "0.6606448", "0.6593377", "0.6593377", "0.657461", "0.657461", "0.64384013", "0.63829714", "0.638256", "0.6313892", "0.63086975", "0.6294777", "0.6255455", "0.62498176", "0.6232411", "0.62255615", "0.62123764", "0.6148428",...
0.7066509
2
Check whether the enum is valid and return the values of the enum.
def _assert_enum_valid(cls, enum): if isinstance(enum, EnumMeta): enum_values = [str(option.value) for option in enum] elif isinstance(enum, Iterable): enum_values = list(enum) else: msg = "enum must be a subclass of Enum or an iterable." raise Val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def availableValues(self):\n return [x.name for x in self._field.enum_type.values]", "def _assert_enum_valid(cls, enum: Type):\n if isinstance(enum, EnumMeta):\n enum_values = [str(option.value) for option in enum]\n elif isinstance(enum, Iterable):\n enum_values = list...
[ "0.7362305", "0.6796512", "0.65609664", "0.6545454", "0.63113946", "0.6263624", "0.62445295", "0.6234288", "0.62187", "0.62126726", "0.621075", "0.6066409", "0.6063317", "0.6051494", "0.60372716", "0.60307807", "0.60129493", "0.5993756", "0.594691", "0.5916411", "0.57821494",...
0.68541235
1
Merge field keys from annotations and cls dict to get all fields in class.
def _merge_field_keys(annotation_fields, defaults_dict): anno_keys = list(annotation_fields.keys()) dict_keys = defaults_dict.keys() if not dict_keys: return anno_keys # Fields with default values must follow those without defaults, so find the first key with # annota...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_declared_fields(mcs, klass, cls_fields, inherited_fields, dict_cls):\n opts = klass.opts\n Converter = opts.model_converter\n converter = Converter(schema_cls=klass)\n declared_fields = super(SchemaMeta, mcs).get_declared_fields(\n klass, cls_fields, inherited_fields,...
[ "0.6685666", "0.64662904", "0.64032733", "0.63022685", "0.6253286", "0.6240337", "0.6235441", "0.62293345", "0.62007964", "0.61014855", "0.60974395", "0.6083527", "0.60407984", "0.5988987", "0.5785129", "0.57410014", "0.5734831", "0.5703273", "0.5700501", "0.5686906", "0.5663...
0.60819465
12
Get the timestamp of the specified key and time
def getTimestamp(self, key, time): return self.get("timestamp", key, time)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getKeyTime(self, index, keyIndexOrHash, view) -> float:\n ...", "def getTimestamp(self):\r\n\t\treturn self.pair.data['timestamp']", "def timestamp():\n return time.time()", "def get_timestamp():\n return time.strftime('%Y-%m-%d %H:%M:%S')", "def get_timestamp():\n return int(time.t...
[ "0.68067765", "0.6517463", "0.65090746", "0.6479973", "0.6473025", "0.64701426", "0.64549804", "0.6353315", "0.6323875", "0.6320996", "0.628207", "0.62733644", "0.6272486", "0.6145687", "0.613244", "0.6120174", "0.6102125", "0.60762984", "0.60748947", "0.6073392", "0.60721284...
0.8337492
0
Resets the score for players. Will be called whenever the player changes the gamemode.
def reset_score(self): self.x_score = 0 self.o_score = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_player_scores(self):\n for j, player in enumerate(self._players_list):\n self._players_list[j].reset_all_scores()", "def reset_score(self):\n self._score = p.params['initial_score']", "def ResetScore(self):\n # Requirement ID: 7.0.1\n\n self.shot_bullets = 0\n ...
[ "0.7751881", "0.7495091", "0.735892", "0.73229796", "0.72997475", "0.7260959", "0.71807325", "0.7132584", "0.7120904", "0.7040615", "0.6889424", "0.68061036", "0.67745614", "0.67414445", "0.67102915", "0.6709723", "0.6688626", "0.66612864", "0.6608987", "0.65861654", "0.65837...
0.7357734
3
r""" Create scaled integer polynomial with respect to prime ``p``. Given an integral polynomial ``c``, we can write `c = p^ic'`, where ``p`` does not divide ``c``. Returns ``c'`` and `v i` where `i` is the smallest valuation of the coefficients of `c`.
def scale(c,v,p): scaleval = min([coeff.valuation(p) for coeff in c.coefficients()]) if scaleval > 0: c = c/(p**scaleval) v = v - scaleval if v <= 0: flag = False else: flag = True return [flag,c,v]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def integerpolynomialfactorization(f):\n cont = f.content()\n prim = f.primitive_part()\n F = [prim]\n G = prim\n c = 0\n one = G.getRing().one\n while (G.differentiate() and F[c] != one):\n deriv = G.differentiate()\n F.append(F[c].subresultant_gcd(deriv))\n c = c + 1\n ...
[ "0.6149162", "0.5929646", "0.58255297", "0.5785284", "0.5711117", "0.57079804", "0.570709", "0.56368804", "0.5630318", "0.56215453", "0.55755943", "0.5573291", "0.5566123", "0.55292475", "0.54912364", "0.5452024", "0.54478467", "0.5402359", "0.5396747", "0.538684", "0.5372848...
0.56856984
7
r""" Determine if given map is affine minimal. Given vp a scheme morphisms on the projective line over the rationals, this procedure determines if `\phi` is minimal. In particular, it determines if the map is affine minimal, which is enough to decide if it is minimal or not. See Proposition 2.10 in [BruinMolnar]_.
def affine_minimal(vp, return_transformation=False, D=None, quick=False): BR = vp.domain().base_ring() conj = matrix(BR,2,2,1) flag = True d = vp.degree() vp.normalize_coordinates(); Affvp = vp.dehomogenize(1) R = Affvp.coordinate_ring() if R.is_field(): #want the polynomial rin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_h_contrained(self, m):\n available_area = self._get_render_area_size()\n map_aspect = m.envelope().width() / m.envelope().height()\n page_aspect = available_area[0] / available_area[1]\n\n return map_aspect > page_aspect", "def is_lower(self):\n M = self.rep\n fo...
[ "0.509496", "0.5083823", "0.49298248", "0.4909595", "0.49056163", "0.48246107", "0.48185727", "0.47816676", "0.47234157", "0.47230712", "0.4717085", "0.4703497", "0.46632418", "0.46525338", "0.4638692", "0.4621058", "0.46113315", "0.45416078", "0.45252818", "0.45076373", "0.4...
0.63180494
0
updates bit[idx] += x
def update(self, idx, x): while idx < len(self.bit): self.bit[idx] += x idx |= idx + 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, idx, add):\n idx += 1\n while idx < len(self.array):\n self.array[idx] += add\n idx += idx & -idx #Adding the last bit", "def __init__(self, x):\n self.bit = x\n for i in range(len(x)):\n j = i | (i + 1...
[ "0.81440353", "0.7164437", "0.7037175", "0.6825663", "0.6755222", "0.66548693", "0.6643246", "0.65694606", "0.64788926", "0.6365865", "0.63008875", "0.62780505", "0.6252346", "0.6180964", "0.6084746", "0.60828376", "0.6072919", "0.60236037", "0.60177165", "0.5937351", "0.5894...
0.92334026
0
Calculate the sigmoid for the give inputs (array)
def sigmoid(inputs): sigmoid_scores = [1 / float(1 + np.exp(- x)) for x in inputs] return sigmoid_scores
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(x: np.ndarray \n ) -> np.ndarray:\n return 1/(1+np.exp(-x))", "def sigmoid(X):\n if isinstance(X,(list,tuple)):\n X=np.array(X)\n return 1/(1+np.exp(-X))\n #return np.exp(X)/(1+np.exp(X))", "def sigmoid(x):\r\n return 1 / (1 + np.exp(-x))", "def sigmoid(X):\...
[ "0.8376034", "0.83122724", "0.80985767", "0.80895185", "0.80895185", "0.8053431", "0.8053431", "0.8053431", "0.8053431", "0.8053431", "0.8053431", "0.80432314", "0.8030513", "0.80283993", "0.8002724", "0.7961807", "0.7944575", "0.7943942", "0.7928192", "0.7924972", "0.7924384...
0.76400137
43
Calculate the softmax for the give inputs (array)
def softmax(inputs): return np.exp(inputs) / float(sum(np.exp(inputs)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(inputs):\n probs = np.exp(inputs)\n # print(probs.shape)\n # t = np.sum(probs, axis=0)\n # print(t.shape)\n\n probs /= np.sum(probs, axis=0)[np.newaxis,:]\n return probs", "def softmax(x): \n return np.exp(x) / np.sum(np.exp(x), axis=0)", "def softmax(x):\n #pass ...
[ "0.8418574", "0.84092134", "0.84068877", "0.84053314", "0.83708495", "0.83661324", "0.83660907", "0.83629894", "0.83629894", "0.8347957", "0.8342697", "0.83423424", "0.8325401", "0.83090335", "0.83090335", "0.83090335", "0.83090335", "0.83090335", "0.83090335", "0.83090335", ...
0.84293765
1
Regenerates this corridor. New values are drawn from the `corridor_width` and `corridor_height` distributions specified in `_build`. The corridor resized accordingly, and new sets of obstructing walls are created according to values drawn from the `wall_gap`, `wall_width`, `wall_height`, and `wall_rgba` distributions s...
def regenerate(self, random_state): super(WallsCorridor, self).regenerate(random_state) wall_x = variation.evaluate( self._wall_gap, random_state=random_state) - _CORRIDOR_X_PADDING wall_side = 0 wall_id = 0 while wall_x < self._current_corridor_length: wall_width = variation.evaluate(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def regenerate(self, random_state):\n # Resize the entire corridor first.\n super(GapsCorridor, self).regenerate(random_state)\n\n # Move the ground plane down and make it invisible.\n self._ground_plane.pos = [self._current_corridor_length / 2, 0, -10]\n self._ground_plane.rgba = [0, 0, 0, 0]\n\n ...
[ "0.7158215", "0.6916643", "0.5969294", "0.5832664", "0.55596715", "0.5186313", "0.51725626", "0.5136404", "0.51347834", "0.5109342", "0.509041", "0.5076304", "0.50454664", "0.50352633", "0.50305325", "0.50128245", "0.5010999", "0.50021213", "0.49959674", "0.49950147", "0.4970...
0.7437008
0
Devuelve verdadero si el usuario se ha inscrito a un congreso y falso en caso contrario.
def do_is_inscrito_msg(parser, token): bits = token.contents.split() if len(bits) == 5 and bits[3] =='as': return IsInscritoMsg(bits[1], bits[2], bits[4]) else: return template.TemplateSyntaxError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_user(self):\n try:\n if self.get_customer()[0][0] == self.dni:\n return True\n else:\n return False\n except:\n return False", "def validate_usuario(self, data):\n\t\tuser = Usuario.objects.filter(usuario=data)\n\t\t# Si estoy...
[ "0.67371446", "0.6650247", "0.6567982", "0.6404022", "0.6350396", "0.62846154", "0.62336314", "0.6230998", "0.61440814", "0.6136602", "0.6136602", "0.6100215", "0.60647005", "0.60523343", "0.6027024", "0.59779286", "0.59779286", "0.59779286", "0.59675306", "0.5933827", "0.590...
0.0
-1
it validates other object we want to compare to object must be of type MachineLearningExperimentResults and have the same name
def _validate_comparison(self, other: "MachineLearningExperimentResults"): if type(other) != type(self): raise TypeError( f'Comparison makes sense only for "{self.__class__.__name__}" type' ) if self.name != other.name: raise ValueError( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_models_equal(self, benchmark_result1, benchmark_result2):\n if (not isinstance(benchmark_result1, ate_res.BenchmarkATEResult) or\n not isinstance(benchmark_result2, ate_res.BenchmarkATEResult)):\n self.fail('object was not a BenchmarkATEResult')\n self.assertEqual...
[ "0.6730554", "0.64330214", "0.6423065", "0.62028956", "0.6143106", "0.61314774", "0.6111404", "0.610992", "0.607744", "0.6041725", "0.6019648", "0.60136884", "0.5990979", "0.59469795", "0.59462446", "0.59371", "0.5891297", "0.5877175", "0.5866717", "0.58603776", "0.58580303",...
0.77577823
0
method to save this class as a JSON file
def to_json(self, path_to_json: str): with open(path_to_json, "w") as _f: json.dump(self.data, _f)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, filename):\n content = self.to_dict()\n with open(filename, 'w') as f:\n json.dump(content, f)", "def _save(self):\n with open(self.file_path, 'w') as fid:\n json.dump(self.data, fid, indent=4, sort_keys=True)", "def save_class(self):\n with open...
[ "0.8294183", "0.8205693", "0.80813426", "0.8050925", "0.8002092", "0.79825723", "0.7883684", "0.7854155", "0.7854155", "0.7854155", "0.78537285", "0.78255206", "0.77965754", "0.77888334", "0.77751166", "0.7741886", "0.7716145", "0.76650107", "0.76298714", "0.7584407", "0.7569...
0.0
-1
method to setup ADA classifier. you can override classifier_name to compare different sets of kwargs all the kwargs will be provided to the scikitlearn classifier constructor
def setup_ada(self, classifier_name="ADA", **kwargs): if not classifier_name in self.classifiers: clf = AdaBoostClassifier(**kwargs) clf.fit(self.X_train, self.y_train) self.classifiers[classifier_name] = clf
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, classifier, X, y, val_method, val_size, k, stratify, mode):\n\t\tsuper().__init__(classifier, X, y, val_method, val_size, k, stratify)\n\t\tself.type_ = 'naive bayes'", "def __init__(self, clf, **kwargs):\n\n # Is done before parents __init__ since we need\n # it for _set_retrain...
[ "0.6290978", "0.6212142", "0.61258507", "0.6071785", "0.6046671", "0.593124", "0.5920679", "0.5889093", "0.5870537", "0.5847244", "0.5716073", "0.5650463", "0.5596349", "0.5588999", "0.5584441", "0.5565967", "0.5550611", "0.55152", "0.5512434", "0.55089635", "0.54947525", "...
0.8347859
0
Return monochrome image with doubled(scale) selected color minus half of the other two colors(/fraction) added together. Where color is Blue (0), Green (1default), or Red (2)
def emphasis(self, img, scale=2, fraction=0.5) : return cv2.subtract(cv2.multiply(img[:,:,self.color],scale), cv2.multiply(cv2.add( img[:,:,(self.color+1)%3], img[:,:,(self.color+2)%3]),fraction))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse(color):\n return 255 - color", "def blend(c: float, a: float) -> float:\n return 255 + (c - 255) * a", "def greyscale(c):\n return desaturate(c, 1)", "def negative(img): \n for pixel in img:\n x, y, col = pixel \n r, g, b = col\n \n new_color = create_...
[ "0.64198655", "0.6400547", "0.63976747", "0.6326675", "0.62678677", "0.6265407", "0.62574065", "0.62114024", "0.61314505", "0.60954577", "0.60629565", "0.6059655", "0.59547377", "0.5924679", "0.5921512", "0.5898028", "0.5896281", "0.5886589", "0.5882595", "0.58771574", "0.587...
0.5481402
73
return array of browser command line arguments from config_section [Chrome] browser_arguments=enableexperimentalwebplatformfeatures unlimitedstorage ...
def get_browser_arguments(self, config_section): if config_section is None: return [] try: arguments_string = self.shishito_support.get_opt(config_section, 'browser_arguments') except configparser.NoOptionError: return [] if arguments_string: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def browser_options():\n opts = Options()\n opts.add_argument('--disable-dev-shm-usage')\n if settings.SELENIUM_DEBUG: opts.add_argument('--auto-open-devtools-for-tabs')\n if settings.USER_AGENT != 'default': opts.add_argument(f'user-agent={settings.USER_AGENT}')\n # Fallback, falls Chrome Installat...
[ "0.70940334", "0.66641027", "0.64358586", "0.6359367", "0.63571846", "0.60843676", "0.60441506", "0.58515286", "0.5656138", "0.56438345", "0.5581591", "0.5565579", "0.5563207", "0.55478483", "0.54750407", "0.54376984", "0.54106665", "0.54055953", "0.5399551", "0.53704447", "0...
0.77858526
0
Return browser profile ready to be passed to driver.
def get_browser_profile(self, browser_type, capabilities, config_section=None): # lowercase browser_type browser_type = browser_type.lower() profile = None if browser_type == 'firefox': profile = webdriver.FirefoxProfile() try: download_file_path...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_profile(self):\n endpoint = '/profile'\n return self.get_request(endpoint)", "def create_chprofile(self):\n logging.info(\"# Setting up chrome profile.\")\n driver_path = \"../drivers/chromedriver\"\n return driver_path", "def create_chprofile(self):\n logging....
[ "0.6978005", "0.6928539", "0.6928539", "0.6866122", "0.67833185", "0.65746945", "0.65342957", "0.64967644", "0.64967644", "0.64924467", "0.64356273", "0.6363064", "0.63366324", "0.6284175", "0.62463605", "0.6242935", "0.61901397", "0.61740077", "0.61598533", "0.61598533", "0....
0.669233
5
Each __getitem__ call yields a list of self.samples_per_instance observations of a single scene (each a dict), as well as a list of groundtruths for each observation (also a dict).
def __getitem__(self, idx): obj_idx, rel_idx = self.get_instance_idx(idx) observations = [] observations.append(self.all_instances[obj_idx][rel_idx]) for i in range(self.samples_per_instance - 1): observations.append(self.all_instances[obj_idx][np.random.randint(len(self.al...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, idx):\n obj_idx, rel_idx = self.get_instance_idx(idx)\n\n # print('obj_idx = ', obj_idx, 'rel_idx = ', rel_idx)\n\n observations = []\n observations.append(self.all_instances[obj_idx][rel_idx])\n\n if self.load_depth:\n ground_truth = [{\n ...
[ "0.7864449", "0.76773065", "0.6841382", "0.6420116", "0.6305259", "0.6030545", "0.6000444", "0.5958141", "0.5937155", "0.58990186", "0.5890973", "0.5881616", "0.58649594", "0.5839009", "0.5833697", "0.5803065", "0.57591385", "0.5743175", "0.5737527", "0.5691412", "0.5669703",...
0.7952802
0
Each __getitem__ call yields a list of self.samples_per_instance observations of a single scene (each a dict), as well as a list of groundtruths for each observation (also a dict).
def __getitem__(self, idx): obj_idx, rel_idx = self.get_instance_idx(idx) # print('obj_idx = ', obj_idx, 'rel_idx = ', rel_idx) observations = [] observations.append(self.all_instances[obj_idx][rel_idx]) ground_truth = [{'rgb':ray_bundle['rgb']} for ray_bundle in observations]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, idx):\n obj_idx, rel_idx = self.get_instance_idx(idx)\n\n observations = []\n observations.append(self.all_instances[obj_idx][rel_idx])\n\n for i in range(self.samples_per_instance - 1):\n observations.append(self.all_instances[obj_idx][np.random.randint...
[ "0.7952309", "0.78633666", "0.6841431", "0.64203453", "0.63039815", "0.6032739", "0.59996927", "0.5956884", "0.5939113", "0.58993036", "0.58931214", "0.58798444", "0.58632505", "0.5838321", "0.58327913", "0.58014464", "0.57576954", "0.5742789", "0.5736073", "0.568955", "0.567...
0.7676358
2
Each __getitem__ call yields a list of self.samples_per_instance observations of a single scene (each a dict), as well as a list of groundtruths for each observation (also a dict).
def __getitem__(self, idx): obj_idx, rel_idx = self.get_instance_idx(idx) # print('obj_idx = ', obj_idx, 'rel_idx = ', rel_idx) observations = [] observations.append(self.all_instances[obj_idx][rel_idx]) if self.load_depth: ground_truth = [{ 'rgb':r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, idx):\n obj_idx, rel_idx = self.get_instance_idx(idx)\n\n observations = []\n observations.append(self.all_instances[obj_idx][rel_idx])\n\n for i in range(self.samples_per_instance - 1):\n observations.append(self.all_instances[obj_idx][np.random.randint...
[ "0.7952802", "0.76773065", "0.6841382", "0.6420116", "0.6305259", "0.6030545", "0.6000444", "0.5958141", "0.5937155", "0.58990186", "0.5890973", "0.5881616", "0.58649594", "0.5839009", "0.5833697", "0.5803065", "0.57591385", "0.5743175", "0.5737527", "0.5691412", "0.5669703",...
0.7864449
1
Returns a human friendly time statement
def time_spent(start, end): spent = end - start minutes = spent / 60 seconds = spent % 60 return '\nTime spent : %s minutes and %s seconds' % (int(minutes), round(seconds, 2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time_string(self):\n return f\"{self.year} {self.month:02} \" \\\n f\"{self.start_day:02} {self.start_hour:02} 00 {self.get_duration():6}\"", "def friendly_time(time=None):\n if time is None:\n time = pass_good_until()\n return time.strftime(config.TIME_PRINT_FORMAT)", "d...
[ "0.74643034", "0.74427", "0.73872733", "0.7374944", "0.73232436", "0.72643906", "0.72527343", "0.7195245", "0.71504444", "0.7096231", "0.7038637", "0.7034044", "0.7033334", "0.702201", "0.70152014", "0.70122015", "0.6996821", "0.69855076", "0.690553", "0.68989956", "0.6895217...
0.0
-1