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 |
|---|---|---|---|---|---|---|
Sets the first_name of this TpoDataDTOsSharedPatientDTO. | def first_name(self, first_name):
if first_name is None:
raise ValueError("Invalid value for `first_name`, must not be `None`") # noqa: E501
self._first_name = first_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def first_name(self, first_name):\n\n self._first_name = first_name",
"def first_name(self, first_name):\n\n self._first_name = first_name",
"def first_name(self, first_name):\n\n self._first_name = first_name",
"def first_name(self, first_name):\n\n self._first_name = first_name"... | [
"0.8058884",
"0.8058884",
"0.8058884",
"0.8058884",
"0.8058884",
"0.8058884",
"0.8058884",
"0.8058884",
"0.8058884",
"0.8029564",
"0.7997372",
"0.7762523",
"0.7762523",
"0.754256",
"0.72024226",
"0.70958656",
"0.6852315",
"0.6836379",
"0.67244524",
"0.67244524",
"0.663269",
... | 0.7558067 | 13 |
Sets the second_name of this TpoDataDTOsSharedPatientDTO. | def second_name(self, second_name):
self._second_name = second_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def second_name(self, instance):\r\n return instance.user.profile.second_name",
"def set_second_incident_node(self, second_incident_node):\n # overwrite the existing second incident node with the input second incident Node object\n self.second_incident_node = second_incident_node",
"def th... | [
"0.6415674",
"0.5711527",
"0.5602875",
"0.55171484",
"0.5472258",
"0.5472258",
"0.5472258",
"0.5462259",
"0.5380895",
"0.5380895",
"0.5286535",
"0.5255808",
"0.5255808",
"0.5255808",
"0.5255808",
"0.5255808",
"0.5255808",
"0.5255808",
"0.5255808",
"0.5255808",
"0.5255808",
... | 0.8145993 | 0 |
Sets the last_name of this TpoDataDTOsSharedPatientDTO. | def last_name(self, last_name):
self._last_name = last_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_last_name(self, last_name):\n self.last_name = last_name",
"def lastname(self, lastname):\n\n self._lastname = lastname",
"def last_name(self, name):\n self._last_name = name",
"def setLastname(self, lastname):\n self.lastname = lastname\n return self",
"def last_... | [
"0.7465448",
"0.7214873",
"0.71458066",
"0.7052572",
"0.68031865",
"0.66664743",
"0.6621527",
"0.6621527",
"0.6602129",
"0.6550469",
"0.62603474",
"0.6198123",
"0.6164634",
"0.6124336",
"0.61231273",
"0.61231273",
"0.61231273",
"0.61231273",
"0.6065119",
"0.60451233",
"0.5975... | 0.7445647 | 10 |
Sets the gender of this TpoDataDTOsSharedPatientDTO. | def gender(self, gender):
if gender is None:
raise ValueError("Invalid value for `gender`, must not be `None`") # noqa: E501
self._gender = gender | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gender(self, gender):\n\n self._gender = gender",
"def gender(self, gender):\n\n self._gender = gender",
"def gender(self, gender):\n\n self._gender = gender",
"def gender(self, gender):\n\n self._gender = gender",
"def gender(self, gender: str):\n allowed_values = [\... | [
"0.7096655",
"0.7096655",
"0.7096655",
"0.7096655",
"0.6590023",
"0.6335712",
"0.62288207",
"0.5941493",
"0.56297135",
"0.5477953",
"0.5477953",
"0.547222",
"0.5449893",
"0.5439797",
"0.53277653",
"0.53277653",
"0.5316213",
"0.53078634",
"0.52587366",
"0.52491844",
"0.5245593... | 0.70449406 | 4 |
Sets the date_of_birth of this TpoDataDTOsSharedPatientDTO. | def date_of_birth(self, date_of_birth):
if date_of_birth is None:
raise ValueError("Invalid value for `date_of_birth`, must not be `None`") # noqa: E501
self._date_of_birth = date_of_birth | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setBirthday(self, birthdate):\r\n self.birthday = birthdate",
"def setBirthday(self, birthdate):\n self.birthday = birthdate",
"def date_of_birth(self, value: str) -> None:\n self._date_of_birth = datetime.strptime(value, '%Y-%m-%d')",
"def set_birthdate(self, date):\n\n if va... | [
"0.68425965",
"0.68114984",
"0.6752815",
"0.6653897",
"0.6512428",
"0.63583356",
"0.63583356",
"0.63536924",
"0.620549",
"0.6026011",
"0.59759104",
"0.5956653",
"0.5956385",
"0.58654356",
"0.5770229",
"0.5740218",
"0.5709339",
"0.5572713",
"0.55613035",
"0.5523119",
"0.550038... | 0.73148006 | 0 |
Sets the dob_hijri of this TpoDataDTOsSharedPatientDTO. | def dob_hijri(self, dob_hijri):
self._dob_hijri = dob_hijri | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_haiku(self, haiku):\n self.haiku = haiku",
"def set_hbond(self) -> None:\n ...",
"def hobby(self, hobby):\n\n self._hobby = hobby",
"def hios_ids(self, hios_ids):\n\n self._hios_ids = hios_ids",
"def set_husb_id(self, h, line_number=0):\n self.husb_id = h\n ... | [
"0.5301778",
"0.5260287",
"0.5232619",
"0.52164793",
"0.5015914",
"0.49680457",
"0.49146372",
"0.47819838",
"0.4672573",
"0.46162045",
"0.45889214",
"0.45642465",
"0.4526036",
"0.44803566",
"0.44527295",
"0.44422492",
"0.44149506",
"0.4402572",
"0.44014636",
"0.43601543",
"0.... | 0.78106105 | 0 |
Sets the contact_number of this TpoDataDTOsSharedPatientDTO. | def contact_number(self, contact_number):
if contact_number is None:
raise ValueError("Invalid value for `contact_number`, must not be `None`") # noqa: E501
self._contact_number = contact_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contact_info(self, contact_info):\n\n self._contact_info = contact_info",
"def person_phone_number(self, person_phone_number):\n\n self._person_phone_number = person_phone_number",
"def contact(self, contact):\n\n self.logger.debug(\"In 'contact' setter.\")\n\n self._contact = c... | [
"0.62844795",
"0.62836736",
"0.6237638",
"0.6188607",
"0.61771697",
"0.61771697",
"0.60278136",
"0.60278136",
"0.60131556",
"0.60131556",
"0.60131556",
"0.60131556",
"0.59559953",
"0.5928816",
"0.5923227",
"0.5751054",
"0.57440615",
"0.57018304",
"0.5692645",
"0.56119037",
"0... | 0.72371227 | 0 |
Sets the email of this TpoDataDTOsSharedPatientDTO. | 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.6753805",
"0.6688689",
"0.6501089",
"0.64727134",
"0.64295816",
"0.618951",
"0.618951",
"0.617309",
"0.606463",
"0.5939123",
"0.5939123",
"0.5939123",
"0.5895375",
"0.5885451",
"0.58692724",
"0.58633494",
"0.57363904",
"0.57203156",
"0.5641336",
"0.56407493",
"0.56321573",... | 0.66569835 | 9 |
Sets the blood_group of this TpoDataDTOsSharedPatientDTO. | def blood_group(self, blood_group):
self._blood_group = blood_group | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_group(self, group):\n # Implemented from template for osid.resource.ResourceForm.set_group_template\n if self.get_group_metadata().is_read_only():\n raise errors.NoAccess()\n if not self._is_valid_boolean(group):\n raise errors.InvalidArgument()\n self._my_... | [
"0.58865935",
"0.55830896",
"0.5503867",
"0.5410558",
"0.5410029",
"0.5410029",
"0.5410029",
"0.5396463",
"0.52603614",
"0.52577436",
"0.52577436",
"0.5247818",
"0.5203359",
"0.5203359",
"0.5203359",
"0.5203359",
"0.5203359",
"0.5203359",
"0.5194191",
"0.5011616",
"0.49316517... | 0.8528948 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, TpoDataDTOsSharedPatientDTO):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Perform a circular left shift on the first and second five bits | def leftShift(keyBitList):
shiftedKey = [None] * KeyLength
shiftedKey[0:9] = keyBitList[1:10]
shiftedKey[4] = keyBitList[0]
shiftedKey[9] = keyBitList[5]
return shiftedKey | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def circular_left_shift(bits, numberofbits):\n shiftedbits = bits[numberofbits:] + bits[:numberofbits]\n return shiftedbits",
"def leftshift(x, c):\n return x << c",
"def lrshift(val, n) -> np.int64:\n return (val % (1 << 64)) >> n",
"def shiftleft(num,shiftplaces):\n for i in range(shiftplace... | [
"0.7554009",
"0.6862937",
"0.6643694",
"0.65804476",
"0.6566264",
"0.6566264",
"0.6563826",
"0.6535258",
"0.64031124",
"0.6352255",
"0.62783855",
"0.62418693",
"0.6216665",
"0.61622155",
"0.6131483",
"0.6113987",
"0.61020756",
"0.6099654",
"0.6066652",
"0.603961",
"0.6019166"... | 0.5443362 | 71 |
Creates a new guild profile instance from the given parameters. | def __new__(
cls,
*,
avatar = ...,
boosts_since = ...,
flags = ...,
joined_at = ...,
nick = ...,
pending = ...,
role_ids = ...,
timed_out_until = ...,
):
# avatar
if avatar is ...:
avatar = None
else:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_player_profile(sender, **kwargs):\n if kwargs.get('created') is True:\n PlayerProfile.objects.create(user=kwargs.get('instance'))",
"def create_profile(sender, **kwargs):\n\n # I import profile here cause i can't import it right in the top.\n from .profiles import Profile\n\n ... | [
"0.64133596",
"0.6304537",
"0.62891245",
"0.6209736",
"0.6130808",
"0.60852903",
"0.60743177",
"0.6074052",
"0.6030012",
"0.60286367",
"0.6024556",
"0.59830743",
"0.59784526",
"0.5966472",
"0.5941459",
"0.5935422",
"0.5897243",
"0.58577096",
"0.58499914",
"0.5840311",
"0.5826... | 0.56069314 | 46 |
Returns whether the two guild profiles are equal. | def __eq__(self, other):
if type(self) is not type(other):
return NotImplemented
# avatar
if self.avatar != other.avatar:
return False
# boosts_since
if self.boosts_since != other.boosts_since:
return False
# ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checkProfileEquality(self, profile1, profile2):\r\n if len(profile1) != len(profile2) or len(profile1[0]) != len(profile2[0]):\r\n return False\r\n for gram1 in profile1:\r\n contains = False\r\n for gram2 in profile2:\r\n if gram1 == gram2:\r\n ... | [
"0.73616284",
"0.734884",
"0.6504068",
"0.63457304",
"0.6259065",
"0.6141803",
"0.6082148",
"0.5868695",
"0.58018774",
"0.577464",
"0.5742489",
"0.5734423",
"0.570045",
"0.56957626",
"0.56929046",
"0.56915677",
"0.56776965",
"0.5651791",
"0.5632203",
"0.560775",
"0.55983317",... | 0.52022177 | 71 |
Converts the guild profile to a json serializable object. | def to_data(self, *, defaults = False, include_internals = False):
data = {}
type(self).avatar.put_into(self.avatar, data, defaults, as_data = not include_internals)
put_nick_into(self.nick, data, defaults)
put_role_ids_into(self.role_ids, data, defaults)
put_timed_out_u... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toJSON(self):\n return {\n 'orcid_id': self.orcid_id,\n 'access_token': self.access_token,\n 'created': self.created and self.created.isoformat() or None,\n 'updated': self.updated and self.updated.isoformat() or None,\n 'profile': self.profile and ... | [
"0.6226298",
"0.5832722",
"0.5813382",
"0.5799837",
"0.5766646",
"0.5755184",
"0.5747039",
"0.57265794",
"0.5713734",
"0.57040703",
"0.57040703",
"0.5693157",
"0.56773746",
"0.5661918",
"0.5625929",
"0.56217843",
"0.5621252",
"0.5597682",
"0.5592738",
"0.5582136",
"0.55788803... | 0.0 | -1 |
Copies the guild profile. Returns | def copy(self):
new = object.__new__(type(self))
new.avatar_hash = self.avatar_hash
new.avatar_type = self.avatar_type
new.boosts_since = self.boosts_since
new.flags = self.flags
new.joined_at = self.joined_at
new.nick = self.nick
new.pending = self.pendin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copy_server_profile(profile_obj):\n FusionUIBase.navigate_to_section(SectionType.SERVER_PROFILES, time_for_loading=8)\n\n total = len(profile_obj)\n not_exists = 0\n copied = 0\n\n for n, profile in enumerate(profile_obj):\n logger.info(\"{2} No: {0} --- Total: {1} {2}\".format((n + 1), t... | [
"0.5992419",
"0.56771487",
"0.55431265",
"0.5524235",
"0.54762983",
"0.5443781",
"0.5378398",
"0.5329429",
"0.5221172",
"0.51993454",
"0.5192154",
"0.5161359",
"0.5150946",
"0.5148247",
"0.5116117",
"0.5115019",
"0.5115019",
"0.51134646",
"0.5112481",
"0.51079947",
"0.5103642... | 0.5886465 | 1 |
Creates a new guild profile with it's default attributes set. Returns self `instance` | def _create_empty(cls):
self = object.__new__(cls)
self.avatar_hash = 0
self.avatar_type = IconType.none
self.boosts_since = None
self.flags = GuildProfileFlag()
self.joined_at = None
self.nick = None
self.pending = False
self.role_ids = None
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(cls, **kwargs):\n if \"user\" not in kwargs:\n with mute_signals(post_save):\n profile = ProfileFactory.create()\n kwargs[\"user\"] = profile.user\n return super().create(**kwargs)",
"def from_guild_create(self, **data: dict) -> 'Guild':\n self... | [
"0.63263637",
"0.6203195",
"0.6060182",
"0.5969648",
"0.59654814",
"0.5920758",
"0.5886763",
"0.5881776",
"0.5863076",
"0.5758609",
"0.5754809",
"0.57499707",
"0.5749282",
"0.5739487",
"0.5724686",
"0.5722561",
"0.5689606",
"0.5686849",
"0.56785446",
"0.5653668",
"0.5639949",... | 0.66373456 | 0 |
Returns the color of the respective user at the respective guild. Returns | def color(self):
role_ids = self.role_ids
if (role_ids is not None):
for role in sorted((create_partial_role_from_id(role_id) for role_id in self.role_ids), reverse=True):
color = role.color
if color:
return color
return Co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user_color(user: discord.Member, guild: discord.Guild) -> discord.Colour:\n # If it's a PM, server will be none\n if guild is None:\n return discord.Colour.default()\n member = guild.get_member(user.id) # type: discord.Member\n if member is not None:\n return member.colour\n r... | [
"0.83624274",
"0.6191421",
"0.60157096",
"0.6010785",
"0.5984158",
"0.5964939",
"0.58933336",
"0.589237",
"0.58806205",
"0.5880127",
"0.58783716",
"0.5857977",
"0.5828458",
"0.5818611",
"0.57614595",
"0.5760636",
"0.57502055",
"0.5720402",
"0.571388",
"0.5712219",
"0.5679545"... | 0.58145005 | 14 |
Returns ``.joined_at`` if set, else the Discord epoch. Returns | def created_at(self):
created_at = self.joined_at
if created_at is None:
created_at = DISCORD_EPOCH_START
return created_at | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def joined(member : discord.Member):\n await bot.say('{0.name} joined in {0.joined_at}'.format(member))",
"async def joined(member : discord.Member):\n await bot.say('{0.name} joined in {0.joined_at}'.format(member))",
"async def joined(member : discord.Member):\n await bot.say('{0.name} joined ... | [
"0.5512486",
"0.5512486",
"0.5512486",
"0.5500375",
"0.5478844",
"0.546965",
"0.5456217",
"0.5423227",
"0.53808814",
"0.53574973",
"0.5351431",
"0.52074903",
"0.5207478",
"0.5181871",
"0.51751375",
"0.51717824",
"0.5141047",
"0.5140008",
"0.50858665",
"0.5038743",
"0.4991394"... | 0.6792107 | 0 |
r"""Computes the mean point (x,y) for a bivariate probability distribution Uses the trapezoid rule and assumes input of pdf values directly computed on some mesh | def bivariate_mean(x, y, pdf):
if pdf.shape[0] != x.shape[0] or pdf.shape[1] != y.shape[0]:
print("Error, mesh size does not match x and y")
n_x = x.shape[0]
n_y = y.shape[0]
mean_int_x, mean_int_y = 0.0, 0.0
p_of_x, p_of_y = np.zeros(n_x), np.zeros(n_y)
for i in range(0, n_x):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bivariate_norm(x, y, pdf):\n\n if pdf.shape[0] != x.shape[0] or pdf.shape[1] != y.shape[0]:\n print(\"Error, mesh size does not match x and y\")\n n_x = x.shape[0]\n n_y = y.shape[0]\n norm_integral = 0.0\n p_of_x = np.zeros(n_x)\n for i in range(0, n_x):\n for j in range(1, n_y... | [
"0.6538318",
"0.61299115",
"0.6067951",
"0.598912",
"0.58869267",
"0.58247197",
"0.58068615",
"0.580411",
"0.57488257",
"0.5743805",
"0.5737953",
"0.5736858",
"0.56976354",
"0.5687007",
"0.56576484",
"0.56464916",
"0.5638585",
"0.5634519",
"0.5627421",
"0.5624721",
"0.5618778... | 0.80673075 | 0 |
Make sure an entered IP is valid. | def IsValidIP(ip):
if ip != None:
if ip.count('.') == 3:
ipNumbers = ip.split('.')
for number in ipNumbers:
if not number.isdigit() or int(number) > 255:
return False
return ipNumbers
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_valid_ip(ip):\n ...",
"def validateIP():\n try:\n s = socket.inet_aton(args.target)\n except socket.error:\n print(\"\")\n print(f\"{bad_cmd} Bad IP address\")\n print(\"\")\n sys.exit()",
"def __checkIPAddr(self,ip):\n if no... | [
"0.8290124",
"0.8198014",
"0.7999776",
"0.7974664",
"0.79032713",
"0.78196543",
"0.7716797",
"0.7699786",
"0.7694739",
"0.7681369",
"0.76281816",
"0.7623063",
"0.75491947",
"0.75464034",
"0.7528311",
"0.7517867",
"0.7458337",
"0.740884",
"0.73996466",
"0.73743147",
"0.7335472... | 0.718398 | 23 |
Convert None, "None", or "" to string type "None" Used for putting text in a text box. If the value to put in is 'None', the box will be blank. | def noneToString(text):
if text in (None, ""):
return "None"
else:
return str(text) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def str_or_none(val):\n return str(val) if val is not None else None",
"def noneToBlankString(text):\n if text in (None, \"None\"):\n return \"\"\n else:\n return str(text)",
"def silent_none(value):\n if value is None:\n return ''\n return value",
"def noneType(value):\r\... | [
"0.8044133",
"0.79362696",
"0.7774173",
"0.7674547",
"0.7417621",
"0.74157476",
"0.72853",
"0.720645",
"0.71675533",
"0.70269996",
"0.69711494",
"0.6934389",
"0.69249177",
"0.6802112",
"0.675872",
"0.6735091",
"0.6677421",
"0.6648968",
"0.6577978",
"0.64749974",
"0.6409316",
... | 0.8234191 | 0 |
entropy of normalised distribution in bits | def entropy(x):
nz = np.nonzero(x)[0]
return -np.sum(x[nz]*np.log2(x[nz])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _entropy(data):\n hist = np.array(PIL.Image.fromarray(data).histogram())\n hist = hist / hist.sum()\n hist = hist[hist != 0]\n return -np.sum(hist * np.log2(hist))",
"def image_entropy(img):\r\n hist = img.histogram()\r\n hist_size = sum(hist)\r\n hist = [... | [
"0.808939",
"0.7854212",
"0.76573455",
"0.7632713",
"0.76213855",
"0.7598081",
"0.75897694",
"0.756483",
"0.75551265",
"0.75504774",
"0.7544841",
"0.750373",
"0.7480598",
"0.7447731",
"0.74368805",
"0.74238867",
"0.7403027",
"0.7398044",
"0.73866606",
"0.737823",
"0.73523074"... | 0.76091546 | 5 |
Create the api and authenticator objects. | def async_setup(self, conf):
if conf.get(VERIFICATION_CODE_KEY):
return
if conf.get(CONF_ACCESS_TOKEN_CACHE_FILE) is None:
conf[
CONF_ACCESS_TOKEN_CACHE_FILE
] = f".{conf[CONF_USERNAME]}{DEFAULT_AUGUST_CONFIG_FILE}"
self._config = conf
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self.api = Api(consumer_key=credentials[\"consumer_key\"],\n consumer_secret=credentials[\"consumer_secret\"],\n access_token_key=credentials[\"access_token_key\"],\n access_token_secret=credentials[\"access_token_secret... | [
"0.66780365",
"0.6645443",
"0.6397644",
"0.6388884",
"0.633235",
"0.6326718",
"0.624818",
"0.6222473",
"0.61881906",
"0.6158173",
"0.6120532",
"0.60853136",
"0.60724443",
"0.6064991",
"0.6060397",
"0.6057882",
"0.60202724",
"0.6010488",
"0.600326",
"0.59973305",
"0.59905744",... | 0.6110127 | 11 |
.compare(v1, v2) The method to check two versions whether one is greater than, equal to, or less than the other | def compare(v1="", v2=""):
if any([v1 == "", v2 == ""]):
return 'One or both versions are not provided.'
characters1 = list(v1)
characters2 = list(v2)
if not characters1.index('.'):
return 'v1 is in wrong format'
if not characters2.index('.'):
return 'v2 is in wrong format'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compare_version(v1, v2):\n s1 = StrictVersion(v1)\n s2 = StrictVersion(v2)\n if s1 == s2:\n return 0\n elif s1 > s2:\n return -1\n else:\n return 1",
"def compare_version(v1, v2):\n s1 = StrictVersion(v1)\n s2 = StrictVersion(v2)\n if s1 == s2:\n return 0\n... | [
"0.7693779",
"0.7693779",
"0.7592231",
"0.7583037",
"0.75152576",
"0.7507064",
"0.742832",
"0.72952414",
"0.7264322",
"0.7249429",
"0.7233002",
"0.7157759",
"0.71400934",
"0.7119563",
"0.71047044",
"0.70675635",
"0.70363635",
"0.69951063",
"0.699023",
"0.6984975",
"0.6971152"... | 0.65018696 | 80 |
Draw 3pixel width bounding boxes on the given image array. | def draw_box(image, curr_box, label, draw_line=False):
# y1, x1, y2, x2 = box
# print(curr_box)
# assert False
x1, y1, x2, y2 = curr_box[0], curr_box[1], curr_box[2], curr_box[3]
_, h, w = image.size()
x1 = int(x1.item() * w)
y1 = int(y1.item() * h)
x2 = int(x2.item() * w)
y2 = int(y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_bounding_boxes_on_image_array(image, boxes, color=[], thickness=5):\n\n draw_bounding_boxes_on_image(image, boxes, color, thickness)\n\n return image",
"def draw_bounding_boxes_on_image(image, boxes, color=[], thickness=5):\n\n boxes_shape = boxes.shape\n if not boxes_shape:\n return\... | [
"0.72010815",
"0.6934973",
"0.678356",
"0.6505996",
"0.64761895",
"0.64393055",
"0.6320378",
"0.62343025",
"0.61802584",
"0.61543655",
"0.6117841",
"0.6064829",
"0.6053924",
"0.6024019",
"0.59821874",
"0.5975932",
"0.59749836",
"0.59738517",
"0.5960479",
"0.5959631",
"0.59017... | 0.0 | -1 |
Draw 3pixel width bounding boxes on the given image array. | def draw_floor_plan(image, curr_box, label):
wall_thickness = 2
wall_symbol = 2.0
x1, y1, x2, y2 = curr_box[0], curr_box[1], curr_box[2], curr_box[3]
_, h, w = image.size()
x1 = int(x1.item() * w)
y1 = int(y1.item() * h)
x2 = int(x2.item() * w)
y2 = int(y2.item() * h)
image[:, y1:y2,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_bounding_boxes_on_image_array(image, boxes, color=[], thickness=5):\n\n draw_bounding_boxes_on_image(image, boxes, color, thickness)\n\n return image",
"def draw_bounding_boxes_on_image(image, boxes, color=[], thickness=5):\n\n boxes_shape = boxes.shape\n if not boxes_shape:\n return\... | [
"0.72001135",
"0.6934072",
"0.6783045",
"0.650449",
"0.6476033",
"0.6439586",
"0.6319619",
"0.6233559",
"0.6180277",
"0.61531425",
"0.6116829",
"0.6064441",
"0.6053513",
"0.60231596",
"0.59820205",
"0.59759617",
"0.5973104",
"0.5972736",
"0.59599525",
"0.59589607",
"0.5901387... | 0.0 | -1 |
Save a given Tensor into an image file. | def save_image(tensor, filename, nrow=8, padding=2,
normalize=False, range=None, scale_each=False, pad_value=0):
from PIL import Image
grid = make_grid(tensor, nrow=nrow, padding=padding, pad_value=pad_value,
normalize=normalize, range=range, scale_each=scale_each)
# Add... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_tensor(tensor, path, title=\"NONAME\"):\n image = to_image(tensor)\n\n image.save(os.path.join(path, \"{}.jpg\".format(title)))",
"def save_image(img, view, ts, output_dir):\n\n img = tf.image.decode_jpeg(img, channels=3)\n img = Image.fromarray(img.numpy(), 'RGB')\n img.save(os.path.join... | [
"0.7915944",
"0.7439306",
"0.7385877",
"0.72915584",
"0.7258483",
"0.6993751",
"0.6975457",
"0.6916539",
"0.68686783",
"0.6781512",
"0.67706203",
"0.67251974",
"0.6720317",
"0.6670126",
"0.6655157",
"0.6620581",
"0.660503",
"0.65987986",
"0.654922",
"0.65490943",
"0.65183806"... | 0.0 | -1 |
Save a given Tensor into an image file. | def save_bbox(tensor, box, filename, nrow=8, padding=0,
normalize=False, scale_each=False, pad_value=0, draw_line=False, save=True):
from PIL import Image
# print(box)
# assert False
grid = make_grid_bbox(tensor, box, nrow=nrow, padding=padding, pad_value=pad_value,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_tensor(tensor, path, title=\"NONAME\"):\n image = to_image(tensor)\n\n image.save(os.path.join(path, \"{}.jpg\".format(title)))",
"def save_image(img, view, ts, output_dir):\n\n img = tf.image.decode_jpeg(img, channels=3)\n img = Image.fromarray(img.numpy(), 'RGB')\n img.save(os.path.join... | [
"0.7915944",
"0.7439306",
"0.7385877",
"0.72915584",
"0.7258483",
"0.6993751",
"0.6975457",
"0.6916539",
"0.68686783",
"0.6781512",
"0.67706203",
"0.67251974",
"0.6720317",
"0.6670126",
"0.6655157",
"0.6620581",
"0.660503",
"0.65987986",
"0.654922",
"0.65490943",
"0.65183806"... | 0.0 | -1 |
Save a given Tensor into an image file. | def save_floor_plan(tensor, box, filename, nrow=8, padding=2,
normalize=False, range=None, scale_each=False, pad_value=0):
from PIL import Image
grid = make_grid_floor_plan(tensor, box, nrow=nrow, padding=padding, pad_value=pad_value,
normalize=normalize, range=range... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_tensor(tensor, path, title=\"NONAME\"):\n image = to_image(tensor)\n\n image.save(os.path.join(path, \"{}.jpg\".format(title)))",
"def save_image(img, view, ts, output_dir):\n\n img = tf.image.decode_jpeg(img, channels=3)\n img = Image.fromarray(img.numpy(), 'RGB')\n img.save(os.path.join... | [
"0.7915944",
"0.7439306",
"0.7385877",
"0.72915584",
"0.7258483",
"0.6993751",
"0.6975457",
"0.6916539",
"0.68686783",
"0.6781512",
"0.67706203",
"0.67251974",
"0.6720317",
"0.6670126",
"0.6655157",
"0.6620581",
"0.660503",
"0.65987986",
"0.654922",
"0.65490943",
"0.65183806"... | 0.0 | -1 |
Save a given Tensor into an image file. | def save_image_for_fid(tensor_real, tensor_fake, save_path_real,
save_path_fake, step_test, batch_size,
nrow=1, padding=0, normalize=False,
range=None, scale_each=False, pad_value=0):
from PIL import Image
num_imgs = tensor_real.size(0)
for i in xrange(num_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_tensor(tensor, path, title=\"NONAME\"):\n image = to_image(tensor)\n\n image.save(os.path.join(path, \"{}.jpg\".format(title)))",
"def save_image(img, view, ts, output_dir):\n\n img = tf.image.decode_jpeg(img, channels=3)\n img = Image.fromarray(img.numpy(), 'RGB')\n img.save(os.path.join... | [
"0.791521",
"0.7440565",
"0.738678",
"0.7291382",
"0.72587353",
"0.6995279",
"0.6976932",
"0.6917578",
"0.6870656",
"0.67835736",
"0.677193",
"0.6727998",
"0.6720696",
"0.6670933",
"0.6658899",
"0.6624146",
"0.6608319",
"0.66019315",
"0.65529466",
"0.6550902",
"0.6518862",
... | 0.0 | -1 |
Add client getter for provider. | def client_handle(session, model, provider):
def load_client(client_id):
return session.query(model).filter_by(client_id=client_id).first()
provider._clientgetter = load_client
return provider | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clientgetter(self, f):\n self._clientgetter = f\n return f",
"def add_getter(self, getter):\n self.__weather_data_getter.append(getter)",
"def get_client(self):\n return self.client",
"def _get_client(self):\n _client = KOPS(provider=self.provider, config=self.config)\n... | [
"0.7142654",
"0.59422356",
"0.58776706",
"0.5812485",
"0.58001226",
"0.5703276",
"0.5699164",
"0.5699164",
"0.56945634",
"0.5549883",
"0.5543943",
"0.5487972",
"0.54846674",
"0.546121",
"0.5450172",
"0.54470533",
"0.5432141",
"0.542657",
"0.5413664",
"0.5411189",
"0.540783",
... | 0.5902128 | 2 |
The object's self string | def __str__(self):
msg = '- Window size: ' + str(self.window_size) + " by " + str(self.window_size)
msg += '\n'
msg += ' - Expression for r.mapcalc to determine column water vapor: '
return msg + str(self.column_water_vapor_expression) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self) -> str:\n\n return str(self.current_obj)",
"def __repr__(self):\n return '%s(%r)' % (self.__class__.__name__, str(self))",
"def __repr__(self):\n return \"{}\".format(self.__class__.__name__)",
"def __repr__(self) -> str:\n return self.__str__()",
"def __repr__... | [
"0.7672171",
"0.76083493",
"0.7584324",
"0.75630134",
"0.75630134",
"0.75630134",
"0.75630134",
"0.75578713",
"0.75427234",
"0.75259906",
"0.7507144",
"0.7507144",
"0.7507144",
"0.7504045",
"0.7501505",
"0.74970734",
"0.74712205",
"0.7466751",
"0.746588",
"0.746588",
"0.74555... | 0.0 | -1 |
Return mapcalc expression for window medians based on the given mapcalc pixel modifiers. r.mapcalc has a "median" function. Thus, just return the pixel modifiers. | def _median_tirs_expression(self, modifiers):
tx_median_expression = 'median({pixel_modifiers})'
# print tx_median_expression.format(pixel_modifiers=modifiers)
return tx_median_expression | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_medians(window_means):\n return np.median(window_means, axis=0)",
"def _big_cwv_expression_median():\n modifiers_ti = self._derive_modifiers(self.ti)\n ti_median = 'median({modifiers}'.format(modifiers=modifiers_ti)\n\n modifiers_tj = self._derive_modifiers(self.tj)\n tj_... | [
"0.53726614",
"0.4961448",
"0.4827054",
"0.4782952",
"0.472603",
"0.46957016",
"0.46878675",
"0.45760006",
"0.45705128",
"0.4545601",
"0.4536835",
"0.4530441",
"0.45060524",
"0.44873902",
"0.44861606",
"0.4477577",
"0.4442116",
"0.44409403",
"0.44349384",
"0.44155705",
"0.440... | 0.6211256 | 0 |
Forward propagation of inputs through the network. | def forward(self, x, y):
if self.dataset_type == 'tabular':
input = torch.cat([x, y.unsqueeze(1)], dim=1).float()
out = self.net(input).squeeze(dim=-1)
else:
intermediate = self.cnn(x)
intermediate = torch.cat([intermediate.float(), y.float().unsqueeze(1... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forward(self, inputs):\n raise NotImplementedError",
"def feedForward(self, inputs):\n\n\t\tinputs = np.atleast_1d(inputs)\n\n\t\tif not len(inputs) == self.nInputs:\n\n\t\t\traise ValueError(\"The input vector is the wrong length for this network\")\n\n\t\t#don't forget we have a bias unit in here to... | [
"0.80642503",
"0.7918714",
"0.78559965",
"0.78450876",
"0.77674174",
"0.7750006",
"0.762506",
"0.762506",
"0.762506",
"0.7595454",
"0.7595454",
"0.75730264",
"0.74256265",
"0.74238014",
"0.7412861",
"0.74069273",
"0.739987",
"0.73511165",
"0.7323129",
"0.72767234",
"0.7274881... | 0.0 | -1 |
Helper function to encrypt and encode request data. Returns hex encoded encrypted data. | def encodeRequest(self, request_data):
return encodeHex(self._requestCipher.encrypt(nullPad(request_data))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encrypt_and_encode(data, key):\r\n return base64.urlsafe_b64encode(aes_encrypt(data, key))",
"def encode_data( key, data ):\n text = json.to_json_string(data)\n text = base64.urlsafe_b64encode(text)\n digest = hmac.new(key, text).hexdigest()\n return text, digest",
"def encrypt(self, request... | [
"0.70507723",
"0.6844719",
"0.68149763",
"0.6787832",
"0.6683991",
"0.6629208",
"0.6574461",
"0.6562552",
"0.65560216",
"0.654297",
"0.6495045",
"0.64251596",
"0.63448274",
"0.634072",
"0.6326657",
"0.63217825",
"0.6264611",
"0.62330246",
"0.6201289",
"0.6185112",
"0.60618556... | 0.8102992 | 0 |
Return source as valid filename as per filename rules. | def _source_is_valid_filename(self):
filename = self.source
if not filename_is_valid(filename):
raise BadFilenameError(f"{repr(filename)} must be a valid filename.")
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalize_source_filename(self, fn):\n if fn.endswith(\".go\"):\n return self._normalize_go(fn)\n elif fn.endswith(\".java\") or fn.endswith(\".kt\"):\n return self._normalize_jvm(fn)\n return fn",
"def whisper_filename(self):\r\n source_name = self.source_id and self.source.name or... | [
"0.7069771",
"0.70073843",
"0.69937384",
"0.6652245",
"0.6498441",
"0.6485995",
"0.64812887",
"0.6386555",
"0.63478875",
"0.63460475",
"0.6343621",
"0.63184774",
"0.6309065",
"0.6282811",
"0.6279778",
"0.6233037",
"0.62190247",
"0.62134767",
"0.620575",
"0.61995125",
"0.61690... | 0.66952413 | 3 |
Returns True if source is not equal to target. | def _source_filename_field_is_not_equal_target(self):
if self.source == self.target:
# print(f"{self}")
raise SourceEqualsTargetError("source must not equal target.")
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: 'OriginInput') -> bool:\n return not self == other",
"def __ne__ (self, other):\n return not self == other",
"def __ne__(self, other: 'Origin') -> bool:\n return not self == other",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def ... | [
"0.7117385",
"0.71140563",
"0.7099622",
"0.7091816",
"0.70748913",
"0.7014513",
"0.6995561",
"0.698715",
"0.6983941",
"0.6974609",
"0.6974609",
"0.6974609",
"0.6974609",
"0.6974609",
"0.6974609",
"0.6974609",
"0.6974609",
"0.6974609",
"0.6974609",
"0.6974609",
"0.6974609",
... | 0.73537105 | 0 |
split DataFrame into trainin, validation and testing | def train_val_test_split(df):
from sklearn.model_selction import train_test_split
train, test = train_test_split(df, train_size = 0.80, test_size=0.20,
random_state = 42)
train, val = train_test_split(train, train_size = 0.70, val_size=0.30)
print(train.shape, val.shape, test.shape)
return tra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def train_test_split(df, test_size=0.3):\r\n # split df here\r\n train_size = int(df.shape[0] * (1 - test_size))\r\n test_size = df.shape[0] - train_size\r\n train = df[:train_size]\r\n test = df[train_size:]\r\n\r\n return train, test # return the train and test datasets\r",
"def train_test_s... | [
"0.83828",
"0.83289933",
"0.82579815",
"0.80276376",
"0.7978223",
"0.7956342",
"0.7941696",
"0.78901076",
"0.7889492",
"0.7868206",
"0.77938557",
"0.77781934",
"0.77503794",
"0.7702781",
"0.76781243",
"0.7658984",
"0.76138896",
"0.7589798",
"0.75693506",
"0.75",
"0.74949723",... | 0.81118554 | 3 |
Get the list of parsers defined for the MDF | def get_mdf_parsers() -> Set[str]:
return set([name for name, info in get_available_adapters().items()
if info['class'].startswith('mdf_matio')]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_parsers(self):\n return tuple([getattr(self, '_{}'.format(i)) for i in self.parsers_available])",
"def d_parsers(self):\n\n return self._d_parsers",
"def get_all_parsers():\n return [OptimizerFactory.get_parser(optimizer) for optimizer in OptimizerFactory.optimizers]",
"def list_... | [
"0.7620664",
"0.74679875",
"0.74633986",
"0.6965154",
"0.66305953",
"0.643726",
"0.6089348",
"0.578824",
"0.5744802",
"0.5691443",
"0.5666223",
"0.55551755",
"0.5447189",
"0.5393577",
"0.53734523",
"0.53607243",
"0.53554773",
"0.5343076",
"0.5311867",
"0.52994555",
"0.5292552... | 0.77574617 | 0 |
Similar to ``np.broadcast()`` but for shapes. Equivalent to ``np.broadcast(map(np.empty, shapes)).shape``. | def broadcast_shape(*shapes, **kwargs):
strict = kwargs.pop("strict", False)
reversed_shape = []
for shape in shapes:
for i, size in enumerate(reversed(shape)):
if i >= len(reversed_shape):
reversed_shape.append(size)
elif reversed_shape[i] == 1 and not strict... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def broadcast_shapes(*shapes: Tuple[int, ...]) -> Tuple[int, ...]:\n\n arrays = [np.empty(shape) for shape in shapes]\n return np.broadcast(*arrays).shape",
"def shape_to_broadcast(shape):\n return tuple(n==1 for n in shape)",
"def broadcast_shapes(*args):\n x = list(np.atleast_1d(args[0])) if args... | [
"0.8031733",
"0.6709287",
"0.6608235",
"0.6220126",
"0.6172327",
"0.61095786",
"0.57702434",
"0.5728449",
"0.56912404",
"0.5685939",
"0.5650364",
"0.5649787",
"0.56408995",
"0.56206495",
"0.55885595",
"0.5577972",
"0.55559945",
"0.55212015",
"0.5496631",
"0.54427445",
"0.5434... | 0.6822579 | 1 |
Assert that no tasks are scheduled. | def assertNoScheduled(self):
actual_task_count = self.redis.llen('celery')
self.assertEqual(actual_task_count, 0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_missing_dates(self):\n task = Task({\n 'name': 'test',\n 'id': 1,\n 'stage_id' : [1, 'name'],\n 'date_deadline': False,\n 'date_start': False,\n 'date_end': False,\n 'full_project_name': 'test_project',\n 'parti... | [
"0.6898314",
"0.68297046",
"0.6745926",
"0.6703574",
"0.66847396",
"0.6665011",
"0.6502342",
"0.65012395",
"0.6496293",
"0.64909637",
"0.64443207",
"0.63862115",
"0.63862115",
"0.638033",
"0.62574387",
"0.62144643",
"0.62084484",
"0.62054574",
"0.6202889",
"0.6185061",
"0.615... | 0.80603117 | 0 |
The file name measurement for the exemplar disk image | def source_file_name_feature(self):
return "_".join((C_FILE_NAME, self.file_image_name.value)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filename(self):\n # TODO(aron): write tests for this\n\n return os.path.basename(self.file_on_disk.name)",
"def create_file_name(self):\n # create a unique id for the file name\n index = self.helpers.alpha_uuid()\n\n filename = self.form['FieldStorage'][self.image_cid].file... | [
"0.7226778",
"0.71744794",
"0.708932",
"0.70752895",
"0.70599556",
"0.6997",
"0.6990273",
"0.6981896",
"0.69383436",
"0.6921032",
"0.6881703",
"0.68714577",
"0.6859709",
"0.68496007",
"0.68347275",
"0.6793649",
"0.67768526",
"0.6765624",
"0.67621285",
"0.675501",
"0.675018",
... | 0.67733 | 17 |
Computes ngrams from the list of words. | def create_ngrams(word_list, n):
yield zip(*[word_list[i:] for i in range(n)]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ngrams(words, n=1):\n return [tuple(words[j:j + n]) for j in range(len(words) - n + 1)]",
"def word2ngrams(text, n=3):\n return [text[i:i+n] for i in range(len(text)-n+1)]",
"def word_ngrams(sent, n):\n\t\n\t# EXAMPLES \n\t# > word_ngrams(tokenize('hello world'), 1)\n\t# [('hello',), ('world',)]\n\t#... | [
"0.76748836",
"0.74729234",
"0.73396146",
"0.73033047",
"0.72778606",
"0.7266304",
"0.72451067",
"0.7244604",
"0.723173",
"0.72209466",
"0.72209466",
"0.7217995",
"0.7163791",
"0.7145254",
"0.70819396",
"0.70793355",
"0.70561045",
"0.70503694",
"0.70135546",
"0.6943509",
"0.6... | 0.7706776 | 0 |
Return a datetime instance of the user's registration date. | def date_registered(self) -> datetime:
return datetime.utcfromtimestamp(self.registered) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def register_date(self):\n\n return self._register_date",
"def getUserSignupDate(self):\r\n userinfo = self.getUserInfo()\r\n timestamp = int(float(userinfo[\"signupTimeSec\"]))\r\n return time.strftime(\"%m/%d/%Y %H:%M\", time.gmtime(timestamp))",
"def registered_date(self):\n ... | [
"0.7455323",
"0.7260614",
"0.718711",
"0.6525263",
"0.65236914",
"0.64185023",
"0.64185023",
"0.64185023",
"0.63833",
"0.63192785",
"0.6235479",
"0.6231673",
"0.617322",
"0.6119592",
"0.6083479",
"0.60149604",
"0.5979281",
"0.59744436",
"0.59466183",
"0.5933466",
"0.5933409",... | 0.78252804 | 0 |
Get the user's personal tags. | def get_personal_tags(
self, tag: str, type: str, limit: int = 50, page: int = 1
) -> ListModel[Union[Artist, Track, Album]]:
map = dict(artist=Artist, album=Album, track=Track)
bind = map.get(type)
assert bind is not None
return self.retrieve(
bind=bind,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def by_user(user):\n return Tag.objects.all().filter(owner=user)",
"def get_tags(self):\n resp = self.get(_u.build_uri(\"tags\", domain=self.domain))\n return utils.handle_response(resp)",
"def tags(self) -> Optional[Any]:\n return pulumi.get(self, \"tags\")",
"def tags(request):\... | [
"0.66687936",
"0.6583378",
"0.652082",
"0.65046144",
"0.6486444",
"0.64725584",
"0.64719546",
"0.64439434",
"0.6384524",
"0.6377347",
"0.6373856",
"0.63724524",
"0.63149035",
"0.6275968",
"0.62728846",
"0.6265393",
"0.6237297",
"0.6230856",
"0.6181736",
"0.6179542",
"0.613700... | 0.66523093 | 1 |
The conditional probability of x1. | def conditional_pdf(self, x1, x2 = None):
return np.exp(self.conditional_logpdf(x1, x2)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def evaluate_one(self, x):\n # p = 1. / (np.sqrt(2. * np.pi) * self.sigma) * \\\n # np.exp(-0.5 * (self.mean - x) * self.invvar * (self.mean - x))\n p = self.dist.probability(x)\n return p",
"def prob(x):\n\treturn 1. * bivariate_normal(x, (0., 1.2), (1., 1.), .8) + \\\n\t 1.0... | [
"0.76534253",
"0.7536851",
"0.7362225",
"0.7269607",
"0.71314096",
"0.68956095",
"0.6891509",
"0.6864677",
"0.68354434",
"0.6820483",
"0.67983025",
"0.6714162",
"0.67051584",
"0.66814375",
"0.664406",
"0.6632907",
"0.6631286",
"0.66006416",
"0.6592607",
"0.65750146",
"0.65671... | 0.66848665 | 13 |
Return all variables created to perform rotation and translation. | def get_transform_vars(self):
return [v for v in (self.rotation_vars + self.translation_vars)
if isinstance(v, tf.Variable)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_variables(self):\n return [self.g_t, self.m_t]",
"def getVariables(self):\n statVars = [self[vn] for vn in self.statVars]\n timeVars = [self[vn] for vn in self.timeVars]\n return statVars + timeVars",
"def get_variables(self) -> np.array:\n return np.array([self.a, self.b... | [
"0.70107085",
"0.65569705",
"0.6543175",
"0.6502202",
"0.644413",
"0.63996756",
"0.6341541",
"0.63410157",
"0.63068867",
"0.6221026",
"0.6169103",
"0.61680347",
"0.6151924",
"0.61379313",
"0.6134744",
"0.6121936",
"0.60941255",
"0.6068834",
"0.60545456",
"0.6027803",
"0.60119... | 0.72888505 | 0 |
Load and preprocess data from tensorflow_datasets. | def load_data_tf_datasets(dataset_name, target_num_train_per_class,
target_num_val, seed):
logging.info('Loading and preprocessing data from tensorflow datasets...')
# Load train data.
ds = tfds.load(dataset_name, split=tfds.Split.TRAIN, batch_size=-1)
ds = tfds.as_numpy(ds)
train_in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_raw_datasets():\n ds_train_raw = (\n tf.data.TextLineDataset(filenames=[train_data_path])\n .map(split_line, num_parallel_calls=tf.data.experimental.AUTOTUNE)\n .shuffle(buffer_size=1000)\n .batch(BATCH_SIZE)\n .prefetch(tf.data.experimental.AUTOTUNE)\n )\n\n ds... | [
"0.7053245",
"0.70072013",
"0.68787855",
"0.6795892",
"0.67955875",
"0.6580316",
"0.655637",
"0.6532044",
"0.64965504",
"0.64798933",
"0.64663315",
"0.6454775",
"0.64145654",
"0.6395551",
"0.6392552",
"0.6391336",
"0.6365981",
"0.6360732",
"0.6346722",
"0.6342318",
"0.6342009... | 0.7322116 | 0 |
Function for filtering dictionary structures (eg. dictionary where values are also dictionaries). | def dict_cleanup(self, data):
for data_key, data_value in list(data.items()):
# TODO: Add DEBUG logging (?)
for filter_key, filter_value in self.required.items():
if filter_key in data_value.keys():
if isinstance(filter_value, str) and self.exact_match... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_keys(data, keys=[]):\n # filter key\n for filter_key in keys:\n if filter_key in data:\n del data[filter_key]\n\n # filter sub dictionaries\n for _, value in data.items():\n if type(value) == dict:\n filter_keys(value, keys)",
"def filter_values(function... | [
"0.7173403",
"0.7168984",
"0.71410537",
"0.70059514",
"0.69099784",
"0.68303853",
"0.6788644",
"0.6746141",
"0.6707607",
"0.6676209",
"0.65986687",
"0.65959316",
"0.65735817",
"0.65312916",
"0.6524203",
"0.6521999",
"0.6514477",
"0.6469185",
"0.6441903",
"0.6437054",
"0.64355... | 0.62594575 | 26 |
m.init_armor_set( [ method ] ) > None Build each piece of the monster's armor and add it to the set. | def init_armor_set(self, armor_set):
if armor_set:
for armor_build in armor_set:
armor = armor_build(self)
self.armor_set.append(armor)
armor.activate() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setArmor(self, armor):\n self.av = armor",
"def __init__(self):\n self.weapon = Weapon()\n self.armor = Armor()",
"def hk_armor(self):\n self.name = \"Holy Knight's Armor\"\n self.rarity = \"Common\"\n self.pdef_value = 40\n self.mdef_value = 10\n sel... | [
"0.62117183",
"0.60225606",
"0.5761032",
"0.572699",
"0.5668436",
"0.54605114",
"0.5450287",
"0.5318623",
"0.5309805",
"0.53056717",
"0.52231437",
"0.5195177",
"0.51610994",
"0.5132713",
"0.5094153",
"0.5064365",
"0.50605935",
"0.5058604",
"0.50346714",
"0.5032196",
"0.502205... | 0.8116815 | 0 |
m.faceTowards( Being ) > None The monster faces left or right, depending on which direction the target is in. This will influence movement and animations. | def faceTowards(self, target):
current_tile = self.current_tile()
if(target and current_tile):
x_dist = target.coordinates()[0] - current_tile.coordinates()[0]
if x_dist == 0: return
self.direction_val = x_dist/abs(x_dist)
#TEMP
if self.directi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def turn_face_up(self):\n self.face_up = True",
"def turn(self, is_right):\n if is_right:\n self.heading.rotate(1)\n else:\n self.heading.rotate(-1)",
"def _wander_strategy(self):\n\n result = 'moveForward'\n\n if self.last_status == 'Fail' or self.last_... | [
"0.5548279",
"0.55162793",
"0.55032545",
"0.5430616",
"0.54161274",
"0.5354968",
"0.528274",
"0.52575326",
"0.5251552",
"0.5227132",
"0.5208039",
"0.5189017",
"0.5177764",
"0.51716787",
"0.5149845",
"0.51287955",
"0.5102928",
"0.5089273",
"0.508586",
"0.5079562",
"0.507911",
... | 0.6784305 | 0 |
Initializes an event tag index. | def __init__(self):
super(EventTagIndex, self).__init__()
self._index = None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _BuildEventTagIndex(self):\n self._event_tag_index = {}\n for event_tag in self.GetEventTags():\n event_identifier = event_tag.GetEventIdentifier()\n lookup_key = event_identifier.CopyToString()\n self._event_tag_index[lookup_key] = event_tag.GetIdentifier()",
"def __init__(self):\n s... | [
"0.6740978",
"0.66236126",
"0.6580892",
"0.64129055",
"0.6088895",
"0.6034589",
"0.5985557",
"0.59699357",
"0.5887384",
"0.58771455",
"0.58667725",
"0.5840605",
"0.57838374",
"0.57691926",
"0.57691926",
"0.5737148",
"0.56825066",
"0.5676429",
"0.56246144",
"0.5558476",
"0.554... | 0.79637307 | 0 |
When name is not given, return the current branch name. Otherwise, set the working directory branch name (the branch will not exist in the repository until the next commit). Standard practice recommends that primary development take place on the 'default' branch. name new branch name clean reset branch name to parent b... | def branch(self, name=None, clean=None, force=None):
if name and clean:
raise ValueError('Cannot use both name and clean')
self._client.execute('branch', name, f=force, C=clean)
if name:
return name
elif not clean:
return out.strip()
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_current_branch_name(self):\n # type: () -> Optional[str]\n branch = self.get_current_branch()\n if branch:\n return branch.name\n return None",
"def branch(branch_name):\n env.branch = branch_name",
"def branch(branch_name):\n env.branch = branch_name",
"d... | [
"0.69977635",
"0.69428694",
"0.69428694",
"0.6787466",
"0.6645439",
"0.65794235",
"0.6558024",
"0.6527584",
"0.64437985",
"0.63662267",
"0.6366129",
"0.63405025",
"0.63190484",
"0.6285004",
"0.6281684",
"0.6264817",
"0.6262522",
"0.6262011",
"0.61216146",
"0.60493",
"0.604818... | 0.73896277 | 0 |
Generate Change objects between revisions for the specified files. files the files to diff (if None, diff the entire repository) rev 0, 1 or 2 revisions; if none, compare the working directory to its parent; if one, compare with working directory to that revision; if two, compare those revisions change generate a diff ... | def changes(self, files=[], rev=None, change=None, text=False,
reverse=False, ignore_all_space=False, ignore_space_change=False,
ignore_blank_lines=False, context=None, subrepos=False,
include=None, exclude=None):
return diffparser.parse(self.diff(files=files, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def diff(self, files=[], rev=None, change=None, text=False,\n git=False, nodates=False, show_function=False, reverse=False,\n ignore_all_space=False, ignore_space_change=False,\n ignore_blank_lines=False, unified=None,\n stat=False, subrepos=False, include=None, excl... | [
"0.6445128",
"0.57100946",
"0.5576651",
"0.5270639",
"0.5217728",
"0.5098464",
"0.50349844",
"0.5005927",
"0.50048965",
"0.4995622",
"0.4992258",
"0.4989167",
"0.49602535",
"0.4923687",
"0.49016792",
"0.48749018",
"0.4864071",
"0.48116848",
"0.47506148",
"0.47315946",
"0.4729... | 0.64501894 | 0 |
Returns dataframe of synthetic measurements. | def measure(self):
return self.batch.measure(self.ambiguity, self.num_replicates) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def runSimulationDF(cls, **kwargs):\r\n fittedTS = NamedTimeseries(namedArray=cls.runSimulationArr(**kwargs))\r\n return fittedTS.to_dataframe()",
"def measurements():\n \n number_of_days = 100\n\n\n # the temperature is usually 20 but can vary by 10 degrees at a time\n \n average_te... | [
"0.6683026",
"0.66055834",
"0.65300083",
"0.6481748",
"0.636432",
"0.6364167",
"0.63088566",
"0.62996805",
"0.62955457",
"0.62634623",
"0.6230132",
"0.6222584",
"0.6193309",
"0.6171957",
"0.6167649",
"0.61589366",
"0.6158472",
"0.6130138",
"0.61124706",
"0.6104767",
"0.610094... | 0.0 | -1 |
Return the raw data for tag. | def dump(self, tag):
length = tag.length
result = self._read_bytes(0, length)
self._buffer = self._buffer[length:]
self._resetTag()
return tag.raw + result | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def raw(self):\n return self.data",
"def get_raw_data(self):\n return self.content",
"def get_raw_data(self):\n return self.__data",
"def raw_data(self):\n return self._raw_data",
"def raw_data(self):\n return self._raw_data",
"def rawdata(self) -> str:\n return ... | [
"0.7240558",
"0.7173444",
"0.7117779",
"0.7101145",
"0.7101145",
"0.70347095",
"0.6921688",
"0.6917218",
"0.6917218",
"0.69025606",
"0.66963434",
"0.66636306",
"0.65960425",
"0.6552913",
"0.6516113",
"0.6383683",
"0.6368218",
"0.6357114",
"0.6357114",
"0.6357114",
"0.6353803"... | 0.6831482 | 10 |
Searches a column for a given value and returns the row the value first appears in. | def find_in_column(self, column, value):
values = [cell[column - 1] for cell in self._op.values]
try:
return values.index(value) + 1
except ValueError:
return 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_row(table, row):\n for idx in range(len(table)):\n if table[idx][0] == row:\n return idx\n return -1",
"def find_col(table, col):\n return table[0].index(col)",
"def row_by_value(idl_, table, column, match, default=_NO_DEFAULT):\n tab = idl_.tables[table]\n for r in ta... | [
"0.69421947",
"0.6893456",
"0.6765275",
"0.6690687",
"0.65816945",
"0.6565631",
"0.6460732",
"0.6397726",
"0.6339769",
"0.6334957",
"0.62474763",
"0.62097424",
"0.6209072",
"0.6197558",
"0.6178861",
"0.6148743",
"0.6114857",
"0.60577446",
"0.6056467",
"0.5985548",
"0.59794486... | 0.64902973 | 6 |
Sets the name of this ApiaccountsBillcontact. | def name(self, name):
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contact_name(self, contact_name):\n\n self._contact_name = contact_name",
"def contact_name(self, contact_name):\n\n self._contact_name = contact_name",
"def SetName(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\... | [
"0.7261152",
"0.7261152",
"0.66610503",
"0.66559684",
"0.66559684",
"0.66559684",
"0.66559684",
"0.66559684",
"0.66156304",
"0.6573643",
"0.6536291",
"0.65226156",
"0.65158993",
"0.6490762",
"0.6490762",
"0.646719",
"0.6463478",
"0.6453776",
"0.6453776",
"0.64310724",
"0.6431... | 0.0 | -1 |
Sets the zipcode of this ApiaccountsBillcontact. | def zipcode(self, zipcode):
if zipcode is None:
raise ValueError("Invalid value for `zipcode`, must not be `None`") # noqa: E501
self._zipcode = zipcode | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zipcode(self, zipcode):\n self._zipcode = zipcode",
"def zip_code(self, zip_code):\n\n self._zip_code = zip_code",
"def principal_zip_code(self, principal_zip_code):\n\n self._principal_zip_code = principal_zip_code",
"def zip_code(self, value):\n regex = config.get('validator... | [
"0.78441685",
"0.7720664",
"0.69060963",
"0.66386056",
"0.65722424",
"0.65722424",
"0.65722424",
"0.65691864",
"0.6243531",
"0.6003641",
"0.5818464",
"0.57841724",
"0.56315094",
"0.56210095",
"0.55950606",
"0.5452774",
"0.5447015",
"0.5447015",
"0.5447015",
"0.5338217",
"0.52... | 0.76014894 | 2 |
Sets the country of this ApiaccountsBillcontact. | def country(self, country):
self._country = country | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def country(self, country):\n if country is None:\n raise ValueError(\"Invalid value for `country`, must not be `None`\")\n\n self._country = country",
"def domain_settings_set_country(self, country):\n return self._request('domain/settings/set_country', inspect_args_func(inspect.... | [
"0.7135401",
"0.6613108",
"0.6435555",
"0.60529906",
"0.5980225",
"0.5980225",
"0.5730811",
"0.57172006",
"0.55933183",
"0.5518457",
"0.5362083",
"0.52071846",
"0.50269055",
"0.50260365",
"0.5020843",
"0.49875706",
"0.49875706",
"0.48868054",
"0.48827586",
"0.48782575",
"0.48... | 0.70548373 | 4 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, ApiaccountsBillcontact):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.8455985",
"0.83913255",
"0.81440157",
"0.8140831",
"0.8132328",
"0.80937284",
"0.809181",
"0.809181",
"0.809181",
"0.808509",
"0.808509",
"0.8076134",
"0.8076134",
"0.8065528"
] | 0.0 | -1 |
Return the dtypes as a Series for the underlying MultiIndex. | def dtypes(self) -> pd.Series:
return pd.Series(
[field.dtype for field in self._internal.index_fields],
index=pd.Index(
[name if len(name) > 1 else name[0] for name in self._internal.index_names]
),
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dtypes(self) -> Series:\n from pandas import Series\n\n names = com.fill_missing_names([level.name for level in self.levels])\n return Series([level.dtype for level in self.levels], index=Index(names))",
"def _to_pandas(self) -> pd.MultiIndex:\n return cast(pd.MultiIndex, super().... | [
"0.8184228",
"0.68621963",
"0.6358254",
"0.6307995",
"0.61511695",
"0.6075133",
"0.60155475",
"0.5840205",
"0.5590463",
"0.5561326",
"0.54950684",
"0.5491656",
"0.5378195",
"0.53119725",
"0.5295259",
"0.52875245",
"0.5279626",
"0.5245437",
"0.52452826",
"0.523891",
"0.5221498... | 0.78761137 | 1 |
Swap level i with level j. Calling this method does not change the ordering of the values. | def swaplevel(self, i: int = -2, j: int = -1) -> "MultiIndex":
for index in (i, j):
if not isinstance(index, int) and index not in self.names:
raise KeyError("Level %s not found" % index)
i = i if isinstance(i, int) else self.names.index(i)
j = j if isinstance(j, int... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def swaplevel(self, i=-2, j=-1) -> MultiIndex:\n new_levels = list(self.levels)\n new_codes = list(self.codes)\n new_names = list(self.names)\n\n i = self._get_level_number(i)\n j = self._get_level_number(j)\n\n new_levels[i], new_levels[j] = new_levels[j], new_levels[i]\n... | [
"0.74526614",
"0.7346278",
"0.7346278",
"0.7294899",
"0.72918224",
"0.72742206",
"0.71956444",
"0.7175905",
"0.712711",
"0.71144307",
"0.70062816",
"0.69035494",
"0.6693372",
"0.66693985",
"0.6646694",
"0.66430485",
"0.65844166",
"0.65626323",
"0.6560102",
"0.6546376",
"0.651... | 0.68559766 | 12 |
Create a DataFrame with the levels of the MultiIndex as columns. Column ordering is determined by the DataFrame constructor with data as a dict. | def to_frame( # type: ignore[override]
self, index: bool = True, name: Optional[List[Name]] = None
) -> DataFrame:
if name is None:
name = [
name if name is not None else (i,)
for i, name in enumerate(self._internal.index_names)
]
elif... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_multi_index_data_frame(data_frames: list, sub_header: list, header_columns: list) -> pd.DataFrame:\r\n\r\n tuples = build_multi_index_tuples(header_columns, sub_header)\r\n\r\n multi_header = pd.MultiIndex.from_tuples(tuples)\r\n\r\n df = pd.concat(data_frames, axis=1).loc[:, dict(tuples).keys()... | [
"0.7025814",
"0.6876633",
"0.68388975",
"0.64850295",
"0.6364974",
"0.6280288",
"0.6252759",
"0.5973858",
"0.59734046",
"0.5968347",
"0.59410197",
"0.593488",
"0.5902506",
"0.5855398",
"0.584917",
"0.58324987",
"0.5809604",
"0.5801654",
"0.57453054",
"0.5744082",
"0.57377875"... | 0.5579021 | 28 |
Return a pandas MultiIndex. | def to_pandas(self) -> pd.MultiIndex:
# TODO: We might need to handle internal state change.
# So far, we don't have any functions to change the internal state of MultiIndex except for
# series-like operations. In that case, it creates a new Index object instead of MultiIndex.
return cas... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _to_pandas(self) -> pd.MultiIndex:\n return cast(pd.MultiIndex, super()._to_pandas())",
"def make_index(cls, selector, names=[]):\n\n assert cls.is_selector(selector)\n assert not cls.is_ambiguous(selector)\n\n # Since nonempty Selectors are already expanded into lists of tuples,\... | [
"0.763254",
"0.68634033",
"0.6724343",
"0.64997625",
"0.64425975",
"0.64136726",
"0.6362066",
"0.6310585",
"0.63012844",
"0.6289729",
"0.6228385",
"0.6177782",
"0.6112098",
"0.60561055",
"0.60102683",
"0.5928012",
"0.5861009",
"0.5800596",
"0.57858115",
"0.5694984",
"0.568785... | 0.70413494 | 1 |
Return other suit of the same same color I'm embarrased I had to write this function. | def same_color(suit):
if suit == 's':
return 'c'
elif suit == 'c':
return 's'
elif suit == 'd':
return 'h'
elif suit == 'h':
return 'd' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_trump_color(self):\n color_counter = collections.Counter()\n for card in self.hand:\n color = card.color\n if color == \"White\":\n continue\n color_counter[color] += 1\n if not color_counter.most_common(1):\n return super().ge... | [
"0.7629291",
"0.6938815",
"0.68371",
"0.6620941",
"0.64420456",
"0.6439577",
"0.6263596",
"0.6232412",
"0.6119415",
"0.610538",
"0.6077046",
"0.6033653",
"0.601187",
"0.6003282",
"0.59425944",
"0.59376603",
"0.59208816",
"0.589354",
"0.5888985",
"0.58701396",
"0.58692646",
... | 0.8190205 | 0 |
Returns ArgumentParser for command line interface. | def create_cli_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser()
parser.add_argument("config", nargs="?", help="path to yaml configuration file")
return parser | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def command_line_argument_parser() -> argparse.ArgumentParser:\n parser = argparse.ArgumentParser(\n description=description(),\n epilog=epilog(),\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n return parser",
"def command_line_argument_parser() -> argparse.ArgumentPa... | [
"0.8461342",
"0.8461342",
"0.8252302",
"0.7937467",
"0.78921616",
"0.78906125",
"0.76528436",
"0.7616996",
"0.75524634",
"0.753225",
"0.7528854",
"0.74952257",
"0.74838954",
"0.7477763",
"0.7441388",
"0.74413127",
"0.74005115",
"0.7399652",
"0.73877126",
"0.73801035",
"0.7365... | 0.7442752 | 14 |
Convert and return file to array lines. It excludes comment lines. | def get_lines_in_file(config_file):
lines = []
line = config_file.readline()
lines.append([1, line])
line_counter = 1
while line:
line = config_file.readline()
if not (line.lstrip().startswith("#")):
lines.append([line_counter, line])
line_counter += 1
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_file_as_array(self, file_):\n file_as_string = \"\"\n for line in file_:\n if \";\" in line:\n line = line[:line.find(\";\")]\n line = (line.replace('\\t', '').replace('\\n', ' ')\n .replace('(', ' ( ').replace(')', ' ) '))\n file_as_string += line\n file_.close()\n... | [
"0.74129647",
"0.70819384",
"0.6997679",
"0.6991039",
"0.6963677",
"0.69568044",
"0.6932118",
"0.69123197",
"0.6883258",
"0.683574",
"0.68239194",
"0.68173975",
"0.6804039",
"0.68016917",
"0.6801218",
"0.6780617",
"0.67767113",
"0.6759458",
"0.67489535",
"0.67387605",
"0.6705... | 0.61156267 | 69 |
Test if a plain conversation with zero messages can be started | def test_conversation_with_zero_messages(self):
response = self.client.post('/conversation/{}/message'.format(self.conversation.id), {
"sender_id": self.user_a.id,
"receiver_id": self.user_b.id,
"text": "test message"
}, format='json')
self.assertEqual(respon... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n if len(self.messages) < 1:\n return True\n else:\n return False",
"def test_initial_length_equals_zero(self):\r\n msg_list = messages.MessageList()\r\n self.assertEqual(msg_list.length(), 0)",
"def test_zero_msgs(self):\n msg = []\n... | [
"0.6509104",
"0.63578737",
"0.63547844",
"0.63307923",
"0.6216674",
"0.60820293",
"0.5835983",
"0.5825491",
"0.5825491",
"0.57829905",
"0.57530224",
"0.57272893",
"0.5685221",
"0.5670224",
"0.5648186",
"0.56157255",
"0.5615679",
"0.55684596",
"0.553764",
"0.55175346",
"0.5502... | 0.6514676 | 0 |
r"""Number of graphs in the dataset. Returns int | def __len__(self):
return self.n_node.shape[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ngraphs(self):\n return len(self.__graph_list)",
"def number_of_data_nodes(self):\n return int(self._data['number_of_data_nodes'])",
"def graph_count(self) -> int:\n return int(self.graph_tuple_stats.graph_count)",
"def graph_data_size(self) -> int:\n return int(self.graph_tuple_stats... | [
"0.8177282",
"0.77682084",
"0.77343106",
"0.751806",
"0.7409018",
"0.7385039",
"0.736291",
"0.73342484",
"0.7197069",
"0.7106285",
"0.70112616",
"0.70004135",
"0.69535905",
"0.691286",
"0.6844889",
"0.6818709",
"0.67441154",
"0.6678891",
"0.66424835",
"0.66161907",
"0.6611182... | 0.0 | -1 |
Deletes an analytics configuration for the bucket (specified by the analytics configuration ID). | def delete_bucket_analytics_configuration(Bucket=None, Id=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_bucket_metrics_configuration(Bucket=None, Id=None):\n pass",
"def delete_bucket_inventory_configuration(Bucket=None, Id=None):\n pass",
"def delete_config_callback(self, trigger_id, config):\n self.tcex.log.trace('delete config callback')",
"def put_bucket_analytics_configuration(Buck... | [
"0.7604093",
"0.7065312",
"0.6486593",
"0.6268282",
"0.6093107",
"0.5897825",
"0.585958",
"0.58551997",
"0.57395333",
"0.57225347",
"0.56757987",
"0.5669398",
"0.5631595",
"0.56072986",
"0.5604812",
"0.5551352",
"0.5548683",
"0.55200934",
"0.5478435",
"0.54742473",
"0.5471771... | 0.8686281 | 0 |
Deletes a metrics configuration for the Amazon CloudWatch request metrics (specified by the metrics configuration ID) from the bucket. Note that this doesn\'t include the daily storage metrics. | def delete_bucket_metrics_configuration(Bucket=None, Id=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_bucket_analytics_configuration(Bucket=None, Id=None):\n pass",
"def get_bucket_metrics_configuration(Bucket=None, Id=None):\n pass",
"def put_bucket_metrics_configuration(Bucket=None, Id=None, MetricsConfiguration=None):\n pass",
"def list_bucket_metrics_configurations(Bucket=None, Contin... | [
"0.65952796",
"0.5764277",
"0.5698529",
"0.5589302",
"0.5554627",
"0.5480715",
"0.54474235",
"0.5428808",
"0.53637606",
"0.5326495",
"0.52871424",
"0.5269845",
"0.52398854",
"0.52120304",
"0.51522744",
"0.5125438",
"0.5074952",
"0.50555134",
"0.50500447",
"0.50296086",
"0.502... | 0.8071948 | 0 |
This implementation of the GET operation returns an analytics configuration (identified by the analytics configuration ID) from the bucket. | def get_bucket_analytics_configuration(Bucket=None, Id=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_bucket_metrics_configuration(Bucket=None, Id=None):\n pass",
"def list_bucket_analytics_configurations(Bucket=None, ContinuationToken=None):\n pass",
"def get_bucket_inventory_configuration(Bucket=None, Id=None):\n pass",
"def get_config():\n\n # Retrieve config from S3\n config = get_... | [
"0.65982515",
"0.642073",
"0.6262458",
"0.6142293",
"0.58704066",
"0.586523",
"0.56924176",
"0.5563753",
"0.5562354",
"0.55071986",
"0.5486208",
"0.5486208",
"0.5484506",
"0.54726094",
"0.5413658",
"0.53968894",
"0.5354896",
"0.53433937",
"0.533905",
"0.53382653",
"0.53316456... | 0.7725061 | 0 |
Returns the default encryption configuration for an Amazon S3 bucket. For information about the Amazon S3 default encryption feature, see Amazon S3 Default Bucket Encryption . | def get_bucket_encryption(Bucket=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_config():\n\n # Retrieve config from S3\n config = get_json(BUCKET, CONFIG_S3_KEY)\n\n # If config does not currently exist, create a default one and save to S3\n if not config:\n config = generate_config()\n save_config(config)\n\n return config",
"def encryption(self) -> ty... | [
"0.6691077",
"0.65997523",
"0.65723044",
"0.65082",
"0.6217193",
"0.6061714",
"0.5971248",
"0.59203583",
"0.59139633",
"0.59068954",
"0.5865721",
"0.5861929",
"0.5858688",
"0.5841083",
"0.5830963",
"0.57897705",
"0.5785154",
"0.5759144",
"0.5748477",
"0.5728825",
"0.57243854"... | 0.7612864 | 0 |
Returns the Region the bucket resides in. You set the bucket\'s Region using the LocationConstraint request parameter in a CreateBucket request. For more information, see CreateBucket . To use this implementation of the operation, you must be the bucket owner. | def get_bucket_location(Bucket=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_region(self):\n return self.creds.get('region_name')",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) -> str:\n return pulumi.get(self, \"region\")",
"def region(self) ... | [
"0.71272635",
"0.69390935",
"0.69390935",
"0.69390935",
"0.69390935",
"0.69390935",
"0.69390935",
"0.6886231",
"0.68698424",
"0.6855191",
"0.6855191",
"0.6855191",
"0.6855191",
"0.6830683",
"0.68108875",
"0.68108875",
"0.6769921",
"0.6769921",
"0.6769921",
"0.667816",
"0.6671... | 0.62944496 | 51 |
Gets a metrics configuration (specified by the metrics configuration ID) from the bucket. Note that this doesn\'t include the daily storage metrics. | def get_bucket_metrics_configuration(Bucket=None, Id=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_bucket_metrics_configurations(Bucket=None, ContinuationToken=None):\n pass",
"def fusion_api_get_metrics_configuration(self, api=None, headers=None):\n return self.metrics.get(api=api, headers=headers, param='/configuration')",
"def get_bucket_analytics_configuration(Bucket=None, Id=None... | [
"0.6472764",
"0.63830733",
"0.6319523",
"0.6089206",
"0.5713139",
"0.56319344",
"0.55435246",
"0.5527125",
"0.5511432",
"0.5493204",
"0.5405601",
"0.51752955",
"0.5127896",
"0.5099804",
"0.50663567",
"0.4955683",
"0.49294037",
"0.48972574",
"0.48957008",
"0.48954207",
"0.4860... | 0.77769315 | 0 |
Returns the notification configuration of a bucket. If notifications are not enabled on the bucket, the operation returns an empty NotificationConfiguration element. | def get_bucket_notification_configuration(Bucket=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_bucket_notification(Bucket=None):\n pass",
"def notification_config(self) -> 'outputs.NotificationConfigResponse':\n return pulumi.get(self, \"notification_config\")",
"def put_bucket_notification_configuration(Bucket=None, NotificationConfiguration=None):\n pass",
"def put_bucket_notifi... | [
"0.6575426",
"0.6573674",
"0.62484014",
"0.59397197",
"0.574118",
"0.56884736",
"0.55369836",
"0.5498997",
"0.54311985",
"0.5425835",
"0.5331692",
"0.52451295",
"0.52449757",
"0.5231619",
"0.5231619",
"0.5174376",
"0.5058591",
"0.4997675",
"0.49326843",
"0.49109352",
"0.48929... | 0.78894174 | 0 |
Returns the replication configuration of a bucket. For information about replication configuration, see Replication in the Amazon Simple Storage Service Developer Guide . | def get_bucket_replication(Bucket=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_bucket_notification_configuration(Bucket=None):\n pass",
"def get_bucket_lifecycle_configuration(Bucket=None):\n pass",
"def put_bucket_replication(Bucket=None, ReplicationConfiguration=None, Token=None):\n pass",
"def get_bucket_metrics_configuration(Bucket=None, Id=None):\n pass",
"de... | [
"0.6029611",
"0.58928066",
"0.5698696",
"0.5635227",
"0.55993426",
"0.556204",
"0.5470341",
"0.54167914",
"0.54069185",
"0.5384654",
"0.5384654",
"0.5383954",
"0.5373886",
"0.53681964",
"0.531558",
"0.5312697",
"0.5285252",
"0.5274173",
"0.5219478",
"0.52130157",
"0.5139271",... | 0.76546067 | 0 |
Returns the request payment configuration of a bucket. To use this version of the operation, you must be the bucket owner. For more information, see Requester Pays Buckets . | def get_bucket_request_payment(Bucket=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_bucket_accelerate_configuration(Bucket=None):\n pass",
"def put_bucket_request_payment(Bucket=None, RequestPaymentConfiguration=None):\n pass",
"def get_bucket_notification_configuration(Bucket=None):\n pass",
"def get_bucket_policy(Bucket=None):\n pass",
"def get_object_lock_configurat... | [
"0.68753695",
"0.6624221",
"0.652675",
"0.61396354",
"0.6088341",
"0.59856516",
"0.5870276",
"0.5674686",
"0.5674686",
"0.565474",
"0.5610779",
"0.5569977",
"0.5569977",
"0.5569977",
"0.5569977",
"0.5569977",
"0.5552412",
"0.55205476",
"0.5516042",
"0.5502",
"0.54954416",
"... | 0.7960077 | 0 |
Returns the versioning state of a bucket. To retrieve the versioning state of a bucket, you must be the bucket owner. This implementation also returns the MFA Delete status of the versioning state. If the MFA Delete status is enabled , the bucket owner must use an authentication device to change the versioning state of... | def get_bucket_versioning(Bucket=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_bucket_versioning_status(self, bucket_name):\n return self._client.get_bucket_versioning(Bucket=bucket_name).get(\"Status\")",
"def get_versioning_status(self, headers=None):\r\n response = self.connection.make_request('GET', self.name,\r\n query_args='versioning', headers=he... | [
"0.7558039",
"0.6453385",
"0.6293636",
"0.61154073",
"0.5805858",
"0.5680489",
"0.561151",
"0.5587636",
"0.5575067",
"0.55235976",
"0.54868305",
"0.53736943",
"0.53601485",
"0.53278774",
"0.53076166",
"0.5302237",
"0.5283305",
"0.52719134",
"0.52427113",
"0.5226363",
"0.52260... | 0.72780436 | 1 |
Sets the accelerate configuration of an existing bucket. Amazon S3 Transfer Acceleration is a bucketlevel feature that enables you to perform faster data transfers to Amazon S3. | def put_bucket_accelerate_configuration(Bucket=None, AccelerateConfiguration=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_bucket_accelerate_configuration(Bucket=None):\n pass",
"def setup_bucket(bucket):\n s3_bucket = BUCKET_MANAGER.init_bucket(bucket)\n BUCKET_MANAGER.set_policy(s3_bucket)\n BUCKET_MANAGER.configure_website(s3_bucket)",
"def put_bucket_cors(Bucket=None, CORSConfiguration=None):\n pass",
... | [
"0.69880927",
"0.58963805",
"0.5852694",
"0.5844379",
"0.54831946",
"0.5467168",
"0.537238",
"0.5366594",
"0.53374815",
"0.5289862",
"0.5258023",
"0.51401204",
"0.5130629",
"0.5093954",
"0.5082433",
"0.5080951",
"0.5073416",
"0.5055574",
"0.50536156",
"0.5031694",
"0.50294584... | 0.79310095 | 0 |
Set the logging parameters for a bucket and to specify permissions for who can view and modify the logging parameters. All logs are saved to buckets in the same AWS Region as the source bucket. To set the logging status of a bucket, you must be the bucket owner. The bucket owner is automatically granted FULL_CONTROL to... | def put_bucket_logging(Bucket=None, BucketLoggingStatus=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_iam_permission_bucket(bucket_name, role_type, member_type):\n\n # initialize client & get bucket\n _, bucket, _ = create_client(bucket_name)\n\n policy = bucket.get_iam_policy(requested_policy_version=3)\n\n # get member type\n member_value = get_member_bucket_level(member_type)\n\n # get... | [
"0.5979146",
"0.583399",
"0.5752306",
"0.57464045",
"0.56900907",
"0.56152815",
"0.5572567",
"0.5517638",
"0.54065436",
"0.53307724",
"0.5305048",
"0.525352",
"0.52176446",
"0.51585925",
"0.514643",
"0.51375484",
"0.511182",
"0.509909",
"0.50654566",
"0.50474274",
"0.5046175"... | 0.72196704 | 0 |
Creates a replication configuration or replaces an existing one. For more information, see Replication in the Amazon S3 Developer Guide . Specify the replication configuration in the request body. In the replication configuration, you provide the name of the destination bucket where you want Amazon S3 to replicate obje... | def put_bucket_replication(Bucket=None, ReplicationConfiguration=None, Token=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def replicate(self, source, target, **params):\n replicator = cloudant.replicator.Replication(self.cloudant_client)\n source_db = Database(self.cloudant_client, source)\n target_db = Database(self.cloudant_client, target)\n return replicator.create_replication(source_db, target_db, **pa... | [
"0.55977476",
"0.52265596",
"0.5216164",
"0.5096016",
"0.5051606",
"0.5032355",
"0.48676997",
"0.48335698",
"0.4753804",
"0.46794835",
"0.4656571",
"0.46255225",
"0.46108475",
"0.45803452",
"0.45522138",
"0.4443814",
"0.44354197",
"0.44330853",
"0.442313",
"0.4419442",
"0.441... | 0.5756311 | 0 |
Sets the tags for a bucket. Use tags to organize your AWS bill to reflect your own cost structure. To do this, sign up to get your AWS account bill with tag key values included. Then, to see the cost of combined resources, organize your billing information according to resources with the same tag key values. For exampl... | def put_bucket_tagging(Bucket=None, Tagging=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_bucket_tagging(Bucket=None):\n pass",
"def put_object_tagging(Bucket=None, Key=None, VersionId=None, ContentMD5=None, Tagging=None):\n pass",
"def get_tags(bucket: str, key: str) -> dict:\n logger.debug(f'Reading tags from s3://{bucket}/{key}')\n response = client().get_object_tagging(Bucke... | [
"0.649924",
"0.6472873",
"0.6169073",
"0.61282045",
"0.60677725",
"0.5940627",
"0.5923109",
"0.58977324",
"0.57952404",
"0.5770267",
"0.57653356",
"0.57653356",
"0.57653356",
"0.57562095",
"0.57497555",
"0.57437474",
"0.57437474",
"0.57437474",
"0.57437474",
"0.57437474",
"0.... | 0.7325588 | 0 |
Applies a Legal Hold configuration to the specified object. | def put_object_legal_hold(Bucket=None, Key=None, LegalHold=None, RequestPayer=None, VersionId=None, ContentMD5=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def legal_hold(self) -> 'outputs.LegalHoldPropertiesResponse':\n return pulumi.get(self, \"legal_hold\")",
"def apply(self) -> None:\n _ba.apply_config()",
"def update(self, obj):\n\n self.cfg.update(obj)",
"def set_wam_joint_hold(hold):\n msg = HoldRequest()\n msg.hold = hold\n ... | [
"0.5459299",
"0.5223168",
"0.51662433",
"0.51042247",
"0.49540895",
"0.4940352",
"0.49180752",
"0.49166292",
"0.4883322",
"0.4842406",
"0.4841826",
"0.4804079",
"0.47931382",
"0.47098985",
"0.46599212",
"0.465391",
"0.4651016",
"0.46399558",
"0.46250498",
"0.46120122",
"0.460... | 0.62764627 | 0 |
Places an Object Lock configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. | def put_object_lock_configuration(Bucket=None, ObjectLockConfiguration=None, RequestPayer=None, Token=None, ContentMD5=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_object_lock_configuration(Bucket=None):\n pass",
"def lock_environment(bucket, environment):\n s3.put_object(Bucket=bucket, Key=\"%s.lock\"%environment)",
"def bucket(self, bucket):\n\n self._bucket = bucket",
"def create_bucket(ACL=None, Bucket=None, CreateBucketConfiguration=None, Gran... | [
"0.6710751",
"0.602169",
"0.5885827",
"0.57805544",
"0.57708627",
"0.57537395",
"0.5658306",
"0.55914557",
"0.55896646",
"0.55116683",
"0.54173034",
"0.5411396",
"0.54101723",
"0.5393415",
"0.53822637",
"0.5368272",
"0.53459513",
"0.5343463",
"0.5331058",
"0.53233033",
"0.529... | 0.73429054 | 0 |
This operation filters the contents of an Amazon S3 object based on a simple structured query language (SQL) statement. In the request, along with the SQL expression, you must also specify a data serialization format (JSON, CSV, or Apache Parquet) of the object. Amazon S3 uses this format to parse object data into reco... | def select_object_content(Bucket=None, Key=None, SSECustomerAlgorithm=None, SSECustomerKey=None, SSECustomerKeyMD5=None, Expression=None, ExpressionType=None, RequestProgress=None, InputSerialization=None, OutputSerialization=None, ScanRange=None):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read(\n database, query, s3_output=None, region=None, key=None, secret=None, profile=None\n):\n session = get_session(key=key, secret=secret, profile=profile, region=region)\n if not s3_output:\n account_id = session.client(\"sts\").get_caller_identity().get(\"Account\")\n session_region... | [
"0.55632377",
"0.5396689",
"0.51638365",
"0.5075111",
"0.50745624",
"0.50196445",
"0.49587226",
"0.4914471",
"0.49034506",
"0.48356918",
"0.47919387",
"0.4771649",
"0.47328568",
"0.47247073",
"0.47218427",
"0.4696132",
"0.4685012",
"0.46767336",
"0.46605876",
"0.46241844",
"0... | 0.5933831 | 0 |
Appends a new value on the end of the list. | def push(self, obj):
if self.begin == self.end == None:
self.begin = self.end = DoubleLinkedListNode(obj, None, None)
elif self.begin == self.end != None:
self.end = DoubleLinkedListNode(obj, None, self.begin)
self.begin = DoubleLinkedListNode(self.begin.value, self.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append(self, value):\n self.list.append(value)",
"def append_value(self, value):\n self.value += value",
"def append(self, value):\n\n list.append(self, value)\n self.changed()",
"def append(self, val):\n self._values.push(val)",
"def append(self, value):\n ... | [
"0.7845259",
"0.7835501",
"0.7699414",
"0.7572769",
"0.7529863",
"0.7505154",
"0.744546",
"0.7440138",
"0.742297",
"0.7416251",
"0.73919535",
"0.7383919",
"0.73799324",
"0.7362911",
"0.7228265",
"0.7162951",
"0.7099212",
"0.70848644",
"0.7068363",
"0.704191",
"0.7041322",
"... | 0.0 | -1 |
Removes the last item and returns it. | def pop(self):
if self.begin == None:
return None
elif self.begin == self.end:
node = self.begin
self.end = self.begin = None
return node.value
else:
node = self.begin
while node.next != self.end:
node = n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_last_item_from_stack(self):\n if self.length > 0:\n return self.container.pop()\n else:\n return None",
"def pop_last(self):\n self.pop_item(-1)",
"def popitem(self):\n return self.pop(0)",
"def remove_rear(self):\n\n if self.items:\n ... | [
"0.8382281",
"0.81132346",
"0.79878813",
"0.7886381",
"0.7805141",
"0.7716931",
"0.76364756",
"0.7627316",
"0.7619489",
"0.75985986",
"0.75980556",
"0.7586525",
"0.7544955",
"0.7544733",
"0.7506782",
"0.7495859",
"0.7493139",
"0.7490336",
"0.7471603",
"0.74467856",
"0.7444382... | 0.0 | -1 |
Get parameters as a ColumnDataSource object. Collecting parameters like this is a bit of a hack to enable dynamic updating of parameters from the bokeh client. | def _init_param_source():
amp_sine = 1
amp_rand = 1
rollover = 100 # length of data to display
update_delay = 100 # time between delays of update in ms
param_source = ColumnDataSource(dict(
amp_sine=[amp_sine],
amp_rand=[amp_rand],
rollover=[rollover],
update_delay=[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_source(self):\n self.source = ColumnDataSource(self.data)\n\n x_names, y_names = self.attr[::2], self.attr[1::2]\n\n endx = max(max(self.data[i]) for i in x_names)\n startx = min(min(self.data[i]) for i in x_names)\n self.xdr = Range1d(\n start=startx - 0.1 * (... | [
"0.6000857",
"0.56154776",
"0.54943204",
"0.5473951",
"0.5461998",
"0.5461998",
"0.5461998",
"0.5379675",
"0.5330758",
"0.5307025",
"0.5230002",
"0.5228616",
"0.5198542",
"0.5182733",
"0.5176886",
"0.5150221",
"0.51046276",
"0.50738746",
"0.50570047",
"0.5042232",
"0.50394714... | 0.7107605 | 0 |
Return whether a vector value is within this rectangle | def __contains__(self, item):
try:
pos = Vec2(*item)
return pos.x >= self.origin.x and pos.y >= self.origin.y \
and pos.x < self.origin.x + self.size.x \
and pos.y < self.origin.y + self.size.y
except TypeError:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def point_in_rectangle(point: Vector, rect_min: Vector, rect_max: Vector) -> bool:\n return rect_min[0] <= point[0] <= rect_max[0] and rect_min[1] <= point[1] <= rect_max[1]",
"def in_rectangle(x, y):\n return ((self.min_x <= x <= self.max_x) and\n (self.min_y <= y <= self.max_y)... | [
"0.7645428",
"0.7498518",
"0.7440714",
"0.743401",
"0.73838365",
"0.73804635",
"0.72002894",
"0.71066487",
"0.7089623",
"0.7083991",
"0.70810413",
"0.7063479",
"0.7043575",
"0.7039562",
"0.700009",
"0.6999421",
"0.6939362",
"0.6926556",
"0.6905979",
"0.6894331",
"0.68863624",... | 0.66998494 | 34 |
It gets the maximum value and its index | def maximo(arr):
maxVal = float('-inf')
maxIdx = -1
for i in range(len(arr)):
if arr[i] > maxVal:
maxVal = arr[i]
maxIdx = i
return maxVal, maxIdx | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def imax(self):\n return self.elem.index(max(self))",
"def get_max_index(a):\n return a.argmax()",
"def get_max_index(a):\n return a.argmax()",
"def get_max_index(a):\n return a.argmax()",
"def max(self, i):\n x=self.val(i,0)\n lm=len(self)\n t=1\n while t<lm:\n ... | [
"0.78248173",
"0.7754072",
"0.7754072",
"0.7754072",
"0.7746403",
"0.7596116",
"0.75570214",
"0.75416714",
"0.7534985",
"0.750736",
"0.7454747",
"0.73859334",
"0.7357726",
"0.7340802",
"0.7287925",
"0.7241319",
"0.72166294",
"0.7194909",
"0.7191979",
"0.7188061",
"0.7177977",... | 0.7699912 | 5 |
It gets the minimum value and its index | def minimo(arr):
minVal = float('inf')
minIdx = -1
for i in range(len(arr)):
if arr[i] < minVal:
minVal = arr[i]
minIdx = i
return minVal, minIdx | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def imin(self):\n return self.index(min(self))",
"def index_min(values):\n return min(values), min(range(len(values)),key=values.__getitem__)",
"def minimum_index(self):\n return self._minidx",
"def get_min(fun):\n\tglobal __dataset\n\n\tmin_val = sys.maxint\n\tmin_index = 0\n\tfor i, vec in... | [
"0.8116542",
"0.7859201",
"0.7798217",
"0.7723898",
"0.7633541",
"0.76251554",
"0.76251554",
"0.7609725",
"0.75643754",
"0.7512227",
"0.74619204",
"0.7458412",
"0.74271476",
"0.74018574",
"0.7363827",
"0.7362296",
"0.73592865",
"0.73592865",
"0.73515314",
"0.7348613",
"0.7334... | 0.77952003 | 3 |
Remove stop words from tokens and remove tokens that are single letters/char like 's' | def remove_stop_words(stop_list, tokens):
return [t for t in tokens if len(t) > 2 and not t in stop_list] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_stop_words(tweet):\n tokens_without_sw = \"\"\n for word in tweet.split():\n if not word.lower() in STOPWORDS:\n tokens_without_sw += word.lower() + \" \"\n return tokens_without_sw",
"def sanitize_text(tokens, stopwords=None):\n\n tokens = [x.lower() for x in tokens]\n ... | [
"0.78649163",
"0.7797847",
"0.7783436",
"0.7726466",
"0.758762",
"0.7480345",
"0.7472018",
"0.74375755",
"0.7429568",
"0.7392277",
"0.73468554",
"0.7335161",
"0.7334401",
"0.7319751",
"0.72707963",
"0.7225762",
"0.7219649",
"0.72168875",
"0.71663773",
"0.7165724",
"0.71494937... | 0.70773864 | 27 |
Checks if virtual contest is not expired for ContestConnection | def _is_available_for_connection(self, cc: ContestConnection) -> bool:
if not self.is_virtual:
return True
current_time = datetime.datetime.utcnow()
if cc.created_at + self.virtual_duration < current_time:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_expired(self, now):\n if now < self._expires:\n return False\n\n return self._enclave_wait_timer.has_expired()",
"def expired(self):\n\n return self.getNotAfter() <= rpki.sundial.now()",
"def is_expired(self):\n delta = datetime.datetime.now() - self.created_at\n\... | [
"0.66460353",
"0.66195655",
"0.65851945",
"0.6571791",
"0.6556252",
"0.65527797",
"0.6542871",
"0.65180707",
"0.65102017",
"0.6508713",
"0.6484906",
"0.6455353",
"0.6455122",
"0.64407295",
"0.6427559",
"0.63789296",
"0.63726926",
"0.6370473",
"0.63626385",
"0.6359632",
"0.634... | 0.6362942 | 18 |
return an iterator which is merely the cartesian product of all pickup and dropoff points in df | def product_route(df):
L = df.shape[0]
for i in xrange(L):
# pickup location for ride i
s = df.iloc[i]
slat = s.start_lat
slng = s.start_lng
for j in xrange(L):
# dropoff location for ride j
e = df.iloc[j]
elat = e.end_lat
e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __iter__(self):\n pt = (self.x, self.y)\n for i in pt:\n yield i",
"def __iter__(self):\n for label, coord_seq in self.coords.items():\n for coordinate in coord_seq:\n yield (label, tuple(coordinate),)",
"def __iter__(self):\n for point in se... | [
"0.5707443",
"0.56446296",
"0.5617313",
"0.56168056",
"0.56060535",
"0.55785084",
"0.5525412",
"0.55237234",
"0.55204886",
"0.5518398",
"0.55162936",
"0.55141765",
"0.5503061",
"0.54939556",
"0.54819053",
"0.5477821",
"0.5476776",
"0.54637253",
"0.5436618",
"0.54228306",
"0.5... | 0.6819462 | 0 |
Sets the learning rate to the initial LR decayed by 10 every 30 epochs | def adjust_learning_rate(optimizer, epoch):
lr = learning_rate * (0.88 ** (epoch))
for param_group in optimizer.param_groups:
param_group['lr'] = lr | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr",
"def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l... | [
"0.79140896",
"0.7908034",
"0.7850816",
"0.7776915",
"0.7735598",
"0.7732588",
"0.7723862",
"0.77235436",
"0.77208304",
"0.7710736",
"0.76948273",
"0.7675381",
"0.76670265",
"0.76670265",
"0.76670265",
"0.7657111",
"0.76431805",
"0.7640621",
"0.7639109",
"0.76275903",
"0.7625... | 0.0 | -1 |
Convert this DamageStream to an object json.dump can serialize. | def to_json_serializable(self):
return {
'attacker': self.attacker,
'target': self.target,
'weapon': self.weapon,
'ticker': self.ticker,
'damage': list(self.damage),
'enemy_ships': self.enemy_ships,
'start_time': self.start_time... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dump_to_json (self):\n return json.loads(self.dump())",
"def dump(self):\n return json.dumps(self.__data)",
"def convert_to_json(self):\n return self.__dict__",
"def toJson(self):\r\n return self.__dict__",
"def cls2json(self):\n return json.dumps(self.__dict__)",
"def ... | [
"0.66100323",
"0.6317209",
"0.6255187",
"0.6210193",
"0.618827",
"0.618827",
"0.6144537",
"0.6140861",
"0.6131019",
"0.61156094",
"0.6110744",
"0.6106607",
"0.6092413",
"0.6092413",
"0.6092413",
"0.6092413",
"0.6081226",
"0.60733026",
"0.6072585",
"0.6066133",
"0.6065633",
... | 0.70822775 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.