query stringlengths 9 9.05k | document stringlengths 10 222k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Sets the killing_spree of this LolStatsTeamGame. | def killing_spree(self, killing_spree):
self._killing_spree = killing_spree | [
"def largest_killing_spree(self, largest_killing_spree):\n\n self._largest_killing_spree = largest_killing_spree",
"def kills(self, kills):\n\n self._kills = kills",
"def kills_per_min(self, kills_per_min):\n\n self._kills_per_min = kills_per_min",
"def set_king(self, king):\n self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the longest_time_spent_living of this LolStatsTeamGame. | def longest_time_spent_living(self, longest_time_spent_living):
self._longest_time_spent_living = longest_time_spent_living | [
"def max_time(self, max_time: str):\n\n self._max_time = max_time",
"def habit_longest_streak(self):\n # Clean up the console\n self.clear_console()\n # Prints the name of the application and instructions to the main menu\n self.back_to_menu_info()\n print(\"\"\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the double_kills of this LolStatsTeamGame. | def double_kills(self, double_kills):
self._double_kills = double_kills | [
"def triple_kills(self, triple_kills):\n\n self._triple_kills = triple_kills",
"def double_doubles(self, double_doubles):\n\n self._double_doubles = double_doubles",
"def unreal_kills(self, unreal_kills):\n\n self._unreal_kills = unreal_kills",
"def update_kills(self, num_kills):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the triple_kills of this LolStatsTeamGame. | def triple_kills(self, triple_kills):
self._triple_kills = triple_kills | [
"def quadra_kills(self, quadra_kills):\n\n self._quadra_kills = quadra_kills",
"def double_kills(self, double_kills):\n\n self._double_kills = double_kills",
"def turret_kills(self, turret_kills):\n\n self._turret_kills = turret_kills",
"def penta_kills(self, penta_kills):\n\n self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the quadra_kills of this LolStatsTeamGame. | def quadra_kills(self, quadra_kills):
self._quadra_kills = quadra_kills | [
"def turret_kills(self, turret_kills):\n\n self._turret_kills = turret_kills",
"def unreal_kills(self, unreal_kills):\n\n self._unreal_kills = unreal_kills",
"def update_kills(self, num_kills):\n for hero in self.heroes:\n hero.add_kill(num_kills)",
"def penta_kills(self, penta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the penta_kills of this LolStatsTeamGame. | def penta_kills(self, penta_kills):
self._penta_kills = penta_kills | [
"def update_kills(self, num_kills):\n for hero in self.heroes:\n hero.add_kill(num_kills)",
"def turret_kills(self, turret_kills):\n\n self._turret_kills = turret_kills",
"def inhibitor_kills(self, inhibitor_kills):\n\n self._inhibitor_kills = inhibitor_kills",
"def quadra_kill... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the unreal_kills of this LolStatsTeamGame. | def unreal_kills(self, unreal_kills):
self._unreal_kills = unreal_kills | [
"def turret_kills(self, turret_kills):\n\n self._turret_kills = turret_kills",
"def quadra_kills(self, quadra_kills):\n\n self._quadra_kills = quadra_kills",
"def update_kills(self, num_kills):\n for hero in self.heroes:\n hero.add_kill(num_kills)",
"def kills(self, kills):\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the total_damage_dealt of this LolStatsTeamGame. | def total_damage_dealt(self, total_damage_dealt):
self._total_damage_dealt = total_damage_dealt | [
"def total_damage_dealt_to_champions(self, total_damage_dealt_to_champions):\n\n self._total_damage_dealt_to_champions = total_damage_dealt_to_champions",
"def magic_damage_dealt(self, magic_damage_dealt):\n\n self._magic_damage_dealt = magic_damage_dealt",
"def total_damage_taken(self, total_dama... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the magic_damage_dealt of this LolStatsTeamGame. | def magic_damage_dealt(self, magic_damage_dealt):
self._magic_damage_dealt = magic_damage_dealt | [
"def magic_damage_dealt_to_champions(self, magic_damage_dealt_to_champions):\n\n self._magic_damage_dealt_to_champions = magic_damage_dealt_to_champions",
"def true_damage_dealt(self, true_damage_dealt):\n\n self._true_damage_dealt = true_damage_dealt",
"def set_damage(self, damage):\n self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the physical_damage_dealt of this LolStatsTeamGame. | def physical_damage_dealt(self, physical_damage_dealt):
self._physical_damage_dealt = physical_damage_dealt | [
"def magic_damage_dealt(self, magic_damage_dealt):\n\n self._magic_damage_dealt = magic_damage_dealt",
"def total_damage_dealt(self, total_damage_dealt):\n\n self._total_damage_dealt = total_damage_dealt",
"def true_damage_dealt(self, true_damage_dealt):\n\n self._true_damage_dealt = true_d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the true_damage_dealt of this LolStatsTeamGame. | def true_damage_dealt(self, true_damage_dealt):
self._true_damage_dealt = true_damage_dealt | [
"def magic_damage_dealt(self, magic_damage_dealt):\n\n self._magic_damage_dealt = magic_damage_dealt",
"def true_damage_dealt_to_champions(self, true_damage_dealt_to_champions):\n\n self._true_damage_dealt_to_champions = true_damage_dealt_to_champions",
"def total_damage_dealt(self, total_damage_d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the largest_critical_strike of this LolStatsTeamGame. | def largest_critical_strike(self, largest_critical_strike):
self._largest_critical_strike = largest_critical_strike | [
"def clan_chest_max_level(self, clan_chest_max_level):\n\n self._clan_chest_max_level = clan_chest_max_level",
"def __setLuredMaxRounds(self, suitId, rounds):\n if self.__suitIsLured(suitId):\n self.currentlyLuredSuits[suitId][1] = rounds",
"def max_players(self, max_players):\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the total_damage_dealt_to_champions of this LolStatsTeamGame. | def total_damage_dealt_to_champions(self, total_damage_dealt_to_champions):
self._total_damage_dealt_to_champions = total_damage_dealt_to_champions | [
"def total_damage_dealt(self, total_damage_dealt):\n\n self._total_damage_dealt = total_damage_dealt",
"def magic_damage_dealt_to_champions(self, magic_damage_dealt_to_champions):\n\n self._magic_damage_dealt_to_champions = magic_damage_dealt_to_champions",
"def true_damage_dealt_to_champions(self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the magic_damage_dealt_to_champions of this LolStatsTeamGame. | def magic_damage_dealt_to_champions(self, magic_damage_dealt_to_champions):
self._magic_damage_dealt_to_champions = magic_damage_dealt_to_champions | [
"def true_damage_dealt_to_champions(self, true_damage_dealt_to_champions):\n\n self._true_damage_dealt_to_champions = true_damage_dealt_to_champions",
"def magic_damage_dealt(self, magic_damage_dealt):\n\n self._magic_damage_dealt = magic_damage_dealt",
"def physical_damage_dealt_to_champions(self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the physical_damage_dealt_to_champions of this LolStatsTeamGame. | def physical_damage_dealt_to_champions(self, physical_damage_dealt_to_champions):
self._physical_damage_dealt_to_champions = physical_damage_dealt_to_champions | [
"def magic_damage_dealt_to_champions(self, magic_damage_dealt_to_champions):\n\n self._magic_damage_dealt_to_champions = magic_damage_dealt_to_champions",
"def true_damage_dealt_to_champions(self, true_damage_dealt_to_champions):\n\n self._true_damage_dealt_to_champions = true_damage_dealt_to_champi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the true_damage_dealt_to_champions of this LolStatsTeamGame. | def true_damage_dealt_to_champions(self, true_damage_dealt_to_champions):
self._true_damage_dealt_to_champions = true_damage_dealt_to_champions | [
"def magic_damage_dealt_to_champions(self, magic_damage_dealt_to_champions):\n\n self._magic_damage_dealt_to_champions = magic_damage_dealt_to_champions",
"def true_damage_dealt(self, true_damage_dealt):\n\n self._true_damage_dealt = true_damage_dealt",
"def total_damage_dealt_to_champions(self, t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the total_heal of this LolStatsTeamGame. | def total_heal(self, total_heal):
self._total_heal = total_heal | [
"def total_units_healed(self, total_units_healed):\n\n self._total_units_healed = total_units_healed",
"def heal(self):\n self.pkmn.setStat(\"HP\", self.hp)\n heal = self.heal.getHeal(self.pkmn)\n assert heal == self.hp/PeriodicHeal.ratio, \"Heal should be a sixteenth of the targets he... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the total_units_healed of this LolStatsTeamGame. | def total_units_healed(self, total_units_healed):
self._total_units_healed = total_units_healed | [
"def total_heal(self, total_heal):\n\n self._total_heal = total_heal",
"def total_damage_taken(self, total_damage_taken):\n\n self._total_damage_taken = total_damage_taken",
"def liabilities_total(self, liabilities_total):\n\n self._liabilities_total = liabilities_total",
"def total_stren... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the total_damage_taken of this LolStatsTeamGame. | def total_damage_taken(self, total_damage_taken):
self._total_damage_taken = total_damage_taken | [
"def total_turnover(self, total_turnover):\n\n self._total_turnover = total_turnover",
"def magic_damage_taken(self, magic_damage_taken):\n\n self._magic_damage_taken = magic_damage_taken",
"def total_damage_dealt(self, total_damage_dealt):\n\n self._total_damage_dealt = total_damage_dealt"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the magic_damage_taken of this LolStatsTeamGame. | def magic_damage_taken(self, magic_damage_taken):
self._magic_damage_taken = magic_damage_taken | [
"def set_damage(self, damage):\n self.playerDamage = damage",
"def set_player_damage(self, player_damage):\n self.player_damage = player_damage\n self.state_dict[c.PLAYER_DAMAGED] = self.player_hit()",
"def physical_damage_taken(self, physical_damage_taken):\n\n self._physical_damage... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the physical_damage_taken of this LolStatsTeamGame. | def physical_damage_taken(self, physical_damage_taken):
self._physical_damage_taken = physical_damage_taken | [
"def magic_damage_taken(self, magic_damage_taken):\n\n self._magic_damage_taken = magic_damage_taken",
"def total_damage_taken(self, total_damage_taken):\n\n self._total_damage_taken = total_damage_taken",
"def set_player_damage(self, player_damage):\n self.player_damage = player_damage\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the true_damage_taken of this LolStatsTeamGame. | def true_damage_taken(self, true_damage_taken):
self._true_damage_taken = true_damage_taken | [
"def magic_damage_taken(self, magic_damage_taken):\n\n self._magic_damage_taken = magic_damage_taken",
"def set_player_damage(self, player_damage):\n self.player_damage = player_damage\n self.state_dict[c.PLAYER_DAMAGED] = self.player_hit()",
"def physical_damage_taken(self, physical_damage... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the gold_earned of this LolStatsTeamGame. | def gold_earned(self, gold_earned):
self._gold_earned = gold_earned | [
"def gold_per_min(self, gold_per_min):\n\n self._gold_per_min = gold_per_min",
"def gold_spent(self, gold_spent):\n\n self._gold_spent = gold_spent",
"def get_gold(self, gold):\n self.gold += gold",
"def gold_medalist(self, gold_medalist):\n\n self._gold_medalist = gold_medalist",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the gold_spent of this LolStatsTeamGame. | def gold_spent(self, gold_spent):
self._gold_spent = gold_spent | [
"def gold_earned(self, gold_earned):\n\n self._gold_earned = gold_earned",
"def gold_per_min(self, gold_per_min):\n\n self._gold_per_min = gold_per_min",
"def get_gold(self, gold):\n self.gold += gold",
"def set_steals_percentage(self):\n bx = self.get_standard_stats()\n tea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the turret_kills of this LolStatsTeamGame. | def turret_kills(self, turret_kills):
self._turret_kills = turret_kills | [
"def quadra_kills(self, quadra_kills):\n\n self._quadra_kills = quadra_kills",
"def unreal_kills(self, unreal_kills):\n\n self._unreal_kills = unreal_kills",
"def update_kills(self, num_kills):\n for hero in self.heroes:\n hero.add_kill(num_kills)",
"def kills(self, kills):\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the inhibitor_kills of this LolStatsTeamGame. | def inhibitor_kills(self, inhibitor_kills):
self._inhibitor_kills = inhibitor_kills | [
"def unreal_kills(self, unreal_kills):\n\n self._unreal_kills = unreal_kills",
"def turret_kills(self, turret_kills):\n\n self._turret_kills = turret_kills",
"def penta_kills(self, penta_kills):\n\n self._penta_kills = penta_kills",
"def quadra_kills(self, quadra_kills):\n\n self._... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the total_minions_killed of this LolStatsTeamGame. | def total_minions_killed(self, total_minions_killed):
self._total_minions_killed = total_minions_killed | [
"def neutral_minions_killed_enemy_jungle(self, neutral_minions_killed_enemy_jungle):\n\n self._neutral_minions_killed_enemy_jungle = neutral_minions_killed_enemy_jungle",
"def wards_killed(self, wards_killed):\n\n self._wards_killed = wards_killed",
"def update_kills(self, num_kills):\n for... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the neutral_minions_k_illed of this LolStatsTeamGame. | def neutral_minions_k_illed(self, neutral_minions_k_illed):
self._neutral_minions_k_illed = neutral_minions_k_illed | [
"def neutral_minions_k_illed_team_jungle(self, neutral_minions_k_illed_team_jungle):\n\n self._neutral_minions_k_illed_team_jungle = neutral_minions_k_illed_team_jungle",
"def neutral_minions_killed_enemy_jungle(self, neutral_minions_killed_enemy_jungle):\n\n self._neutral_minions_killed_enemy_jungl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the neutral_minions_k_illed_team_jungle of this LolStatsTeamGame. | def neutral_minions_k_illed_team_jungle(self, neutral_minions_k_illed_team_jungle):
self._neutral_minions_k_illed_team_jungle = neutral_minions_k_illed_team_jungle | [
"def neutral_minions_killed_enemy_jungle(self, neutral_minions_killed_enemy_jungle):\n\n self._neutral_minions_killed_enemy_jungle = neutral_minions_killed_enemy_jungle",
"def neutral_minions_k_illed(self, neutral_minions_k_illed):\n\n self._neutral_minions_k_illed = neutral_minions_k_illed",
"def... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the neutral_minions_killed_enemy_jungle of this LolStatsTeamGame. | def neutral_minions_killed_enemy_jungle(self, neutral_minions_killed_enemy_jungle):
self._neutral_minions_killed_enemy_jungle = neutral_minions_killed_enemy_jungle | [
"def neutral_minions_k_illed_team_jungle(self, neutral_minions_k_illed_team_jungle):\n\n self._neutral_minions_k_illed_team_jungle = neutral_minions_k_illed_team_jungle",
"def neutral_minions_k_illed(self, neutral_minions_k_illed):\n\n self._neutral_minions_k_illed = neutral_minions_k_illed",
"def... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the total_time_crowd_control_dealt of this LolStatsTeamGame. | def total_time_crowd_control_dealt(self, total_time_crowd_control_dealt):
self._total_time_crowd_control_dealt = total_time_crowd_control_dealt | [
"def total_damage_dealt(self, total_damage_dealt):\n\n self._total_damage_dealt = total_damage_dealt",
"def set_total_time(self, total_time):\n self._total_time = total_time",
"def total_damage_dealt_to_champions(self, total_damage_dealt_to_champions):\n\n self._total_damage_dealt_to_champi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the vision_wards_bought_in_game of this LolStatsTeamGame. | def vision_wards_bought_in_game(self, vision_wards_bought_in_game):
self._vision_wards_bought_in_game = vision_wards_bought_in_game | [
"def sight_wards_bought_in_game(self, sight_wards_bought_in_game):\n\n self._sight_wards_bought_in_game = sight_wards_bought_in_game",
"def face_offs_won(self, face_offs_won):\n\n self._face_offs_won = face_offs_won",
"def wards_killed(self, wards_killed):\n\n self._wards_killed = wards_kil... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the sight_wards_bought_in_game of this LolStatsTeamGame. | def sight_wards_bought_in_game(self, sight_wards_bought_in_game):
self._sight_wards_bought_in_game = sight_wards_bought_in_game | [
"def vision_wards_bought_in_game(self, vision_wards_bought_in_game):\n\n self._vision_wards_bought_in_game = vision_wards_bought_in_game",
"def wins(self, wins):\n\n self._wins = wins",
"def fight_ways(self, fight_ways):\n\n self._fight_ways = fight_ways",
"def war_day_wins(self, war_day_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the wards_placed of this LolStatsTeamGame. | def wards_placed(self, wards_placed):
self._wards_placed = wards_placed | [
"def wards_killed(self, wards_killed):\n\n self._wards_killed = wards_killed",
"def wins(self, wins):\n\n self._wins = wins",
"def war_day_wins(self, war_day_wins):\n\n self._war_day_wins = war_day_wins",
"def tournament_cards_won(self, tournament_cards_won):\n\n self._tournament_c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the wards_killed of this LolStatsTeamGame. | def wards_killed(self, wards_killed):
self._wards_killed = wards_killed | [
"def total_minions_killed(self, total_minions_killed):\n\n self._total_minions_killed = total_minions_killed",
"def update_kills(self, num_kills):\n for hero in self.heroes:\n hero.add_kill(num_kills)",
"def kills(self, kills):\n\n self._kills = kills",
"def neutral_minions_kil... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the combat_player_score of this LolStatsTeamGame. | def combat_player_score(self, combat_player_score):
self._combat_player_score = combat_player_score | [
"def objective_player_score(self, objective_player_score):\n\n self._objective_player_score = objective_player_score",
"def set_game_auth_score(self, _score: Address) -> None:\n if self.msg.sender == self.owner:\n self._game_auth_score.set(_score)",
"def set_score(self, score: float):\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the objective_player_score of this LolStatsTeamGame. | def objective_player_score(self, objective_player_score):
self._objective_player_score = objective_player_score | [
"def combat_player_score(self, combat_player_score):\n\n self._combat_player_score = combat_player_score",
"def set_score(self, score: float):\n self.score = score",
"def priority_score(self, priority_score):\n\n self._priority_score = priority_score",
"def set_score(self, score):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the total_player_score of this LolStatsTeamGame. | def total_player_score(self, total_player_score):
self._total_player_score = total_player_score | [
"def total_score(self, total_score):\n self._total_score = total_score",
"def get_total_score(self):\n\n # Return the player's total score\n return self._total_score",
"def objective_player_score(self, objective_player_score):\n\n self._objective_player_score = objective_player_score... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the fantasy_points of this LolStatsTeamGame. | def fantasy_points(self, fantasy_points):
self._fantasy_points = fantasy_points | [
"def fantasy_points_fantasy_draft(self, fantasy_points_fantasy_draft):\n\n self._fantasy_points_fantasy_draft = fantasy_points_fantasy_draft",
"def fantasy_points_fan_duel(self, fantasy_points_fan_duel):\n\n self._fantasy_points_fan_duel = fantasy_points_fan_duel",
"def fantasy_points_draft_kings(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the ten_kills_or_assists of this LolStatsTeamGame. | def ten_kills_or_assists(self, ten_kills_or_assists):
self._ten_kills_or_assists = ten_kills_or_assists | [
"def update_kills(self, num_kills):\n for hero in self.heroes:\n hero.add_kill(num_kills)",
"def turret_kills(self, turret_kills):\n\n self._turret_kills = turret_kills",
"def penta_kills(self, penta_kills):\n\n self._penta_kills = penta_kills",
"def setrounds(self, number):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the games of this LolStatsTeamGame. | def games(self, games):
self._games = games | [
"def fill(self, games):\n try:\n self.sport = games[0].sport\n self.league = games[0].league\n except IndexError:\n return games\n \n odds_dict = self._request()\n \n for game in games:\n vegas_odds = self._get_matching_odds(game,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the matches of this LolStatsTeamGame. | def matches(self, matches):
self._matches = matches | [
"def update_matches(self):\n\n player_standings = self.playerStandings()\n assert len(player_standings) % 2 == 0\n\n # Generate matchups from playerStandings\n # player_standings is ordered, so consecutive players are paired up.\n matchups = [\n (player_standings[x][0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the is_closed of this LolStatsTeamGame. | def is_closed(self, is_closed):
self._is_closed = is_closed | [
"def closed(self, closed):\n\n self._closed = closed",
"def setClosed(self, flag, add = 1): \n\t\tLogging.info(\"Track is closed: %s\" % (flag != 0), kw = \"animator\")\n\t\tself.closed = flag\n\t\tself.splineEditor.setClosed(flag)\n\t\tself.paintTrack()\n\t\tself.Refresh()",
"def closed_time(self, c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate the gt targets for DRRG. | def generate_targets(self, data):
assert isinstance(data, dict)
image = data['image']
polygons = data['polys']
ignore_tags = data['ignore_tags']
h, w, _ = image.shape
polygon_masks = []
polygon_masks_ignore = []
for tag, polygon in zip(ignore_tags, poly... | [
"def make_targets(tgt_re, samples, target_suffix=\"\"):\n tgts = list(set(tgt_re.fmt.format(**unit) + target_suffix for unit in samples))\n return tgts",
"def generate_targets(self):\n # Generate the GT parameters first\n target_params = np.zeros((self.BATCH_SIZE, 85))\n target_params =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
There is an UpgradeConfig on the cluster, its upgradeAt is in the past, and we did not already notify | def test_new_upgrade_notify(
mocker, state, slack, ouw_oc_map, ouw_ocm_map, upgrade_config, dt
):
dt.utcnow.return_value = upgrade_at + timedelta(hours=1)
gso = mocker.patch(
"reconcile.openshift_upgrade_watcher._get_start_osd", autospec=True
)
gso.return_value = upgrade_at.strftime("%Y-%m-%... | [
"def _on_upgrade_charm(self, _):\n # update config hash\n self._stored.config_hash = (\n \"\"\n if not self.container.can_connect()\n else sha256(yaml.safe_dump(yaml.safe_load(self.container.pull(self._config_path))))\n )\n\n # After upgrade (refresh), th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We already notified for this cluster, but on an old version | def test_new_version_notify(mocker, state, slack, clusters):
state.exists.return_value = True
state.get.return_value = old_version # different version
ouw.notify_cluster_new_version(clusters, state=state, slack=slack)
assert slack.chat_post_message.call_count == 1
assert state.add.call_count == 1 | [
"def _on_upgrade(self, event):\n self._notify_consumers()",
"def notify_old_hits():\n if notify_old_hits.done:\n return\n notify_old_hits.done = True\n hits_overlay_dist = os.path.join(PLUGDIR, \"HITS\", \"EDMCOverlay\", \"EDMCOverlay.exe\")\n if os.path.exists(hits_overlay_dist):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a list of file names using a time range, resoution and file format Based on Davin Larson's file_dailynames in IDL SPEDAS | def dailynames(directory='',
trange=None,
res=24*3600.,
hour_res=False,
file_format='%Y%m%d',
prefix='',
suffix='',
return_times=False):
if trange is None:
logging.error('No trange specified')
re... | [
"def create_filenames(date):\n \n filelist = list()\n for t in [\"0000\", \"0600\", \"1200\", \"1800\"]:\n for t2 in [\"000\", \"003\"]:\n filelist.append(\"gfsanl_4_\"+d.strftime('%Y%m%d')+\"_\"+t+\"_\"+t2+\".grb2\")\n return filelist",
"def file_name_list():\n file_names = []\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List of columns that can be split on, i.e. that have more than one unique value Returns List[int] List of column numbers that can be split on | def splittable_variables(self) -> List[int]:
#print("enter bartpy/bartpy/data.py CovariateMatrix splittable_variables")
for i in range(0, self._n_features):
if self._splittable_variables[i] is None:
self._splittable_variables[i] = is_not_constant(self.get_column(i))
... | [
"def get_split_col_names():\n return ['dna_%d' % (idx+1) for idx in range(60)]",
"def get_id_columns(df):\n id_cols = []\n cols= df.columns\n df_len = len(df)\n for column in cols:\n if df[column].nunique() == df_len:\n id_cols.append(column)\n\n return id_cols",
"def getColu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Choose a variable at random from the set of splittable variables Returns str a variable name that can be split on | def random_splittable_variable(self) -> str:
#print("enter bartpy/bartpy/data.py CovariateMatrix random_splittable_variable")
if self.is_at_least_one_splittable_variable():
output = np.random.choice(np.array(self.splittable_variables()), 1)[0]
#print("-exit bartpy/bartpy... | [
"def select_word_at_random(word_select)-> str:\n words_tuple = []\n if word_select != 'FIXED' and word_select != 'ARBITRARY':\n print('not fixed or arbitrary')\n return None\n else:\n words_tuple = load_words(word_select)\n word_index ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Normalize y into the range (0.5, 0.5) Useful for allowing the leaf parameter prior to be 0, and to standardize the sigma prior | def normalize_y(y: np.ndarray) -> np.ndarray:
#print("enter bartpy/bartpy/data.py Target normalize_y")
y_min, y_max = np.min(y), np.max(y)
output = -0.5 + ((y - y_min) / (y_max - y_min))
#print("-exit bartpy/bartpy/data.py Target normalize_y")
return output | [
"def norm_y(y):\n return (y - min_y) / (max_y - min_y)",
"def normalize(self, external=None):\n if external is None:\n return np.max(self.y)\n else:\n return self.y/external",
"def normalize(y, x=None):\n x = 1. if x is None else x\n return (y.T * rms(x) / rms(y)).T"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update or provide information about updating stored credentials. This function is an interactive helper to update credentials stored in disk from IBM Quantum Experience v1 to v2. Upon invocation, the function will inspect the credentials stored in disk and attempt to convert them to the new version, displaying the chan... | def update_credentials(force: bool = False) -> Optional[Credentials]:
# Get the list of stored credentials.
stored_credentials, _ = read_credentials_from_qiskitrc()
credentials_list = list(stored_credentials.values())
new_credentials = []
hub_lines = []
warnings = []
provider_number = 1
... | [
"def testUpdateCredentials(self):\r\n \r\n credentials = dict()\r\n credentials[\"username\"] = \"\"\r\n credentials[\"password\"] = \"\"\r\n self._factory.updateCredentials(credentials)",
"def update_cli_credentials(self, **kwargs):\n\n return self.api_request(self._get_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns ``True`` if credentials can be updated directly. | def is_directly_updatable(credentials: Credentials) -> bool:
if credentials.base_url == QE_URL:
return True
if credentials.base_url in (QCONSOLE_URL, QE2_URL, QCONSOLE2_URL):
if credentials.base_url == credentials.url:
return True
return False | [
"def _check_credentials():\n if hasattr(S3.credentials, \"refresh_needed\"):\n if S3.credentials.refresh_needed():\n return True\n else:\n return False\n else:\n return True",
"def are_credentials_valid(self):\n try:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Receives expected words to look for and calculates a proper rank based on how many words are actually found | def _calculate_rank_result(words, content):
found = 0
for word in words:
# NOTE: We could use regex, but since we might avoid libs
# we're going to filter stuff ourselves
begin_word = f"{word} "
end_word = f" {word}"
middle_word = f" {word} "
if word == content:
... | [
"def _calculate_ranking(self, files_found_by_word: Dict[str, int],\n words: List[str]) -> List[Tuple[str, float]]:\n size_words = len(words)\n words_percentage_hit = [(k, v / size_words) for (k, v) in files_found_by_word.items()]\n return words_percentage_hit",
"def ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Escape reserved language keywords like openapi generator does it. | def escape_reserved_keyword(word):
reserved_keywords = ["from"]
if word in reserved_keywords:
return f"_{word}"
return word | [
"def esc_kw(kw):\n kw = kw.replace('\\\\', '\\\\\\\\') # be sure to do this first, as we inject \\!\n kw = kw.replace('(', '\\(')\n kw = kw.replace(')', '\\)')\n kw = kw.replace('+', '\\+')\n kw = kw.replace('-', '\\-')\n kw = kw.replace(':', '\\:')\n kw = kw.replace('/', '\\/')\n kw = kw.re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a valid Application key. | def a_valid_application_key(configuration):
configuration.api_key["appKeyAuth"] = os.getenv("DD_TEST_CLIENT_APP_KEY", "fake") | [
"def get_app_key(self):\n return self.app_key",
"def validate_key(self, key):\n\t\treturn key",
"def app_key(self, app_key):\n if self.local_vars_configuration.client_side_validation and app_key is None: # noqa: E501\n raise ValueError(\"Invalid value for `app_key`, must not be `None`\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable the unstable operation specific in the clause. | def operation_enabled(client, name):
client.configuration.unstable_operations[snake_case(name)] = True | [
"def disabledPeriodic(self):",
"def setEnableCondition(*args):",
"def disabledPeriodic(self):\n self.putData()",
"def enable():\n atop_enable()\n thread_enable()",
"def disable():\n atop_disable()\n thread_disable()",
"def enabled(self, enable):\n #ic()\n pass",
"def ena... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check that a response path has field. | def expect_response_has_field(context, response_path, field):
response_value = glom(context["api_request"]["response"][0], response_path)
assert field in response_value | [
"def _check_valid_field(self, field):\n exists = False\n if field in self.resource.fields_dict:\n exists = True\n return exists",
"def has(self, subpath):\n subpath = self._path + '.' + subpath\n return check_layer_field_exists(self._packet, subpath) is not None",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the channel_type of this WrappedChannel. | def channel_type(self, channel_type):
if channel_type is None:
raise ValueError("Invalid value for `channel_type`, must not be `None`") # noqa: E501
self._channel_type = channel_type | [
"def channels_set_type(self, room_id, a_type, **kwargs):\n return self.__call_api_post('channels.setType', roomId=room_id, type=a_type, kwargs=kwargs)",
"def c_type(self, c_type):\n\n self._c_type = c_type",
"def set_type(self, type):\n self.type = type",
"def set_channel(cls, channel):\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the unit of this WrappedChannel. | def unit(self, unit):
if unit is None:
raise ValueError("Invalid value for `unit`, must not be `None`") # noqa: E501
self._unit = unit | [
"def setUnit(self,\n unit):\n # IMPL.: Check format etc.\n self.__unit = unit\n return self",
"def set_unit(self,unit):\n self.unit = unit",
"def unit(self, unit: str):\n\n self._unit = unit",
"def SetUnit(self, unit, axis='z'):\n callResult = self._Cal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the last_annotation of this WrappedChannel. | def last_annotation(self, last_annotation):
if last_annotation is None:
raise ValueError("Invalid value for `last_annotation`, must not be `None`") # noqa: E501
self._last_annotation = last_annotation | [
"def last(self, last):\n\n self._last = last",
"def setLastValue(self, last):\n self.lastVal = last",
"def timestamp_last(self, timestamp_last):\n self._timestamp_last = timestamp_last",
"def annotation(self, annotation):\n\n self._annotation = annotation",
"def last_occurrence(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the spike_duration of this WrappedChannel. | def spike_duration(self, spike_duration):
self._spike_duration = spike_duration | [
"def set_duration(self, duration_secs):\n raise UnsupportedOperation('Duration not implemented')",
"def set_duration(self, duration):\n \n self.duration = float(duration)",
"def setDuration(self, duration):\n self.duration = duration",
"def duration(self, duration):\n self._... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the package_id of this WrappedChannel. | def package_id(self, package_id):
if package_id is None:
raise ValueError("Invalid value for `package_id`, must not be `None`") # noqa: E501
self._package_id = package_id | [
"def package_id(self, package_id):\n\n self._package_id = package_id",
"def channel_id(self, channel_id):\n \n self._channel_id = channel_id",
"def package(self, package):\n self._package = package",
"def package(self, package):\n\n self._package = package",
"def packagefa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute the clustering objective for X and C | def compute_objective(X, C):
# similar as mse
acc = 0
for x in range(len(X)):
acc += (nearest_distance(X.iloc[x], C)) ** 2
return acc | [
"def compute_objective(X, C):\n #iterate through all of the data points and the final cluster centers and compute\n #the sum of all distances between each point and their assigned clusters\n \n #calculating distance between centroids and points + assigning data to clusters\n pair_dist = sp.spatial.di... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Records plant type and name | def plants (plant_name, plant_type):
print (f"\n{plant_name.title()} is a {plant_type}. \n") | [
"def plant (type, age, name= ''):\n if name:\n plantid = f\"{type} {age} {name}\"\n else:\n plantid = f\"{type} {age}\\n\"\n return plantid.title ()",
"def addPlant(self, plant):\n pass",
"def generate_plant_report(self):\n print('PLANTS IN ' + self.name)\n for specie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Records plant type, age, and name. | def plant (type, age, name= ''):
if name:
plantid = f"{type} {age} {name}"
else:
plantid = f"{type} {age}\n"
return plantid.title () | [
"def plants (plant_name, plant_type):\n print (f\"\\n{plant_name.title()} is a {plant_type}. \\n\")",
"def generate_plant_report(self):\n print('PLANTS IN ' + self.name)\n for species, count in self.plants.items():\n print(f'{species}: {count}')",
"def addPlant(self, plant):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Records tree type, climate found. | def trees (type, climate):
formatted = f"{type} {climate}"
return formatted.title() | [
"def check_tree_type(tree):\n return tree.type in ref",
"def get_cancer_types(oncotree, code, spreadsheet_fields):\n\n first = True\n header = []\n cancer_type = NA\n cancer_type_detailed = NA\n primary_node = NA\n for line in oncotree:\n if first:\n header = line.sp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return lines in both a and b | def lines(a, b):
a = set(a.split('\n'))
b = set(b.split('\n'))
return a & b | [
"def lines(a, b):\n first_line = set(a.split('\\n'))\n second_line = set(b.split('\\n'))\n\n \"\"\"Contexto en la primera línea\"\"\"\n return first_line & second_line",
"def lines(a, b):\n\n # obtiene las lineas parecidas\n listaA = set(a.split(\"\\n\"))\n listaB = set(b.split(\"\\n\"))\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Each read is remaped to alternative cds alignment with highest coverage. Coverage for modified cds alignments is then recalculated. Given cds alignment is deleted from container. | def remove_cds_and_remap_reads(self, cds_aln):
super(GreedySolver, self).remove_cds_and_remap_reads(cds_aln)
# Dictionary where key is read_id and value is cds alignment to which it maps.
# If it does not map to any cds alignment then value is None.
new_read_mappings = {}
for al... | [
"def mergeChainedAlignedSegments(chainedAlignedSegments, refSequence, readSequence):\n cAR = pysam.AlignedSegment()\n aR = chainedAlignedSegments[0]\n cAR.query_name = aR.query_name\n \n #Parameters we don't and therefore set properly\n #cAR.flag = aR.flag\n #cAR.mapq = aR.mapq\n #cAR.mrnm =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If coverage was already calculated before then it is just returned. Otherwise coverage is calculated, stored for later and then returned. (CdsAlignment) cds_aln (float) coverage | def _get_coverage(self, cds_aln):
if not (cds_aln in self._coverages):
self._coverages[cds_aln] = self._calc_coverage(cds_aln)
return self._coverages[cds_aln] | [
"def _calc_coverage(self, cds_aln):\n # Aligned region is part of a read that intersects with cds.\n coverage = 0\n for aln_reg in cds_aln.aligned_regions.values(): # aln_reg is of type CdsAlnSublocation\n location = aln_reg.location # location is of type Location\n covera... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates coverage of given cds alignment. Coverage is calculated as sum of lengths of aligned regions divided by length of cds. (CdsAlignment) cds_aln (float) coverage | def _calc_coverage(self, cds_aln):
# Aligned region is part of a read that intersects with cds.
coverage = 0
for aln_reg in cds_aln.aligned_regions.values(): # aln_reg is of type CdsAlnSublocation
location = aln_reg.location # location is of type Location
coverage += loca... | [
"def _get_coverage(self, cds_aln):\n if not (cds_aln in self._coverages):\n self._coverages[cds_aln] = self._calc_coverage(cds_aln)\n return self._coverages[cds_aln]",
"def calculate_coverage(path, alignment, number_of_fastas):\n\n path_to_alignment = path + 'Modeling/fasta_alns_and_id... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Run a kubectl command. | def RunKubectlCommand(command: List[str], **kwargs):
cmd = [FLAGS.kubectl, '--kubeconfig', FLAGS.kubeconfig] + command
return vm_util.IssueCommand(cmd, **kwargs) | [
"def kubectl(self, command, check=True, log_stdout=True, log_stderr=True):\n return common.execute(\n f\"{self.kubectl_exec} --kubeconfig {self.kubeconfig}\"\n f\" {command}\",\n check=check,\n capture=True,\n log_stdout=log_stdout,\n log_stde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply flag settings to the container spec. | def _ApplyFlags(cls, config_values, flag_values):
super(ContainerSpec, cls)._ApplyFlags(config_values, flag_values)
if flag_values['image'].present:
config_values['image'] = flag_values.image
if flag_values['static_container_image'].present:
config_values['static_image'] = flag_values.static_con... | [
"def _ApplyFlags(cls, config_values, flag_values):\n super(ContainerRegistrySpec, cls)._ApplyFlags(config_values, flag_values)\n if flag_values['cloud'].present or 'cloud' not in config_values:\n config_values['cloud'] = flag_values.cloud\n if flag_values['container_cluster_cloud'].present:\n con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets decoder classes and constructor args for each configurable option. Can be overridden by derived classes to add options or impose additional requirements on existing options. | def _GetOptionDecoderConstructions(cls):
result = super(ContainerSpec, cls)._GetOptionDecoderConstructions()
result.update({
'image': (option_decoders.StringDecoder, {
'default': None
}),
'static_image': (option_decoders.BooleanDecoder, {
'default': False
... | [
"def _GetOptionDecoderConstructions(cls):\n result = super()._GetOptionDecoderConstructions()\n result.update({\n 'enable_freeze_restore': (option_decoders.BooleanDecoder, {\n 'default': False,\n 'none_ok': True\n }),\n 'delete_on_freeze_error': (option_decoders.Bool... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply flag values to the spec. | def _ApplyFlags(cls, config_values, flag_values):
super(ContainerRegistrySpec, cls)._ApplyFlags(config_values, flag_values)
if flag_values['cloud'].present or 'cloud' not in config_values:
config_values['cloud'] = flag_values.cloud
if flag_values['container_cluster_cloud'].present:
config_values... | [
"def _ApplyFlags(cls, config_values, flag_values):\n super(ContainerSpec, cls)._ApplyFlags(config_values, flag_values)\n if flag_values['image'].present:\n config_values['image'] = flag_values.image\n if flag_values['static_container_image'].present:\n config_values['static_image'] = flag_values.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns image build related samples. | def GetSamples(self):
samples = []
metadata = self.GetResourceMetadata()
for image_name, build_time in self.local_build_times.items():
metadata.update({
'build_type': 'local',
'image': image_name,
})
samples.append(
sample.Sample('Image Build Time', build_time... | [
"def build_samples(self):\n\n\t\ttracks = {}\n\n\t\tfor sample in self.data:\n\t\t\tim = sample['im']\n\t\t\tidentity = sample['id']\n\n\t\t\tif identity in tracks:\n\t\t\t\ttracks[identity].append(sample)\n\t\t\telse:\n\t\t\t\ttracks[identity] = []\n\t\t\t\ttracks[identity].append(sample)\n\n\t\t# sample max_per_p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build the image remotely. | def RemoteBuild(self, image):
raise NotImplementedError() | [
"def dockerbuild():\r\n hostout = api.env.hostout\r\n path = api.env.path\r\n client = myclient(**kwargs_from_env(assert_hostname=False))\r\n hostimage = api.env.get('hostimage', 'alpine')\r\n params = dict(user=api.env['buildout-user'],\r\n group=api.env['buildout-group'],\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build the image locally and push to registry. Assumes we are already authenticated with the registry from self.Login. Building and pushing done in one command to support multiarch images | def LocalBuildAndPush(self, image):
full_tag = self.GetFullRegistryTag(image.name)
# Multiarch images require buildx create
# https://github.com/docker/build-push-action/issues/302
vm_util.IssueCommand(['docker', 'buildx', 'create', '--use'])
cmd = ['docker', 'buildx', 'build']
if _CONTAINER_CLU... | [
"def RemoteBuild(self, image):\n raise NotImplementedError()",
"def build_local():\n try:\n subprocess.call(f'docker build -t {PROJECT_NAME}:local -f Dockerfile.local .', shell=True)\n finally:\n print(\"Built 'local' tagged docker image successfully\")",
"def build_image(host, version, b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the image in the registry or builds it. | def GetOrBuild(self, image):
full_image = self.GetFullRegistryTag(image)
# Log in to the registry to see if image exists
self.Login()
if not FLAGS.force_container_build:
# manifest inspect inpspects the registry's copy
inspect_cmd = ['docker', 'manifest', 'inspect', full_image]
_, _, r... | [
"def _build_or_get_image(name: str) -> NoReturn:\n conf_data = _get_config_data(name)\n if \"docker-image\" in conf_data.keys():\n image_name = conf_data[\"docker-image\"]\n if image_name is not None:\n # Register Docker image.\n print(\n f\"{_get_constant('M... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the value for the kubeconfig flag if it's unspecified. | def _SetKubeConfig(unused_sender, benchmark_spec):
if not FLAGS.kubeconfig:
FLAGS.kubeconfig = vm_util.PrependTempDir(
'kubeconfig' + str(benchmark_spec.sequence_number))
# Store the value for subsequent run stages.
benchmark_spec.config.flags['kubeconfig'] = FLAGS.kubeconfig | [
"def kubeconfig(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"kubeconfig\")",
"def _load_kubernetes_config(self):\n (\n kubernetes.config.load_incluster_config()\n if self._config_location == ConfigLocation.INCLUSTER\n else kubernetes.config.load_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clean node pool names to be usable by all providers. | def NodePoolName(name: str) -> str:
# GKE (or k8s?) requires nodepools use alphanumerics and hyphens
# AKS requires full alphanumeric
# PKB likes to use underscores strip them out.
return name.replace('_', '') | [
"def _ValidateUniqueNames(pools):\n used_names = set()\n for pool in pools:\n name = pool.nodePool\n if name in used_names:\n raise exceptions.InvalidArgumentException(\n '--pools', 'Pool name \"%s\" used more than once.' % name)\n used_names.add(name)",
"def remove_pools(ct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete services belonging to the cluster. | def DeleteServices(self):
for service in self.services.values():
service.Delete() | [
"def delete_cluster_service(self, cluster_name, service_name):\n return self._delete(endpoint='{}/clusters/{}/services/{}'.format(self.api_version,\n cluster_name,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deploys a ContainerSerivice according to the ContainerSpec. | def DeployContainerService(self, name, container_spec, num_containers):
raise NotImplementedError() | [
"def DeployContainer(self, base_name, container_spec):\n name = base_name + str(len(self.containers[base_name]))\n container = KubernetesContainer(container_spec=container_spec, name=name)\n self.containers[base_name].append(container)\n container.Create()",
"def service_create(container, cconfig, sys... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return samples with information about deployment times. | def GetSamples(self):
samples = super().GetSamples()
for container in itertools.chain(*list(self.containers.values())):
metadata = {'image': container.image.split('/')[-1]}
if container.resource_ready_time and container.create_start_time:
samples.append(
sample.Sample(
... | [
"def GetSamples(self):\n samples = []\n metadata = self.GetResourceMetadata()\n for image_name, build_time in self.local_build_times.items():\n metadata.update({\n 'build_type': 'local',\n 'image': image_name,\n })\n samples.append(\n sample.Sample('Image Build Tim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a representation of the POD and returns it. | def _GetPod(self) -> Dict[str, Any]:
stdout, _, _ = RunKubectlCommand(['get', 'pod', self.name, '-o', 'yaml'])
pod = yaml.safe_load(stdout)
self.ip_address = pod.get('status', {}).get('podIP')
return pod | [
"def pod(self):\n return self._pod",
"def getPODModel(self):\n return self._PODmodel",
"def _get_pad_content(self):\n self.ensure_one()\n return self.pad_get_content(self.description_pad)",
"def to_dok(self):\n return self.to_ddm().to_dok()",
"def __repr__(self):\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes all resources from a namespace. Since StatefulSets do not reclaim PVCs upon deletion, they are explicitly deleted here to prevent dynamically provisioned PDs from leaking once the cluster has been deleted. | def _DeleteAllFromDefaultNamespace(self):
run_cmd = [
'delete', 'all', '--all', '-n', 'default'
]
RunKubectlCommand(run_cmd)
run_cmd = [
'delete', 'pvc', '--all', '-n', 'default'
]
RunKubectlCommand(run_cmd)
# There maybe a slight race if resources are cleaned up in the back... | [
"def delete_resources(self):\n logger.info(\"Deleting resources as a sanity functional validation\")\n\n self.delete_obc()\n\n for pod_obj in self.pod_objs:\n pod_obj.delete()\n for pod_obj in self.pod_objs:\n pod_obj.ocp.wait_for_delete(pod_obj.name)\n for p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deploys Containers according to the ContainerSpec. | def DeployContainer(self, base_name, container_spec):
name = base_name + str(len(self.containers[base_name]))
container = KubernetesContainer(container_spec=container_spec, name=name)
self.containers[base_name].append(container)
container.Create() | [
"def DeployContainerService(self, name, container_spec, num_containers):\n raise NotImplementedError()",
"def deploy(tag,num, names):\n len=0\n click.echo('*** DEPLOYMENT IS INITIATED\\n')\n for name in names:\n len+=1\n if (num==len):\n for name in names:\n try:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies a declarative Kubernetes manifest; possibly with jinja. | def ApplyManifest(self, manifest_file, **kwargs):
filename = data.ResourcePath(manifest_file)
if not filename.endswith('.j2'):
assert not kwargs
RunKubectlCommand(['apply', '-f', filename])
return
environment = jinja2.Environment(undefined=jinja2.StrictUndefined)
with open(filename) a... | [
"def deploy_deployment_with_config_map(self, versioned):\n deployment_name = self.TEST_APP + \"-deployment\"\n deployment = self.mf.deployment(deployment_name, \"library/nginx\")\n configmap_name = self.TEST_APP + \"-configmap\"\n configmap = self.mf.config_map(configmap_name, {\"key\": ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Blocks until a Kubernetes rollout is completed. | def WaitForRollout(self, resource_name):
run_cmd = [
'rollout',
'status',
'--timeout=%ds' % vm_util.DEFAULT_TIMEOUT,
resource_name
]
RunKubectlCommand(run_cmd) | [
"def wait_operational(self, timeout):\n def wo():\n status = self.get_status()['status']\n if status == \"error\":\n raise Exception(\"Cluster deploy failed\")\n return self.get_status()['status'] == 'operational'\n with_timeout(timeout, \"deploy cluster... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the IP address of a LoadBalancer service when ready. | def GetLoadBalancerIP(self, service_name):
get_cmd = [
'get', 'service', service_name, '-o',
'jsonpath={.status.loadBalancer.ingress[0].ip}'
]
stdout, _, _ = RunKubectlCommand(get_cmd)
try:
# Ensure the load balancer is ready by parsing the output IP
ip_address = ipaddress.... | [
"def get_load_balancer_ip(cluster_config):\n cluster = load_cluster_config_json(cluster_config)\n\n lb_ip = cluster[\"load_balancers\"][0][\"ip\"]\n return lb_ip",
"def load_balancer(self) -> Optional[pulumi.Input['_core.v1.LoadBalancerStatusArgs']]:\n return pulumi.get(self, \"load_balancer\")",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the IP address of a ClusterIP service when ready. | def GetClusterIP(self, service_name) -> str:
get_cmd = [
'get', 'service', service_name, '-o', 'jsonpath={.spec.clusterIP}'
]
stdout, _, _ = RunKubectlCommand(get_cmd)
if not stdout:
raise errors.Resource.RetryableCreationError(
"ClusterIP for service '%s' is not ready." % serv... | [
"def ClusterIp(self) -> Optional[str]:\n cluster_ip = self.Read().spec.cluster_ip # type: Optional[str]\n return cluster_ip",
"def get_node_ip():\n cidr = cluster_cidr()\n if cidr and is_ipv6_preferred(cidr):\n return get_ingress_address6(\"kube-control\")\n else:\n return get_ingres... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a Kubernetes ConfigMap. | def CreateConfigMap(self, name, from_file_dir):
RunKubectlCommand(
['create', 'configmap', name, '--from-file', from_file_dir]) | [
"def create_configmap(self, request, namespace):\n return self._create(request, u\"configmaps\")",
"def create_configmap(\n name, namespace, data, source=None, template=None, saltenv=\"base\", **kwargs\n):\n if source:\n data = __read_and_render_yaml_file(source, template, saltenv)\n el... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a k8s service account and clusterrolebinding. | def CreateServiceAccount(self,
name: str,
clusterrole: Optional[str] = None,
namespace='default'):
RunKubectlCommand(
['create', 'serviceaccount', name, '--namespace', namespace])
if clusterrole:
# TODO(pclay): Suppor... | [
"def create_role():\n headers = {\"X-Vault-Token\": args.x_vault_token}\n data = {\n \"bound_service_account_names\": args.k8s_service_account,\n \"bound_service_account_namespaces\": args.k8s_namespace,\n \"policies\": args.vault_policies.split(','),\n \"ttl\": arg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Usable memory of each node in cluster in KiB. | def node_memory_allocatable(self) -> units.Quantity:
stdout, _, _ = RunKubectlCommand(
# TODO(pclay): Take a minimum of all nodes?
[
'get', 'nodes', '-o',
'jsonpath={.items[0].status.allocatable.memory}'
])
return units.ParseExpression(stdout) | [
"def aggregated_free_memory(self):\n total = 0\n for node_id_, node in self.nodes.items():\n total += node.node_free_memory()\n return total",
"def fetch_available_memory_for_kv_on_a_node(self):\n info = self.rest.get_nodes_self()\n free_memory_in_mb = info.memoryFree... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
vCPU of each node in cluster. | def node_num_cpu(self) -> int:
stdout, _, _ = RunKubectlCommand(
['get', 'nodes', '-o', 'jsonpath={.items[0].status.capacity.cpu}'])
return int(stdout) | [
"def vcpus(self):\n return self._vcpus",
"def vCPU_calculator(self):\r\n\r\n return self.vm_obj.config.hardware.numCPU",
"def _apply_vpp_cpu(node):\n\n # Get main core\n cpu = \"\\n\"\n if \"vpp_main_core\" in node[\"cpu\"]:\n vpp_main_core = node[\"cpu\"][\"vpp_mai... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Actual Kubernetes version reported by server. | def k8s_version(self) -> str:
stdout, _, _ = RunKubectlCommand(['version', '-o', 'yaml'])
return yaml.safe_load(stdout)['serverVersion']['gitVersion'] | [
"def kubernetes_version(self) -> str:\n return pulumi.get(self, \"kubernetes_version\")",
"def kubernetes_version(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"kubernetes_version\")",
"def version(self):\n response = self._request_call('/version')\n return response.version... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a list of internal IPs for pod label keyvalue. | def GetPodIpsByLabel(self, pod_label_key, pod_label_value) -> List[str]:
get_cmd = [
'get', 'pods', '-l', f'{pod_label_key}={pod_label_value}',
'-o', 'jsonpath="{.items[*].status.podIP}"'
]
stdout, _, _ = RunKubectlCommand(get_cmd)
return yaml.safe_load(stdout).split() | [
"def get_vtep_ip_by_label(cls, client_object, label=None):\n nsxa_socket = cls._get_nsxa_socket(client_object)\n cmd = '%s -t %s vtep/ip %%s' % (cls.CLI, nsxa_socket)\n out = client_object.connection.request(\n cmd % label).response_data.strip()\n return utilities.parse_one_li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a list of internal IPs for a pod name. | def GetPodIps(self, resource_name) -> List[str]:
pod_label = self.GetPodLabel(resource_name)
return self.GetPodIpsByLabel('app', pod_label) | [
"def get_iplist(name):\n\n global IP_RRTYPES\n iplist = []\n for rrtype in IP_RRTYPES:\n msg = dns.resolver.resolve(name, rrtype,\n raise_on_no_answer=False).response\n for rrset in msg.answer:\n if rrset.rdtype != rrtype:\n continue... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Propagate cluster labels to disks if not done by cloud provider. | def LabelDisks(self):
pass | [
"def set_disk_labels(layout, layout_config):\n # TODO: Trace disk generator and inject this\n partition_tables = layout_config.get('partition_tables')\n for partition_table in partition_tables:\n label = partition_table.get('label')\n if label:\n LOG.info('Table: %s is set as %s in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creation of a Concrete Model, specify the countries and sectors to include. | def __init__(self, name, list_countries,list_sectors,EORA=False,list_fd_cats=[]):
self.name = name
self.m = ConcreteModel()
self.countries = list_countries
self.total_countries = len(list_countries)
self.sectors = list_sectors
self.fd_cat = list_fd_cats
if EORA is... | [
"def __init__(self, name, list_countries,list_sectors,list_products,EORA=False):\n self.name = name\n self.m = ConcreteModel()\n self.countries = list_countries\n self.total_countries = len(list_countries)\n self.sectors = list_sectors\n self.products = list_products\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creation of the various sets. First step in futureproofing by allowing for own specification of set inputs | def create_sets(self,FD_SET=[],VA_SET=[]):
self.m.S = Set(initialize=self.sectors, doc='sectors')
if self.EORA is True:
self.m.rROW = Set(initialize=self.countries+['ROW'],ordered=True, doc='regions including export')
self.m.R = Set(initialize=self.countries+['ROW'],ord... | [
"def create_sets(self,FD_SET=['FinalD'],VA_SET=['VA']):\n \n self.m.S = Set(initialize=self.sectors, doc='sectors')\n self.m.P = Set(initialize=self.products, doc='sectors')\n self.m.row = Set(initialize=self.products, doc='products')\n self.m.col = Set(initialize=self.sectors+['Fi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |