query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Finds the active (in focus, last clicked) spinbox and increases or decreases its value, based on the button that was pressed | def spinbox_control(self, action):
# Gets the current tab, so that it can check which of the spinboxes currently shown is
# in focus, or choose one to be in focus
c_tab = self.tabWidget.currentIndex()
tab_content = {0:[self.VCV_frequency_spb,
self.VCV_volume_sp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_spinBox_valueChanged(self, p0):\n self.nbr_pts_caracterisation = self.spinBox.value()",
"def numeric_toggled_cb(src_widget, data):\n\n spin_button = data\n check_button = src_widget\n\n spin_button.set_numeric(check_button.get_active())",
"def _b_spin_changed(self):\n self.bLine.s... | [
"0.6725767",
"0.6580369",
"0.63271296",
"0.62209195",
"0.6159946",
"0.6156558",
"0.6142189",
"0.6078603",
"0.60732454",
"0.5983436",
"0.5939023",
"0.5852982",
"0.58320403",
"0.5823299",
"0.58172697",
"0.5794523",
"0.57405204",
"0.57199585",
"0.5719815",
"0.5647692",
"0.563553... | 0.72564876 | 0 |
Defines the current mode and based on the user's selection Mode 1 = VCV Mode 2 = PCV Mode 3 = PSV Mode 4 = Emergency Mode 0 or else = Stop everything | def modes(self, mode):
# Sends the update to the piston worker
self.worker_piston.mode = mode
if mode == 1: # 'VCV'
self.VCV_start_btn.setEnabled(False)
self.PCV_start_btn.setEnabled(True)
self.PSV_start_btn.setEnabled(True)
self.stop_btn.setEnabl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _select_mode(self):\n self.__check_mode()\n if self.mode[\"auto_mode\"]:\n self.mode_auto()\n elif self.mode[\"auto_mode\"] is None: # Do Nothing\n self.mode_standby()\n else:\n self.mode_manual()",
"def chooseGamemode(self):\n\n # Set the ... | [
"0.717673",
"0.7045415",
"0.65520954",
"0.6531386",
"0.65154326",
"0.65006095",
"0.6478692",
"0.6435735",
"0.63803434",
"0.63710314",
"0.6344585",
"0.6344585",
"0.63153756",
"0.6283795",
"0.6272891",
"0.62718356",
"0.62630045",
"0.62419057",
"0.62358516",
"0.6228614",
"0.6220... | 0.7259531 | 0 |
Searches for a film using its processed named. {String} Name Processed Film Name {Dict} Result | def getFilmByProcessedName(Name):
try:
connection = connect()
with connection.cursor() as cursor:
cursor.execute("""SELECT FilmID, Title FROM `films` WHERE TitlePP = %s""", (Name))
return cursor.fetchone()
except Exception as e:
print("Error getting film id by si... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search_by_person(name):\n\tids = get_id_by_name(name)\n\tif not ids:\n\t\treturn JSONResponse({}) # No actors with the name found\n\turl = tmdb_api(\"discover/movie\")+\"&with_cast=\"+'|'.join(map(str, ids))\n\tresponse = json.load(urllib2.urlopen(url))\n\treturn JSONResponse(response)",
"def search_for_titl... | [
"0.66867244",
"0.6587706",
"0.63311243",
"0.6288353",
"0.628104",
"0.6201554",
"0.6171039",
"0.60855263",
"0.5865013",
"0.58598894",
"0.5849725",
"0.5848272",
"0.58030355",
"0.5796211",
"0.57383025",
"0.57043695",
"0.56673664",
"0.5663597",
"0.5650063",
"0.5647027",
"0.563291... | 0.6729573 | 0 |
Helper function to format a tag as '{namespace}tagname' | def ns_tag(self, tagname):
return "{%s}%s" % (S3_XMLNS, tagname) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _mk_tag(ns, tag):\n return '{%s}%s' % (ns, tag) if ns else tag",
"def get_namespace_str(namespace: Namespace, region: Region):\n\n return namespace.value.format(region.value)",
"def format_tag(tag):\n # If the tag presented is an IP address then no modifications are required\n try:\n ip_... | [
"0.76651984",
"0.66934645",
"0.6313872",
"0.62827003",
"0.6173642",
"0.6111676",
"0.6099627",
"0.5957938",
"0.59360254",
"0.5909541",
"0.5898243",
"0.5853829",
"0.57245845",
"0.5697943",
"0.56849617",
"0.5680485",
"0.5650349",
"0.5558615",
"0.5537226",
"0.5536175",
"0.5515593... | 0.69170785 | 1 |
Test output options match expected. | def test_output_options(self):
# These are tested separately because they are initialised
# differently by subclasses.
self.assertEqual(
self.segment._output_options, self.expected_output_options) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_compiler_options(self):\n output_text = ''\n self.assertEqual(self.output.getvalue(), output_text)\n\n command = create_command('clang++', options=['--test', 'something', 'short'])\n target = ExecutableTarget(command, 'abc2', ['libx.c', 'abc2.cc', ])\n target.bind(self.g... | [
"0.6731592",
"0.65885186",
"0.6522249",
"0.645341",
"0.6452676",
"0.64276636",
"0.6423636",
"0.6415418",
"0.6329705",
"0.63243914",
"0.630813",
"0.63008773",
"0.62894356",
"0.6280701",
"0.62784195",
"0.6267624",
"0.62459236",
"0.6241507",
"0.6239946",
"0.6221171",
"0.61869174... | 0.80955684 | 0 |
Test that input stream specifier is correctly generated. | def test_input_stream_specifier(self):
expected_specifier = "[{n}:{t}]".format(
n=tuple(Segment._input_files).index(self.segment.input_file),
t=self.segment._TYPE[0] if self.segment._TYPE else "")
self.assertEqual(
self.segment.input_stream_specifier(), expected_speci... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_output_stream_specifier(self):\n expected_specifier = \"[{t}{n}]\".format(\n t=self.segment._TYPE[0] if self.segment._TYPE else \"\",\n n=self.segment.segment_number)\n self.assertEqual(\n self.segment.output_stream_specifier(), expected_specifier)",
"def t... | [
"0.7116505",
"0.6289879",
"0.6155659",
"0.5946478",
"0.591319",
"0.5757479",
"0.5662722",
"0.56428504",
"0.56209266",
"0.5612203",
"0.5589218",
"0.55878985",
"0.55272764",
"0.55244005",
"0.55212677",
"0.5512511",
"0.5511584",
"0.5507041",
"0.5489416",
"0.5478611",
"0.547744",... | 0.79394364 | 0 |
Test that output stream specifier is correctly generated. | def test_output_stream_specifier(self):
expected_specifier = "[{t}{n}]".format(
t=self.segment._TYPE[0] if self.segment._TYPE else "",
n=self.segment.segment_number)
self.assertEqual(
self.segment.output_stream_specifier(), expected_specifier) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_input_stream_specifier(self):\n expected_specifier = \"[{n}:{t}]\".format(\n n=tuple(Segment._input_files).index(self.segment.input_file),\n t=self.segment._TYPE[0] if self.segment._TYPE else \"\")\n self.assertEqual(\n self.segment.input_stream_specifier(), ... | [
"0.62656844",
"0.605737",
"0.5850712",
"0.5842266",
"0.58262855",
"0.58200276",
"0.57954574",
"0.5792919",
"0.57802624",
"0.5775109",
"0.5708147",
"0.5692388",
"0.56754184",
"0.5668933",
"0.56386256",
"0.5633716",
"0.5633102",
"0.5627954",
"0.5607384",
"0.5597146",
"0.559102"... | 0.80842334 | 0 |
Test that the trim filter is correctly generated. | def test_trim_filter(self):
expected_filter = (
"{inspec} {trim}=start={pi}:duration={d},{setpts}=PTS-STARTPTS "
"{outspec}".format(
inspec=self.segment.input_stream_specifier(),
trim=self.segment._TRIM, setpts=self.segment._SETPTS,
pi=self... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_sanitized_trim(self):\n value = \" sample \"\n response = clean.trim(value)\n assert response == \"sample\"\n assert type(response) == str",
"def test_trim(self):\n s1 = 'esrdctfvubfiqisqwduonq'\n assert lws.trim(s1, 5) == 'esrdc...'\n assert lws.trim(s1,... | [
"0.7739009",
"0.7500387",
"0.74219215",
"0.6613027",
"0.6551487",
"0.6474108",
"0.646266",
"0.63504386",
"0.62945336",
"0.6263693",
"0.6246229",
"0.6232027",
"0.6182067",
"0.61658484",
"0.610402",
"0.6081595",
"0.5991856",
"0.59873164",
"0.59763646",
"0.58639973",
"0.58308417... | 0.8638635 | 0 |
Export rule set to technical interchange format trxf from internal representation for the positive value (i.e. label value) it has been fitted for. When the internal rule set is empty an empty dnf rule set with the internal pos value is returned. | def explain(self):
assert (self.target_label is not None), 'Not fitted or not fitted for a specific pos value. Use export_rules ' \
'in the latter case. '
if len(self._rule_map.items()) == 0:
return DnfRuleSet([], self.target_label)
fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_transform_interface_repr(example_tsds: TSDataset) -> None:\n trend_transform = TrendTransform(in_column=\"target\", detrend_model=LinearRegression(), model=\"rbf\")\n out_column = f\"regressor_{trend_transform.__repr__()}\"\n result = trend_transform.fit_transform(example_tsds.df)\n for seg in... | [
"0.4919374",
"0.46883133",
"0.4552474",
"0.45391175",
"0.44423106",
"0.44217125",
"0.44103274",
"0.43774098",
"0.43676746",
"0.4347871",
"0.43334657",
"0.43263423",
"0.43246445",
"0.4296303",
"0.42825028",
"0.42747578",
"0.426999",
"0.425343",
"0.42118198",
"0.42067188",
"0.4... | 0.5546812 | 0 |
Transform one rule to a trxf conjunction given its internal presentation | def _rule_to_trxf_conjunction(self, rule):
# TODO code duplication with decode_rule should be refactored -> deprecate decode_rule as it should go
# through trxf
conjunction = Conjunction([])
for condition in rule:
name = self._column_name_list[condition.name]
f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _rules_to_trxf_dnf_ruleset(self, rules, label):\n conjunctions = list()\n for rule in rules:\n conjunction = self._rule_to_trxf_conjunction(rule)\n conjunctions.append(conjunction)\n dnf_ruleset = DnfRuleSet(conjunctions, label)\n return dnf_ruleset",
"def tr... | [
"0.5870737",
"0.53365463",
"0.53204113",
"0.53023887",
"0.5082648",
"0.5039773",
"0.5028235",
"0.49805644",
"0.49752817",
"0.49614105",
"0.49609885",
"0.49511072",
"0.4942823",
"0.49112538",
"0.4910984",
"0.48693594",
"0.4856589",
"0.48442188",
"0.482758",
"0.48192337",
"0.48... | 0.6740971 | 0 |
Transform rules to trxf dnf_ruleset given their internal presentation and their label | def _rules_to_trxf_dnf_ruleset(self, rules, label):
conjunctions = list()
for rule in rules:
conjunction = self._rule_to_trxf_conjunction(rule)
conjunctions.append(conjunction)
dnf_ruleset = DnfRuleSet(conjunctions, label)
return dnf_ruleset | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_rules(self, labels=None):\n # Extract flat list of rules in array form\n if isinstance(self.base_estimator, RandomForestClassifier):\n rules = list(it.chain(*[self.__extract_dt_rules__(dt) for dt in self.base_estimator.estimators_]))\n elif isinstance(self.base_estimator... | [
"0.60895956",
"0.5970408",
"0.567868",
"0.55641735",
"0.55397093",
"0.54414916",
"0.5399139",
"0.53944004",
"0.53680515",
"0.5366483",
"0.5341247",
"0.5267566",
"0.52633786",
"0.5222454",
"0.5138617",
"0.50969034",
"0.50963247",
"0.50794286",
"0.5062235",
"0.50526375",
"0.503... | 0.7949042 | 0 |
Return True if ignore_act_logic is set or the act_logic_str argument is empty; otherwise, evaluate the act_logic_str and return the result. | def eval_act_logic(self, act_logic_str):
if self.ignore_act_logic:
return True
# return true for empty string
if len(act_logic_str) == 0:
return True
eval_str = act_logic_str
# switch to Python boolean operators
for (op, py_op) in (('!', ' not '), ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_logic(self):\n return self.value in ('and_logic', 'or_logic')",
"def yices_logic(pysmt_logic):\n ylogic = str(pysmt_logic)\n if ylogic == \"QF_BOOL\":\n ylogic = \"NONE\"\n return ylogic",
"def parse_logic(self, logic):\n if 'xxx' in logic.conf:\n # self.function... | [
"0.63924867",
"0.61907065",
"0.6055943",
"0.5576882",
"0.5382165",
"0.5161074",
"0.51513916",
"0.51442385",
"0.5019837",
"0.4856873",
"0.48202324",
"0.48084027",
"0.4778607",
"0.47735447",
"0.47364372",
"0.46944693",
"0.46600413",
"0.46143237",
"0.46131638",
"0.46126387",
"0.... | 0.8530997 | 0 |
Set the Ships Collidemask, which is a combination of ships allies | def setCollidemask(self):
friends = self.createFriendlyEmpireList()
mask = 0
for id in friends:
id = int(id)
mask = mask + (1<<id)
self.collidemask = mask | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __set_mask_regions(self):\n self.bottom_clip = np.int32(np.int32([[[60,0], [1179,0], [1179,650], [60,650]]]))\n self.roi_clip = np.int32(np.int32([[[640, 425], [1179,550], [979,719],\n [299,719], [100, 550], [640, 425]]]))",
"def setup_mask(self, d25scale): \n... | [
"0.59712905",
"0.588983",
"0.58887863",
"0.5834503",
"0.5670981",
"0.566405",
"0.5652416",
"0.56333166",
"0.5549052",
"0.55325466",
"0.5487698",
"0.5476475",
"0.5476475",
"0.5472333",
"0.5386332",
"0.5362993",
"0.5361637",
"0.53606224",
"0.5331153",
"0.53078085",
"0.53013045"... | 0.6788285 | 0 |
Return empireID list of all friendly empires | def createFriendlyEmpireList(self):
friends = []
for shipID, myShip in self.myGalaxy.ships.iteritems():
if shipID not in self.targets and myShip.empireID not in friends:
friends.append(myShip.empireID)
return friends | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_eids(self):\n return [d['eid'] for d in self._json]",
"def getIDs():",
"def _get_employee_info() -> List[List[str]]:\n return [\n ['100', 'Dave', 'Team Leader'],\n ['101', 'Ram', 'Developer'],\n ['102', 'Raj', 'Developer'],\n ['103', 'Rahul', 'Tester'],\n ]",
... | [
"0.5927092",
"0.5782016",
"0.5697313",
"0.5613784",
"0.55880463",
"0.55452657",
"0.55252194",
"0.5473026",
"0.54286206",
"0.5353245",
"0.5348759",
"0.533756",
"0.53235847",
"0.5322783",
"0.5299086",
"0.52973986",
"0.5267958",
"0.526212",
"0.5240821",
"0.5219076",
"0.5190375",... | 0.6644379 | 0 |
Setup the Ship Counts and Goals based on Captain rank | def setMyShipCounts(self):
self.retargetGoal = globals.rankMods[self.myCaptain.rank]['retarget']
self.retargetCount = globals.rankMods[self.myCaptain.rank]['retarget'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prep_ships(self):\n\t\t\tself.ships = Group()\n\t\t\tfor ship_number in range(self.stats.ships_left):\n\t\t\t\tship = Ship(self.ai_settings, self.screen)\n\t\t\t\tship.rect.x = 10 + ship_number * ship.rect.width\n\t\t\t\tship.rect.y = 10\n\t\t\t\tself.ships.add(ship)",
"def prep_ships(self):\n self.ships ... | [
"0.5789952",
"0.5778577",
"0.5675931",
"0.5673261",
"0.5570776",
"0.5554563",
"0.5551854",
"0.5528239",
"0.55241203",
"0.5517139",
"0.5508762",
"0.54834807",
"0.5476958",
"0.54638433",
"0.5454179",
"0.54489183",
"0.5440598",
"0.54062164",
"0.5405112",
"0.53591526",
"0.5342036... | 0.71262914 | 0 |
Add Target Ship ID to list of targets for this ship | def addTargetShip(self, targetID):
self.targets.append(targetID) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tellEnemiesToTargetMeAgain(self):\n for shipID in self.shipsTargetingMe:\n myShip = self.myGalaxy.ships[shipID]\n if self.id not in myShip.targets:\n myShip.targets.append(self.id)\n self.shipsTargetingMe = []",
"def copyWhoTargetsMe(self, winningShipID):\n ... | [
"0.6905803",
"0.6717201",
"0.6213943",
"0.59731954",
"0.5942745",
"0.59369075",
"0.5936854",
"0.59256864",
"0.58923775",
"0.58746827",
"0.58349705",
"0.580631",
"0.5803375",
"0.58002454",
"0.5798088",
"0.5719089",
"0.5718299",
"0.5704151",
"0.57001275",
"0.5678343",
"0.566313... | 0.8334525 | 0 |
Initial ship commands at begining of simulation | def begin(self):
self.setMyShipCounts()
self.setMyStatus()
self.setTotalAmmoForWeapons()
self.chargeBatteries() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start(self):\n self.__init__()\n self.set_n_players()\n self.init_players()\n self.init_territory_selection_phase()\n self.init_troop_deployment_phase()\n # self.game_phase()",
"def _initialize(self):\n self.send_init_command()",
"def __init__(self):\n ... | [
"0.66750395",
"0.6407124",
"0.6327536",
"0.63086736",
"0.62801313",
"0.6267066",
"0.61964643",
"0.6169486",
"0.6149744",
"0.6141105",
"0.6141105",
"0.609559",
"0.609559",
"0.609559",
"0.609559",
"0.609559",
"0.60923535",
"0.6060023",
"0.6038217",
"0.6023961",
"0.6003757",
"... | 0.6881211 | 0 |
Set the Weapons totalAmmo state | def setTotalAmmoForWeapons(self):
for myWeapon in self.activeWeapons:
myWeapon.setTotalAmmo()
for myWeapon in self.amsWeapons:
myWeapon.setTotalAmmo() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reloadAmmo(self):\n for componentID, myComponent in self.components.iteritems():\n if myComponent.myComponentData.maxAmmo > 0:\n myComponent.currentAmount = myComponent.myComponentData.maxAmmo",
"def setMyStatus(self):\n self.clearMyStatus()\n for id, myComponen... | [
"0.70450485",
"0.6242401",
"0.6228078",
"0.6047097",
"0.58896303",
"0.5876648",
"0.5814055",
"0.579145",
"0.56938505",
"0.56286377",
"0.5623901",
"0.56091434",
"0.55547535",
"0.5504194",
"0.5488021",
"0.54642916",
"0.5455545",
"0.54522663",
"0.5409598",
"0.53584224",
"0.52797... | 0.851958 | 0 |
Charge the batteries before battle begins | def chargeBatteries(self):
self.currentBattery = self.maxBattery | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wait(self, cycles):\n\t\tself.planet.tiles[self.y][self.x].set_occupant() # set occupant to the initial tile\n\t\tif self.planet.tiles[self.y][self.x].is_shaded: # in 'plain' the rover will recharge itself\n\t\t\ti = 0\n\t\t\twhile i < int(cycles):\n\t\t\t\tif self.battery < 100:\n\t\t\t\t\tself.battery += 1... | [
"0.6534404",
"0.6516215",
"0.6400743",
"0.6400743",
"0.6165692",
"0.6127216",
"0.60785556",
"0.5995827",
"0.58894855",
"0.58811694",
"0.5872813",
"0.5825078",
"0.58169067",
"0.5812761",
"0.57943857",
"0.5787553",
"0.5770078",
"0.57647353",
"0.5705315",
"0.56874925",
"0.567777... | 0.7781498 | 0 |
Clear all Target Ships | def clearTargetShips(self):
self.targets = []
self.currentTarget = None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset(targets):",
"def clearQueue(targets):",
"def clear_target(remote):\n cmd = mmapi.StoredCommands()\n cmd.AppendSceneCommand_ClearTarget();\n remote.runCommand(cmd)",
"async def clear_all(self) -> None:",
"def KillAllAnts(cls):\n cls.antArray.clear()",
"def clear_all(self):\n ... | [
"0.7414668",
"0.72340506",
"0.68892217",
"0.6819219",
"0.6808926",
"0.6787367",
"0.667513",
"0.65523094",
"0.655149",
"0.65157306",
"0.6502788",
"0.64500123",
"0.64442044",
"0.6398218",
"0.63778657",
"0.63638765",
"0.63635457",
"0.62855667",
"0.626182",
"0.626182",
"0.626182"... | 0.874425 | 0 |
Set the ships mode | def setMode(self):
if self.currentTarget != None and self.finishedAssault == 0:
if self.isAssault == 1:
if self.currentTarget != None:
self.mode = 'assault'
else:
self.mode = 'escape'
else:
self.log.d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setNewShip(self):\r\n self._ship = Ship(GAME_WIDTH/2,SHIP_BOTTOM+SHIP_HEIGHT/2,SHIP_WIDTH,\r\n SHIP_HEIGHT,'ship.png')",
"def setScalingMode(mode='down'):\n mdict = {'down':'DOWN','full':'FULL'}\n dislin.sclmod(mode)",
"def select_ship(self, type):\n ship = PlayerShip(type=ty... | [
"0.58356744",
"0.5825737",
"0.5816815",
"0.57944316",
"0.5738993",
"0.57314104",
"0.5686505",
"0.55278957",
"0.55092883",
"0.5434536",
"0.53974396",
"0.53592217",
"0.5342324",
"0.53331625",
"0.53157765",
"0.5302809",
"0.53008354",
"0.53008354",
"0.52975875",
"0.52716815",
"0.... | 0.6323356 | 0 |
Go through all active weapons and check if they are ready | def updateWeapons(self):
self.readyWeapons = []
self.setWeaponStatus()
for myWeapon in self.activeWeapons:
if myWeapon.preFireCheck() == 1:
self.readyWeapons.append(myWeapon)
self.alternateTargets = []
if self.amsTargets != []:
for myWeap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fireMyWeapons(self):\n for myWeapon in self.readyWeapons:\n myWeapon.fire()\n\n self.readyWeapons = []",
"def weapon_check():\n if get_locations()['player'] == get_locations()['weapon']:\n STATUS['weapon'] = 'armed'\n STATUS['locations']['weapon'] = None\n pri... | [
"0.7489451",
"0.67067677",
"0.66584647",
"0.6589341",
"0.6411594",
"0.6287098",
"0.625295",
"0.61717993",
"0.6035616",
"0.5932443",
"0.5863218",
"0.5824023",
"0.58029544",
"0.5761088",
"0.5714244",
"0.5714244",
"0.57078743",
"0.56801105",
"0.5672054",
"0.5656998",
"0.56028",
... | 0.77022606 | 0 |
Fire all weapons that can fire | def fireMyWeapons(self):
for myWeapon in self.readyWeapons:
myWeapon.fire()
self.readyWeapons = [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updateWeapons(self):\n self.readyWeapons = []\n self.setWeaponStatus()\n\n for myWeapon in self.activeWeapons:\n if myWeapon.preFireCheck() == 1:\n self.readyWeapons.append(myWeapon)\n self.alternateTargets = []\n\n if self.amsTargets != []:\n ... | [
"0.7098171",
"0.6798719",
"0.6397469",
"0.638709",
"0.62391275",
"0.6136321",
"0.6100035",
"0.60176325",
"0.601626",
"0.60092396",
"0.60033697",
"0.6001779",
"0.59771055",
"0.5957221",
"0.5955055",
"0.59525734",
"0.59395176",
"0.5916459",
"0.5874916",
"0.5845796",
"0.584423",... | 0.8456265 | 0 |
Return the (valueBV, valueCR, valueAL, valueEC, valueIA) in a tuple valueBV = credit conversion of ship | def getMyValue(self):
valueBV = 0.0
valueCR = 0.0
valueAL = 0.0
valueEC = 0.0
valueIA = 0.0
factorAL = globals.cityCRGen/globals.cityALGen
factorEC = globals.cityCRGen/globals.cityECGen
factorIA = globals.cityCRGen/globals.cityIAGen
ratio = self.st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_values(state):\n keys = ['player_ammo', 'player_block', 'player_prev',\n 'comp_ammo', 'comp_block', 'comp_prev']\n return tuple([state[key] for key in keys])",
"def get_value_tuple(self):\r\n\r\n retval = tuple()\r\n for val in self.VALUES:\r\n retval += (getattr... | [
"0.6279682",
"0.6217492",
"0.6050168",
"0.5752565",
"0.56892484",
"0.5647932",
"0.5626707",
"0.5609625",
"0.5591199",
"0.5512637",
"0.55078804",
"0.54763144",
"0.54689556",
"0.5420453",
"0.5387843",
"0.5380877",
"0.5367452",
"0.5351716",
"0.5351716",
"0.5349269",
"0.534753",
... | 0.6435945 | 0 |
Return Ship info as dict | def getMyShipInfo(self):
d = self.getMyInfoAsDict()
d['quads'] = self.getMyDictInfo('quads', 'getMyQuadInfo')
d['targets'] = self.targets
d['availSystems'] = self.availSystems
d['oldAvailSystems'] = self.oldAvailSystems
return d | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def my_ship_info(self, ship_id):\n r = requests.get(self.base_url + f'/users/{self.username}/ships/{ship_id}', headers=self.auth_header)\n return r.text",
"def getShipUpdate(self, empireID, shipList):\n d = {}\n for shipID in shipList:\n myShip = self.ships[shipID]\n ... | [
"0.70338327",
"0.6640894",
"0.66130275",
"0.6449053",
"0.6068618",
"0.60605574",
"0.6060046",
"0.603705",
"0.59919953",
"0.59891075",
"0.5987735",
"0.59318817",
"0.5927752",
"0.58683836",
"0.5855859",
"0.5845039",
"0.577094",
"0.5749574",
"0.5724747",
"0.57181406",
"0.5693051... | 0.79618406 | 0 |
Return the shipyard capacity required to perform full repairs | def getRepairCapacity(self):
return int(self.myDesign.getSYCRequired() * (1-(self.strength/100.0))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Capacity(self) -> int:",
"def get_capacity():\n fs.get_capacity()",
"def get_num_slots(self):\n # Your code here\n return self.capacity",
"def available_capacity(self):\r\n return self.capacity - len(self.passengers)",
"def inventoryCapacity(self):\n # TODO: Worry about h... | [
"0.7423663",
"0.7293427",
"0.7291084",
"0.6970682",
"0.691767",
"0.68904936",
"0.6830906",
"0.6830867",
"0.67972016",
"0.67938155",
"0.67938155",
"0.67938155",
"0.67938155",
"0.67620003",
"0.66968286",
"0.669053",
"0.66652375",
"0.6642956",
"0.6642956",
"0.6642956",
"0.664295... | 0.7935856 | 0 |
Cycle through operational weapons and increment target lock if required | def lockWeapons(self, interval):
i = 0
for myWeapon in self.activeWeapons:
i += 1
myWeapon.lockTarget(interval)
for myWeapon in self.amsWeapons:
myWeapon.lockTarget(interval) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updateWeapons(self):\n self.readyWeapons = []\n self.setWeaponStatus()\n\n for myWeapon in self.activeWeapons:\n if myWeapon.preFireCheck() == 1:\n self.readyWeapons.append(myWeapon)\n self.alternateTargets = []\n\n if self.amsTargets != []:\n ... | [
"0.6699665",
"0.64983165",
"0.63821155",
"0.638019",
"0.624896",
"0.62324136",
"0.61947846",
"0.6117929",
"0.6110638",
"0.60288554",
"0.5988279",
"0.58426404",
"0.58253014",
"0.5748934",
"0.5743187",
"0.5737637",
"0.57342106",
"0.57153654",
"0.5707402",
"0.5680784",
"0.567925... | 0.76075596 | 0 |
Update Weapons status if ship selected | def updateWeaponStatus(self):
if self.myGalaxy.shipSelected == self:
for position in self.positions:
myQuad = self.quads[position]
for id in funcs.sortStringList(myQuad.weapons.keys()):
myWeapon = myQuad.weapons[id]
self.update... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updateWeapons(self):\n self.readyWeapons = []\n self.setWeaponStatus()\n\n for myWeapon in self.activeWeapons:\n if myWeapon.preFireCheck() == 1:\n self.readyWeapons.append(myWeapon)\n self.alternateTargets = []\n\n if self.amsTargets != []:\n ... | [
"0.7029819",
"0.6835021",
"0.6047575",
"0.5998209",
"0.59675515",
"0.58768064",
"0.583233",
"0.5824426",
"0.5801472",
"0.57697356",
"0.5750643",
"0.57112527",
"0.5663858",
"0.5631053",
"0.55250716",
"0.5505748",
"0.5493327",
"0.5474506",
"0.54583716",
"0.5442414",
"0.54376155... | 0.8391242 | 0 |
Remove Drone from ships tracking of its drones | def removeDrone(self, myDrone):
self.drones.remove(myDrone) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def removeShip(self, shipID):\n myShip = self.ships[shipID]\n # remove captain first\n myCaptain = myShip.myCaptain\n self.removeCaptain(myCaptain.id)\n # remove ship\n del self.ships[shipID]",
"def remove_self(self):\n if self.game.rules[\"trapping\"]:\n ... | [
"0.57939804",
"0.57777774",
"0.5654431",
"0.5626904",
"0.5561409",
"0.55013496",
"0.54792875",
"0.5463884",
"0.54494274",
"0.5447706",
"0.54331434",
"0.5412422",
"0.5407124",
"0.5375867",
"0.5350811",
"0.5296833",
"0.52812636",
"0.5263148",
"0.5256238",
"0.5255262",
"0.522865... | 0.656295 | 0 |
Reset ship data on end round | def resetData(self):
self.alive = 1
self.fromSystem = self.toSystem
self.systemGrid = 5
mySystem = self.myGalaxy.systems[self.toSystem]
mySystem.availSYC += self.repair | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset(self):\n self.ship_list = self.backup_list",
"def reset_stats(self):\n self.ships_left = self.sett.ship_limit\n self.score = 0\n self.level = 1",
"def reset_stats(self):\r\n self.ship_left = self.settings.ship_limit\r\n self.score = 0\r\n self.level = ... | [
"0.7045187",
"0.6821064",
"0.6800473",
"0.6790477",
"0.67565376",
"0.67279935",
"0.6652407",
"0.6475497",
"0.64517874",
"0.64297736",
"0.6360238",
"0.62905234",
"0.6284323",
"0.6279317",
"0.62509763",
"0.62235016",
"0.61790115",
"0.61746776",
"0.611112",
"0.6110762",
"0.61049... | 0.6835767 | 1 |
Power all available weapons, then return any unused power | def powerWeapons(self, interval, availPower):
if self.allWeaponsPowered == 0:
weaponList = []
for position, myQuad in self.quads.iteritems():
weaponIDList = []
weaponIDList.extend(funcs.sortStringList(myQuad.weapons.keys()))
for wID in weap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fireMyWeapons(self):\n for myWeapon in self.readyWeapons:\n myWeapon.fire()\n\n self.readyWeapons = []",
"def weapons(self):\n return self._get_by_class(Weapon)",
"def get_weapon_holding():\n return unrealsdk.GetEngine().GamePlayers[0].Actor.Pawn.Weapon",
"def updateWea... | [
"0.66738576",
"0.65936744",
"0.64127314",
"0.62904364",
"0.6243986",
"0.61661214",
"0.61375064",
"0.60634834",
"0.5984181",
"0.5969051",
"0.5879427",
"0.58320296",
"0.5824147",
"0.58155566",
"0.5763517",
"0.57565784",
"0.5749005",
"0.57304597",
"0.5702572",
"0.56931055",
"0.5... | 0.7669027 | 0 |
Return 1 if ship is outside border of simulator | def isOutsideBorder(self):
if (self.posX < -self.myGalaxy.worldWidth or self.posX > self.myGalaxy.worldWidth or
self.posY < -self.myGalaxy.worldHeight or self.posY > self.myGalaxy.worldHeight):
return 1
return 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _in_bounds(self, x, y):\r\n return 0 <= x < 8 and 0 <= y < 8",
"def swimming_fish_out_of_bounds(f: SwimmingFish, width: int) -> bool:\n return (left_edge(f) < -width/2 and f.dx < 0) or \\\n (right_edge(f) > width/2 and f.dx > 0)",
"def hasSpaceAround(self,x,y):\n global gamemap\n... | [
"0.6456591",
"0.6360883",
"0.63393646",
"0.63232255",
"0.63121676",
"0.6304735",
"0.6234349",
"0.6227776",
"0.62234503",
"0.62180036",
"0.61911255",
"0.61893386",
"0.61722976",
"0.6170054",
"0.6154485",
"0.6136805",
"0.6131116",
"0.61228883",
"0.60718054",
"0.6047775",
"0.599... | 0.7493689 | 0 |
Ship is colliding with enemy ship, decide if assault will take place | def shallIAssault(self, enemyShip):
if (self.isAssault == 1 and enemyShip.isAssault == 0 and
self.underAssault == 0 and enemyShip.underAssault == 0 and
self.currentTarget == enemyShip):
self.myGalaxy.setupAssaultBattle(self, enemyShip) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def canItakeEnemyShip(self, enemyShip):\n if self.assaultStrength/enemyShip.getPersonStrength() > 1.5:\n return 1\n return 0",
"def check_enemy_fleet(self):\n if len(self.enemyShips) > 0:\n response = False\n for ship in self.enemyShips:\n if s... | [
"0.68384343",
"0.67401",
"0.6720131",
"0.64217734",
"0.6420012",
"0.64042145",
"0.6383553",
"0.63772774",
"0.6351664",
"0.6334861",
"0.6331924",
"0.6321916",
"0.63201356",
"0.6293384",
"0.6285244",
"0.62531406",
"0.624675",
"0.6239652",
"0.6210115",
"0.620083",
"0.6200511",
... | 0.75361145 | 0 |
Set Current Target based on ship type | def setCurrentTarget(self):
if self.isAssault:
self.setAssaultTarget()
else:
self.setWarshipTarget() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setWarshipTarget(self):\n # first look for closest target of target type\n closestShip = self.getNearestTarget()\n\n if closestShip == None and (self.targets != [] or self.takenOverByEmpire != ''):\n # No Targets available\n if self.myGalaxy.shipsUnderAssault() == 0:\... | [
"0.749024",
"0.65275705",
"0.6311807",
"0.6102749",
"0.60880286",
"0.6018172",
"0.5903521",
"0.59021914",
"0.58619124",
"0.58422256",
"0.58356595",
"0.583231",
"0.58301747",
"0.57948416",
"0.57645565",
"0.5761492",
"0.5737723",
"0.57229143",
"0.57203424",
"0.5711116",
"0.5707... | 0.76790154 | 0 |
Set Current Target for Assault Ships | def setAssaultTarget(self):
if self.underAssault == 1:
return
closestRange = 99999
closestShip = None
for shipID in self.targets:
enemyShip = self.myGalaxy.ships[shipID]
if (enemyShip.alive == 1 and enemyShip.strength < 100 and
enemyShi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setCurrentTarget(self):\n if self.isAssault:\n self.setAssaultTarget()\n else:\n self.setWarshipTarget()",
"def target(self, target) :\n\t\ttry :\n\t\t\tself._target = target\n\t\texcept Exception as e:\n\t\t\traise e",
"def target(self, target) :\n\t\ttry :\n\t\t\tself.... | [
"0.8083243",
"0.65302014",
"0.65302014",
"0.6487067",
"0.64606005",
"0.64348084",
"0.64046645",
"0.64031994",
"0.6194626",
"0.6188188",
"0.6104702",
"0.60383475",
"0.602039",
"0.5956502",
"0.5818565",
"0.577592",
"0.57716405",
"0.57538927",
"0.5742936",
"0.5702102",
"0.569749... | 0.6678327 | 1 |
Set Ship Target based on nearest valid target | def setWarshipTarget(self):
# first look for closest target of target type
closestShip = self.getNearestTarget()
if closestShip == None and (self.targets != [] or self.takenOverByEmpire != ''):
# No Targets available
if self.myGalaxy.shipsUnderAssault() == 0:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setAssaultTarget(self):\n if self.underAssault == 1:\n return\n closestRange = 99999\n closestShip = None\n for shipID in self.targets:\n enemyShip = self.myGalaxy.ships[shipID]\n if (enemyShip.alive == 1 and enemyShip.strength < 100 and\n ... | [
"0.7115338",
"0.688314",
"0.6676593",
"0.6676593",
"0.6627239",
"0.6389175",
"0.638842",
"0.6347819",
"0.6309359",
"0.63060826",
"0.6272827",
"0.61689657",
"0.6134203",
"0.602905",
"0.59708244",
"0.59646",
"0.5927972",
"0.58907986",
"0.58907986",
"0.58639836",
"0.5863548",
... | 0.7928407 | 0 |
Assign the Captain to this ship | def setMyCaptain(self, captainObject):
self.myCaptain = captainObject
self.captainID = captainObject.id
captainObject.setMyShip(self.id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setNewShip(self):\n self._ship = Ship()",
"def _createShip(self):\n self._ship=Ship()",
"def setNewShip(self):\r\n self._ship = Ship(GAME_WIDTH/2,SHIP_BOTTOM+SHIP_HEIGHT/2,SHIP_WIDTH,\r\n SHIP_HEIGHT,'ship.png')",
"def Place(self, ref, scent):\n coords = self.Map.la... | [
"0.6659112",
"0.6454469",
"0.6224067",
"0.59771895",
"0.59482396",
"0.58608437",
"0.5703452",
"0.5672479",
"0.5640089",
"0.5599713",
"0.55969596",
"0.5532199",
"0.5476407",
"0.53711057",
"0.5366852",
"0.5351503",
"0.5330391",
"0.5321654",
"0.5314658",
"0.52951986",
"0.5283371... | 0.6938931 | 0 |
setup this ship according to the design object and ship dictionary info given | def setFromDict(self, designObject, myShipDict):
self.myDesign = designObject
self.designID = designObject.id
self.componentdata = designObject.componentdata
self.weapondata = designObject.weapondata
self.myShipHull = designObject.myShipHull
designAttrDict = designObject.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _createShip(self):\n self._ship=Ship()",
"def createShipDesigns(self):\n for designID, designInfo in self.game.shipDesigns.iteritems():\n if designID not in self.game.shipDesignObjects.keys():\n myDesign = self.getShipDesign(designInfo[1],designInfo[2],designInfo[3],de... | [
"0.706905",
"0.6757908",
"0.67319703",
"0.6518807",
"0.6510874",
"0.645509",
"0.6406291",
"0.6406291",
"0.6404311",
"0.6202227",
"0.6166891",
"0.61429554",
"0.610511",
"0.61033714",
"0.60951203",
"0.60747343",
"0.60595965",
"0.6059069",
"0.6044048",
"0.60213953",
"0.6001829",... | 0.75071675 | 0 |
Set the repair cost of Starship | def setRepairCost(self):
# first take into account the ship hull which is based on internal structure points
ratio = 1.0 - (self.currentISP/self.myShipHull.maxISP)
CR = int(self.myShipHull.costCR*ratio)
AL = int(self.myShipHull.costAL*ratio)
EC = int(self.myShipHull.costEC*ratio)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def _cost_setheist(self, ctx, cost: int):\r\n guild = ctx.guild\r\n config = await self.thief.get_guild_settings(guild)\r\n\r\n if cost >= 0:\r\n config[\"Cost\"] = cost\r\n await self.thief.config.guild(guild).Config.set(config)\r\n msg = \"Setting heist... | [
"0.6537321",
"0.6459258",
"0.6197646",
"0.61579597",
"0.605877",
"0.59824544",
"0.59384936",
"0.5911195",
"0.5700008",
"0.5663033",
"0.56553936",
"0.5616602",
"0.5596647",
"0.5560045",
"0.55250424",
"0.55102265",
"0.54572284",
"0.545103",
"0.53988767",
"0.53764904",
"0.537450... | 0.7154965 | 0 |
Return current value including repairs required in (AL, EC, IA) | def getCurrentResourceValue(self):
AL = self.myDesign.costAL - self.repairCost[1]
EC = self.myDesign.costEC - self.repairCost[2]
IA = self.myDesign.costIA - self.repairCost[3]
return (AL, EC, IA) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _getLilyAccidental(self):\n s = \"\"\n if self.accidental == 0:\n return \"\"\n elif self.accidental < 0:\n s = _LILYFLAT\n elif self.accidental > 0:\n s = _LILYSHARP\n return s * abs(self.accidental)",
"def getMyValue(self):\n value... | [
"0.569842",
"0.55963534",
"0.5518019",
"0.5453932",
"0.5451087",
"0.5450937",
"0.54362977",
"0.5434666",
"0.54155874",
"0.5414289",
"0.53903836",
"0.5376649",
"0.5362325",
"0.5342164",
"0.5324512",
"0.53046167",
"0.52975017",
"0.52833486",
"0.5280751",
"0.52446854",
"0.524449... | 0.7076824 | 0 |
Take the ship from and to system to decide its systemGrid Attribute | def setSystemGrid(self):
fromSystem = self.myGalaxy.systems[self.fromSystem]
toSystem = self.myGalaxy.systems[self.toSystem]
self.systemGrid = funcs.getMapQuadrant(toSystem, self, fromSystem.x, fromSystem.y,
toSystem.x, toSystem.y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def system_fleet_dimensioning(self):",
"def assignGridInfo(self):\n\n for point in self.gridPoints:\n for house in self.houses:\n if (point.xLocation == house.xLocation and\n point.yLocation == house.yLocation):\n house.gridID = point.ID\n ... | [
"0.60076034",
"0.59440726",
"0.55085313",
"0.53816247",
"0.5347802",
"0.5303017",
"0.52160954",
"0.52091426",
"0.51955074",
"0.51380354",
"0.5123778",
"0.5113282",
"0.51074874",
"0.50823647",
"0.50521684",
"0.50475",
"0.5019734",
"0.50008845",
"0.49889183",
"0.4988071",
"0.49... | 0.63004255 | 0 |
Set the ship posX, posY for battle using setX, setY, and fromSystem, toSystem | def setPosition(self):
# determine posX, posY for battle
(x1,y1) = globals.battlemapQuadrants[self.systemGrid]
self.posX = x1+self.setX
self.posY = y1+self.setY | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def positioning_ship(self):\n self.rect.midleft = self.screen_rect.midleft\n self.y = float(self.rect.y)",
"def __init__(self,ai_settings, screen):\n\t\tsuper(Ship,self).__init__()\n\t\tself.screen = screen\n\t\tself.ai_settings = ai_settings\n\t\t\n\t\t# Load ship and get its rect\n\t\tself.image ... | [
"0.666589",
"0.64109236",
"0.63306254",
"0.62973076",
"0.6281268",
"0.6259413",
"0.62388605",
"0.62137085",
"0.6197118",
"0.61661035",
"0.6155561",
"0.6099876",
"0.6092357",
"0.6088177",
"0.6071891",
"0.60584444",
"0.6050845",
"0.6037462",
"0.60161126",
"0.5978602",
"0.596875... | 0.7602327 | 0 |
Attempt to unload Regiment from Ship | def unloadRegiment(self, regimentID):
if regimentID in self.myRegiments:
self.myRegiments.remove(regimentID)
return 1
else:
return 'unable to unload Regiment' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def unload(self) -> None:",
"def unloaded():\n pass",
"def unload():\r\n database.save() # Save the database\r\n\r\n \"\"\" Remove any popups \"\"\"\r\n deleted = []\r\n for popup in popuplib.gPopups:\r\n if popup.startswith('sourcerpg_'):\r\n deleted.append(popup)\r\n ... | [
"0.6674896",
"0.65182585",
"0.6405071",
"0.6295327",
"0.62279993",
"0.610963",
"0.6029479",
"0.5997003",
"0.59544367",
"0.5933292",
"0.5916467",
"0.588574",
"0.5860201",
"0.58432007",
"0.5839643",
"0.58160335",
"0.58014",
"0.5785609",
"0.5726801",
"0.57203925",
"0.5717381",
... | 0.6990066 | 0 |
Test that PlaybackGrants are created and decoded correctly. | def test_playback_grant(self):
grant = {
"requestCredentials": None,
"playbackUrl": "https://000.us-east-1.playback.live-video.net/api/video/v1/us-east-000.channel.000?token=xxxxx",
"playerStreamerSid": "VJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
}
scat = AccessToke... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_player(self):\n pass",
"def test_plays_get(self):\n pass",
"def testPlayback(self):\n \n pass",
"def test_plays_id_get(self):\n pass",
"def test_creation_profile_4():\n assert tuple_NT[0][3] == LIST_dict[0]['blood_group'], \"blood_group of profile is not getti... | [
"0.59152514",
"0.5836017",
"0.5832816",
"0.55722713",
"0.5484468",
"0.54032695",
"0.53469896",
"0.5335209",
"0.53281236",
"0.5314113",
"0.52903646",
"0.5277839",
"0.5276405",
"0.52449065",
"0.523717",
"0.52356446",
"0.5233588",
"0.5209001",
"0.51857024",
"0.5185059",
"0.51796... | 0.69176674 | 0 |
Attempt to parse actor information from given URL. | def parse_actor_page(pageurl):
logging.info('attempt to parse page ' + pageurl + 'as an actor')
# attempt to load the wikipedia page and parse with beautifulsoup
soup = load_page(pageurl)
if soup == None:
return None
# attempt to retrieve name from page tree
name = parse_name_actor(soup,pageurl)
if name == Non... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_actors_movie(soup, pageurl):\n\t# find the cast section\n\tcast = soup.findAll('span', {'id': 'Cast'})\n\t# if cast doesn't exist, return None\n\tif len(cast) == 0:\n\t\tlogging.warning('' + pageurl + ' does not have a cast section, parsing will terminate')\n\t\treturn None, None\n\t# cast will be stored... | [
"0.65128535",
"0.6473657",
"0.6287108",
"0.6243513",
"0.62370616",
"0.59029365",
"0.57607085",
"0.57459843",
"0.5735032",
"0.5675593",
"0.5663115",
"0.56630397",
"0.5606281",
"0.5543727",
"0.5491842",
"0.5467913",
"0.53913224",
"0.5382244",
"0.53459936",
"0.5322451",
"0.53081... | 0.6994831 | 0 |
Attempt to parse movie information from given URL. | def parse_movie_page(pageurl):
logging.info('attempt to parse page ' + pageurl + 'as a movie')
movie = {}
# attempt to load the wikipedia page and parse with beautifulsoup
soup = load_page(pageurl)
if soup == None:
return None
# attempt to retrieve name from page tree
name = parse_name_movie(soup, pageurl)
if... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getMovieInfo(url):\n infobox = getInfoBox(url)\n if infobox:\n infoDict = {}\n title = getTitle(infobox)\n infoDict[\"Title\"] = title\n for label in getLabels(infobox):\n infoDict[label] = getContents(infobox, label=label)\n # Adding IMDB and Meta scores\n ... | [
"0.69630533",
"0.67741174",
"0.676121",
"0.6750898",
"0.6673219",
"0.6594146",
"0.6527191",
"0.65252304",
"0.6443314",
"0.63403386",
"0.6254046",
"0.624448",
"0.6200167",
"0.6189439",
"0.613459",
"0.61134636",
"0.6103859",
"0.60461605",
"0.6030283",
"0.6026462",
"0.60182256",... | 0.7033002 | 0 |
Retrieve name of movie from parsetree | def parse_name_movie(soup, pageurl):
# find the summary class header
name_tag = soup.findAll('th', {'class': 'summary'})
# if this header doesn't exist, cannot retrieve name
if len(name_tag) == 0:
logging.warn('' + pageurl + 'does not have a valid name field, parsing terminated')
return None
# return name as a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def director_name(self, director_name):",
"def movies_filename(self):\n pass",
"def get_movies():\n tree = get_tree()\n movie_list = [movie.get(\"title\") for movie in tree.getroot().findall(\"movie\")]\n return movie_list",
"def _get_movie_name(self, movie_id):\n return self.movies[se... | [
"0.6382431",
"0.6269243",
"0.6251219",
"0.6234211",
"0.6042622",
"0.5963573",
"0.5943358",
"0.5888004",
"0.5875247",
"0.5840306",
"0.5776748",
"0.5774783",
"0.5695759",
"0.567225",
"0.56598824",
"0.5656389",
"0.5628296",
"0.56280106",
"0.56135345",
"0.55831826",
"0.5577635",
... | 0.630592 | 1 |
retrieve movie year from parse tree | def parse_year_movie(date, pageurl):
# remove dashes if 01-05-2015 format
if '-' in date:
date = date.strip()[1:-1]
year = date.split('-')[0]
# remove commas if format is 01,05,2015
else:
if ',' in date:
year = date.split(',')[1].strip()
elif ' ' in date.strip():
if len(date.split(' ')) < 3:
loggi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getYear(movieInfo):\n if \"release_date\" in movieInfo:\n date = movieInfo[\"release_date\"]\n if (date != '') :\n return datetime.strptime(date, \"%Y-%m-%d\").year\n else:\n return 0\n else:\n raise AttributeError(\"%s instance has no attribute release_d... | [
"0.7033299",
"0.6922235",
"0.68769693",
"0.67565024",
"0.66693854",
"0.6599834",
"0.6557494",
"0.64408225",
"0.64157677",
"0.63422817",
"0.6338198",
"0.6302831",
"0.6298376",
"0.626142",
"0.62313515",
"0.62253755",
"0.6154122",
"0.6152826",
"0.61440194",
"0.6141382",
"0.61193... | 0.70757 | 0 |
retrieve actor age from parse tree | def parse_age_actor(soup, pageurl):
age = None
# search for class containing age
age_span = soup.findAll('span', { 'class' : 'noprint ForceAgeToShow' });
if len(age_span) == 0:
# check if actor is dead.
death_span = soup.findAll('span', {'class': 'deathplace'})
# if actor is dead, need to parse slightly diffe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_age(self):\n\t\treturn self.age",
"def get_age(actor: Actor, movie: Movie) -> str:\r\n opening_date = dateutil.parser.parse(movie.release_date)\r\n birth_date = dateutil.parser.parse(actor.born)\r\n age = int((opening_date - birth_date).days / 365)\r\n return f'{actor.name} was {age} years ol... | [
"0.65754455",
"0.65303713",
"0.6492695",
"0.6451706",
"0.6371887",
"0.62652147",
"0.62574565",
"0.62335324",
"0.6231755",
"0.62016493",
"0.62016493",
"0.62016493",
"0.6167333",
"0.6165584",
"0.6122277",
"0.60912716",
"0.6021394",
"0.5909445",
"0.5898403",
"0.5867766",
"0.5851... | 0.72760314 | 0 |
retrieve actor name from parse tree | def parse_name_actor(soup, pageurl):
# find fn (fullname) class
name_span = soup.findAll('span', {'class': 'fn'});
# if class does not exist, cannot get name
if len(name_span) == 0:
logging.warning('' + pageurl + ' does not contain a name for the actor and will not be parsed')
return None
name = name_span[0].g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_name_for_actor(actor, keyName=\"MeshName\"):\n information = actor.GetPropertyKeys()\n if information is None:\n return None\n\n iterator = vtkInformationIterator()\n iterator.SetInformation(information)\n iterator.InitTraversal()\n while (not iterator.IsDoneWithTraversal()):\n ... | [
"0.646448",
"0.6285451",
"0.6232348",
"0.62113476",
"0.6046053",
"0.5965016",
"0.59196943",
"0.59175456",
"0.5808527",
"0.58005923",
"0.5753228",
"0.5753228",
"0.5753228",
"0.5753228",
"0.5673512",
"0.5673044",
"0.5650498",
"0.5631687",
"0.5623361",
"0.5622566",
"0.55921346",... | 0.7316833 | 0 |
run the scraper until actors and movies have been read starting from starting_url | def run_scraping(max_actors, max_movies, starting_url):
actors = []
movies = []
seen_actors = set() # keep track of actor urls we have already read
seen_movies = set() # keep track of movie urls we have already read
# attempt to parse starting page as actor
actor = parse_actor_page(starting_url)
# parsing as act... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def movie_spider(self, movieTag):\n index = 0\n logging.info(\"Start crawling tag: %s\" % movieTag)\n while index < self.MAX_NUM:\n root = \"https://movie.douban.com/tag/%s?start=%d&type=T\" % (movieTag, index)\n result = {}\n try:\n html = reque... | [
"0.60525113",
"0.59239",
"0.5902864",
"0.58827484",
"0.58633286",
"0.58445555",
"0.5842251",
"0.5801655",
"0.5792442",
"0.57478684",
"0.57307994",
"0.5704864",
"0.56988525",
"0.5689044",
"0.56390786",
"0.56176597",
"0.5610419",
"0.55998534",
"0.55607843",
"0.5532689",
"0.5529... | 0.76580703 | 0 |
take a list of immediate rewards r(s,a) for the whole session compute cumulative returns (a.k.a. G(s,a) in Sutton '16) G_t = r_t + gammar_{t+1} + gamma^2r_{t+2} + ... The simple way to compute cumulative rewards is to iterate from last to first time tick and compute G_t = r_t + gammaG_{t+1} recurrently You must return ... | def get_cumulative_rewards(rewards, # rewards at each step
gamma=0.99 # discount for reward
):
cumulative_rewards = []
prev = 0
for r in reversed(rewards):
prev = r + gamma * prev
cumulative_rewards.append(prev)
cumulat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cumulative_rewards(rewards, # rewards at each step\n gamma=0.99 # discount for reward\n ):\n\n cumulative_rewards = np.empty_like(rewards)\n cumulative_rewards = cumulative_rewards.astype(float)\n cumulative_rewards[-1] = rewards[-1]\n\n for... | [
"0.8086463",
"0.75221175",
"0.74989986",
"0.7120142",
"0.7040207",
"0.6970117",
"0.69169426",
"0.68208987",
"0.6805671",
"0.6779615",
"0.6777824",
"0.6775084",
"0.6762717",
"0.6722188",
"0.6722188",
"0.67143553",
"0.6705431",
"0.6679104",
"0.6675288",
"0.66531205",
"0.6645495... | 0.7958346 | 1 |
Remove all entries and readd the default one | def reset(self):
self.clear()
self.addItem(self.default_entry)
self.default_present = True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_default(self):\n if self.default_present:\n self.removeItem(0)\n self.default_present = False",
"def reset(self):\n self.manager.delete_all()\n for name, val in DEFAULT_SETTINGS.items():\n val['name'] = name\n val['default_value'] = val[... | [
"0.6977303",
"0.67498195",
"0.6285861",
"0.6220166",
"0.6104129",
"0.60792434",
"0.60662955",
"0.60528636",
"0.596549",
"0.59406954",
"0.59254277",
"0.59136504",
"0.59018177",
"0.58770996",
"0.5872821",
"0.58519936",
"0.5848563",
"0.58399236",
"0.58017194",
"0.580006",
"0.579... | 0.72225904 | 0 |
Remove the default entry from the combobox | def remove_default(self):
if self.default_present:
self.removeItem(0)
self.default_present = False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset(self):\n self.clear()\n self.addItem(self.default_entry)\n self.default_present = True",
"def callback_ResetDropdown(window):\n # set values and value to empty to get rid of previously specified answers\n window['changeMod'].update('Change ___:')\n window['changeOptions'].... | [
"0.75154924",
"0.67385966",
"0.67171717",
"0.66934747",
"0.6626956",
"0.6524782",
"0.6524782",
"0.64653707",
"0.6325919",
"0.6286732",
"0.6245934",
"0.6219625",
"0.62084115",
"0.6120786",
"0.6089416",
"0.6072567",
"0.6061621",
"0.60542953",
"0.6050444",
"0.5972857",
"0.596547... | 0.7131062 | 1 |
return true if given entry is equal to the default one | def is_default(self, entry: str):
if entry == self.default_entry:
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_default(self):\r\n return self.default is not None",
"def isDefault (self):\n val = self.__getattribute__('StoredValue')\n dft = self.__class__.StoredValue\n return val==dft",
"def selected(self, key):\n default = self.default\n if not default:\n ret... | [
"0.6521376",
"0.6338704",
"0.63305163",
"0.63305163",
"0.6317462",
"0.6317462",
"0.6317462",
"0.6310651",
"0.6307207",
"0.61208886",
"0.60462457",
"0.5967732",
"0.5884814",
"0.5872585",
"0.585515",
"0.585515",
"0.5801563",
"0.5794065",
"0.5731509",
"0.5726565",
"0.57056355",
... | 0.85995895 | 0 |
Give the mainwindow the focus | def get_focus(self):
self.activateWindow()
self.setFocus() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetFocus(self):\r\n \r\n self._main_win.SetFocus()",
"def __window_focus(self):\n pass",
"def focus(self):\n self.image_window.focus_set()",
"def cb_main_window(self, event):\n self.main_frame.Show()",
"def focus_on_main_content(self):\n self.browser.execute_sc... | [
"0.85215765",
"0.7625653",
"0.7386683",
"0.7265388",
"0.72404176",
"0.7198138",
"0.7100562",
"0.69812185",
"0.687903",
"0.67848086",
"0.6738931",
"0.67172503",
"0.6704273",
"0.6688338",
"0.6682438",
"0.6682438",
"0.6682438",
"0.6682438",
"0.6667337",
"0.66074306",
"0.6604284"... | 0.7647 | 1 |
Toggle fullscreen display of live stream | def toggle_fullscreen(self):
if self.view is not None:
self.view.toggle_fullscreen()
else:
if self.isFullScreen():
self.showNormal()
else:
self.showFullScreen() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toggle_fullscreen(self):\n self.view['fullscreen'] = not self.view['fullscreen']\n self.update_flags()",
"def ToggleFullScreen(self, event):\n pass",
"def toggle_display_mode(self):\n if self.main_window.windowState() == Qt.WindowFullScreen:\n self.main_window.showNorma... | [
"0.77785176",
"0.7289721",
"0.72561216",
"0.69165295",
"0.68373",
"0.68166304",
"0.6764844",
"0.6413092",
"0.6281825",
"0.6215867",
"0.614676",
"0.6129783",
"0.5990289",
"0.5984907",
"0.5957068",
"0.5856672",
"0.5847585",
"0.5787374",
"0.5762275",
"0.5753435",
"0.57442886",
... | 0.7450912 | 1 |
toggle if window is maximized | def toggle_maximized(self):
if self.isMaximized():
self.showNormal()
else:
self.showMaximized() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ev_windowmaximized(self, event: WindowEvent) -> None:",
"def showMaximized(self):\n self.usualSize = self.size()\n self.setWindowState(Qt.WindowMaximized)\n self.move(0, 0)\n self.setFixedSize(QSize(self.screenSize.width(), self.screenSize.height()))\n self.maximized = True... | [
"0.7820601",
"0.7653134",
"0.7629788",
"0.7489226",
"0.74695164",
"0.7399641",
"0.7397679",
"0.73632103",
"0.6924824",
"0.6897695",
"0.6890535",
"0.67408967",
"0.6691294",
"0.6614349",
"0.64903975",
"0.6457933",
"0.6359517",
"0.634822",
"0.6307984",
"0.6301482",
"0.6282737",
... | 0.87751627 | 0 |
SLOT for opening the device_dialog | def open_device_dialog(self):
res, device = DeviceDialog.get_device(self.indexer)
if res and device:
self.serial = device.serial
if self.serial:
caps_str = None
self.open_device(self.serial, caps_str) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def openDialog(self):\n\n dialog = OlaInterfaceDialog(self.iface)\n #activityRequestManager.setLogger(dialog.getLogger())\n #stakeholderRequestManager.setLogger(dialog.getLogger())\n dialog.show()\n dialog.exec_()",
"def show_dialog(self, widget, data):\n\t\twidget.show()",
"... | [
"0.72223973",
"0.65935975",
"0.64645797",
"0.62754333",
"0.61981803",
"0.6146807",
"0.61411476",
"0.5960082",
"0.5948667",
"0.59420764",
"0.5940712",
"0.593929",
"0.5929782",
"0.59068716",
"0.5895663",
"0.5881444",
"0.5840185",
"0.58293617",
"0.5821385",
"0.5817283",
"0.58166... | 0.7736335 | 0 |
SLOT for save_image button Signal TcamView to save an image. | def save_image_action(self):
self.view.save_image(self.settings.get_image_type()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_image(self):\n self.save()",
"def saveImage(self, event):\r\n fileWritten = self.image.writeFile()\r\n self.statusBar.SetStatusText(\"Saved {}\".format(fileWritten))",
"def saveimage(self):\n if self.saveimageButton.isChecked():\n self.save = True\n sel... | [
"0.7665097",
"0.74206346",
"0.72684413",
"0.707904",
"0.6925761",
"0.68802965",
"0.6684905",
"0.6577725",
"0.6543838",
"0.6503374",
"0.64440256",
"0.64293844",
"0.6404814",
"0.6368824",
"0.63486",
"0.63454443",
"0.6295196",
"0.6246747",
"0.6241237",
"0.62363344",
"0.62125033"... | 0.771208 | 0 |
SLOT for triggering TcamView recording start | def start_recording_video(self):
self.view.start_recording_video(self.settings.get_video_type())
self.recording_action.setIcon(QIcon.fromTheme("media-playback-stop"))
self.recording_action.setText("Stop recording")
self.recording_action.triggered.disconnect(self.start_recording_video)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_btn_press(self):\n video_name_prefix = 'record_cam_'\n curr_btn_text = self.ids.camera_type_btn.text\n cam_type = None\n if curr_btn_text == 'LEFT camera':\n cam_type = CameraType.LEFT\n video_name_prefix += 'left_'\n elif curr_btn_text == 'RIGHT c... | [
"0.707944",
"0.7018223",
"0.7001985",
"0.6938329",
"0.6819354",
"0.68083215",
"0.6669713",
"0.6644366",
"0.66404665",
"0.64095736",
"0.6393445",
"0.6225379",
"0.61866045",
"0.6174494",
"0.6170784",
"0.6168816",
"0.61610895",
"0.61354643",
"0.61025184",
"0.60540915",
"0.599639... | 0.71693856 | 0 |
SLOT for triggering TcamView recording stop | def stop_recording_video(self):
self.view.stop_recording_video()
self.recording_action.setText("Start recording")
self.recording_action.setIcon(QIcon.fromTheme("media-record"))
# self.recording_action.clicked.connect(self.start_recording_video)
self.recording_action.triggered.con... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_recording(self):\n self.timer.stop()\n self.camera.release()",
"def stop_recording(self):\n self.flag_event.clear()\n self.statusBar().showMessage('Recording Stopped')\n print('boo ya')",
"def recording_stop(self):\n self._post('recording/stop')",
"def stop(... | [
"0.75150037",
"0.7468689",
"0.7401987",
"0.72047955",
"0.71698153",
"0.7064419",
"0.70641965",
"0.69533217",
"0.6856337",
"0.6849003",
"0.683635",
"0.6815774",
"0.67987853",
"0.67265373",
"0.67242557",
"0.6723735",
"0.6631874",
"0.6622279",
"0.65967786",
"0.6567594",
"0.65546... | 0.7968838 | 0 |
SLOT for indexer.update_device_list Refills the device combobox | def update_device_list(self, device_list):
self.device_list = device_list
self.device_combo.clear()
if not device_list:
return
self.device_combo.addItem("")
active_entry = None
for dev in device_list:
action_string = "{model:<18} - {contype:<... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rescan(self):\n # clear list then try to populate it\n self.combobox.clear()\n self.combobox.addItems(self.serial_ports())",
"def updateIndiDeviceNameList(self, deviceNames):\n self.ui.indiDeviceList.clear()\n self.ui.indiDeviceList.setView(QListView())\n for deviceN... | [
"0.65742946",
"0.6435014",
"0.62879837",
"0.62796646",
"0.62454766",
"0.60760653",
"0.60412735",
"0.6029993",
"0.6026281",
"0.5987554",
"0.59793836",
"0.5933709",
"0.5932247",
"0.59020907",
"0.588613",
"0.5801976",
"0.57783437",
"0.5754646",
"0.57529074",
"0.57402176",
"0.571... | 0.76592964 | 0 |
Fill format combobox with the correct values | def populate_fmt_box(self):
if not self.caps_desc:
log.error("No caps description available")
return
self.format_combo.clear()
self.format_combo.addItems(self.caps_desc.get_fmt_list()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fill_combobox_attributes(self):\n\n list_char = [\"\"]\n list_num = [\"\"]\n if self.ui.radioButton_file.isChecked():\n for a in self.attributes:\n if a['caseOrFile'] == \"file\" and a['valuetype'] == \"character\":\n list_char.append(a['name'])... | [
"0.6657599",
"0.61305267",
"0.5976538",
"0.5975161",
"0.59560186",
"0.5913378",
"0.58423036",
"0.5786123",
"0.57765007",
"0.5742966",
"0.57259357",
"0.5723684",
"0.56895316",
"0.5585147",
"0.55753726",
"0.55739045",
"0.5534609",
"0.5532612",
"0.5478232",
"0.54637164",
"0.5458... | 0.6849542 | 0 |
Fill resolution combobox with the correct values | def populate_resolution_box(self, fmt: str):
self.resolution_combo.reset()
self.fps_combo.reset()
res_list = self.caps_desc.get_resolution_list(fmt)
if not res_list:
log.error("Could not retrieve resolutions for format. Resolution box will be empty.")
return
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def populate_widget(self):\n self.temp_dropdown.addItems(self.units_data[\"Choices\"][\"Temperature\"])\n self.volume_dropdown.addItems(self.units_data[\"Choices\"][\"Volume\"])\n self.press_dropdown.addItems(self.units_data[\"Choices\"][\"Pressure\"])\n self.energy_dropdown.addItems(se... | [
"0.6261228",
"0.62291586",
"0.61907",
"0.59861046",
"0.5910437",
"0.579078",
"0.5787957",
"0.5754356",
"0.5731423",
"0.5644927",
"0.562032",
"0.55707103",
"0.5559286",
"0.55488664",
"0.55329794",
"0.5510547",
"0.5505883",
"0.5460895",
"0.5393549",
"0.53639525",
"0.53261834",
... | 0.73871225 | 0 |
Fill fps combobox with the correct values | def populate_fps_box(self, fmt: str, resolution: str):
self.fps_combo.reset()
self.selected_format.resolution = resolution
fps_list = self.caps_desc.get_fps_list(fmt, resolution)
if fps_list:
self.fps_combo.addItems(fps_list)
else:
log.error("fps list is... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_fps(self):\n self.fps.tick()\n\n\trange_str = \"\"\n gd = self.main_curve_dialog.curve.get_data()[1]\n\trange_str = \"Max: %s, Min: %s, Avg: %0.5s \" \\\n\t\t % (numpy.max(gd), numpy.min(gd), numpy.average(gd))\n\n\n fps_text = \"%s Update: %s FPS\" % (range_str, self.fp... | [
"0.669535",
"0.6247682",
"0.62121534",
"0.5872882",
"0.5801373",
"0.5727971",
"0.5694387",
"0.5655729",
"0.5653547",
"0.5649037",
"0.5614854",
"0.561173",
"0.55304486",
"0.55304486",
"0.5464913",
"0.54498553",
"0.53941745",
"0.5332726",
"0.5283767",
"0.5276037",
"0.51836836",... | 0.7432794 | 0 |
SLOT for TcamView.current_fps signal | def current_fps(self, fps: float):
self.current_fps_label.setText("FPS: {0:.2f}".format(fps)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_fps(self):\n #return int(self._root.knob('fps').getValue())\n return None",
"def get_fps(self):\n raise NotImplementedError(\"get_fps is not implemented\")",
"def get_fps(self):\n return self.fps",
"def update_fps(self):\n self.fps.tick()\n\n\trange_str = \"\"\n ... | [
"0.7003743",
"0.69901824",
"0.6960558",
"0.6936377",
"0.64896387",
"0.63295084",
"0.6309658",
"0.6299556",
"0.6299556",
"0.6206244",
"0.6189777",
"0.6168409",
"0.6114089",
"0.60884637",
"0.60884637",
"0.6070239",
"0.60246634",
"0.6024544",
"0.60196865",
"0.5999914",
"0.593570... | 0.71897244 | 0 |
SLOT for toggle_properties_dialog button | def toggle_properties_dialog(self):
if self.props:
if self.props_action.isEnabled():
if self.props.isVisible():
self.props.setVisible(False)
else:
self.props.setVisible(True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _propertyStateChangedSlot(self):\r\n \r\n self._updateButtonStates()",
"def runPropertiesDialog(\n self,\n title: str='Properties',\n data: Any=None,\n callback: Callable=None,\n buttons: list[str]=None,\n ) -> tuple[str, dict]:\n if not g.unitTestin... | [
"0.68079835",
"0.59354854",
"0.58478785",
"0.57949",
"0.5761404",
"0.57025796",
"0.56807196",
"0.56803876",
"0.5661363",
"0.5661363",
"0.5634546",
"0.562932",
"0.562932",
"0.56098855",
"0.5517654",
"0.5514949",
"0.5506094",
"0.5452804",
"0.5442448",
"0.54012376",
"0.5400129",... | 0.786769 | 0 |
Callback for device lost | def lost_device(self):
log.error("Lost device. Stopping...")
error_dialog = QtWidgets.QMessageBox(self)
error_dialog.setIcon(QtWidgets.QMessageBox.Critical)
error_dialog.setWindowTitle("Device lost")
error_dialog.setText("Device has been lost. Please reconnect or re-open it.")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connectionLost(self,reason):\n pass",
"def device_disconnect(self):\n pass",
"def onSlaveLost(self):",
"def onDisconnect(self):\n if self.mode:\n self.onSlaveLost()\n else:\n self.onMasterLost()",
"def connectionLost(reason):",
"def connectionLost(sel... | [
"0.68883383",
"0.6881039",
"0.6835883",
"0.68068254",
"0.680549",
"0.68000424",
"0.6739751",
"0.67163235",
"0.6713551",
"0.6674512",
"0.64816093",
"0.64513654",
"0.64346534",
"0.6407615",
"0.6388652",
"0.637159",
"0.63641965",
"0.6353555",
"0.63299817",
"0.6317049",
"0.627711... | 0.6924699 | 0 |
Reset the settings file to its default settings. | def reset_settings():
settings = Settings()
settings.reset()
settings.save() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset(self):\n self.settings = None\n self.sublime_settings = None\n self.settings_base = \"Javatar.sublime-settings\"\n self.sublime_base = \"Preferences.sublime-settings\"",
"def reset(self):\n self.manager.delete_all()\n for name, val in DEFAULT_SETTINGS.items():\... | [
"0.77655935",
"0.76699114",
"0.75686604",
"0.73642653",
"0.714579",
"0.69762117",
"0.6961716",
"0.69464904",
"0.69106317",
"0.68446547",
"0.675989",
"0.6677753",
"0.6652857",
"0.6632827",
"0.66272193",
"0.6585988",
"0.65594023",
"0.65523386",
"0.6483458",
"0.6475557",
"0.6468... | 0.8261184 | 0 |
Synthesize a mixture of complex sinusoids with given amps and freqs. | def synthesize1(amps, freqs, ts):
components = [thinkdsp.ComplexSinusoid(freq, amp)
for amp, freq in zip(amps, freqs)]
signal = thinkdsp.SumSignal(*components)
ys = signal.evaluate(ts)
return ys | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def synthesize2(amps, freqs, ts):\n i = complex(0, 1)\n args = numpy.outer(ts, freqs)\n M = numpy.exp(i * PI2 * args)\n ys = numpy.dot(M, amps)\n return ys",
"def sim_any_sinmode(gls_obj, in_freq, times):\n k = np.where(np.round(gls_obj.freq, 5) == in_freq)[0]\n if len(k) > 1:\n k = k... | [
"0.80196184",
"0.6407792",
"0.62863654",
"0.62863654",
"0.6147729",
"0.6080275",
"0.60179985",
"0.5974659",
"0.5897086",
"0.58589035",
"0.58248323",
"0.5815062",
"0.5793412",
"0.5755238",
"0.5733475",
"0.5718344",
"0.5685311",
"0.5675494",
"0.5591899",
"0.5589799",
"0.5572544... | 0.801305 | 1 |
Synthesize a mixture of cosines with given amps and freqs. | def synthesize2(amps, freqs, ts):
i = complex(0, 1)
args = numpy.outer(ts, freqs)
M = numpy.exp(i * PI2 * args)
ys = numpy.dot(M, amps)
return ys | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def synthesize1(amps, freqs, ts):\n components = [thinkdsp.ComplexSinusoid(freq, amp)\n for amp, freq in zip(amps, freqs)]\n signal = thinkdsp.SumSignal(*components)\n\n ys = signal.evaluate(ts)\n return ys",
"def make_cosine_filter(freqs, l, h, convert_to_erb=True):\n if convert_... | [
"0.66440606",
"0.5971497",
"0.59364045",
"0.5690704",
"0.5600116",
"0.55793095",
"0.55698717",
"0.55436957",
"0.55254865",
"0.55194205",
"0.55178684",
"0.5508569",
"0.55030453",
"0.54539835",
"0.54503185",
"0.54468507",
"0.54093593",
"0.5403311",
"0.5377375",
"0.5377375",
"0.... | 0.6846313 | 0 |
Get target Q values for the DQN | def get_target_q_values(
self, next_states: torch.Tensor, rewards: torch.Tensor, dones: torch.Tensor
) -> torch.Tensor:
return ddqn_q_target(self, next_states, rewards, dones) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _build_target_q_op(self):\n targets = []\n for gamma, target_q in zip(self.gammas,\n self._replay_next_target_net_outputs.q_values):\n # Get the maximum Q-value across the actions dimension.\n replay_next_qt_max = tf.reduce_max(target_q, 1)\n\n # Calculate the... | [
"0.7340513",
"0.731698",
"0.73039997",
"0.72186744",
"0.7103071",
"0.70633316",
"0.6898974",
"0.68981934",
"0.6862593",
"0.6812295",
"0.6812295",
"0.67770517",
"0.6720027",
"0.6611473",
"0.657207",
"0.6543056",
"0.6533878",
"0.65277517",
"0.6377499",
"0.6356354",
"0.63253444"... | 0.81235486 | 0 |
Conditinonally initialize an empty container for persistence, but only if it is not currently bound | def initialize_persistence(self, key, empty):
self.log.info(f"Checking to see if {key} is available")
if not self.get(key):
self.log.info(f"Initializing {key} is available")
self[key] = empty | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ensure_container():\n return exec_fn(_init_container)",
"def __post_init__(self):\n self.dbase = databases.Database(\n self.dsn,\n min_size=self.min_size,\n max_size=self.max_size\n )\n self.engine, self.meta = self.get_engine_metadata()",
"def initi... | [
"0.5714295",
"0.5692599",
"0.5512448",
"0.54564196",
"0.5452596",
"0.5422317",
"0.54130006",
"0.5396915",
"0.53508943",
"0.5342851",
"0.5336218",
"0.53324497",
"0.5316186",
"0.53095114",
"0.53095114",
"0.52793956",
"0.5267756",
"0.5214219",
"0.52099735",
"0.51714766",
"0.5165... | 0.57061845 | 1 |
(!rg add ) add a trigger phrase (!rg list ) list trigger phrases (!rg del ) get rid of a trigger phrase (!rg ) reply to the trigger phrase | def rg(self, cmd, action, trigger=None, reply=None):
key = "REPLYGUYREPLIES"
self.log.info(f"Got this cmd: {cmd}, trigger: {trigger}, reply: {reply}")
self.initialize_persistence(key, dict())
if action not in ('add', 'list', 'del'):
return self.get_trigger(action)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _addTrigger(self, message: IRCMessage) -> IRCResponse:\n if len(message.parameterList) < 3:\n return IRCResponse(self.help(message.parameterList), message.replyTo)\n else:\n triggerName = message.parameterList[1]\n regex = message.parameterList[2]\n if ... | [
"0.5783098",
"0.5747691",
"0.560282",
"0.55853987",
"0.5524236",
"0.55069995",
"0.52896726",
"0.5271488",
"0.5221964",
"0.52139896",
"0.5181011",
"0.516994",
"0.5133364",
"0.5074347",
"0.5054005",
"0.50130767",
"0.4957021",
"0.48693043",
"0.4868257",
"0.48661622",
"0.48642397... | 0.585128 | 0 |
Shortcut for definining one of patterns | def oneof(chars):
return Pattern("[" + re.escape(chars) + "]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, pattern1, pattern2):\n self.pattern1 = pattern1\n self.pattern2 = pattern2",
"def __init__(self, pattern):\r\n self.pattern = pattern",
"def _parse_pattern(cls, pattern, default_pattern: str = \"*\") -> Pattern:\n pattern = pattern or default_pattern\n if p... | [
"0.64103615",
"0.62365615",
"0.60184973",
"0.597726",
"0.5804374",
"0.5748904",
"0.5744501",
"0.5654598",
"0.5547254",
"0.5546239",
"0.5541917",
"0.55197877",
"0.55184805",
"0.5518048",
"0.54880273",
"0.5478061",
"0.54655737",
"0.5455595",
"0.5455595",
"0.5424383",
"0.54209",... | 0.62504685 | 1 |
is_seat_available should be True | def test_seat_available(self):
course = Course.objects.first()
self.assertTrue(course.is_seat_available()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def can_reserve(train_id,segment_id):\n cursor.execute(\"\"\"select freeseat from seats_free where train_id= %s and segment_id= %s\"\"\", [train_id,segment_id]) # query\n available_seats = cursor.fetchone() # fetch all reservations related to that passenger\n print(available_seats)\n if available_sea... | [
"0.75618273",
"0.7324938",
"0.6822535",
"0.6357032",
"0.6225129",
"0.61665374",
"0.60513437",
"0.59948534",
"0.59166336",
"0.58736706",
"0.5858866",
"0.58557504",
"0.5846569",
"0.5841871",
"0.58000517",
"0.5749854",
"0.5716636",
"0.571171",
"0.56503063",
"0.5605793",
"0.55785... | 0.76609826 | 0 |
Parse MetaData and separate from the original text. This was copied from the PythonMarkdown metadata extension because we need to get the metadata before processing the text. | def parse_metadata(source_text):
meta = {}
key = None
lines = source_text.split('\n')
META_RE = re.compile(r'^[ ]{0,3}(?P<key>[A-Za-z0-9_-]+):\s*(?P<value>.*)')
META_MORE_RE = re.compile(r'^[ ]{4,}(?P<value>.*)')
while 1:
line = lines.pop(0)
if line.strip() == '':
bre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _parse_metadata(self, meta):\r\n output = {}\r\n for name, value in meta.items():\r\n name = name.lower()\r\n if name == \"summary\":\r\n # handle summary metadata as markdown\r\n # summary metadata is special case and join all list values\r\n ... | [
"0.6679287",
"0.64856046",
"0.6477376",
"0.6405227",
"0.63946843",
"0.63365054",
"0.6293972",
"0.6265375",
"0.6251389",
"0.62103",
"0.619661",
"0.6171009",
"0.61523783",
"0.60900044",
"0.6067146",
"0.6022465",
"0.60156524",
"0.59465307",
"0.5935348",
"0.5865524",
"0.58340776"... | 0.6732872 | 0 |
Scan through the text and return the first heading. | def first_heading(source_text):
lines = source_text.split('\n')
for l in lines:
if l.startswith(u'#'):
return l.strip(u'# ')
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_heading(self):\n return self.heading[0]",
"def getHead(text):\n\n text = text.strip()\n\n #check if conjunction\n if utils.isConj(text):\n return utils.conjHead(text)\n\n tokens = text.split()\n new_text = \"\"\n first = True\n for word in tokens:\n if (utils.bre... | [
"0.7118369",
"0.67600405",
"0.6324827",
"0.6280133",
"0.62466013",
"0.6157914",
"0.6089808",
"0.60865825",
"0.60865825",
"0.6075665",
"0.60706073",
"0.606172",
"0.6052698",
"0.6035757",
"0.59962547",
"0.5976843",
"0.590053",
"0.5854347",
"0.58163756",
"0.58121425",
"0.5784009... | 0.78976667 | 0 |
Enable or disable the greeter. | async def greeter_toggle(self, ctx, value: bool):
await queries.update_setting(ctx, "greeter_settings", "is_enabled", value)
if value:
await util.send_success(ctx, "Greeter is now **enabled**")
else:
await util.send_success(ctx, "Greeter is now **disabled**") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def greetWaveHand(self):\n\n self.behaviorService.startBehavior(\"caresses/greetingsuk_silent\")",
"def hook_greet(self):\n ui.greet()",
"async def goodbye_toggle(self, ctx, value: bool):\n await queries.update_setting(ctx, \"goodbye_settings\", \"is_enabled\", value)\n if value:\n ... | [
"0.6477771",
"0.6264559",
"0.6054871",
"0.6028336",
"0.60077584",
"0.59350467",
"0.59019685",
"0.5861723",
"0.58585143",
"0.5835431",
"0.5834937",
"0.5825718",
"0.58109444",
"0.58109444",
"0.5804014",
"0.5765661",
"0.5760887",
"0.5691181",
"0.5691181",
"0.5685854",
"0.5684209... | 0.7328916 | 0 |
Set the greeter channel. | async def greeter_channel(self, ctx, *, channel: discord.TextChannel):
await queries.update_setting(ctx, "greeter_settings", "channel_id", channel.id)
await util.send_success(ctx, f"Greeter channel is now {channel.mention}") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cmd_channel_greet(self, c, e):\n c.privmsg(e.target(), 'Greetings %s!' % nm_to_n(e.source()))",
"async def setwelcomechannel(self, ctx, *, channel : discord.TextChannel = None):\n\n isAdmin = ctx.message.author.permissions_in(ctx.message.channel).administrator\n if not isAdmin:\n ... | [
"0.7318288",
"0.67578006",
"0.65876096",
"0.6227286",
"0.6199718",
"0.6185189",
"0.61525005",
"0.6103339",
"0.595159",
"0.5932074",
"0.5901783",
"0.58469766",
"0.5811762",
"0.5802515",
"0.57934093",
"0.57206345",
"0.56566197",
"0.5635526",
"0.5626589",
"0.5614913",
"0.5610345... | 0.8017055 | 0 |
Change the greeter welcome message format. Use with "default" to reset to the default format. | async def greeter_message(self, ctx, *, message):
if message.lower() == "default":
message = None
await queries.update_setting(ctx, "greeter_settings", "message_format", message)
preview = util.create_welcome_embed(ctx.author, ctx.guild, message)
await ctx.send(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def goodbye_message(self, ctx, *, message):\n if message.lower() == \"default\":\n message = None\n\n await queries.update_setting(ctx, \"goodbye_settings\", \"message_format\", message)\n\n preview = util.create_goodbye_message(ctx.author, ctx.guild, message)\n await c... | [
"0.63834804",
"0.60635793",
"0.5964353",
"0.595972",
"0.5918968",
"0.591741",
"0.59035933",
"0.5873536",
"0.587106",
"0.5812223",
"0.5807533",
"0.578724",
"0.57856905",
"0.5778921",
"0.57711405",
"0.57711405",
"0.57562244",
"0.57479846",
"0.57199866",
"0.571122",
"0.5698763",... | 0.8244929 | 0 |
Configure the goodbye message. | async def goodbyemessage(self, ctx):
await util.command_group_help(ctx) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def setgoodbye(self, ctx, *, message = None):\n\n isAdmin = ctx.message.author.permissions_in(ctx.message.channel).administrator\n if not isAdmin:\n checkAdmin = self.settings.getServerStat(ctx.message.guild, \"AdminArray\")\n for role in ctx.message.author.roles:\n ... | [
"0.71816283",
"0.69867355",
"0.66739315",
"0.6558542",
"0.63833344",
"0.6288717",
"0.6247802",
"0.61139035",
"0.6053868",
"0.6016886",
"0.58894956",
"0.58512425",
"0.580781",
"0.580781",
"0.580781",
"0.580781",
"0.57996494",
"0.57834107",
"0.577756",
"0.563015",
"0.5591717",
... | 0.70658946 | 1 |
Enable or disable the goodbye messages. | async def goodbye_toggle(self, ctx, value: bool):
await queries.update_setting(ctx, "goodbye_settings", "is_enabled", value)
if value:
await util.send_success(ctx, "Goodbye messages are now **enabled**")
else:
await util.send_success(ctx, "Goodbye messages are now **disab... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def setgoodbye(self, ctx, *, message = None):\n\n isAdmin = ctx.message.author.permissions_in(ctx.message.channel).administrator\n if not isAdmin:\n checkAdmin = self.settings.getServerStat(ctx.message.guild, \"AdminArray\")\n for role in ctx.message.author.roles:\n ... | [
"0.7018153",
"0.66460556",
"0.64507306",
"0.6184782",
"0.6183916",
"0.6118601",
"0.610833",
"0.59966445",
"0.58894914",
"0.58488446",
"0.57712567",
"0.57665324",
"0.570186",
"0.5598159",
"0.55362624",
"0.55231476",
"0.55149776",
"0.55095404",
"0.54875284",
"0.5425469",
"0.536... | 0.7206986 | 0 |
Set the goodbye messages channel. | async def goodbye_channel(self, ctx, *, channel: discord.TextChannel):
await queries.update_setting(ctx, "goodbye_settings", "channel_id", channel.id)
await util.send_success(ctx, f"Goodbye messages channel is now {channel.mention}") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def setgoodbye(self, ctx, *, message = None):\n\n isAdmin = ctx.message.author.permissions_in(ctx.message.channel).administrator\n if not isAdmin:\n checkAdmin = self.settings.getServerStat(ctx.message.guild, \"AdminArray\")\n for role in ctx.message.author.roles:\n ... | [
"0.7816099",
"0.6805236",
"0.6357314",
"0.62137836",
"0.62005395",
"0.613328",
"0.60564995",
"0.59892213",
"0.59874475",
"0.595532",
"0.5928017",
"0.5894383",
"0.5848997",
"0.57791036",
"0.57519305",
"0.5716252",
"0.5674424",
"0.5674424",
"0.5674424",
"0.5674424",
"0.5666469"... | 0.78777874 | 0 |
Change the goodbye message format. Use with "default" to reset to the default format. | async def goodbye_message(self, ctx, *, message):
if message.lower() == "default":
message = None
await queries.update_setting(ctx, "goodbye_settings", "message_format", message)
preview = util.create_goodbye_message(ctx.author, ctx.guild, message)
await ctx.send(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def greeter_message(self, ctx, *, message):\n if message.lower() == \"default\":\n message = None\n\n await queries.update_setting(ctx, \"greeter_settings\", \"message_format\", message)\n\n preview = util.create_welcome_embed(ctx.author, ctx.guild, message)\n await ctx... | [
"0.65157515",
"0.5964058",
"0.5521351",
"0.53972715",
"0.53753895",
"0.52022594",
"0.519179",
"0.51566714",
"0.5146679",
"0.509162",
"0.5064359",
"0.50575995",
"0.50530344",
"0.5037282",
"0.5024463",
"0.50166017",
"0.49504206",
"0.49470967",
"0.4944687",
"0.49100703",
"0.4879... | 0.8226291 | 0 |
Set channel for member leaves and joins logging. Set to \"none\" to disable. | async def logger_members(self, ctx, *, channel: ChannelSetting):
await queries.update_setting(
ctx,
"logging_settings",
"member_log_channel_id",
channel.id if channel is not None else None,
)
if channel is None:
await util.send_success(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def setjoinlogchannel(self, ctx, channel):\r\n guild = ctx.message.guild\r\n channel = discord.utils.get(guild.channels, name=channel)\r\n functions.updatesql(server=ctx.guild.id, joinchannel=channel.id)\r\n await ctx.send(embed=discord.Embed(title='Sucsessful!'))",
"async def l... | [
"0.6388253",
"0.61632013",
"0.60923856",
"0.59469324",
"0.58941215",
"0.583976",
"0.57854843",
"0.5784756",
"0.57304996",
"0.571542",
"0.5693126",
"0.56816924",
"0.56628096",
"0.56007785",
"0.5545248",
"0.552837",
"0.5506172",
"0.5458992",
"0.54587036",
"0.5447408",
"0.539945... | 0.6712195 | 0 |
Configure logging of deleted messages. | async def logger_deleted(self, ctx):
await util.command_group_help(ctx) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_delete_messages(self, mock_logging):\n self.client.get_messages()\n self.client.unique_buckets_from_messages()\n self.client.delete_messages()\n\n assert_true(mock_logging.info.called)",
"def test_delete_messages(self, mock_logging):\n self.client.delete_messages()\n\n... | [
"0.63532245",
"0.62736726",
"0.6077349",
"0.59833217",
"0.5927443",
"0.5896194",
"0.57929784",
"0.57720333",
"0.5720607",
"0.5696656",
"0.566804",
"0.5651914",
"0.5646251",
"0.56186223",
"0.5581898",
"0.5578034",
"0.55721843",
"0.55694205",
"0.55602795",
"0.5523681",
"0.55101... | 0.6733723 | 0 |
Set channel where deleted messages are logged. Set to \"none\" to disable. | async def deleted_channel(self, ctx, *, channel: ChannelSetting):
await queries.update_setting(
ctx,
"logging_settings",
"message_log_channel_id",
channel.id if channel is not None else None,
)
if channel is None:
await util.send_succes... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def deleted_ignore(self, ctx, *, channel: discord.TextChannel):\n await self.bot.db.execute(\n \"INSERT IGNORE message_log_ignore (guild_id, channel_id) VALUES (%s, %s)\",\n ctx.guild.id,\n channel.id,\n )\n await util.send_success(\n ctx, f\"N... | [
"0.6275573",
"0.6192169",
"0.6155777",
"0.60911435",
"0.60149145",
"0.6013943",
"0.5994552",
"0.5970127",
"0.5947025",
"0.5902792",
"0.58888257",
"0.58867365",
"0.581911",
"0.5642268",
"0.561333",
"0.5613302",
"0.5556067",
"0.5522734",
"0.5477377",
"0.5347408",
"0.5326588",
... | 0.75079334 | 0 |
Ignore channels from being logged in deleted messages. | async def deleted_ignore(self, ctx, *, channel: discord.TextChannel):
await self.bot.db.execute(
"INSERT IGNORE message_log_ignore (guild_id, channel_id) VALUES (%s, %s)",
ctx.guild.id,
channel.id,
)
await util.send_success(
ctx, f"No longer loggin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def deleted_unignore(self, ctx, *, channel: discord.TextChannel):\n await self.bot.db.execute(\n \"DELETE FROM message_log_ignore WHERE guild_id = %s and channel_id = %s\",\n ctx.guild.id,\n channel.id,\n )\n await util.send_success(\n ctx, f\"... | [
"0.7360008",
"0.68895507",
"0.68258065",
"0.6386742",
"0.637563",
"0.6257892",
"0.6201101",
"0.6153284",
"0.6080621",
"0.6042102",
"0.6003482",
"0.59936863",
"0.5904756",
"0.5898352",
"0.5885802",
"0.5868689",
"0.5863",
"0.5861538",
"0.5791361",
"0.57619256",
"0.57619256",
... | 0.72416854 | 1 |
Unignore channel from logging deleted messages. | async def deleted_unignore(self, ctx, *, channel: discord.TextChannel):
await self.bot.db.execute(
"DELETE FROM message_log_ignore WHERE guild_id = %s and channel_id = %s",
ctx.guild.id,
channel.id,
)
await util.send_success(
ctx, f"{channel.mentio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def deleted_ignore(self, ctx, *, channel: discord.TextChannel):\n await self.bot.db.execute(\n \"INSERT IGNORE message_log_ignore (guild_id, channel_id) VALUES (%s, %s)\",\n ctx.guild.id,\n channel.id,\n )\n await util.send_success(\n ctx, f\"N... | [
"0.7009797",
"0.69817466",
"0.6773601",
"0.6706983",
"0.6589273",
"0.65629417",
"0.64006984",
"0.6324372",
"0.63126546",
"0.63115185",
"0.623914",
"0.62346995",
"0.62052894",
"0.6100807",
"0.60527056",
"0.6034753",
"0.60061955",
"0.5985775",
"0.59622896",
"0.5913944",
"0.5891... | 0.7869431 | 0 |
Enable or disable levelup messages. | async def levelup(self, ctx, value: bool):
await queries.update_setting(ctx, "guild_settings", "levelup_messages", value)
self.bot.cache.levelupmessage[str(ctx.guild.id)] = value
if value:
await util.send_success(ctx, "Level up messages are now **enabled**")
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable(self, message):\n self.Enable()",
"def level_up(self):\n if self.level < self.max_level:\n self.level = self.level + 1\n self.update_level_buttons()",
"def update_level_buttons(self):\n self.level_buttons[0].set_text(\"Level \" + str(self.level))\n i... | [
"0.6004002",
"0.58667386",
"0.58334637",
"0.5747977",
"0.5647755",
"0.55298764",
"0.5503052",
"0.5503052",
"0.5501034",
"0.5489065",
"0.5480927",
"0.5440391",
"0.5434728",
"0.54146266",
"0.53779954",
"0.53762686",
"0.537069",
"0.5361621",
"0.5360507",
"0.53429866",
"0.5338378... | 0.7560187 | 0 |
Change the amount of reactions required to starboard a message. | async def starboard_amount(self, ctx, amount: int):
await queries.update_setting(ctx, "starboard_settings", "reaction_count", amount)
emoji_name, emoji_id, emoji_type = await self.bot.db.execute(
"""
SELECT emoji_name, emoji_id, emoji_type
FROM starboard_settings WHER... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def reactions(self, ctx):\n\n\t\tawait self.message_leaderboard(ctx, \"reactions\")",
"def add_reactions(_) -> int:\n return 1 << 6",
"def add_reactions(_) -> int:\n return 1 << 6",
"def replenish(self, amount: int):\n self._inventory += amount",
"def update_recruiting(self, rate... | [
"0.63772947",
"0.6179722",
"0.6179722",
"0.5825801",
"0.58167845",
"0.560417",
"0.5564357",
"0.5545454",
"0.55370396",
"0.5528173",
"0.5518888",
"0.55142504",
"0.55124456",
"0.5497931",
"0.54795575",
"0.54564846",
"0.54389095",
"0.54326606",
"0.5426115",
"0.54188395",
"0.5386... | 0.75119036 | 0 |
Enable or disable the starboard. | async def starboard_toggle(self, ctx, value: bool):
await queries.update_setting(ctx, "starboard_settings", "is_enabled", value)
if value:
await util.send_success(ctx, "Starboard is now **enabled**")
else:
await util.send_success(ctx, "Starboard is now **disabled**")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def enable(self, ctx):\n self.bot.db.execute(\"UPDATE starboards SET enabled = 1 WHERE channel_id = ?\", (ctx.channel.id,))\n await ctx.say(\"star.enabled\")",
"def enable(self):\r\n self.update(enabled=True)",
"def enable(self):\n self.enabled = True",
"def enable(self):\n ... | [
"0.73347926",
"0.6678862",
"0.64272314",
"0.64272314",
"0.6332191",
"0.63085085",
"0.621917",
"0.61903405",
"0.6167511",
"0.610374",
"0.60661536",
"0.60428685",
"0.6018322",
"0.59943926",
"0.5961357",
"0.59239256",
"0.5923186",
"0.5915935",
"0.5912247",
"0.5882375",
"0.588093... | 0.71241033 | 1 |
Change the emoji to use for starboard. | async def starboard_emoji(self, ctx, emoji):
if emoji[0] == "<":
# is custom emoji
emoji_obj = await util.get_emoji(ctx, emoji)
if emoji_obj is None:
raise exceptions.Warning("I don't know this emoji!")
await self.bot.db.execute(
"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def emoji(self, new_emoji):\n self._manager._items[self.name][\"emoji\"] = new_emoji",
"async def emoji(self, ctx):\n emb = discord.Embed(colour=self.color)\n emb.add_field(name='Usage', value=f'```{self.bot.command_prefix}emoji <emojiname>```')\n await ctx.message.edit(embed=emb)",
... | [
"0.747814",
"0.67162085",
"0.6436995",
"0.63608056",
"0.6325624",
"0.61955166",
"0.61558616",
"0.6100455",
"0.60699123",
"0.6055131",
"0.60201323",
"0.5990598",
"0.5963166",
"0.59600675",
"0.5952855",
"0.59410125",
"0.5884371",
"0.57748556",
"0.57458675",
"0.5726449",
"0.5700... | 0.7078539 | 1 |
Set starboard logging channel to log starring events. | async def starboard_log(self, ctx, channel: ChannelSetting):
if channel is None:
await queries.update_setting(ctx, "starboard_settings", "log_channel_id", None)
await util.send_success(ctx, "Starboard log is now disabled")
else:
await queries.update_setting(ctx, "star... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def log_channel(self, ctx, channel: discord.TextChannel = None):\n if not channel:\n channel = ctx.channel\n await self.config.logChannel.set(channel.id)\n await ctx.send(f\"Set {channel.mention} as the log channel.\")",
"async def log(self, ctx: commands.Context, *, channel... | [
"0.65407205",
"0.626499",
"0.6182352",
"0.61187524",
"0.60568273",
"0.58455837",
"0.583881",
"0.5826057",
"0.57415724",
"0.56891274",
"0.5685825",
"0.56736535",
"0.5602801",
"0.55732495",
"0.5521697",
"0.54911536",
"0.54852647",
"0.5451384",
"0.5439705",
"0.5426035",
"0.54138... | 0.73025167 | 0 |
Blacklist a channel from being counted for starboard. | async def starboard_blacklist(self, ctx, channel: discord.TextChannel):
await self.bot.db.execute(
"""
INSERT INTO starboard_blacklist (guild_id, channel_id)
VALUES (%s, %s)
ON DUPLICATE KEY UPDATE
channel_id = channel_id
""",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def starboard_unblacklist(self, ctx, channel: discord.TextChannel):\n await self.bot.db.execute(\n \"\"\"\n DELETE FROM starboard_blacklist WHERE guild_id = %s AND channel_id = %s\n \"\"\",\n ctx.guild.id,\n channel.id,\n )\n await u... | [
"0.7701849",
"0.7458994",
"0.6936165",
"0.6751506",
"0.6683966",
"0.6313854",
"0.62444025",
"0.6207786",
"0.61005974",
"0.6091192",
"0.60751545",
"0.60740715",
"0.6030533",
"0.602858",
"0.60215175",
"0.5990134",
"0.5979729",
"0.596842",
"0.5940257",
"0.5883848",
"0.58685654",... | 0.7591608 | 1 |
Unblacklist a channel from being counted for starboard. | async def starboard_unblacklist(self, ctx, channel: discord.TextChannel):
await self.bot.db.execute(
"""
DELETE FROM starboard_blacklist WHERE guild_id = %s AND channel_id = %s
""",
ctx.guild.id,
channel.id,
)
await util.send_success(ct... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def unwatch(self, ctx, channel: discord.TextChannel):\r\n channel_list = await self.config.guild(ctx.guild).watching()\r\n if channel.id in channel_list:\r\n channel_list.remove(channel.id)\r\n else:\r\n return await ctx.send(\"Channel is not being watched.\")\r\n ... | [
"0.6954328",
"0.66228104",
"0.64334494",
"0.64204955",
"0.6242785",
"0.62098294",
"0.60095453",
"0.5959053",
"0.59541696",
"0.59374624",
"0.5932349",
"0.5903953",
"0.5864807",
"0.58647525",
"0.5813934",
"0.58111167",
"0.5808564",
"0.57795113",
"0.576817",
"0.576073",
"0.57290... | 0.748404 | 0 |
See current starboard config. | async def starboard_current(self, ctx):
starboard_settings = self.bot.cache.starboard_settings.get(str(ctx.guild.id))
if not starboard_settings:
raise exceptions.Warning("Nothing has been configured on this server yet!")
(
is_enabled,
board_channel_id,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def running_config(self):\n return self.show(\"show running-config\")",
"def config():",
"def config():",
"def magic_config(self,parameter_s=''):\n \n page('Current configuration structure:\\n'+\n pformat(self.rc.dict()))",
"def config(self):\n return self[CONFIG_KEY... | [
"0.6932935",
"0.68101513",
"0.68101513",
"0.6727502",
"0.6621875",
"0.66020155",
"0.65464556",
"0.6545495",
"0.6512111",
"0.6497331",
"0.64561635",
"0.6432405",
"0.6425665",
"0.6412814",
"0.6412814",
"0.63946736",
"0.6388964",
"0.6383513",
"0.6367806",
"0.6348651",
"0.6346286... | 0.69071114 | 1 |
Remove a voting channel. | async def votechannel_remove(self, ctx, *, channel: discord.TextChannel):
await self.bot.db.execute(
"DELETE FROM voting_channel WHERE guild_id = %s and channel_id = %s",
ctx.guild.id,
channel.id,
)
self.bot.cache.votechannels.discard(channel.id)
await... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_channel(self, channel):\n to_exec = \"DELETE FROM channel WHERE channel_id = %s\"\n self.__cursor.execute(to_exec, (str(channel.id),))\n self.__connection.commit()",
"async def remove(self, ctx, channel : discord.Channel):\r\n \r\n server = ctx.message.server\r\n ... | [
"0.7149222",
"0.714502",
"0.7041786",
"0.6968231",
"0.69668585",
"0.6924569",
"0.6630783",
"0.6527944",
"0.65166974",
"0.6483894",
"0.6454751",
"0.6329355",
"0.62373024",
"0.6229125",
"0.61606574",
"0.6073813",
"0.6043893",
"0.6032386",
"0.5994328",
"0.5949203",
"0.5914197",
... | 0.8143196 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.