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
Split the dataset in train and test
def split_data(X_data, y_data): return cv.train_test_split(X_data, y_data, test_size=0.1, random_state=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __split_dataset(self):\n self.train, self.valid, _, _ = train_test_split(self.data, self.data, test_size=0.2)\n self.valid, self.test, _, _ = train_test_split(self.valid, self.valid, test_size=0.5)", "def split_dataset(self, test_size=0.20):\n\t\t(self.training_data, self.test_data, self.traini...
[ "0.8802637", "0.86079246", "0.8466979", "0.82975525", "0.8284587", "0.827557", "0.8264588", "0.81958085", "0.81672466", "0.8152023", "0.8112103", "0.8103609", "0.8087945", "0.80442524", "0.8010122", "0.7993666", "0.7990225", "0.79382634", "0.79229766", "0.79132396", "0.786750...
0.78183466
26
Gets the email of this UserBase. The Zulip API email address of the user or bot. If you do not have permission to view the email address of the target user, this will be a fake email address that is usable for the Zulip API but nothing else.
def email(self): return self._email
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_email(self):\n member = self.get_user()\n if member:\n return member.getProperty('email')", "def get_email(self):\n return self._email", "def get_email(self):\n return self.email", "def user_email(self) -> pulumi.Output[str]:\n return pulumi.get(self...
[ "0.8533475", "0.80256367", "0.80006677", "0.7957389", "0.78827", "0.7873399", "0.78575724", "0.7735007", "0.76502186", "0.76435256", "0.7608377", "0.76025885", "0.76025885", "0.76025885", "0.75683004", "0.75669813", "0.75593585", "0.7512967", "0.74382466", "0.7384822", "0.731...
0.76262873
12
Sets the email of this UserBase. The Zulip API email address of the user or bot. If you do not have permission to view the email address of the target user, this will be a fake email address that is usable for the Zulip API but nothing else.
def email(self, email): self._email = email
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setEmail(self, email):\n self.email = email\n return self", "def email(self, email):\n if self.local_vars_configuration.client_side_validation and email is None: # noqa: E501\n raise ValueError(\"Invalid value for `email`, must not be `None`\") # noqa: E501\n\n self._...
[ "0.7745995", "0.734506", "0.7238552", "0.71991414", "0.70291823", "0.69148123", "0.67069113", "0.66328615", "0.66016483", "0.65045893", "0.65045893", "0.64563024", "0.6400238", "0.6398678", "0.63835156", "0.6366219", "0.6354441", "0.6354117", "0.6353652", "0.6346813", "0.6336...
0.7170487
10
Gets the full_name of this UserBase. Full name of the user or bot, used for all display purposes.
def full_name(self): return self._full_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name(self):\n return self.user.get_full_name() or None", "def get_full_name(self):\n return self.username", "def get_full_name(self):\n return self.username", "def get_full_name(self):\n full_name = f'{self.first_name} {self.last_name}' if self.first_name and self.last_na...
[ "0.8647986", "0.8576306", "0.8576306", "0.8471668", "0.84708536", "0.8437073", "0.8408093", "0.8342528", "0.8340403", "0.8282167", "0.8266369", "0.8264482", "0.81552136", "0.8024534", "0.8024534", "0.80235624", "0.8002769", "0.8002769", "0.8002769", "0.8002769", "0.8002769", ...
0.78962016
26
Sets the full_name of this UserBase. Full name of the user or bot, used for all display purposes.
def full_name(self, full_name): self._full_name = full_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_full_name(self, user_full_name):\n\n self._user_full_name = user_full_name", "def full_name(self):\n return \"{} {}\".format(self.user.first_name, self.user.last_name)", "def full_name(self):\n return self.user.get_full_name() or None", "def set_fullname(self, value):\n s...
[ "0.8363899", "0.72705364", "0.71784294", "0.71450037", "0.7083193", "0.69895613", "0.6981791", "0.6929003", "0.6929003", "0.6929003", "0.6892608", "0.6891887", "0.6880059", "0.6880059", "0.68403715", "0.6780736", "0.6769605", "0.6752243", "0.67450094", "0.6741219", "0.6727072...
0.81382096
2
Gets the is_admin of this UserBase. A boolean specifying whether the user is an organization administrator.
def is_admin(self): return self._is_admin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_admin(self):\n return self.admin", "def is_admin(self) -> bool:\n return self._is_admin", "def is_admin(self):\r\n return self.admin", "def is_admin_user(self):\n if \"is_admin\" in self._properties and self.is_admin == 'YES':\n return True\n return False"...
[ "0.7881886", "0.77665955", "0.77486885", "0.7689977", "0.7461093", "0.73404866", "0.7156036", "0.71471244", "0.71004605", "0.7084834", "0.7068", "0.7034636", "0.70345366", "0.6991166", "0.69782645", "0.6957708", "0.6923771", "0.6915408", "0.6905435", "0.6894784", "0.6880022",...
0.7862511
1
Sets the is_admin of this UserBase. A boolean specifying whether the user is an organization administrator.
def is_admin(self, is_admin): self._is_admin = is_admin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_admin(self, is_admin: bool):\n if is_admin is None:\n raise ValueError(\"Invalid value for `is_admin`, must not be `None`\") # noqa: E501\n\n self._is_admin = is_admin", "def is_admin_user(self):\n if \"is_admin\" in self._properties and self.is_admin == 'YES':\n ...
[ "0.83135295", "0.66889644", "0.6337106", "0.626878", "0.62481576", "0.62481576", "0.62017304", "0.6183351", "0.6072974", "0.60349", "0.601608", "0.59858966", "0.59276825", "0.58737713", "0.58411723", "0.5830839", "0.5752557", "0.5735811", "0.5708521", "0.57063186", "0.5701734...
0.8068177
1
Gets the is_owner of this UserBase.
def is_owner(self): return self._is_owner
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_user_is_owner(self):\n return self._tag == 'user_is_owner'", "def get_owner_object(self):\n return False", "def isowner(self, o):\n return self._owner is o", "def get_owner(self):\n return self.__owner", "def owner(self) -> discord.User:\n if self.config.owner_id:\...
[ "0.7645217", "0.7104894", "0.6914149", "0.6853681", "0.67683494", "0.6743861", "0.66868156", "0.65692985", "0.6566306", "0.6566306", "0.6566118", "0.6552337", "0.65283376", "0.6492521", "0.64828247", "0.6478465", "0.64477557", "0.6443881", "0.64351815", "0.6400954", "0.632009...
0.79326665
0
Gets the is_billing_admin of this UserBase.
def is_billing_admin(self): return self._is_billing_admin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_billing_admin(self, is_billing_admin):\n\n self._is_billing_admin = is_billing_admin", "def is_admin(self):\n return self.admin", "def is_admin(self):\r\n return self.admin", "def is_admin(self):\n if self.user is None:\n return False\n if unicode(self.use...
[ "0.75745505", "0.6962725", "0.6885912", "0.6775686", "0.67065483", "0.6678298", "0.6678298", "0.66013443", "0.6554211", "0.6432071", "0.6286309", "0.6203971", "0.61566216", "0.6140026", "0.61183566", "0.60726625", "0.6026393", "0.6017969", "0.59559476", "0.59489256", "0.59279...
0.8872368
0
Sets the is_billing_admin of this UserBase.
def is_billing_admin(self, is_billing_admin): self._is_billing_admin = is_billing_admin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_billing_admin(self):\n return self._is_billing_admin", "def is_admin(self, is_admin):\n\n self._is_admin = is_admin", "def is_admin(self, is_admin: bool):\n if is_admin is None:\n raise ValueError(\"Invalid value for `is_admin`, must not be `None`\") # noqa: E501\n\n ...
[ "0.737039", "0.6722866", "0.6429481", "0.59705704", "0.5679304", "0.5440798", "0.5371101", "0.52895933", "0.52759075", "0.52700037", "0.52601206", "0.5256608", "0.5244197", "0.5224175", "0.517771", "0.51590234", "0.5110502", "0.50515014", "0.503452", "0.503452", "0.50335866",...
0.8755264
0
Gets the bot_type of this UserBase.
def bot_type(self): return self._bot_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chat_type(self) -> str:\n return self.user.chat_type.name", "def lobby_type(self):\n return self._get(\"lobby_type\")", "def get_type(self) -> str:\n return Tables.USER.name", "def user_type(self):\n if \"userType\" in self._prop_dict:\n return self._prop_dict[\"use...
[ "0.64627266", "0.6358613", "0.614378", "0.6125625", "0.6125625", "0.59903854", "0.59903854", "0.5968016", "0.5968016", "0.59540266", "0.5942109", "0.58541214", "0.585159", "0.58268684", "0.58268684", "0.58098865", "0.57802206", "0.5750634", "0.5730113", "0.56939965", "0.56846...
0.83526576
0
Sets the bot_type of this UserBase.
def bot_type(self, bot_type): self._bot_type = bot_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bot_type(self):\n return self._bot_type", "def set_type(self, rtype=ALL_USERS):\r\n self.type = rtype", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self.type = type", "def is_bot(self, is_bot):\n\n self._is_bot = is_bot", "def set_ty...
[ "0.6873118", "0.60826707", "0.5980632", "0.5980632", "0.5958783", "0.59285235", "0.58882517", "0.56953204", "0.56326497", "0.5610567", "0.55728096", "0.5503789", "0.5461631", "0.54612577", "0.5455133", "0.5455133", "0.5455133", "0.5455133", "0.5442875", "0.5397702", "0.539770...
0.8411738
0
Gets the user_id of this UserBase. The unique ID of the user.
def user_id(self): return self._user_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_id(self):\n return self.id_user", "def user_id(self) -> str:\n return self._user_id", "def user_id(self) -> str:\n return self._user_id", "def get_id(self) -> int:\n return self.user_id", "def get_id(self):\n return self.user_id", "def user_id(self):\n ...
[ "0.833126", "0.8074868", "0.8074868", "0.79576075", "0.7943644", "0.7802189", "0.77085686", "0.75711966", "0.7557508", "0.74490136", "0.74490136", "0.7431941", "0.7417376", "0.7399928", "0.73023885", "0.7278637", "0.7249883", "0.7241275", "0.71973765", "0.71973765", "0.719737...
0.81448174
5
Sets the user_id of this UserBase. The unique ID of the user.
def user_id(self, user_id): self._user_id = user_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id_user(self, id_user):\n\n self._id_user = id_user", "def user_id(self, user_id):\n if user_id is None:\n raise ValueError(\"Invalid value for `user_id`, must not be `None`\") # noqa: E501\n\n self._user_id = user_id", "def user_id(self, user_id):\n if user_id is No...
[ "0.8062206", "0.7894141", "0.7894141", "0.78666085", "0.7841344", "0.7453738", "0.7334409", "0.7047939", "0.69315517", "0.6743944", "0.67409", "0.67378694", "0.67298764", "0.65137416", "0.6411481", "0.6411481", "0.6393266", "0.6393266", "0.6393266", "0.6393266", "0.6393266", ...
0.8119237
10
Gets the bot_owner_id of this UserBase.
def bot_owner_id(self): return self._bot_owner_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def owner(self) -> None:\n return self.bot.get_user(self.bot.config.owner_ids[0])", "def owner_id(self) -> int:\n return self.proto.owner", "def owner_id(self):\n return self._owner_id", "def owner_id(self) -> str:\n return self.__owner_id", "def owner_id(self) -> str:\n ...
[ "0.74863726", "0.7462389", "0.7429973", "0.73903984", "0.7214011", "0.7123705", "0.70963526", "0.7041297", "0.6885209", "0.6862868", "0.68442214", "0.6656169", "0.66238314", "0.65125304", "0.65125304", "0.6489912", "0.6465008", "0.639576", "0.636058", "0.63590413", "0.6319276...
0.86790913
0
Sets the bot_owner_id of this UserBase.
def bot_owner_id(self, bot_owner_id): self._bot_owner_id = bot_owner_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def owner_id(self, owner_id):\n\n self._owner_id = owner_id", "def owner_id(self, owner_id):\n self._owner_id = owner_id", "def bot_owner_id(self):\n return self._bot_owner_id", "def set_owner(self, owner):\n self.__owner = owner", "def owner_id(self, owner_id):\n if owne...
[ "0.73704034", "0.733693", "0.71219534", "0.69730103", "0.6940321", "0.6678052", "0.64090276", "0.62162405", "0.62162405", "0.62162405", "0.62162405", "0.6192035", "0.6192035", "0.6192035", "0.6192035", "0.60748756", "0.6034818", "0.59885144", "0.5901746", "0.58401716", "0.578...
0.8572632
0
Sets the is_active of this UserBase. A boolean specifying whether the user account has been deactivated.
def is_active(self, is_active): self._is_active = is_active
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_active(self, is_active: bool):\n if is_active is None:\n raise ValueError(\"Invalid value for `is_active`, must not be `None`\")\n\n self._is_active = is_active", "def is_active(self, is_active):\n \n self._is_active = is_active", "def is_active(self, is_active):\n...
[ "0.7834352", "0.76405424", "0.6955871", "0.68170184", "0.68170184", "0.68170184", "0.68170184", "0.6813176", "0.6730943", "0.67180324", "0.67115015", "0.67037755", "0.6689273", "0.66405123", "0.6595193", "0.6499912", "0.6499744", "0.6490623", "0.64750445", "0.636067", "0.6323...
0.7561219
3
Gets the is_guest of this UserBase. A boolean specifying whether the user is a guest user.
def is_guest(self): return self._is_guest
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def guest(self):\n return self._guest", "def is_guest(self, is_guest):\n\n self._is_guest = is_guest", "def get_guest_user():\n\n guest = User.query.filter_by(username=\"guest\").first()\n\n if guest == None:\n guest = User(username=\"guest\",\n pas...
[ "0.67751104", "0.652903", "0.6333875", "0.5840743", "0.5831468", "0.57090145", "0.54347944", "0.53395015", "0.5297339", "0.52234644", "0.5145995", "0.514241", "0.5127566", "0.5127566", "0.50955236", "0.50857407", "0.5083316", "0.5064882", "0.5058896", "0.5041641", "0.50172037...
0.78533375
0
Gets the timezone of this UserBase. The time zone of the user.
def timezone(self): return self._timezone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timezone(self):\n return self._tz", "def timezone(self) -> str:\n return self._tz", "def timezone(self):\n return self.data.get(\"timezone\")", "def TimeZone(self):\n if self.force_auto_sync:\n self.get('TimeZone')\n return self._TimeZone", "def get_timezon...
[ "0.7857188", "0.7602793", "0.75864065", "0.7564862", "0.7543805", "0.7350593", "0.7301738", "0.7264471", "0.71459556", "0.71003807", "0.7097807", "0.68156534", "0.68122673", "0.6797889", "0.6775188", "0.6735393", "0.6680171", "0.66326815", "0.65203756", "0.6517433", "0.651403...
0.7784589
3
Sets the timezone of this UserBase. The time zone of the user.
def timezone(self, timezone): self._timezone = timezone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_timezone():\n tz_name = request.vars.name\n # Validates the name.\n from pytz import all_timezones_set\n if tz_name in all_timezones_set:\n session.user_timezone = tz_name\n # If the user is logged in, sets also the timezone for the user.\n # Otherwise, it can happen that a...
[ "0.70524657", "0.70524657", "0.6869655", "0.6587702", "0.650735", "0.64232886", "0.63101465", "0.6221063", "0.6113634", "0.6078929", "0.6078929", "0.6078929", "0.58731836", "0.5856435", "0.5750898", "0.57249284", "0.5719738", "0.5674356", "0.5662734", "0.5613859", "0.55795693...
0.7129376
4
Gets the date_joined of this UserBase. The time the user account was created.
def date_joined(self): return self._date_joined
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_account_created_date(self):\n return self.account_created_date", "def getJoiningTime(self):\n return self.__joinTime", "def created_at(self):\n created_at = self.joined_at\n if created_at is None:\n created_at = DISCORD_EPOCH_START\n \n return create...
[ "0.62656933", "0.6219153", "0.59980553", "0.59758735", "0.5934436", "0.587002", "0.57954764", "0.5775895", "0.5775895", "0.5775895", "0.57507694", "0.57064766", "0.57064766", "0.56547153", "0.56547153", "0.56422794", "0.5618498", "0.5597825", "0.55175257", "0.550172", "0.5483...
0.7982348
0
Sets the date_joined of this UserBase. The time the user account was created.
def date_joined(self, date_joined): self._date_joined = date_joined
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_joined(self):\n return self._date_joined", "def test_user_creation_old_date_joined(self):\n new_user = self.registration_profile.objects.create_inactive_user(\n site=Site.objects.get_current(), **self.user_info)\n self.assertEqual(new_user.get_username(), 'alice')\n ...
[ "0.66438895", "0.581493", "0.56453663", "0.51747286", "0.5124787", "0.5048352", "0.49426377", "0.49251464", "0.49251464", "0.49176228", "0.49075496", "0.49066377", "0.49043387", "0.48563272", "0.48563272", "0.48563272", "0.48529363", "0.48464775", "0.48464775", "0.48464775", ...
0.7769368
0
Gets the delivery_email of this UserBase. The user's real email address. This field is present only if [email address visibility](/help/restrictvisibilityofemailaddresses) is limited and you are an administrator with access to real email addresses under the configured policy.
def delivery_email(self): return self._delivery_email
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_email(self):\n member = self.get_user()\n if member:\n return member.getProperty('email')", "def email(self):\n billing_contact = self.owner.organization_user.user\n return billing_contact.email", "def get_email(self):\n return self._email", "def get...
[ "0.6896622", "0.68197286", "0.66776025", "0.6648298", "0.64765364", "0.6463804", "0.6460512", "0.64135796", "0.64135796", "0.64135796", "0.64135796", "0.63343066", "0.63343066", "0.6321957", "0.63091224", "0.62989455", "0.6274076", "0.6220656", "0.62095183", "0.6136559", "0.6...
0.8150735
0
Sets the delivery_email of this UserBase. The user's real email address. This field is present only if [email address visibility](/help/restrictvisibilityofemailaddresses) is limited and you are an administrator with access to real email addresses under the configured policy.
def delivery_email(self, delivery_email): self._delivery_email = delivery_email
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delivery_email(self):\n return self._delivery_email", "def delivery(self, delivery):\n if self.local_vars_configuration.client_side_validation and delivery is None: # noqa: E501\n raise ValueError(\"Invalid value for `delivery`, must not be `None`\") # noqa: E501\n\n self._d...
[ "0.69637316", "0.6370568", "0.59695375", "0.59579545", "0.58683085", "0.5863861", "0.58421206", "0.58421206", "0.58421206", "0.58421206", "0.58421206", "0.58421206", "0.58421206", "0.58421206", "0.58421206", "0.58421206", "0.582248", "0.5751209", "0.5748383", "0.5698401", "0....
0.812475
0
dist(Vector,Vector) returns the distance between both points/vectors
def dist(first, other): if isinstance(first,FreeCAD.Vector) and isinstance(other,FreeCAD.Vector): return length(sub(first,other))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _vector_dist(self, vec1, vec2):\r\n return sqrt(sum([(float(v1) - float(v2)) ** 2 for v1, v2 in\r\n zip(vec1, vec2)]))", "def dist(p1,p2):\n\n return sqrt((p1[0] - p2[0])**2 + (p1[1] - p2[1])**2)", "def dist(a: Point, b: Point):\n return (a.x - b.x) ** 2 + (a.y - b.y) *...
[ "0.8330045", "0.7836225", "0.7793538", "0.7769077", "0.7764226", "0.76751816", "0.7628056", "0.7599897", "0.758881", "0.75808233", "0.75630975", "0.75542706", "0.7522357", "0.7487544", "0.7484254", "0.74748534", "0.74724805", "0.7463907", "0.74554265", "0.7436666", "0.7422981...
0.77351147
5
normalized(Vector) returns a unit vector
def normalized(first): if isinstance(first,FreeCAD.Vector): l=length(first) return FreeCAD.Vector(first.x/l, first.y/l, first.z/l)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalized(self):\n try:\n m = abs(self)\n return self / m\n except ZeroDivisionError as e:\n raise Exception(\"Attempted to normalize a zero vector, return a unit vector at zero degrees\") from e\n # return Vector(1, 0)", "def normalized(self):\n ...
[ "0.84013855", "0.8248628", "0.8215351", "0.81663924", "0.81663924", "0.81663924", "0.8158663", "0.8142691", "0.8133052", "0.8133052", "0.8133052", "0.8133052", "0.8133052", "0.8133052", "0.8133052", "0.8133052", "0.8133052", "0.8133052", "0.8133052", "0.8125412", "0.81115973"...
0.7754226
39
dotproduct(Vector,Vector) returns the dot product of both vectors
def dotproduct(first, other): if isinstance(first,FreeCAD.Vector) and isinstance(other,FreeCAD.Vector): return (first.x*other.x + first.y*other.y + first.z*other.z)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dotproduct(vec1, vec2):\n return sum((a*b) for a, b in zip(vec1, vec2))", "def dotproduct(vec1, vec2):\n import operator\n return sum(map(operator.mul, vec1, vec2))", "def dot_product(v1, v2):\n return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]", "def dotProduct(v1, v2):\n n1 = normalize(v1)\...
[ "0.86972415", "0.8648256", "0.85929865", "0.85891086", "0.8570757", "0.8549981", "0.8507858", "0.847935", "0.84727925", "0.84720486", "0.84266394", "0.8419811", "0.8343178", "0.8338558", "0.83323467", "0.8256427", "0.82338524", "0.82235616", "0.82016593", "0.8183103", "0.8173...
0.80322015
23
crossproduct(Vector,Vector) returns the cross product of both vectors. If only one is specified, cross product is made with vertical axis, thus returning its perpendicular in XY plane
def crossproduct(first, other=FreeCAD.Vector(0,0,1)): if isinstance(first,FreeCAD.Vector) and isinstance(other,FreeCAD.Vector): return FreeCAD.Vector(first.y*other.z - first.z*other.y, first.z*other.x - first.x*other.z, first.x*other.y - first.y*other.x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_product(v1, v2):\n return cg3d_vector.CG3dVector(\n v1[1] * v2[2] - v2[1] * v1[2],\n v1[2] * v2[0] - v2[2] * v1[0],\n v1[0] * v2[1] - v2[0] * v1[1]\n )", "def vector_cross(x, y):\n\n if(len(x) != len(y)):\n raise ValueError(\"vector lengths differ\")\n elif(len(x...
[ "0.8131378", "0.802793", "0.79265344", "0.7779056", "0.77629125", "0.77045447", "0.76780075", "0.75904584", "0.7525282", "0.7513922", "0.7469388", "0.7426301", "0.7420362", "0.7362331", "0.73169047", "0.7263604", "0.72250664", "0.7215048", "0.72099155", "0.71860886", "0.71698...
0.72218657
17
Calculate the total area of all ecotopes on the playing board.
def ecotope_area_sums(self, board): # clean up the input and merge into a single dataframe cols = ['geometry', 'z_reference', 'landuse', 'biosafe'] board_clean = board.loc[board.biosafe, cols] board_eco = pd.merge(board_clean, self.vr_eco, on=['z_reference',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def area(self):\n area = 0\n\n for room in self.rooms:\n area += room.polygon.area()\n\n for wall in self.walls:\n area += wall.polygon.area()\n\n return area", "def _area(self):\n self.area = 0.0\n for sail in self.sails:\n self.area += ...
[ "0.72191346", "0.69285345", "0.6818615", "0.6791541", "0.6719441", "0.6589277", "0.6585048", "0.6579154", "0.65724313", "0.65674067", "0.6542835", "0.651549", "0.6497927", "0.64875937", "0.64872205", "0.6446514", "0.6436132", "0.6436132", "0.6436132", "0.6436132", "0.6428201"...
0.7589144
0
Takes text where lines are separated by newline characters. Returns True if the text is a limerick, False otherwise. A limerick is defined as a poem with the form AABBA, where the A lines rhyme with each other, the B lines rhyme with each other, and the A lines do not rhyme with the B lines.
def is_limerick(self, text): # TODO: provide an implementation! text = text.lower() p = [] p = text.split('\n') p = [i.strip(' ') for i in p] p = list(filter(None, p)) # all limericks must have 5 lines AABBA if len(p) != 5: return False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_limerick(self, text):\n\n return False", "def is_limerick(self, text):\n \n sentences = text.splitlines()\n \n #remove blank setences\n sentences = [sentence for sentence in sentences if sentence.strip()] \n \n if len(sentences) != 5 : return False ...
[ "0.7332721", "0.7118218", "0.6140549", "0.58115304", "0.5777548", "0.5629705", "0.5620639", "0.5535499", "0.5423312", "0.5394802", "0.5378505", "0.53308886", "0.5302663", "0.5278468", "0.52720255", "0.5223611", "0.5223611", "0.51562977", "0.51394373", "0.5101829", "0.50781065...
0.7593807
0
Get the color of the mask at position. Using 2 bits as a color.
def get_color(mask: int, position: int): return (mask >> (position << 1)) & 3
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mask_color(self):\n return self._mask_color", "def set_color(mask: int, position: int, color: int):\n return mask | (color << (position << 1))", "def get_color(self, point):\n \n d = point - self._origin\n dist = int(d.dot(d) ** 0.5) % 2\n if dist == 0:\n ...
[ "0.6762996", "0.6617752", "0.6400042", "0.6352335", "0.6179756", "0.607116", "0.60303086", "0.5943762", "0.59284455", "0.58960706", "0.58665735", "0.58665735", "0.58594924", "0.5858215", "0.58338976", "0.57897294", "0.5776139", "0.5772793", "0.5763152", "0.5751781", "0.574337...
0.8632774
0
Test list secrets when not connected to any cluster.
def test_secrets_list_server_not_reachable(): message = "REANA client is not connected to any REANA cluster." reana_token = "000000" runner = CliRunner() result = runner.invoke(cli, ["secrets-list", "-t", reana_token]) assert result.exit_code == 1 assert message in result.output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def list_secrets(self):\n pass", "def test_read_namespaced_secret_list_secrets(self):\n pass", "def test_secrets_list_server_no_token():\n message = \"Please provide your access token\"\n env = {\"REANA_SERVER_URL\": \"localhost\"}\n runner = CliRunner(env=env)\n result = runner...
[ "0.7848596", "0.77356535", "0.73634505", "0.71850795", "0.7145914", "0.6926122", "0.674381", "0.655007", "0.64121014", "0.639309", "0.6267915", "0.6263949", "0.6144681", "0.61244977", "0.6104293", "0.6090162", "0.6053545", "0.60486376", "0.601324", "0.59840655", "0.59817785",...
0.77385426
1
Test list secrets when access token is not set.
def test_secrets_list_server_no_token(): message = "Please provide your access token" env = {"REANA_SERVER_URL": "localhost"} runner = CliRunner(env=env) result = runner.invoke(cli, ["secrets-list"]) assert result.exit_code == 1 assert message in result.output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_read_namespaced_secret_list_secrets(self):\n pass", "def test_check_secrets(self):\n secrets.check_secrets([], argparse.Namespace())", "def test_secrets_list_server_not_reachable():\n message = \"REANA client is not connected to any REANA cluster.\"\n reana_token = \"000000\"\n ...
[ "0.71583724", "0.697432", "0.6764023", "0.6734302", "0.657616", "0.6429628", "0.63544613", "0.6260767", "0.6180775", "0.61721295", "0.61655974", "0.6159696", "0.6127158", "0.6099549", "0.60978544", "0.60681677", "0.60320014", "0.60044026", "0.59975713", "0.59924906", "0.59404...
0.77104926
0
Test adding secrets with wrong format.
def test_secrets_add_wrong_format(secret): reana_token = "000000" env = {"REANA_SERVER_URL": "localhost"} runner = CliRunner(env=env) message = 'For literal strings use "SECRET_NAME=VALUE" format' result = runner.invoke(cli, ["secrets-add", "-t", reana_token, "--env", secret]) assert result.exi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_secrets(self):\n secrets.check_secrets([], argparse.Namespace())", "def test_generate_secret(self):\n random_secret = ef_password.generate_secret(24)\n self.assertEqual(len(random_secret), 24)\n assert not set('[~!@#$%^&*()_+{}\":;\\']+$').intersection(random_secret)", "def test_...
[ "0.75044936", "0.707541", "0.70254934", "0.6977966", "0.67734826", "0.67173374", "0.6702236", "0.66481084", "0.6610407", "0.6495734", "0.642665", "0.6363775", "0.63510156", "0.6331783", "0.6269925", "0.6216668", "0.6207249", "0.61964357", "0.61894506", "0.6124794", "0.6116386...
0.8482589
0
Test adding secrets when they already exist.
def test_secrets_add_already_exist(): status_code = 409 reana_token = "000000" env = {"REANA_SERVER_URL": "localhost"} message = "One of the secrets already exists. No secrets were added." mock_http_response = Mock( status_code=status_code, reason="Conflict", json=Mock(return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_secrets(self):\n secrets.check_secrets([], argparse.Namespace())", "def test_secret(self, env: yaenv.Env):\n assert env.secret() == 'notsosecret'\n assert 'NEW_SECRET_KEY' not in env\n _secret = env.secret('NEW_SECRET_KEY')\n assert _secret is not None\n a...
[ "0.7291631", "0.7147517", "0.6715984", "0.6684597", "0.66473454", "0.66376173", "0.6494984", "0.6443271", "0.6437272", "0.6393369", "0.629985", "0.6255083", "0.62139803", "0.61440545", "0.602208", "0.5996874", "0.5979041", "0.5953571", "0.59042215", "0.58320487", "0.58229697"...
0.7203451
1
Constructor to create instance of the Line object.
def __init__(self, p1=None, p2=None, tolerance=None, l=None): if l is None: p1_arr = np.array(p1, dtype=float) p2_arr = np.array(p2, dtype=float) delta = p2_arr - p1_arr norm2 = delta[0] ** 2 + delta[1] ** 2 + delta[2] ** 2 norm1 = np.math.sqrt(norm2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, vertices, **kwargs):\n super(Line, self).__init__(vertices, **kwargs)\n self._geotype = \"Line\"\n return", "def __init__(self, start, end, oldLine = None):\n self.__start = start\n self.__end = end\n if(self.__start == self.__end):\n \"\"\"...
[ "0.80231184", "0.7601697", "0.7555074", "0.74823064", "0.74259686", "0.73953325", "0.7313491", "0.6963556", "0.69590884", "0.6912488", "0.69103134", "0.68802094", "0.6859208", "0.6848757", "0.68076146", "0.6779403", "0.674837", "0.674837", "0.6747915", "0.6672266", "0.6634589...
0.65474164
23
Function to set the tolerance.
def set_tolerance(self, tol): self.tolerance = tol
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tolerance(self, tolerance: float) -> None:\n self._tolerance = tolerance", "def set_tolerance(self, value):\n\n self._tolerance = value", "def set_tolerance(self, tol):\n self.precision = tol\n return", "def tol(self, value):\n self._tol = value", "def set_tol(self, t...
[ "0.8269015", "0.81052655", "0.79584485", "0.7956575", "0.78157336", "0.7737034", "0.7723517", "0.76122135", "0.7429519", "0.7174162", "0.71566623", "0.7126722", "0.7088782", "0.68695533", "0.6833426", "0.676617", "0.66971606", "0.668103", "0.66773707", "0.665312", "0.6650963"...
0.8542296
0
Function to get one point from the line.
def point_at(self, abscissa): return self.zero + abscissa * self.direction
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pick_point_not_on_line(line: Line):\n return line.point1 + line.get_perpendicular_at_point(line.point1).get_direction_vector()", "def get_line_to(self, point):\n\n b = ((self.x - point.x)*point.y - (self.y - point.y)*point.x)/(self.x - point.x)\n\n a = (self.y - point.y)/(self.x - point....
[ "0.7592827", "0.7068464", "0.6940365", "0.6910205", "0.6897533", "0.68894476", "0.6816368", "0.6789263", "0.67315537", "0.6678987", "0.66766155", "0.66728306", "0.66517955", "0.66410375", "0.663569", "0.6616116", "0.6613046", "0.65880394", "0.6556479", "0.6535376", "0.6529306...
0.0
-1
Use sys.stdout.write to write the string with an indentation equal to indent and specifying the end character
def write(string,indent=0,end=""): sys.stdout.write(" "*indent+string+end)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indentOut_ (stream, indent) :\r\n if indent == 0 :\r\n return\r\n else :\r\n stream.write(\" \"*indent)", "def out_indent(indent, *args):\n s = \"\"\n s += indent * \" \"\n s += \" \".join(args)\n return s", "def try_print_indent(self):\n if self.lasttoken[0] != lex.T...
[ "0.7758625", "0.6414926", "0.6342674", "0.6169035", "0.6082922", "0.59543496", "0.5942104", "0.5933664", "0.58904225", "0.5866938", "0.5845034", "0.5830857", "0.5830536", "0.5825642", "0.5822062", "0.58123285", "0.58008015", "0.5715586", "0.5666716", "0.5651807", "0.56485546"...
0.8376877
0
Get a Producer queue instance
def getProducer(): # get the config and a producer config = ecommerce.config.getConfig() return ecommerce.queue.queue(config, queuePrefix)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queue():\n\n return multiprocessing.Queue()", "def get(queue_name: str, **kwargs) -> Queue:\n return Queue(queue_name, **kwargs)", "def _get_queue(self):\n return self.__queue", "def _get_queue(self):\n return self.__queue", "def _get_queue(self):\n return self.__queue", "def _...
[ "0.7450264", "0.7052122", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69740534", "0.69648343", "0.69545984", "0.6784196", ...
0.8324251
0
A generator that can be used to iterate over all of the message handlers that belong to this instance.
def iter_message_handlers(self): for name in dir(self): attr = getattr(self, name) if isinstance(attr, MessageHandler): yield attr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_message_handlers(self):\n\t\treturn self.message_handlers", "def get_handlers(self):\n\n # Get handlers \n logger.debug(\"%s: Returned %d handlers.\" % \\\n (self.__class__.__name__, len(self._handlers)))\n return self._handlers[:]", "def __iter__(self):\n ...
[ "0.75313586", "0.7092574", "0.689368", "0.6885732", "0.6611093", "0.64954853", "0.6490498", "0.6438109", "0.6379151", "0.6324771", "0.6322066", "0.62982225", "0.62764996", "0.6234379", "0.6224543", "0.62200075", "0.61538786", "0.60254633", "0.6023188", "0.60213643", "0.594284...
0.86009705
0
Adds the given service's message handlers to our managed message handlers.
def register_service(self, service): for message_handler in service.iter_message_handlers(): self.message_handlers[message_handler.name] = message_handler
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect(self, service, handler):\n self.partyline.setdefault(service, []).append(handler)", "def register_websock_handlers(self, service, new_client, new_message, close_client):\n if service in self.websock_handlers:\n L.error(\"Error: service:\" + service + \" is already registered\...
[ "0.6415957", "0.63830936", "0.60461724", "0.6046069", "0.6006367", "0.58971536", "0.5866512", "0.5834788", "0.5806009", "0.5753481", "0.5696065", "0.5631438", "0.56120425", "0.5598932", "0.55874574", "0.55768156", "0.55757207", "0.55562836", "0.5551294", "0.5539715", "0.55364...
0.8374331
0
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): if normalize: cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] print("Normalized confusion matrix") el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.8194862", "0.80949175", "0.8029915", "0.8019153", "0.79941195", "0.7991258", "0.7980955", "0.7976606", "0.79610753", "0.79590565", "0.79378676", "0.7934962", "0.7934504", "0.79313844", "0.7926313", "0.7924577", "0.79241234", "0.7923211", "0.7923023", "0.7921931", "0.791787...
0.0
-1
Make infinite calls to a function with the given arguments. End sequence if func() raises StopIteration.
def repeatedly(func, /, *args, **kwargs): func = to_callable(func) try: while True: yield func(*args, **kwargs) except StopIteration as e: yield from stop_seq(e)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iterate(func, x):\n while True:\n x = func(x)\n yield x", "def iterate(f, x):\n while True:\n yield x\n x = f(x)", "def iterate(func: Callable[..., T], x: T, *args, index: Index = None):\n func = to_callable(func)\n index = to_index_seq(index)\n\n if index is None...
[ "0.7004105", "0.6646999", "0.63588154", "0.633149", "0.6150608", "0.6094851", "0.6073668", "0.59957045", "0.5961045", "0.5894083", "0.5876988", "0.58702266", "0.5862073", "0.58489794", "0.5841767", "0.5814898", "0.57949513", "0.5713033", "0.5708868", "0.57078665", "0.5697791"...
0.7911098
0
Return iterator with a single object.
def singleton(obj: T, expand: bool = False) -> Iter[T]: if expand: try: yield from obj except TypeError: pass yield obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getIter(object):\n iterator = None\n try:\n iterator = iter(object)\n except TypeError:\n pass\n return iterator", "def __next__(self):\n return next(self.iterator)", "def __iter__(self):\n self._first()\n return self", "def __iter__(self):\n return s...
[ "0.75817907", "0.74081564", "0.7373555", "0.71963745", "0.71724164", "0.7078414", "0.7078414", "0.7078414", "0.6872086", "0.6868703", "0.683738", "0.67541516", "0.665635", "0.66446465", "0.6599324", "0.65719706", "0.65708953", "0.65270007", "0.6459694", "0.64549285", "0.64549...
0.6621986
14
f""" Repeatedly apply a function func to input. If more than one argument to func is passed, it iterate over the past n values. It requires at least one argument, if you need to iterate a zero
def iterate(func: Callable[..., T], x: T, *args, index: Index = None): func = to_callable(func) index = to_index_seq(index) if index is None and not args: out = _iterate(func, x) elif index is None: out = _iterate_n(func, (x, *args)) else: if not args: out = _ite...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _call_n(x, f, n, *args, **kwargs):\n return [f(i, x, *args, **kwargs) for i in range(n)]", "def loop(func, n):\n for i in range(n):\n func()", "def repeatfunc(func, n, *args):\n return starmap(func, repeat(args, n))", "def repeat(fun, n):\n for i in range(n):\n yield fun()", "de...
[ "0.7455248", "0.7375146", "0.7370228", "0.71860796", "0.7169171", "0.69895", "0.6812954", "0.6778386", "0.675432", "0.6688753", "0.6684521", "0.665017", "0.6537547", "0.64917755", "0.63972217", "0.63972217", "0.6348087", "0.62363607", "0.62081873", "0.6142448", "0.6037471", ...
0.6898225
6
Helper function for counting leading ""s
def leading(self, string: str) -> int: leading_amount = 0 while string[leading_amount] == "-": leading_amount += 1 return leading_amount
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_blank(bd):\n count = 0\n for num in bd:\n if num == \" \":\n return count\n else:\n count += 1", "def linecount(x):\n return sum(1 for char in x if char == \"\\n\")", "def test_number_start_word():\n assert syllapy.count(\"4dog\") == 0", "def srow(...
[ "0.6599933", "0.62831575", "0.62317944", "0.6203771", "0.6051275", "0.6027196", "0.599927", "0.5920738", "0.5860832", "0.5799355", "0.57977337", "0.57650226", "0.57611704", "0.57336843", "0.5714815", "0.5706141", "0.56840324", "0.5660799", "0.5651189", "0.5635546", "0.562362"...
0.62299573
3
Error thrown when formatting a string but a config value is missing.
def __init__(self, key, parent=None): if parent: msg = f"Missing config while rendering {parent}: {key}" else: msg = f"Missing config: {key}" super(MissingConfiguration, self).__init__(msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _raise_format_error(self, name: str, format_str: str, source_format: str):\n\n raise ValueError(f\"The '{ name }' should be { format_str }, rather than { source_format }\")", "def test_single_specifier_missing(self):\n template = 'missing'\n value_count = 1\n msg = 'The formatter ...
[ "0.6889008", "0.65927273", "0.6343142", "0.6240334", "0.60607684", "0.60268956", "0.5999315", "0.5850035", "0.58428705", "0.5835579", "0.5832608", "0.58293426", "0.58019817", "0.57879996", "0.5760329", "0.5742128", "0.57138693", "0.5656415", "0.5598235", "0.5593386", "0.55930...
0.0
-1
Create a logger with console logging (info level) + log file (debug level).
def create_logger(log_dir): logger = logging.getLogger(__file__) logger.setLevel(logging.INFO) # file logger log_filename = "probabilist_connectogram_%s.log" % time.strftime("%Y-%m-%d_%H:%M:%S") if log_dir: log_path = os.path.join(log_dir, log_filename) else: log_path = log_file...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_logger():\n logging.basicConfig(level = logging.INFO, filename='logging', filemode='w')\n logger = logging.getLogger(\" \")\n admin_handler = logging.FileHandler('logging')\n admin_handler.setLevel(logging.INFO)\n logger.addHandler(admin_handler)\n logger.warning(f'{admin_handler} crea...
[ "0.7268376", "0.70308805", "0.7029211", "0.7027607", "0.6950778", "0.6924888", "0.6906252", "0.6870268", "0.6851774", "0.68211913", "0.6813843", "0.6808933", "0.68085176", "0.6753689", "0.67525923", "0.6736932", "0.67316926", "0.67220473", "0.67183745", "0.6701308", "0.669111...
0.65178096
41
Return the Hamming distance between equallength sequences
def __hamming_distance(s1, s2): if len(s1) != len(s2): raise ValueError("Undefined for sequences of unequal length") return sum(el1 != el2 for el1, el2 in zip(s1, s2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hamming_distance(s1, s2):\n if len(s1) != len(s2):\n raise ValueError(\"Undefined for sequences of unequal lenght.\")\n return sum(ch1 != ch2 for ch1, ch2 in zip(s1, s2))", "def hammingDistance(s1 = \"\", s2 = \"\"):\n # if len(s1) != len(s2):\n # raise ValueError(\"Undefined for sequen...
[ "0.7564989", "0.7524423", "0.7510748", "0.7498424", "0.73834527", "0.72914463", "0.7283258", "0.72027653", "0.719384", "0.7186409", "0.7184023", "0.7142286", "0.7130274", "0.71298635", "0.70760477", "0.70056623", "0.6964983", "0.69032145", "0.6894841", "0.68800247", "0.686782...
0.7553281
1
A helper function to create a Relay IRModule with inputs and params from a tflite file
def create_relay_module_and_inputs_from_tflite_file(tflite_model_file, bind_params_by_name=True): with open(tflite_model_file, "rb") as f: tflite_model_buf = f.read() mod, params = convert_to_relay(tflite_model_buf, bind_params_by_name) inputs = dict() for param in mod["main"].params: n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tflite_load_model(model_file):\n interpreter = tf.lite.Interpreter(model_path=model_file)\n interpreter.allocate_tensors()\n return interpreter", "def convert_to_relay(tflite_model_buf, bind_params_by_name=True):\n # TFLite.Model.Model has changed to TFLite.Model from 1.14 to 2.1\n try:\n ...
[ "0.63068986", "0.6023051", "0.5813477", "0.5714911", "0.5690382", "0.5531973", "0.55067134", "0.5490141", "0.5472677", "0.54595083", "0.5441401", "0.5435935", "0.5368517", "0.5319013", "0.5307069", "0.5298142", "0.5294426", "0.5289352", "0.52519286", "0.5250053", "0.5224872",...
0.8060826
0
Tree object equality test.
def __eq__(self, other): if hasattr(other, 'vector'): return self.vector == other.vector
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other: 'Tree') ->bool:\n return (type(self) is type(other) and\n self.value == other.value and\n self.children == other.children)", "def test_deep_equals(obja, objb, isequal):\n\n objatree = wo.typedtree(obja)\n objbtree = wo.typedtree(objb)\n match ...
[ "0.81907886", "0.8065539", "0.79538393", "0.78520125", "0.7722757", "0.7619981", "0.75722384", "0.7570807", "0.7570623", "0.7570623", "0.7570623", "0.7570623", "0.7570623", "0.7509258", "0.7502789", "0.7492585", "0.74790883", "0.74709064", "0.7460193", "0.7412015", "0.7403098...
0.0
-1
Tree object non equality test.
def __ne__(self, other): if hasattr(other, 'vector'): return self.vector != other.vector
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, obj):\r\n return assert_(self.obj != obj, '%r == %r' % (self.obj, obj))", "def __eq__(self, other):\n self = filter_tree(self, _remove_visit_meta)\n return super(Node, self).__eq__(filter_tree(other, _remove_visit_meta))", "def __ne__(self, obj):\n return not self._...
[ "0.7296645", "0.7240735", "0.7235913", "0.7218751", "0.71460253", "0.7126969", "0.7104418", "0.7090795", "0.7070545", "0.703232", "0.70297754", "0.70278966", "0.70278966", "0.70278966", "0.7015042", "0.6992102", "0.6992102", "0.6984518", "0.69703865", "0.6957141", "0.6948727"...
0.0
-1
Creates a list of victory conditions based on the size of the board
def create_victory_conditions(size): #Written by Cody West. Not used in current program, could be used to make boards of different sizes victory_conditions = [] for i in range(size): horizontal_victory = [] for n in range(size): horizontal_victory.append(size*i+n) victory_co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_board(size) -> list:\n return list(itertools.product([i for i in range(size)], repeat=2))", "def create_board(self, size, cars):\n board = [[None for i in range(size)] for j in range(size)]\n\n for car in cars.values():\n for i in range(car.length):\n if car....
[ "0.66391665", "0.62301445", "0.6140845", "0.60436356", "0.6038024", "0.5961014", "0.5920955", "0.58922297", "0.5841574", "0.581635", "0.57947874", "0.5757776", "0.57379335", "0.57237613", "0.570596", "0.56783783", "0.5668432", "0.56344336", "0.5629953", "0.56038624", "0.56017...
0.8714315
0
Find the index of elem in the reversed iterator.
def index(self, elem): return _coconut.len(self.iter) - self.iter.index(elem) - 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def r_index(sequence, element):\n\n for i, e in enumerate(reversed(sequence)):\n if element == e:\n return len(sequence) - 1 - i\n else:\n raise ValueError(\"r_index(sequence, element):\\\n element not in the sequence\")", "def index(self, elem):\n ...
[ "0.7337428", "0.7109907", "0.67639583", "0.6708626", "0.66251403", "0.6604515", "0.6553324", "0.65205306", "0.6481329", "0.6373556", "0.6335034", "0.6285708", "0.6278031", "0.6270351", "0.62547594", "0.6241182", "0.62061155", "0.6160364", "0.6146057", "0.61259276", "0.6125455...
0.7336818
1
Close down the thread and close the sqlite3 database file.
def close(self): self.exit_set = True self.sql_queue.put((self.exit_token, "", ""), timeout=5) # Sleep and check that the thread is done before returning. while self.thread_running: time.sleep(.01) # Don't kill the CPU waiting.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_db(connection: sqlite3.Connection):\n connection.commit()\n connection.close()", "def close_db(self):\n with nostderr():\n tb.file._open_files.close_all()", "def close(self):\n\t\tself.db.close()", "def cleanup(_):\n self.db.close()", "def close(self):\n ...
[ "0.72728205", "0.726023", "0.71503633", "0.71176696", "0.7114434", "0.7111585", "0.7087267", "0.7087267", "0.7087267", "0.7081732", "0.70814943", "0.6973683", "0.69685507", "0.69284976", "0.68923795", "0.6879302", "0.6870084", "0.68667877", "0.68667877", "0.68667877", "0.6866...
0.6315703
100
Create and save a user with the given username, email, and password.
def _create_user(self, username, email, password, **extra_fields): if not username: raise ValueError('The given username must be set') email = self.normalize_email(email) username = self.model.normalize_username(username) user = self.model(username=username, email=email, **ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_user(self, email, password,username, **extra_fields):\r\n if not email:\r\n raise ValueError('The given email must be set')\r\n if not username:\r\n raise ValueError('The given username must be set')\r\n email = self.normalize_email(email)\r\n user = se...
[ "0.859775", "0.8441594", "0.842702", "0.8424334", "0.8394744", "0.8389154", "0.834259", "0.8335656", "0.8334432", "0.83239305", "0.82892966", "0.82822585", "0.8275777", "0.8270387", "0.82692033", "0.8165085", "0.8160581", "0.8158989", "0.8143792", "0.8138259", "0.8128023", ...
0.84072465
4
Return the first_name plus the last_name, with a space in between.
def get_full_name(self): full_name = '%s %s' % (self.first_name, self.last_name) return full_name.strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name(first_name, last_name):\n return first_name + \" \" + last_name", "def full_name(first_name, last_name):\n\t\n\treturn first_name + \" \" + last_name", "def get_formated_name(first_name,last_name):\n\tfull_name = first_name + '' + last_name\n\treturn full_name.title()", "def get_full_name(se...
[ "0.83421856", "0.82273436", "0.80990887", "0.8067676", "0.80525744", "0.8043721", "0.7993416", "0.7992513", "0.7992513", "0.7992513", "0.7978309", "0.7963202", "0.7957057", "0.79399455", "0.7936728", "0.79338795", "0.79154027", "0.7901051", "0.7892942", "0.787005", "0.7855431...
0.7785957
53
Try to get the path to pdb.py and return it in a list.
def GetPdbArgs(python): # Usually, python is /usr/bin/pythonxx and pdb is /usr/lib/pythonxx/pdb.py components = python.split('/') if len(components) >= 2: pdb_path = '/'.join(components[0:-2] + ['lib'] + components[-1:] + ['pdb.py']) if os.access(pdb_path, os.R_OK): return [p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pdbfile_list():\n import glob, os\n os.chdir(\"../Data\")\n file_list = []\n for file in glob.glob(\"*.pdb\"):\n file_list.append(file)\n return file_list", "def pdbfile_list():\n \n import glob, os\n os.chdir(\"../Data\")\n file_list = []\n for file in glob.glob(\"*.pdb\...
[ "0.7001057", "0.6927535", "0.6694564", "0.5969401", "0.5900031", "0.58544034", "0.5816103", "0.58008647", "0.58002234", "0.57855517", "0.57504606", "0.5737899", "0.5679186", "0.5636797", "0.55898374", "0.5576825", "0.54973745", "0.53993475", "0.53957206", "0.53377414", "0.532...
0.72876877
0
Clone a `Sequential` model instance. Model cloning is similar to calling a model on new inputs, except that it creates new layers (and thus new weights) instead of sharing the weights of the existing layers. Arguments
def _clone_sequential_model(model, input_tensors=None): if not isinstance(model, Sequential): raise ValueError('Expected `model` argument ' 'to be a `Sequential` model instance, ' 'but got:', model) def clone(layer): return layer.__class__.from_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clone_model(model, input_tensors=None):\n if isinstance(model, Sequential):\n return _clone_sequential_model(model, input_tensors=input_tensors)\n else:\n return _clone_functional_model(model, input_tensors=input_tensors)", "def clone(self):\n return _libsbml.Model_clone(self)", ...
[ "0.7385709", "0.66616267", "0.6578116", "0.6526493", "0.6467478", "0.62646365", "0.62586915", "0.6220581", "0.6103913", "0.60691476", "0.6056226", "0.6018872", "0.6015779", "0.6011683", "0.5961887", "0.5907166", "0.58924145", "0.5868687", "0.58646977", "0.584091", "0.58357793...
0.7651821
0
Update parameters using one step of gradient descent
def update_parameters_with_gd(parameters, grads, learning_rate): L = len(parameters) // 2 # number of layers in the neural networks # Update rule for each parameter for l in range(L): parameters["W" + str(l+1)] = parameters["W" + str(l+1)] - learning_rate * grads['dW' + str(l+1)] parameter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_parameters(self, loss):\n self.optimizer.zero_grad()\n loss.backward()\n self.optimizer.step()", "def updateParams(self,gradients):\n for i in xrange(len(self.params)):\n self.params[i].set_value(self.params[i].get_value()-gradients[i]/(1/self.learning_rate+self...
[ "0.7269349", "0.7062195", "0.7061314", "0.7021435", "0.6942396", "0.693245", "0.69282365", "0.6900024", "0.68978393", "0.68952733", "0.6880095", "0.6862448", "0.68579733", "0.6851211", "0.6844264", "0.68293726", "0.6826274", "0.67916423", "0.67859596", "0.67605203", "0.675119...
0.0
-1
Yield successive nsized chunks from l.
def chunks(l, n): for i in range(0, len(l), n): yield l[i:i+n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.8038813", "0.79248375", "0.7923423", "0.7885103", "0.78773195", "0.7815877", "0.77655786", "0.77556044", "0.77441615", "0.7731815", "0.77288336", "0.772473", "0.77028215", "0.76889825", "0.76889825", "0.7664208", "0.76570904", "0.7655856", "0.7655856", "0.7635831", "0.7547...
0.76458347
21
Given a latitude and longitude calculate distance to airplane including altitude, return kilometers
def distance(self, lat: float, long: float) -> float: # Initial euclidian formula below # diff_lat = self.lat - lat # diff_long = self.long - long # euclidian = math.sqrt((diff_lat ** 2 + diff_long ** 2 + self.altitude ** 2)) return self._haversine(lat, long) + self.altitude / 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_distance_meters(aLocation1, aLocation2):\n dlat = aLocation2.lat - aLocation1.lat\n dlong = aLocation2.lon - aLocation1.lon\n return math.sqrt((dlat*dlat) + (dlong*dlong)) * 1.113195e5", "def get_distance_metres(aLocation1, aLocation2):\n dlat = aLocation2.lat - aLocation1.lat\n dlong = aL...
[ "0.70389205", "0.6926336", "0.6884272", "0.6884272", "0.6884272", "0.6884272", "0.6884272", "0.68767065", "0.68557805", "0.67505145", "0.67494184", "0.67259705", "0.6697738", "0.6696931", "0.66856134", "0.66700953", "0.65975", "0.6567814", "0.6560275", "0.6525618", "0.6513142...
0.6852247
9
input h (meters) and the coefficients for the linear profile for the free troposphere theta (ft_intercept (K) and slope gamma (K/m)) return the free tropospher theta at height h
def theta_ft(h,ft_intercept,gamma): theta_top = ft_intercept + h*gamma return theta_top
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_theta_surf_hex_h(theta_hs_in_h: float, theta_hs_out_h: float, v_hs: float) -> float:\n\n c = get_specific_heat()\n rho = get_air_density()\n\n # sensible heating capacity of heat source for heating, W\n q_hs_h = (theta_hs_out_h - theta_hs_in_h) * c * rho * v_hs / 3600\n\n # sensible heat tra...
[ "0.5862929", "0.5850773", "0.57733494", "0.5686483", "0.56282175", "0.5592743", "0.55332625", "0.55067706", "0.55043215", "0.5491298", "0.5484844", "0.5470747", "0.5449616", "0.5431975", "0.5429191", "0.5417069", "0.54054326", "0.5379685", "0.53791565", "0.5375629", "0.536189...
0.75179046
0
Set the duty cycle of both control pins to zero to stop the motor.
def stop(self): self.pwm_forward.ChangeDutyCycle(0) self.pwm_backward.ChangeDutyCycle(0) self.pwm_left.ChangeDutyCycle(0) self.pwm_right.ChangeDutyCycle(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self):\n\n self.pwm_forward.ChangeDutyCycle(0)\n self.pwm_backward.ChangeDutyCycle(0)", "def stop_motor(self):\n self.output(self.steering_pin, 0)\n self.pi.set_servo_pulsewidth(self.steering_pin, 0)", "def stop(self):\n\t\tGPIO.output(self._dir_pin_1, GPIO.HIGH)\n\t\tGPIO....
[ "0.7451313", "0.71744835", "0.70240444", "0.64211655", "0.6414792", "0.6408484", "0.6395715", "0.63024884", "0.6269145", "0.62610817", "0.6226628", "0.6201555", "0.614517", "0.61346424", "0.6122426", "0.6099769", "0.6093762", "0.60788894", "0.6051263", "0.60405594", "0.603532...
0.736179
1
Change the labels from arbitrary numbers to the range [0, len(set(labels))]. Points that are in the same cluster will stay in the same cluster. Points from different clusters will remain in different clusters.
def normalize_labels(labels): new_labels = np.array([-1] * len(labels)) labels = np.array(labels) label_dict = dict() for i, label in enumerate(set(labels)): new_labels[np.where(labels == label)] = i label_dict[i] = label return label_dict, new_labels
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _relocate_clusters(self, cluster_labels):\n for cluster_label in range(self.k):\n if cluster_labels[cluster_label] is not None:\n # mean of the pixels assigned to cluster\n p_sum, p_count = np.asarray(\n cluster_labels[\n ...
[ "0.68851614", "0.6850147", "0.6721148", "0.6478987", "0.643922", "0.6345853", "0.6343787", "0.6329328", "0.62441224", "0.6120226", "0.6087101", "0.60843414", "0.60319865", "0.5999183", "0.59800136", "0.5965767", "0.5940681", "0.59308654", "0.592457", "0.5924074", "0.5922587",...
0.6535897
3
Modify the column name to make it Pythoncompatible as a field name
def normalize_col_name(col_name, used_column_names, is_relation): field_params = {} field_notes = [] new_name = col_name.lower() if new_name != col_name: field_notes.append('Field name made lowercase.') if is_relation: if new_name.endswith('_id'): new_name = new_name[:-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_column_name(self, column, idx, old_name, name):\n dtype = self.dtype\n # Updating the names on the dtype should suffice\n dtype.names = dtype.names[:idx] + (name,) + dtype.names[idx + 1 :]", "def py_field_name(self, field):\n name = field.name\n name = as_identifier...
[ "0.7072573", "0.7007338", "0.6994978", "0.69579434", "0.68072045", "0.6802428", "0.6802428", "0.67907166", "0.6732477", "0.6600031", "0.65641886", "0.64931035", "0.64931035", "0.64816284", "0.6459289", "0.64281356", "0.63902634", "0.6334104", "0.6324554", "0.6324554", "0.6286...
0.7277575
0
Deletes the specified group. The group must be empty.
def delete_group(self, group_id, **kwargs): resource_path = "/groups/{groupId}" method = "DELETE" # Don't accept unknown kwargs expected_kwargs = [ "retry_strategy", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_group(self, group):\n raise NotImplementedError('delete_group')", "def delete_group(self, group_name):\r\n params = {'GroupName' : group_name}\r\n return self.get_response('DeleteGroup', params)", "def delete_group(self, group_id: str):\n # If successful, this method ret...
[ "0.8661287", "0.8429421", "0.8341084", "0.83324933", "0.81745154", "0.80304027", "0.8005047", "0.7919353", "0.79183817", "0.7814903", "0.7808236", "0.7775581", "0.77595615", "0.77590305", "0.773771", "0.7719856", "0.75224054", "0.75213486", "0.7515984", "0.74853754", "0.74750...
0.68005127
46
Deletes the specified group mapping.
def delete_idp_group_mapping(self, identity_provider_id, mapping_id, **kwargs): resource_path = "/identityProviders/{identityProviderId}/groupMappings/{mappingId}" method = "DELETE" # Don't accept unknown kwargs expected_kwargs = [ "retry_strategy", "if_match" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_group(self, group):\n raise NotImplementedError('delete_group')", "def deleteGroup(groupName):\r\n Group.deleteGroup(groupName)", "def delete_group(gid):\n if request.method == 'POST':\n hl.deleteGroup(gid)\n return redirect('/users')", "def do_del_group(dbsync, grou...
[ "0.7407182", "0.6943236", "0.681764", "0.6814603", "0.66882336", "0.665547", "0.66528887", "0.6552498", "0.6507317", "0.65058494", "0.6426595", "0.64135116", "0.64025885", "0.6398474", "0.6387597", "0.63239", "0.62887627", "0.6258294", "0.62549347", "0.6252067", "0.62451065",...
0.5965616
36
Gets the authentication policy for the given tenancy. You must specify your tenant\u2019s OCID as the value for the compartment ID (remember that the tenancy is simply the root compartment).
def get_authentication_policy(self, compartment_id, **kwargs): resource_path = "/authenticationPolicies/{compartmentId}" method = "GET" expected_kwargs = ["retry_strategy"] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authentication_policy(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"authentication_policy\")", "def authentication_policy(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"authentication_policy\")", "def authentication_policy(self) -> pulumi.Output[Optional...
[ "0.5763793", "0.5763793", "0.56437725", "0.52095336", "0.51566327", "0.5049942", "0.49517995", "0.49281493", "0.4919025", "0.48551175", "0.48236695", "0.48195675", "0.48187912", "0.47907704", "0.47624832", "0.4753156", "0.4753156", "0.47355378", "0.47262105", "0.4723426", "0....
0.6030179
0
Lists the compartments in a specified compartment. The members of the list returned depends on the values set for several parameters. With the exception of the tenancy (root compartment), the ListCompartments operation returns only the firstlevel child compartments in the parent compartment specified in `compartmentId`...
def list_compartments(self, compartment_id, **kwargs): resource_path = "/compartments" method = "GET" # Don't accept unknown kwargs expected_kwargs = [ "retry_strategy", "page", "limit", "access_level", "compartment_id_in_subtr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getListOfCompartments(self):\n return self.model.getListOfCompartments()", "def getListOfCompartments(self, *args):\n return _libsbml.Model_getListOfCompartments(self, *args)", "def get_compartment(self, compartment_id, **kwargs):\n resource_path = \"/compartments/{compartmentId}\"\n ...
[ "0.62096506", "0.60235274", "0.5435602", "0.5372225", "0.52894926", "0.5113388", "0.50968504", "0.5042258", "0.49255446", "0.4908474", "0.48918715", "0.4878826", "0.4840922", "0.46979246", "0.46899638", "0.46821752", "0.468023", "0.45857018", "0.45253602", "0.4391601", "0.437...
0.84061605
0
Updates the specified auth token's description.
def update_auth_token(self, user_id, auth_token_id, update_auth_token_details, **kwargs): resource_path = "/users/{userId}/authTokens/{authTokenId}" method = "PUT" # Don't accept unknown kwargs expected_kwargs = [ "retry_strategy", "if_match" ] ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_video_patch_detail_token_user_description(self):\n video = factories.VideoFactory(description=\"my description\")\n jwt_token = AccessToken()\n jwt_token.payload[\"resource_id\"] = str(video.id)\n jwt_token.payload[\"roles\"] = [random.choice([\"instructor\", \"administrato...
[ "0.6497291", "0.6414944", "0.62694657", "0.610832", "0.5971511", "0.5964725", "0.581407", "0.5786695", "0.5741787", "0.57394075", "0.5723997", "0.5715468", "0.5691383", "0.55781394", "0.55590355", "0.5552019", "0.5540073", "0.5533868", "0.552116", "0.5510495", "0.54998803", ...
0.0
-1
If the environment variable TERM is unset try with `fallback` if not empty. vt100 is a popular terminal supporting ANSI X3.64.
def load_terminfo(terminal_name=None, fallback='vt100'): terminal_name = os.getenv('TERM') if not terminal_name: if not fallback: raise TerminfoError('Environment variable TERM is unset and no fallback was requested') else: terminal_name = fallback if os.getenv('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_term(fullterm):\n if platform == 'win32':\n return True\n elif platform in ('darwin', 'linux'):\n global _STATIC_VARS\n fd = stdin.fileno()\n if not isatty(fd):\n return\n old = tcgetattr(fd)\n _STATIC_VARS.term_config = (fd, old)\n new = ...
[ "0.5692326", "0.53151155", "0.5231032", "0.52155876", "0.51974976", "0.51403886", "0.5131423", "0.50917715", "0.50907224", "0.5077649", "0.4965872", "0.48994294", "0.4885659", "0.48755345", "0.48475754", "0.48131225", "0.480396", "0.47808626", "0.4763937", "0.47169244", "0.47...
0.5457427
1
Return the result of an elasticsearch query as a pandas DataFrame.
def _ES_res_to_pandas(self, res, columns, thresh=None): sources = [x['hits']['hits'][0]['_source'] for x in res['responses']] if columns is not None: if isinstance(columns, list): sources = [{key: val for key, val in x.items() if key in columns} for x in sources] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pandas(self):\n return pd.DataFrame(self.results)", "def parse_query_result(self):\n results = self.jsonData['results']\n\n df = pd.DataFrame(results)\n df.drop(['rootSource', 'uri'], axis=1, inplace=True)\n\n return df", "def parse_query_result(self):\n result...
[ "0.74036556", "0.70324427", "0.70324427", "0.7026997", "0.6755308", "0.66402763", "0.65239024", "0.6453229", "0.6447718", "0.641856", "0.63828397", "0.63794637", "0.63329643", "0.6315638", "0.63023823", "0.62740153", "0.6256019", "0.6252512", "0.61707205", "0.616961", "0.6168...
0.59003174
47
two keras Model instances are equal enough
def assert_models_equal(first, second): # layer names and settings assert first.get_config() == second.get_config() # model weights assert len(first.get_weights()) == len(second.get_weights()) for w1, w2 in zip(first.get_weights(), second.get_weights()): np.testing.assert_array_equal(w1, w2)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_second_keras_model_created():\n X, _, _, _ = get_data()\n tf.random.set_seed(12345)\n initializer = tf.keras.initializers.Zeros()\n input_data = Input(shape=X[0].shape)\n xx = Dense(128, activation=\"relu\", kernel_initializer=initializer)(input_data)\n xx = Dense(128, activation=\"relu\...
[ "0.72829473", "0.72438365", "0.7227518", "0.7076971", "0.6773338", "0.6756114", "0.6642388", "0.6548654", "0.6545828", "0.6540332", "0.65398526", "0.6519682", "0.65037364", "0.6483842", "0.64417934", "0.64361674", "0.6423497", "0.636907", "0.6350753", "0.63441813", "0.6334493...
0.7113716
3
correctly convert a series of dicts or a DictArray to lists
def test_input_conversion(self): data = [dict(A=0.1, C=0.2), dict(A=0.1, C=0.2)] base = [("A", 0.1), ("C", 0.2)] expect = [base, base] got = _char_hts_as_lists(data) self.assertEqual(got, expect) # data = [dict(A=0.1, C=0.2), {}] base = [("A", 0.1), ("C", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dict_array_values_as_list(self, dict_object: dict()) -> []:\n new_list = []\n for val in dict_object.values():\n new_list = new_list + val\n return new_list", "def __dict_to_list(dict):\n\n max_val = 1\n for k,v in dict.items():\n if type(v) is list:\n...
[ "0.65203464", "0.6443881", "0.64112335", "0.62288743", "0.62244505", "0.62078065", "0.61272603", "0.60739225", "0.60704356", "0.60704356", "0.6049034", "0.5973778", "0.59609526", "0.5909848", "0.5888783", "0.5881044", "0.58610386", "0.5849552", "0.5837635", "0.5829828", "0.58...
0.0
-1
Return a list of all the cells in the grid. We start increasing x first, i.e. 0th cell is the first cell, 1cell is the one with the next x in the list and y unchanged, .... Return array An array of size n_cells n_dims.
def cells_list(self): xx, yy = np.meshgrid(self.x_spacings, self.y_spacings) return np.vstack([yy.ravel(), xx.ravel()]).transpose()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_cells_from_dims(num_verts_x: int, num_verts_y: int):\n num_cells_x = num_verts_x - 1\n num_cells_y = num_verts_y - 1\n num_cells = num_cells_x*num_cells_y\n cell_array = np.zeros((num_cells, 4), dtype=int)\n cell_num = 0\n\n # I am sure this could be done in a more efficient way.\n ...
[ "0.7313377", "0.70912474", "0.70496106", "0.70136446", "0.70017177", "0.69983876", "0.6967043", "0.6942949", "0.69047695", "0.6899912", "0.6888806", "0.6857896", "0.68333375", "0.6820522", "0.6802178", "0.6766183", "0.66904247", "0.66788596", "0.6637702", "0.66127455", "0.660...
0.77503717
0
Saves chunked speech intervals as WAV file.
def save_chunks(chunk_sound, out_path, video_id): chunk_start_ms = int(chunk_sound.get_start_time()*1000) chunk_end_ms = int(chunk_sound.get_end_time()*1000) chunk_duration = chunk_end_ms - chunk_start_ms chunk_fn = '{0}_{1}_{2}.wav'.format(video_id, chunk_start_ms, chunk_end_ms) chunk_file_path = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_wav(file_name, signal, fs):\n wavfile.write(file_name, fs, np.int16(signal/np.max(np.abs(signal)) * (2**(16)/2-1)))", "def save_audio(self, name=DEFAULT_OUT_NAME):\n print(\"Saving...\")\n wf = wave.open(name+'.wav', 'wb')\n wf.setnchannels(DEFAULT_CHANNELS)\n wf.setsampwi...
[ "0.6919104", "0.6847627", "0.672993", "0.6697336", "0.66271955", "0.6598934", "0.65593815", "0.65480053", "0.65218306", "0.6511665", "0.64606607", "0.6440448", "0.63984156", "0.6338785", "0.63294864", "0.6315476", "0.63118845", "0.63059294", "0.6304708", "0.6291267", "0.62757...
0.6976282
0
Takes input ends of all feed pipes and feeds odd numbers starting from low until high both inclusive. in a round robin fashion. process ends by feeding 1 to all pipes. 1 is a sentinel value.
def distributor(ls_feed_pipe_open,low,high): def getNumber(low,high): i = low if i%2 == 0: #if i is even, then start from i+1 odd. i += 1 while i<=high: yield i i+=2 #no need to check for even numbers, so skip it here at begining ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def odd():\n num = 0\n while True:\n yield num * (num & 1)\n num += 1", "def infinite_odd_generator():\n current = 1\n while True:\n yield current\n current = current + 2", "def input_pipe():\n x = ''\n while True:\n x = yield x\n yiel...
[ "0.5789352", "0.5761657", "0.5741719", "0.564393", "0.52422297", "0.51917", "0.50984246", "0.50861835", "0.5054945", "0.50331575", "0.50145054", "0.5011917", "0.50026035", "0.49603093", "0.49603093", "0.4935153", "0.49219003", "0.49094537", "0.4875977", "0.4841634", "0.483971...
0.68875015
0
Estimate whether the animal was running during each trial. This function first smooths the running trace according to smoothsize (noncausal), it then uses the average of N presamples before the onset to to estimate whether running was higher than the threshold.
def estimate_running_each_trial(running_trace, trial_onset, smoothsize=10, presamples=4, threshold=3, showfig=False): smoothwin = np.ones(smoothsize)/(smoothsize) running_trace_smooth = np.convolve(running_trace, smoothwin, mode='same') trial_onset_ind = np.where(trial_onset)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def punches(self):\n #:TODO Need to parameterize n\n # Initialize smoothing function\n # Also because I can't take the second derivitive\n\n n = 3\n assert (len(self.averages)==len(self.timestamps))\n size = len(self.averages)\n slopes = []\n for t in [0,size...
[ "0.5619866", "0.5553437", "0.5524997", "0.53908414", "0.5296018", "0.5253825", "0.5213897", "0.52011967", "0.51841336", "0.5176683", "0.51282734", "0.5120962", "0.51179755", "0.5112065", "0.50441957", "0.50383514", "0.503653", "0.50297564", "0.4981896", "0.4948819", "0.493829...
0.7172721
0
A helper function to getnerate quaternions from yaws.
def heading(yaw): q = euler2quat(0.0, 0.0, yaw) quat = Quaternion() quat.w = q[0] quat.x = q[1] quat.y = q[2] quat.z = q[3] return quat
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euler_from_quaternion(x, y, z, w):\n t0 = +2.0 * (w * x + y * z)\n t1 = +1.0 - 2.0 * (x * x + y * y)\n roll_x = math.atan2(t0, t1)\n \n t2 = +2.0 * (w * y - z * x)\n t2 = +1.0 if t2 > +1.0 else t2\n t2 = -1.0 if t2 < -1.0 else t2\n pitch_y = math.asin(t2)\n ...
[ "0.5886946", "0.5821129", "0.57884336", "0.5761411", "0.57510763", "0.56554824", "0.55509216", "0.5486164", "0.5485171", "0.5455863", "0.5419014", "0.5404133", "0.53984076", "0.5394962", "0.53919274", "0.5354592", "0.5353793", "0.5328789", "0.5326809", "0.5319791", "0.5303704...
0.47717264
84
Save the DataSets as CSV
def save_datasets(ds, pdf_name, directory=''): print(f'{directory}{pdf_name.split("/")[-1].replace(".pdf", "")}_0..{len(ds)}.csv') list(map( lambda tb: tb[1].to_csv( f'{directory}{pdf_name.split("/")[-1].replace(".pdf", "")}_{tb[0]}.csv', index=False), enumerate(ds)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_to_csv(self):\n path = partial(os.path.join, 'datasets')\n save_name = self.name.lower().replace(' ', '_')\n self.df['values'].sum(axis=1).to_csv(path('{0}_values.csv'.format(save_name)))\n self.df['allocations'].to_csv(path('{0}_allocations.csv'.format(save_name)))\n se...
[ "0.7957732", "0.79157484", "0.7566766", "0.7396046", "0.73250043", "0.7290871", "0.72067684", "0.71864974", "0.71633387", "0.7068782", "0.7042488", "0.7025496", "0.70245546", "0.69767153", "0.69759953", "0.69569284", "0.69508433", "0.69366264", "0.68940073", "0.68940073", "0....
0.6633306
39
All the logic to move, and the game logic goes here. Normally, you'll call update() on the sprite lists that need it.
def update(self, delta_time): # Call draw() on all your sprite lists below game = self.game if game.exit: arcade.close_window() if not game.is_running: return # if level has changed redraw walls if self.game.level != self.last_level: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_logic(self):\n if not self.game_over:\n # Move all the sprites\n self.all_sprites_list.update()", "def update(self):\n self.moving_sprites.update() \n self.static_sprites.update()\n self.camera.update(self.player)", "def update(self):\r\n if self...
[ "0.81336796", "0.7562641", "0.7411709", "0.73849124", "0.7197949", "0.7156386", "0.7143857", "0.7113507", "0.70476794", "0.7022667", "0.69586724", "0.695298", "0.6948688", "0.6880869", "0.6738882", "0.67356026", "0.6731809", "0.67010486", "0.6692721", "0.66918117", "0.6690588...
0.0
-1
Return a head compatible with this task
def create_compatible_head( self, n_features: int, device: Optional[str] = None, ): head = nn.Linear(n_features, self.n_classes) xavier_initialize(head) if device is not None: head = head.to(device) return head
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def head(self) -> TaskHead:\n return self._model.head", "def head(self) -> tf.estimator.Head:\n\n task_type = self._problem_statement.tasks[0].type\n if task_type.HasField('one_dimensional_regression'):\n return tf.estimator.RegressionHead()\n num_classes = (\n self._tf_transform_outp...
[ "0.78820324", "0.7001775", "0.6367529", "0.6272498", "0.6272498", "0.6085029", "0.60775405", "0.60211575", "0.59077823", "0.58798844", "0.5837654", "0.578382", "0.5746318", "0.570547", "0.5696375", "0.56910676", "0.56888205", "0.56619275", "0.56599844", "0.5638932", "0.563865...
0.5274176
76
Evaluate a model on a dataset
def eval_model( self, model: nn.Module, batch_size: int = 32, data: Union[str, th.utils.data.Dataset] = "test", collate_fn: Optional[Callable] = None, by_example: bool = False, label_map: Optional[Callable] = None, nll: bool = False, ): # Set m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(self, dataset):\n return self.model.evaluate(dataset.X_val, dataset.y_val)", "def evaluate(self, dataset):\n\t\tpass", "def evaluate(X_test, y_test):\n # batch size is 16 for evaluation\n batch_size = 16\n\n # Load Model\n model = load_model('model/model.h5')\n return model.e...
[ "0.7838396", "0.75702345", "0.75052845", "0.7403759", "0.7293109", "0.71893185", "0.7124573", "0.71120846", "0.7107418", "0.70945823", "0.70358276", "0.7014347", "0.7008108", "0.6981123", "0.69724715", "0.6952163", "0.69312906", "0.69263285", "0.68702364", "0.68674177", "0.68...
0.6675748
42
Collater to make batches
def collate_fn(self, *args): return TupleMiniBatch(default_collate(*args))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _collater(batch):\n return batch[0]", "def collater(self, samples):\r\n raise NotImplementedError", "def produce_query_batches(self):\n pass", "def trivial_batch_collator(batch):\n return batch", "def trivial_batch_collator(batch):\n return batch", "def trivial_batch_collator(b...
[ "0.7257751", "0.64775294", "0.62918323", "0.62413275", "0.62413275", "0.62413275", "0.6130379", "0.6129091", "0.60867256", "0.6059193", "0.604119", "0.6024431", "0.60000926", "0.59829533", "0.59790826", "0.5951112", "0.590438", "0.5853374", "0.5758594", "0.5754777", "0.575146...
0.55312043
33
Reset the process of training, which includes the loss meter reset, epoch reset and model's weights reset.
def reset_train(self): self.model.apply(self._reset_weights) self.epoch_loss.reset() self.epoch = 0 del self.batch_process self.batch_process = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n self.train_loss.reset_states()\n self.train_accuracy.reset_states()\n self.val_loss.reset_states()\n self.val_accuracy.reset_states()\n self.train_mIoU.reset_states()\n self.val_mIoU.reset_states()", "def train_loop_begin(self):\r\n for _, train_los...
[ "0.80868524", "0.7918954", "0.7916748", "0.7766766", "0.7735061", "0.76176995", "0.7499007", "0.7421006", "0.7351169", "0.72698146", "0.7228589", "0.7210134", "0.71855277", "0.70681477", "0.701447", "0.6989159", "0.69768757", "0.6957746", "0.6951352", "0.6948265", "0.69307107...
0.9016183
0
Update weights based on last input/output and learning rate
def update_weights(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __update(self, learning_rate):\n for layer in self.layers:\n layer.weights.set_value((layer.weights - learning_rate * layer.dW).eval())\n layer.biases.set_value((layer.biases - learning_rate * layer.db).eval())", "def update_weights(self):\n\n\n self.w += self.learn_rate *...
[ "0.80830616", "0.7857255", "0.77221936", "0.75878155", "0.7544157", "0.75073385", "0.7503516", "0.74666196", "0.7415437", "0.7407029", "0.7364739", "0.7336763", "0.7227047", "0.721761", "0.7210267", "0.71573895", "0.7152569", "0.7145055", "0.7145055", "0.7090362", "0.7078788"...
0.7508802
5
Create the reference file of a test using the response received. The file will be created in the git references folder provided in the settings file
def create_reference( self, response_checker=default_checker.default_journey_checker ): # Check that the file doesn't already exist filename = self.get_file_name() filepath = os.path.join(config["REFERENCE_FILE_PATH"], filename) if os.path.isfile(filepath): logge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ref(request):\n r = referencepytest.ref(request)\n this_dir = os.path.abspath(os.path.dirname(__file__))\n r.set_data_location(os.path.join(this_dir, '..', 'reference'))\n return r", "def test_with_new_file(self):\n repository = self.create_repository(tool_name='Test')\n review_requ...
[ "0.65603554", "0.62640995", "0.62635124", "0.62011635", "0.6008765", "0.5936762", "0.5884765", "0.5857535", "0.5827133", "0.5797445", "0.5793405", "0.5725234", "0.57189417", "0.571022", "0.5687655", "0.5664678", "0.5638524", "0.56348014", "0.5630147", "0.5594338", "0.55792326...
0.70232326
0
Pure implement of heap sort algorithm in Python
def heap_sort(collection): n = len(collection) for i in range(n // 2 - 1, -1, -1): heapify(collection, i, n) for i in range(n - 1, 0, -1): collection[0], collection[i] = collection[i], collection[0] heapify(collection, 0, i) return collection
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def heap_sort(list):\n pass", "def heap_sort(arr):\n if not isinstance(arr, list) or len(arr) == 0:\n return\n for i in range(len(arr) // 2 - 1, -1, -1):\n heapify(arr, i, len(arr))\n for i in range(len(arr) - 1, 0, -1):\n arr[0], arr[i] = arr[i], arr[0]\n heapify(arr, 0, ...
[ "0.82783955", "0.8089301", "0.8086552", "0.8035019", "0.8015355", "0.7985793", "0.7985793", "0.7959204", "0.7954446", "0.7736345", "0.7736345", "0.7707003", "0.77046126", "0.77045786", "0.7695088", "0.7671767", "0.76464075", "0.7600847", "0.75952286", "0.7574346", "0.7545443"...
0.7628612
17
Returns a string representation of a path
def render_path(path_to_item): result = "" for pth in path_to_item: if isinstance(pth, six.integer_types): result += "[{0}]".format(pth) else: result += "['{0}']".format(pth) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_str(path):\n\toutput = \"PATH: \"\n\tif path:\n\t\tfor i in path:\n\t\t\toutput += str(i.data) + \" -> \"\n\telse:\n\t\toutput += \"Empty\"\n\treturn output", "def path_to_str(path):\n if hasattr(path, '__fspath__'):\n path = as_str_any(path.__fspath__())\n return path", "def as_string(pa...
[ "0.79950243", "0.77772427", "0.76012766", "0.75008774", "0.7465539", "0.73858505", "0.724589", "0.7177473", "0.71564364", "0.70764357", "0.70681226", "0.70649594", "0.70468634", "0.70299315", "0.6943011", "0.69423383", "0.6906489", "0.6906489", "0.69057655", "0.68910974", "0....
0.0
-1
[channel] Retrieves the vote count for a poll.
def votes(self, irc, msg, args, channel, pid): if channel and msg.args[0] in irc.state.channels: if msg.args[0] != channel: if ircdb.checkCapability(msg.prefix, 'admin') or ircdb.checkCapability(msg.prefix, 'owner'): irc.error("Not Implemented") el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vote_count(self, post):\n return post.vote_set.count()", "async def _vote_count(\n self, ctx: Context, *, channel: discord.TextChannel = None\n ):\n\n guild: discord.Guild = ctx.guild\n\n if not channel:\n channel = await self.get_vote_channel(guild)\n ...
[ "0.6773994", "0.6712171", "0.66255003", "0.64222467", "0.64080846", "0.6403009", "0.6307542", "0.627525", "0.62508446", "0.6187831", "0.6187831", "0.61792505", "0.6178627", "0.61383927", "0.61028653", "0.6074583", "0.60575265", "0.60141224", "0.6011861", "0.60046905", "0.6000...
0.0
-1
Gets information about a RuntimeConfig resource.
def GetConfig(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runtime_config(self) -> str:\n return self._node[\"app_data\"].get(\"runtime_config\")", "def get_resource_config(target=False, force=None):\n return get_stored_property(ctx, 'resource_config', target, force)", "def config(self):\n annotations = IAnnotations(self.context)\n return a...
[ "0.7309697", "0.63536143", "0.61861", "0.61123216", "0.60506386", "0.6046548", "0.60022986", "0.59997743", "0.59895045", "0.5969095", "0.5955346", "0.5955346", "0.5955346", "0.5955346", "0.5955346", "0.5955346", "0.5955346", "0.5955346", "0.5955346", "0.5955346", "0.5955346",...
0.0
-1
Creates a new RuntimeConfig resource. The configuration name must be unique within project.
def CreateConfig(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, config):\n config_name = config.get(\"LaunchConfigurationName\", self._name)\n assert config_name == self._name, \"Config name mismatch {} {}\".format(config_name, self._name)\n config[\"LaunchConfigurationName\"] = self._name\n self._client.create_launch_configuration(...
[ "0.6188884", "0.6090293", "0.6090293", "0.58227265", "0.57470423", "0.57029325", "0.5658915", "0.55869395", "0.55303633", "0.5527195", "0.5509801", "0.5489197", "0.5486522", "0.544036", "0.54257023", "0.5423881", "0.54184675", "0.5381031", "0.5323874", "0.532296", "0.5305365"...
0.0
-1
Deletes a RuntimeConfig resource.
def DeleteConfig(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_global_system_config_delete(self, resource_id, resource_dict):\n pass", "def post_global_vrouter_config_delete(self, resource_id, resource_dict):\n pass", "def delete(name, config, backend, storage, debug):\n setup_lithops_logger(logging.DEBUG)\n\n verify_runtime_name(name)\n\n ...
[ "0.63476586", "0.6339625", "0.6323798", "0.6240317", "0.62242293", "0.619534", "0.61792046", "0.61713314", "0.6144527", "0.6141145", "0.6128976", "0.60849786", "0.6033858", "0.60115296", "0.5929646", "0.57731843", "0.5771558", "0.5689029", "0.5676266", "0.5670987", "0.5560764...
0.56942225
17
Lists variables within given a configuration, matching any provided filters. This only lists variable names, not the values, unless `return_values` is true, in which case only variables that user has IAM permission to GetVariable will be returned.
def ListVariables(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_variables(self, request, context):\n response = ListVariablesResponse()\n for variable in self._delegator.list_variables(request.component):\n response.variables.append(variable)\n return response", "def Run(self, args):\n variable_client = util.VariableClient()\n m...
[ "0.6380369", "0.5820642", "0.57636815", "0.56829864", "0.5545043", "0.552599", "0.5512235", "0.54310113", "0.5424095", "0.5416049", "0.5415185", "0.5367262", "0.53486437", "0.53446084", "0.5319058", "0.52849674", "0.52658916", "0.5254456", "0.5228465", "0.520828", "0.5206558"...
0.5790898
2
The logout view. Redirects to home page after.
def logout(request): if request.user.is_authenticated(): auth_logout(request) return HttpResponseRedirect(reverse("voter_validation:index"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logout_view(request):\n logout(request)\n return redirect('home')", "def logout_view(request):\n auth_logout(request)\n return redirect('home')", "def logout_view(request):\n \n logout(request)\n return HttpResponseRedirect(reverse(\"index\"))", "def logout_view(request):\n logout...
[ "0.8744168", "0.8659496", "0.8525579", "0.8507581", "0.8489514", "0.8458301", "0.8458301", "0.84309167", "0.84134465", "0.83970946", "0.8394286", "0.8385555", "0.83608264", "0.83608264", "0.83596367", "0.8345407", "0.8336058", "0.83315647", "0.83303416", "0.8329741", "0.83283...
0.7844669
100
See recipe_api.py for docs.
def defer_results(self): return recipe_api.defer_results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_recipe_information(self):\n pass", "def recipe(self):\n return self.__recipe", "def test_get_recipe_information_bulk(self):\n pass", "def get_recipe(self, _id):\n raise NotImplementedError()", "def test_get_random_recipes(self):\n pass", "def test_search_re...
[ "0.7399995", "0.7240145", "0.7060982", "0.69131684", "0.68955857", "0.6634333", "0.6622917", "0.6594366", "0.6353314", "0.63221014", "0.63158387", "0.6281272", "0.6268768", "0.62628794", "0.6251283", "0.6206122", "0.6205642", "0.61758476", "0.61579376", "0.6142557", "0.613580...
0.59413797
38
Compares two response objects based on equality.
def compare(obj_a, obj_b): return tuple_to_string(obj_a) == tuple_to_string(obj_b)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n if not isinstance(other, Response):\n return False\n\n return self.__dict__ == other.__dict__", "def __eq__(self, other):\n if not isinstance(other, InlineResponse200):\n return False\n\n return self.to_dict() == other.to_dict()", "de...
[ "0.7743906", "0.7587754", "0.7484174", "0.7346719", "0.73336023", "0.73172593", "0.7316397", "0.7289357", "0.72549665", "0.724851", "0.72303915", "0.722987", "0.7205563", "0.7172449", "0.71693856", "0.7155242", "0.7135397", "0.7128382", "0.71163017", "0.71147203", "0.71114576...
0.0
-1
Return today's date (UTC) formatted as YYYYMMDD.
def _today() -> str: return strftime(DATE_FORMAT, gmtime())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_date_today() -> str:\n return datetime.now().strftime(\"%Y-%m-%d\")", "def today():\n today_object = datetime.utcnow()\n today_string = today_object.strftime('%m/%d/%Y')\n return today_string", "def utc_today_str():\n return datetime.datetime.strftime(datetime.datetime.utcnow(), \"%Y...
[ "0.8165175", "0.77760684", "0.77601326", "0.77202994", "0.76923996", "0.7595528", "0.7585238", "0.7497268", "0.7361167", "0.7340656", "0.73232466", "0.7306702", "0.72497416", "0.7205314", "0.71836877", "0.71293193", "0.7124812", "0.70916235", "0.7083198", "0.7062737", "0.7011...
0.7295072
12