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 |
|---|---|---|---|---|---|---|
Return set with free standins for vote group | def get_free_standins(group): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_voting_group_for(userid):",
"def playerStandingsByPoints():\n with _connect_db() as (conn, cur):\n cur.execute(\"\"\"SELECT * FROM standing_by_points_and_omw;\"\"\")\n standings = cur.fetchall()\n return standings",
"def setOfBetas(self, free=True, fixed=False):\n if free... | [
"0.57512337",
"0.55472344",
"0.5325146",
"0.52594614",
"0.5216245",
"0.5203526",
"0.5180353",
"0.51753294",
"0.514772",
"0.5058915",
"0.5038112",
"0.5038112",
"0.5029908",
"0.5016512",
"0.49624905",
"0.49421495",
"0.49241853",
"0.492211",
"0.49191612",
"0.491825",
"0.4916307"... | 0.7577462 | 0 |
Check if user is available as substitute in group | def can_substitute(userid, group): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_group(group, user, request):\n return group_names[group] in groupfinder(user.username, request)",
"def es_utilizado(self):\n group = Group.objects.filter(id=self.id)\n group = group.all()[0] if group.exists() else None\n # group = Group.objects.get(name=self.nombre)\n ... | [
"0.6843152",
"0.6825423",
"0.6696184",
"0.6569707",
"0.6563286",
"0.6555222",
"0.6513763",
"0.64933294",
"0.64790606",
"0.6447624",
"0.64358574",
"0.6376097",
"0.6351452",
"0.6337335",
"0.633711",
"0.633531",
"0.6327141",
"0.6279555",
"0.62594604",
"0.6216393",
"0.6212417",
... | 0.7977445 | 0 |
Check if users vote in group can be assigned | def can_assign(userid, group): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def can_substitute(userid, group):",
"def assign_vote(from_userid, to_userid, group):",
"def _check_groups_kvm():\n if not _user_belongs_to('libvirtd') and not _user_belongs_to('kvm'):\n _raise_group_error('kvm')",
"def _vote(self, team):\r\n return True",
"def has_permission(self, request... | [
"0.65737265",
"0.6454914",
"0.6086847",
"0.59613115",
"0.59399277",
"0.59117025",
"0.5884281",
"0.58508795",
"0.5833693",
"0.5831978",
"0.5819896",
"0.580923",
"0.58010465",
"0.57998455",
"0.57641053",
"0.56734246",
"0.5670381",
"0.5668177",
"0.5658174",
"0.56207025",
"0.5602... | 0.7091285 | 0 |
Assign vote from/to user in group. Fire event when assigned. | def assign_vote(from_userid, to_userid, group): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def up_vote(cls, user, message):\r\n pass",
"def up_vote(cls, user, message):\n pass",
"def hook_assign_assistance(self, data):\n request_id = data[\"request_id\"]\n assignee_chat_id = data[\"volunteer\"]\n log.info(\"ASSIGN req:%s to vol:%s\", request_id, assignee_chat_id)\n... | [
"0.59657407",
"0.58806044",
"0.57867134",
"0.57653934",
"0.5712857",
"0.55659926",
"0.55515975",
"0.5419159",
"0.5339649",
"0.52747655",
"0.5248671",
"0.52333826",
"0.52248734",
"0.520426",
"0.52010214",
"0.5184497",
"0.5178164",
"0.5177095",
"0.51604635",
"0.5158247",
"0.515... | 0.82624394 | 0 |
Release substitute voter in group. Fire event when released. | def release_substitute(voter, group): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def release(self):\n if not self._released:\n logging.debug('Release {}'.format(self.username))\n self.ref.done(self.username)\n\n self._released = True",
"def release(self, o):\n if not self.available(o):\n raise ValueError('you do not own this lock')\n ... | [
"0.568893",
"0.5510711",
"0.5481713",
"0.54390734",
"0.5432001",
"0.5365603",
"0.5327659",
"0.53139013",
"0.5287539",
"0.5276201",
"0.52522033",
"0.52296",
"0.5217612",
"0.51806086",
"0.51783025",
"0.51783025",
"0.51783025",
"0.5170228",
"0.51651764",
"0.5153382",
"0.5081252"... | 0.8386667 | 0 |
Set role for user in group. Fire event when role is set. | def set_role(userid, role, group, request=None): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_role(self, group, role):\n self.permissions[group] = roles[role]",
"def can_set_role(userid, role, group):",
"def set_role(self, user, role):\n obj = self._get_through_object(user)\n obj.role = role if isinstance(role, int) else obj.ROLE_MAP_REV[role]\n obj.save()",
"def s... | [
"0.78854024",
"0.74935555",
"0.73427594",
"0.7085086",
"0.6954636",
"0.6940147",
"0.6940147",
"0.69231117",
"0.6921136",
"0.69080925",
"0.6673014",
"0.66470397",
"0.6630489",
"0.6626295",
"0.66085875",
"0.65583783",
"0.65336525",
"0.652336",
"0.65176064",
"0.6401517",
"0.6352... | 0.8299594 | 0 |
Return userids with role | def get_roles(role): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_roles_ids(self, principal_id):",
"def user_ids(self):\r\n raise NotImplementedError",
"def get_roles_map(userids):",
"def iter_role_ids(self):\n role_ids = self.role_ids\n if (role_ids is not None):\n yield from role_ids",
"def get_principals(self, role_id):",
"def... | [
"0.7301223",
"0.69987816",
"0.69768566",
"0.6967561",
"0.6922516",
"0.67704755",
"0.66789025",
"0.6607219",
"0.66050965",
"0.6599573",
"0.65758866",
"0.6534075",
"0.65296686",
"0.65155774",
"0.6508593",
"0.64671344",
"0.64501697",
"0.64361936",
"0.6412903",
"0.6383273",
"0.63... | 0.7473805 | 0 |
Return substitute for this user, or None. | def get_substitute_for(userid): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_user(self):\n return None",
"def user(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user\")",
"def user(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user\")",
"def user(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self,... | [
"0.6176437",
"0.6054508",
"0.6054508",
"0.6054508",
"0.59177125",
"0.5911468",
"0.587742",
"0.5787252",
"0.577023",
"0.5761056",
"0.5703204",
"0.5698208",
"0.56566185",
"0.5623337",
"0.5620244",
"0.5597055",
"0.5593594",
"0.55808675",
"0.55754155",
"0.55538505",
"0.55334234",... | 0.65251297 | 0 |
Test the query of a mnemonic over a given time range. | def test_query_single_mnemonic():
mnemonic_identifier = 'SE_ZIMIRICEA'
start_time = Time(2018.01, format='decimalyear')
end_time = Time(2018.02, format='decimalyear')
mnemonic = edb.query_single_mnemonic(mnemonic_identifier, start_time, end_time)
print(mnemonic) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def test_31() -> None:\n LOG.debug(\"Test mateName with start range and no end range.\")\n payload = {\n \"referenceName\": \"2\",\n \"mateName\": \"13\",\n \"startMin\": 300000,\n \"startMax\": 400000,\n \"referenceBases\": \"N\",\n \"assemblyId\": \"GRCh38\",... | [
"0.59789693",
"0.56561685",
"0.5470865",
"0.5455683",
"0.54103154",
"0.53520554",
"0.5272547",
"0.5247404",
"0.5216952",
"0.52157587",
"0.51991236",
"0.5180331",
"0.515263",
"0.51525915",
"0.5125176",
"0.5112662",
"0.5108119",
"0.5106339",
"0.5095755",
"0.5084144",
"0.5084028... | 0.6716472 | 0 |
Run the tests specified in ref_component and driver_component. Results are stored in the output_file and they will be used for the following coverage analysis | def execute_reference_driver_tests(ref_component, driver_component, outcome_file):
# If the outcome file already exists, we assume that the user wants to
# perform the comparison analysis again without repeating the tests.
if os.path.exists(outcome_file):
Results.log("Outcome file (" + outcome_file ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_analyze_driver_vs_reference(outcome_file, args):\n execute_reference_driver_tests(args['component_ref'], \\\n args['component_driver'], outcome_file)\n\n ignored_suites = ['test_suite_' + x for x in args['ignored_suites']]\n\n outcomes = read_outcome_file(outcome_... | [
"0.6742765",
"0.6261754",
"0.62282825",
"0.5921308",
"0.59111327",
"0.58804053",
"0.58306754",
"0.57172936",
"0.56517243",
"0.5647995",
"0.56273764",
"0.5621035",
"0.56132406",
"0.55717474",
"0.5563124",
"0.5563007",
"0.5521342",
"0.55155194",
"0.550273",
"0.54976845",
"0.548... | 0.72836244 | 0 |
Check that all tests executed in the reference component are also executed in the corresponding driver component. | def analyze_driver_vs_reference(outcomes, component_ref, component_driver,
ignored_suites, ignored_test=None):
available = check_test_cases.collect_available_test_cases()
result = True
for key in available:
# Continue if test was not executed by any component
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execute_reference_driver_tests(ref_component, driver_component, outcome_file):\n # If the outcome file already exists, we assume that the user wants to\n # perform the comparison analysis again without repeating the tests.\n if os.path.exists(outcome_file):\n Results.log(\"Outcome file (\" + ou... | [
"0.65716875",
"0.616256",
"0.6154037",
"0.60796356",
"0.6078592",
"0.6071125",
"0.6047107",
"0.60393524",
"0.5998849",
"0.5928936",
"0.59199417",
"0.5894479",
"0.583806",
"0.57810754",
"0.576",
"0.5759518",
"0.57581884",
"0.5738344",
"0.57222354",
"0.56978214",
"0.5668177",
... | 0.6934446 | 0 |
Parse an outcome file and return an outcome collection. An outcome collection is a dictionary mapping keys to TestCaseOutcomes objects. The keys are the test suite name and the test case description, separated by a semicolon. | def read_outcome_file(outcome_file):
outcomes = {}
with open(outcome_file, 'r', encoding='utf-8') as input_file:
for line in input_file:
(platform, config, suite, case, result, _cause) = line.split(';')
key = ';'.join([suite, case])
setup = ';'.join([platform, config]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_acts_results(acts_summary_filename):\n with open(acts_summary_filename) as json_file:\n data = json.load(json_file)\n\n master_results_data = [['Test', 'Result']]\n master_results_pass = [['Test', 'Result']]\n master_results_fail = [['Test', 'Result']]\n master_results_unknown = [['T... | [
"0.5361456",
"0.5054492",
"0.50316614",
"0.49300462",
"0.4913257",
"0.49100512",
"0.48929173",
"0.48553434",
"0.48522368",
"0.4814908",
"0.48115203",
"0.4805499",
"0.47828746",
"0.47713897",
"0.4695003",
"0.46804592",
"0.4667088",
"0.4665277",
"0.4656362",
"0.4639516",
"0.461... | 0.7592572 | 0 |
Perform driver vs reference analyze. | def do_analyze_driver_vs_reference(outcome_file, args):
execute_reference_driver_tests(args['component_ref'], \
args['component_driver'], outcome_file)
ignored_suites = ['test_suite_' + x for x in args['ignored_suites']]
outcomes = read_outcome_file(outcome_file)
Re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def help_analyze(self):\n print(ANALYZE)",
"def analyse(self):\n pass",
"def probe(self):",
"def run_analyze():\n\n parser = ArgumentParser()\n parser.add_argument('name',nargs='?',default=None,help=\"Results file or directory with result files\")\n parser.add_argument('-o','--output',... | [
"0.6217833",
"0.6206486",
"0.60714835",
"0.5904124",
"0.5802196",
"0.57745117",
"0.5773813",
"0.5716741",
"0.57016426",
"0.56533134",
"0.5634568",
"0.56214017",
"0.56130004",
"0.56110144",
"0.55961233",
"0.55313843",
"0.5517428",
"0.55088323",
"0.5493558",
"0.54755896",
"0.54... | 0.7134408 | 0 |
Get a list of subjectsupported playbook actions. | def get_subject_supported_actions(self, client_id=None):
if client_id is None:
client_id = self._use_default_client_id()[0]
url = self.api_base_url.format(str(client_id)) + "/subject-supported-actions"
try:
raw_response = self.request_handler.make_request(ApiRequestHan... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_available_actions(self):\n return self.actions",
"def get_list_of_actions(self):\n return self.actions",
"def get_actions(self):\n return []",
"def getActions():\n return getPlugins(IRenamingAction, plugins)",
"def list(self):\n\n return list(\n filter(\n ... | [
"0.6442799",
"0.6286291",
"0.6225656",
"0.6160071",
"0.6012256",
"0.6003807",
"0.59464866",
"0.5943126",
"0.5935935",
"0.593151",
"0.59251124",
"0.5904549",
"0.58659524",
"0.58659524",
"0.5825306",
"0.58082306",
"0.580288",
"0.57892096",
"0.5785716",
"0.578504",
"0.57394695",... | 0.6987215 | 0 |
Fetch a single page of playbooks from client | def get_playbooks_single_page(self, page_size=1000, page_num=0, sort_dir=SortDirection.ASC, client_id=None):
if client_id is None:
client_id = self._use_default_client_id()[0]
if page_size > 1000:
raise PageSizeError("Page size must be <= 1000")
url = self.api_base_url... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def playbooks(self):\n playbook_url = self._data.get('related', {}).get('playbooks')\n url = f'{self._tower.host}{playbook_url}'\n response = self._tower.session.get(url)\n if not response.ok:\n self._logger.error('Error getting playbooks for project \"%s\", response was :\"%... | [
"0.6795756",
"0.64323425",
"0.641093",
"0.629854",
"0.6172227",
"0.6133158",
"0.6112825",
"0.60934156",
"0.602663",
"0.60111916",
"0.5923647",
"0.5922126",
"0.59147036",
"0.5906467",
"0.59036165",
"0.58775985",
"0.5865158",
"0.5792613",
"0.5782046",
"0.5771832",
"0.5766132",
... | 0.714931 | 0 |
Get all playbooks for a client. | def get_all_playbooks(self, client_id=None):
if client_id is None:
client_id = self._use_default_client_id()[0]
url = self.api_base_url.format(str(client_id)) + "/fetch"
try:
num_pages = self._get_playbook_page_info(url, page_size=1000)
except RequestFailed:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def playbooks(self):\n playbook_url = self._data.get('related', {}).get('playbooks')\n url = f'{self._tower.host}{playbook_url}'\n response = self._tower.session.get(url)\n if not response.ok:\n self._logger.error('Error getting playbooks for project \"%s\", response was :\"%... | [
"0.6847453",
"0.6154859",
"0.61119366",
"0.6058365",
"0.6025219",
"0.58711123",
"0.57999855",
"0.57999855",
"0.5797934",
"0.57751596",
"0.57262754",
"0.57256633",
"0.57162267",
"0.5663738",
"0.56325287",
"0.56157553",
"0.560496",
"0.5604705",
"0.5572589",
"0.5560265",
"0.5525... | 0.8681611 | 0 |
Fetch a specific playbook by UUID. | def get_specific_playbook(self, playbook_uuid, client_id=None):
if client_id is None:
client_id = self._use_default_client_id()[0]
url = self.api_base_url.format(str(client_id)) + "/fetch/{}".format(playbook_uuid)
try:
raw_response = self.request_handler.make_request(A... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_by_uuid(self, uuid):\n return self.get(uuid=uuid)",
"def get_playbook_details(self, playbook_uuid, client_id=None):\n\n if client_id is None:\n client_id = self._use_default_client_id()[0]\n\n url = self.api_base_url.format(str(client_id)) + \"/{}\".format(playbook_uuid)\n... | [
"0.60287845",
"0.5974556",
"0.57457364",
"0.5726571",
"0.56901956",
"0.56731266",
"0.56554705",
"0.56157374",
"0.5600448",
"0.54495275",
"0.5367172",
"0.52542406",
"0.52176076",
"0.5209988",
"0.51830316",
"0.51804554",
"0.5169201",
"0.51656425",
"0.5148833",
"0.5144062",
"0.5... | 0.7592842 | 0 |
Get a single page of rules for a specific playbook | def get_single_page_playbook_rules(self, playbook_uuid, page_num=0, page_size=1000, sort_dir=SortDirection.ASC, client_id=None):
if page_size > 1000:
raise PageSizeError("Page Size must be <= 1000")
if client_id is None:
client_id = self._use_default_client_id()[0]
par... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rules():\n print \"Loading Rules\"\n return render_template(\"rules.html\")",
"def find(self, rule_name):\n return self.rules[rule_name]",
"def list_rulesets(command):\n namespace = app.main(command)\n assert namespace.command == 'lr' or namespace.command == \"listrulesets\"",
"def rul... | [
"0.6155544",
"0.54137385",
"0.51939535",
"0.5154783",
"0.51025707",
"0.51006174",
"0.5087586",
"0.505305",
"0.5046556",
"0.5045578",
"0.503692",
"0.498135",
"0.498135",
"0.498135",
"0.4977265",
"0.49655265",
"0.49486563",
"0.49328122",
"0.49231622",
"0.49086973",
"0.4867919",... | 0.5753641 | 1 |
Add a rule to a playbook with a file. | def add_rule_with_file(self, playbook_uuid, rule_name, rule_desc, rule_input, rule_action_type,
rule_action, rule_output_type, rule_output, file_name, file_path, client_id=None):
if client_id is None:
client_id = self._use_default_client_id()[0]
url = self.api_ba... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_rule(self, rule):\n self.rule.append(rule)",
"def add_rule(self, rule):\n \n self.rules.append(rule)",
"def add_rule(self, rule) -> None:\n self.add_rules([rule])",
"def add_rule(self, rule: Rule):\n self.rules.append(rule)",
"def add_rule(self, rule):\n as... | [
"0.6337733",
"0.632869",
"0.6277358",
"0.6172735",
"0.6102239",
"0.5846287",
"0.5792425",
"0.57257646",
"0.5720321",
"0.55229396",
"0.5509801",
"0.5480592",
"0.54635775",
"0.54485416",
"0.54433674",
"0.5420976",
"0.5370285",
"0.5335484",
"0.52583367",
"0.5254596",
"0.52504575... | 0.659933 | 0 |
Delete an existing playbook rule. | def delete_playbook_rule(self, rule_uuid, client_id=None):
if client_id is None:
client_id = self._use_default_client_id()[0]
url = self.api_base_url.format(str(client_id)) + "/rule/{}".format(rule_uuid)
try:
raw_response = self.request_handler.make_request(ApiRequestH... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_rule(self, index):\n del self.rules[index]",
"def delete_rule(uuid):\n with session_for_write() as session:\n stmt = (\n delete(\n model.RuleAction\n ).where(\n model.RuleAction.rule == uuid\n ).execution_options(synchroniz... | [
"0.66604507",
"0.6583669",
"0.6527114",
"0.64742684",
"0.6419354",
"0.63428366",
"0.6171094",
"0.61237884",
"0.6123752",
"0.6118455",
"0.61073667",
"0.60828674",
"0.6062154",
"0.6028991",
"0.602525",
"0.60155016",
"0.5968572",
"0.5942693",
"0.591645",
"0.58942413",
"0.589395"... | 0.68284297 | 0 |
Attach a file to an existing rule. | def attach_file_to_rule(self, rule_uuid, file_name, file_path, client_id=None):
if client_id is None:
client_id = self._use_default_client_id()[0]
url = self.api_base_url.format(str(client_id)) + "/rule/{}/file".format(rule_uuid)
upload_file = {'file': (file_name, open(file_path, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attach(self, filename, file_contents, **extra):\n\t\tself._client.add_attachment(self, filename, file_contents, **extra)",
"def add_rule_with_file(self, playbook_uuid, rule_name, rule_desc, rule_input, rule_action_type,\n rule_action, rule_output_type, rule_output, file_name, file_p... | [
"0.64118785",
"0.59802157",
"0.5941721",
"0.58638847",
"0.58638626",
"0.5863583",
"0.584371",
"0.5799856",
"0.5799284",
"0.5756087",
"0.57534814",
"0.5752005",
"0.56876343",
"0.56445724",
"0.5626905",
"0.56192553",
"0.55763394",
"0.5566872",
"0.5453234",
"0.5447893",
"0.54134... | 0.66837174 | 0 |
GIVEN a Url model WHEN a new Url is created THEN check the "long" url and "short" url are defined correctly | def test_model(self):
url = Urls('https://blog.gds-gov.tech/terragrunt-in-retro-i-would-have-done-these-few-things-e5aaac451942', 'http://172.104.63.163/n4lm9')
self.assertEqual(url.long,'https://blog.gds-gov.tech/terragrunt-in-retro-i-would-have-done-these-few-things-e5aaac451942')
self.assertE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_short_url(self, value: str) -> str:\n url_id = self.context.get(\"url_id\") # just in update mode we have id.\n\n if url_id: # for update step old and new short_value could be same.\n try:\n old_short_url = URL.objects.get(id=url_id).short_url\n exc... | [
"0.681895",
"0.67708176",
"0.66799545",
"0.66367996",
"0.64779055",
"0.64145344",
"0.6406699",
"0.636378",
"0.63110125",
"0.6284067",
"0.62565553",
"0.6216918",
"0.61968064",
"0.6174536",
"0.61728686",
"0.61644304",
"0.6158213",
"0.610884",
"0.6102415",
"0.6089039",
"0.607610... | 0.7820902 | 0 |
This method will convert a list of strings into it's latex form | def latexify(inputlist):
for index, item in enumerate(inputlist):
if item == "Gamma":
inputlist[index] = '$\Gamma$'
return inputlist | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_menu_text(list_of_items):\n ret = \"\"\n for item in list_of_items:\n item = clean(item)\n ret += item + \"\\n\"\n # translate = gs.translate(item, 'en', 'de')\n # ret += \"_\" + translate.replace(\" , \", \", \") + \"_\\n\"\n # ret += \"\\n\"\n return ret[:-1... | [
"0.6362603",
"0.62667763",
"0.6244385",
"0.6228729",
"0.6203832",
"0.61592513",
"0.6030785",
"0.60089856",
"0.60009927",
"0.58938664",
"0.58455706",
"0.5828954",
"0.5810236",
"0.5807946",
"0.57979995",
"0.57653224",
"0.5755689",
"0.5683192",
"0.5681768",
"0.56782645",
"0.5642... | 0.6739793 | 0 |
This function takes the difference between two consecutive items in a list. Also inputs should be float type lists | def differences(input_list):
output_list = []
for x in range(1,len(input_list)):
output_list.append(input_list[x]-input_list[x-1])
return output_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def temp_difference_cal(time_list):\n if len(time_list) > 1:\n final = float(time_list[len(time_list) - 1])\n initial = float(time_list[len(time_list) - 2])\n difference = final - initial\n else:\n difference = -1.0\n return difference",
"def subtraction_of(number_list):",
... | [
"0.7254786",
"0.66699386",
"0.6469895",
"0.64195234",
"0.63292027",
"0.62914854",
"0.6222279",
"0.6201521",
"0.61462986",
"0.6131335",
"0.5997068",
"0.59884804",
"0.59848124",
"0.5979155",
"0.58782184",
"0.58473486",
"0.58456624",
"0.58336586",
"0.58314794",
"0.5826488",
"0.5... | 0.735102 | 0 |
Opens the bands file and reads info | def open_file(self):
file = open(self.file_name_dat, "r")
rows = []
hashlinecount = 0 # looking at commented lines in order to extract fermi energy
for line in file:
rows.append(line)
# Getting information from the comments section
xdatatemp = []
yda... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_bands(bands):\n bands = map(str.split, open(bands).readlines())\n bands = [\"-\".join(b) for b in bands]\n return bands",
"def readBandit(filename):\n\tfile = open(filename, 'r')\n\tlines = file.readlines()\n\tbandit = [float(value.strip()) for value in lines]\n\treturn bandit",
"def read_mod... | [
"0.6727669",
"0.64556575",
"0.6320829",
"0.6177644",
"0.6142803",
"0.6044862",
"0.59907854",
"0.59298897",
"0.5869542",
"0.57824457",
"0.57716537",
"0.5727789",
"0.5713019",
"0.5712879",
"0.5681583",
"0.5664622",
"0.5653964",
"0.5644157",
"0.5596655",
"0.55922747",
"0.5589863... | 0.6994318 | 0 |
Extracts the binaries from a zip archive | def __extract_zip(self):
archive_binaries_dir = None
zip_file = zipfile.ZipFile(self.archive)
try:
extract_dir = tempfile.mkdtemp()
archive_binaries_dir = self.__create_extraction_dir(
zip_file.namelist(), extract_dir, zip_file.extract)
finally:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unpack_archive(self, archive_name):\n archive = zipfile.ZipFile(\n os.path.join(\n self.current_path,\n os.path.split(self.exe_file)[0],\n archive_name\n )\n )\n\n self.extraction_path = os.getcwd()\n\n archive.extra... | [
"0.73816484",
"0.66376436",
"0.6542317",
"0.65159655",
"0.64973956",
"0.6478698",
"0.6425805",
"0.6424609",
"0.62989867",
"0.62672746",
"0.6263914",
"0.62318075",
"0.62293404",
"0.6224862",
"0.62189317",
"0.6182036",
"0.6178817",
"0.616418",
"0.6155718",
"0.6143352",
"0.61391... | 0.7573248 | 0 |
Extracts the binaries form a compressed tar archive | def __extract_tgz(self):
tar_file = tarfile.open(self.archive)
try:
extract_dir = tempfile.mkdtemp()
archive_binaries_dir = self.__create_extraction_dir(
tar_file.getnames(), extract_dir, tar_file.extract)
finally:
tar_file.close()
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_tars(file_pattern, path_in, path_out):\n for f in glob.glob(os.path.join(path_in, file_pattern)):\n shutil.unpack_archive(f, path_out)",
"def extract_all(fn,dst=\".\"):\r\n if tarfile.is_tarfile(fn): \r\n with tarfile.open(fn,'r') as tf:\r\n tf.extractall(dst)\r\n ... | [
"0.68073887",
"0.68001294",
"0.6757611",
"0.66481763",
"0.6633087",
"0.65113074",
"0.65003157",
"0.6389242",
"0.63529354",
"0.6326272",
"0.6300598",
"0.6216573",
"0.61753213",
"0.6165228",
"0.6163152",
"0.61288",
"0.6118551",
"0.6116314",
"0.6099309",
"0.60938",
"0.60850185",... | 0.7706131 | 0 |
>>> reverse_digits(365) 563 >>> reverse_digits(9999990) 999999 | def reverse_digits(number: int):
acc = 0
while number != 0:
acc *= 10
acc += number % 10
number //= 10 # 정수 나눗셈
return acc | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reverse(n):\n return(int(str(n)[::-1]))",
"def num_reverse(num):\r\n return int(str(num)[::-1])",
"def revNumber(num):\r\n if num == 0:\r\n return \"\"\r\n else: # gets the last digit and recurses to get the new last digit, adds all the digits as a string\r\n return str(num%10) + ... | [
"0.6738876",
"0.6702117",
"0.6677842",
"0.6572699",
"0.65404236",
"0.63590306",
"0.63156235",
"0.620678",
"0.6204486",
"0.61893255",
"0.61891127",
"0.6186583",
"0.6171431",
"0.6167911",
"0.61072147",
"0.60863346",
"0.6021774",
"0.5989797",
"0.5876656",
"0.58619905",
"0.581094... | 0.7163473 | 0 |
Test runtime environment checks | def test_check_environment(monkeypatch):
monkeypatch.delenv("PYTHONPATH")
with pytest.raises(SystemExit):
check_environment() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_all_envs(func):\n register_tests(func, [func.__name__ + '_emulator',\n func.__name__ + '_verilator'])",
"def test_check_system_python_api(self):\n\n errors, successes = check_system.check_system()\n self.assertTrue(len(errors) + len(successes) >= 4)",
"def che... | [
"0.68899846",
"0.6853074",
"0.6817404",
"0.68065184",
"0.6759826",
"0.6682827",
"0.6620642",
"0.661293",
"0.6546175",
"0.65390843",
"0.65210253",
"0.65191996",
"0.65051675",
"0.6501742",
"0.6501211",
"0.64681065",
"0.64656895",
"0.6445622",
"0.64356893",
"0.6435198",
"0.64018... | 0.75505143 | 0 |
Calculate a running average of pressure values. The sensor seems to jitter its values a lot, so this should smooth it out and make the SD display more readable. | def get_pressure(self):
voltage_pressure = self.pressure_sensor.getVoltage()
new_value = (250 * voltage_pressure / 5) - 25
self._pressure_samples.append(new_value)
if not self.pressure_timer.hasPeriodPassed(self.pressure_timer_delay):
return self._last_pressure_value
# Calculate new running average
n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avg_pressure(start, end):\n return round((start + end) / 2, 2)",
"def calculate(self):\n avg = self.sum / self.n if self.n != 0 else 0\n self.running_avg.append(avg)\n return avg",
"def average(self):\n return (self.current + self.last) / 2.0",
"def average(self):\n ... | [
"0.71814156",
"0.70231885",
"0.68901515",
"0.68162245",
"0.6808366",
"0.6722301",
"0.6722301",
"0.6722301",
"0.66644216",
"0.6591414",
"0.6585002",
"0.6580853",
"0.651069",
"0.64285314",
"0.6413627",
"0.6406573",
"0.6406573",
"0.6393817",
"0.6386809",
"0.6385249",
"0.6376018"... | 0.73773116 | 0 |
Logs some info to the SmartDashboard, and standard output. | def log(self):
# Only every 1/10 second (or so) to avoid flooding networktables
if not self.log_timer.running or not self.log_timer.hasPeriodPassed(self.log_timer_delay):
return
wpilib.SmartDashboard.putString('Pressure', '{0:.2f}'.format(self.get_pressure()))
wpilib.SmartDashboard.putBoolean("Garbo?", sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _stdlog(self, msg):\n print msg\n logger.info(msg)",
"def printInfo():\n utils = CONFIG['utils']\n mytime = utils.mytime()\n logIt(\"Todays date: \" + mytime + \"\\n\")\n logIt(\" Number is: \" + str(CONFIG['number']) + \"\\n\")\n logIt(\" Host is: \" + str(CONF... | [
"0.70814556",
"0.6515659",
"0.6452051",
"0.6394406",
"0.63365287",
"0.632162",
"0.63026553",
"0.6202662",
"0.61607474",
"0.6143594",
"0.6135799",
"0.6082327",
"0.60800076",
"0.60795283",
"0.60742676",
"0.60499024",
"0.6034064",
"0.6033001",
"0.6023677",
"0.5975835",
"0.596575... | 0.65523416 | 1 |
Sets the beginning_image_number of this CommitteeReportsIEOnly. | def beginning_image_number(self, beginning_image_number):
self._beginning_image_number = beginning_image_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def image_number(self, image_number):\n\n self._image_number = image_number",
"def front_image(self, front_image):\n\n self._front_image = front_image",
"def SetLeftImage(self, image):\r\n\r\n self._leftimage = image",
"def set_startline(self, line_no):\n self.set_attribute(\"star... | [
"0.5794401",
"0.57165104",
"0.5498633",
"0.54518634",
"0.5356407",
"0.53553164",
"0.5212246",
"0.5207412",
"0.51333266",
"0.51053417",
"0.5093967",
"0.5073472",
"0.5055025",
"0.5001173",
"0.49773967",
"0.49454114",
"0.49412775",
"0.49412775",
"0.49412775",
"0.49412775",
"0.49... | 0.8383185 | 0 |
Sets the committee_id of this CommitteeReportsIEOnly. | def committee_id(self, committee_id):
self._committee_id = committee_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conduit_committee_id(self, conduit_committee_id):\n\n self._conduit_committee_id = conduit_committee_id",
"def committee(self, committee):\n\n self._committee = committee",
"def committee_type(self, committee_type):\n\n self._committee_type = committee_type",
"def committee_name(self... | [
"0.7100169",
"0.6370845",
"0.57569563",
"0.5717242",
"0.5324224",
"0.52166283",
"0.50250715",
"0.50232553",
"0.4985128",
"0.4985128",
"0.49508706",
"0.48953077",
"0.48024383",
"0.47979325",
"0.4784551",
"0.47490433",
"0.4738114",
"0.47220165",
"0.4702411",
"0.4688737",
"0.468... | 0.779657 | 0 |
Sets the committee_type of this CommitteeReportsIEOnly. | def committee_type(self, committee_type):
self._committee_type = committee_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def committee(self, committee):\n\n self._committee = committee",
"def report_type(self, report_type):\n\n self._report_type = report_type",
"def report_type(self, report_type):\n\n self._report_type = report_type",
"def report_type(self, report_type):\n\n self._report_type = repo... | [
"0.6155422",
"0.57214814",
"0.57214814",
"0.57214814",
"0.57164055",
"0.57164055",
"0.57164055",
"0.5387109",
"0.5315805",
"0.5313831",
"0.5267965",
"0.52274555",
"0.52194905",
"0.52194905",
"0.5217858",
"0.5179618",
"0.5177696",
"0.51568884",
"0.5156782",
"0.51126254",
"0.50... | 0.8193917 | 0 |
Sets the coverage_end_date of this CommitteeReportsIEOnly. | def coverage_end_date(self, coverage_end_date):
self._coverage_end_date = coverage_end_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date... | [
"0.7654847",
"0.7654847",
"0.7654847",
"0.7654847",
"0.7654847",
"0.7654847",
"0.7654847",
"0.7654847",
"0.7611371",
"0.73758507",
"0.7329207",
"0.71813506",
"0.71133703",
"0.6948979",
"0.68964326",
"0.684386",
"0.6834189",
"0.6771342",
"0.6759583",
"0.66879004",
"0.6572118",... | 0.8796761 | 0 |
Sets the coverage_start_date of this CommitteeReportsIEOnly. | def coverage_start_date(self, coverage_start_date):
self._coverage_start_date = coverage_start_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_date(self, start_date):\n \n self._start_date = start_date",
"def start_date(self, start_date):\n\n self._start_date = start_date",
"def start_date(self, start_date):\n\n self._start_date = start_date",
"def start_date(self, start_date):\n\n self._start_date = sta... | [
"0.7642533",
"0.75838315",
"0.75838315",
"0.75838315",
"0.75838315",
"0.75838315",
"0.75838315",
"0.75838315",
"0.75838315",
"0.75838315",
"0.7550486",
"0.74578184",
"0.73162735",
"0.72775173",
"0.70172787",
"0.6948155",
"0.67982256",
"0.6486989",
"0.629437",
"0.61973",
"0.60... | 0.845089 | 0 |
Sets the csv_url of this CommitteeReportsIEOnly. | def csv_url(self, csv_url):
self._csv_url = csv_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_input_csv(self):\n if len(self[\"input_csv\"]) > 1:\n raise Exception(\"You must only specify *one* unified CSV file!\")\n self.csv_path = self[\"input_csv\"][0]\n print(\"Using input file\", self.csv_path)",
"def exportCSV(self, log, csvFile):\n return 0",
"def u... | [
"0.59245163",
"0.56930506",
"0.55262655",
"0.5486811",
"0.53810775",
"0.531689",
"0.51883554",
"0.515727",
"0.51071715",
"0.5100657",
"0.507229",
"0.50589067",
"0.50569206",
"0.50320137",
"0.49934044",
"0.496737",
"0.4948793",
"0.49464035",
"0.49073207",
"0.4905693",
"0.49017... | 0.7646552 | 0 |
Sets the cycle of this CommitteeReportsIEOnly. | def cycle(self, cycle):
self._cycle = cycle | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_cycle_suppression(self):\n self._cyclesuppression = True\n self.suppression_used = False",
"def cycle(self):\n return self._cycle",
"def setCycle(self, cycleBit=0):\r\n\t\tcurrentVal = self.dec2BinList(self.read(0x6b))\r\n\t\tcurrentVal[5] = cycleBit\r\n\t\tcurrentVal = self.binLis... | [
"0.5774353",
"0.5691711",
"0.556853",
"0.54563063",
"0.5315737",
"0.5282283",
"0.5151115",
"0.5121156",
"0.5045911",
"0.50221664",
"0.5014134",
"0.49877065",
"0.49809328",
"0.49588326",
"0.48806143",
"0.48435065",
"0.48366222",
"0.48245177",
"0.47599283",
"0.47467914",
"0.469... | 0.67273206 | 0 |
Sets the document_description of this CommitteeReportsIEOnly. | def document_description(self, document_description):
self._document_description = document_description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_description(self, description):\n self._description = description",
"def set_description(self, description):\n self.description = description",
"def set_description(self, description):\n self.__description = description",
"def set_description(self, description):\r\n self._... | [
"0.6329863",
"0.62777823",
"0.61745924",
"0.61744964",
"0.6149189",
"0.61342824",
"0.61342824",
"0.61342824",
"0.61342824",
"0.61342824",
"0.61342824",
"0.61342824",
"0.61342824",
"0.61342824",
"0.61342824",
"0.61342824",
"0.61342824",
"0.61342824",
"0.61342824",
"0.61342824",
... | 0.8082709 | 0 |
Sets the end_image_number of this CommitteeReportsIEOnly. | def end_image_number(self, end_image_number):
self._end_image_number = end_image_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date... | [
"0.58909947",
"0.58909947",
"0.58909947",
"0.58909947",
"0.58909947",
"0.58909947",
"0.58909947",
"0.58909947",
"0.5814588",
"0.5702324",
"0.5631086",
"0.56295997",
"0.5550244",
"0.55355775",
"0.55355775",
"0.54816574",
"0.54816574",
"0.54816574",
"0.54542106",
"0.5452371",
"... | 0.8257827 | 0 |
Sets the fec_file_id of this CommitteeReportsIEOnly. | def fec_file_id(self, fec_file_id):
self._fec_file_id = fec_file_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fec_url(self, fec_url):\n\n self._fec_url = fec_url",
"def fec_url(self, fec_url):\n\n self._fec_url = fec_url",
"def file_id(self, file_id):\n if self.local_vars_configuration.client_side_validation and file_id is None: # noqa: E501\n raise ValueError(\"Invalid value for `... | [
"0.56476444",
"0.56476444",
"0.5474027",
"0.5474027",
"0.5391201",
"0.5388646",
"0.53115934",
"0.5176656",
"0.5067836",
"0.5067836",
"0.5067836",
"0.50658",
"0.5015789",
"0.50070864",
"0.49785918",
"0.49785918",
"0.49028748",
"0.48860705",
"0.48434138",
"0.48336008",
"0.48117... | 0.80598366 | 0 |
Sets the fec_url of this CommitteeReportsIEOnly. | def fec_url(self, fec_url):
self._fec_url = fec_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fec_file_id(self, fec_file_id):\n\n self._fec_file_id = fec_file_id",
"def fec_file_id(self, fec_file_id):\n\n self._fec_file_id = fec_file_id",
"def cpe_uri(self, cpe_uri):\n\n self._cpe_uri = cpe_uri",
"def get_event_start_url(self):\n start_date = (datetime.now() - timedelt... | [
"0.54691577",
"0.54691577",
"0.5139236",
"0.51163834",
"0.5004915",
"0.49690473",
"0.49439517",
"0.4940413",
"0.4919246",
"0.47868812",
"0.4763755",
"0.47588766",
"0.47558805",
"0.4737129",
"0.46898738",
"0.45945024",
"0.45926702",
"0.45504555",
"0.45322812",
"0.45043227",
"0... | 0.7628625 | 0 |
Sets the independent_contributions_period of this CommitteeReportsIEOnly. | def independent_contributions_period(self, independent_contributions_period):
self._independent_contributions_period = independent_contributions_period | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def independent_expenditures_period(self, independent_expenditures_period):\n\n self._independent_expenditures_period = independent_expenditures_period",
"def annual_dividend(self, annual_dividend: float):\n\n self._annual_dividend = annual_dividend",
"def nics_every(self, nics_every):\n\n ... | [
"0.7341486",
"0.49907604",
"0.46329165",
"0.458192",
"0.45773122",
"0.453223",
"0.44640908",
"0.44110942",
"0.44043857",
"0.43827456",
"0.43824667",
"0.43620273",
"0.4323632",
"0.43157676",
"0.43131822",
"0.43021482",
"0.4289625",
"0.42822167",
"0.4232625",
"0.42285788",
"0.4... | 0.8370525 | 0 |
Sets the independent_expenditures_period of this CommitteeReportsIEOnly. | def independent_expenditures_period(self, independent_expenditures_period):
self._independent_expenditures_period = independent_expenditures_period | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def independent_contributions_period(self, independent_contributions_period):\n\n self._independent_contributions_period = independent_contributions_period",
"def annual_dividend(self, annual_dividend: float):\n\n self._annual_dividend = annual_dividend",
"def overdue_periods(self, overdue_period... | [
"0.73478234",
"0.48881933",
"0.48549396",
"0.48283112",
"0.4739329",
"0.4642367",
"0.46010417",
"0.45455936",
"0.45088622",
"0.44739324",
"0.44642538",
"0.4438773",
"0.44289678",
"0.44176108",
"0.4415272",
"0.43957737",
"0.43713087",
"0.43440288",
"0.4343958",
"0.4343958",
"0... | 0.87593395 | 0 |
Sets the is_amended of this CommitteeReportsIEOnly. | def is_amended(self, is_amended):
self._is_amended = is_amended | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def amended_by(self, amended_by):\n\n self._amended_by = amended_by",
"def is_mitigated(self, is_mitigated):\n\n self._is_mitigated = is_mitigated",
"def amendment(self, amendment):\n\n self._amendment = amendment",
"def amendment_indicator(self, amendment_indicator):\n\n self._am... | [
"0.62295175",
"0.59822744",
"0.5910932",
"0.555732",
"0.52606636",
"0.5129305",
"0.50184953",
"0.5005889",
"0.5003657",
"0.5003657",
"0.49314654",
"0.4915959",
"0.48262396",
"0.48130363",
"0.47937226",
"0.47918117",
"0.4789124",
"0.47759283",
"0.47675496",
"0.47266373",
"0.47... | 0.7832977 | 0 |
Sets the means_filed of this CommitteeReportsIEOnly. | def means_filed(self, means_filed):
self._means_filed = means_filed | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def means(self):\n raise NotImplementedError",
"def mean(self, mean):\n\n self._mean = mean",
"def estimate(self, u, i):\n\n if u not in self.user_means:\n return(np.mean([self.global_mean,\n self.item_means[i]]))\n\n if i not in self.item_means... | [
"0.49088868",
"0.47957498",
"0.47092122",
"0.46834674",
"0.46217242",
"0.46135196",
"0.45961866",
"0.4593619",
"0.456663",
"0.45663187",
"0.45619443",
"0.45352167",
"0.4532138",
"0.45283347",
"0.4499992",
"0.44951257",
"0.44782174",
"0.44768396",
"0.44575745",
"0.4414068",
"0... | 0.67240965 | 0 |
Sets the pdf_url of this CommitteeReportsIEOnly. | def pdf_url(self, pdf_url):
self._pdf_url = pdf_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pdf(self, pdf):\n\n self._pdf = pdf",
"def proof_pdf(self, proof_pdf):\n\n self._proof_pdf = proof_pdf",
"def set_local_pdf_path(self, str_selection=None):\n nums = self.selector.select_by_index(str_selection)\n if nums is None or not nums or len(nums) > 1:\n self.vis... | [
"0.63609403",
"0.56880295",
"0.5673981",
"0.56144285",
"0.5610134",
"0.55646867",
"0.5471371",
"0.5438241",
"0.53108764",
"0.5213897",
"0.5211629",
"0.5132746",
"0.5131252",
"0.513073",
"0.50931656",
"0.50931656",
"0.5090907",
"0.49972332",
"0.49670273",
"0.4940618",
"0.49405... | 0.75821304 | 0 |
Sets the receipt_date of this CommitteeReportsIEOnly. | def receipt_date(self, receipt_date):
self._receipt_date = receipt_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expired_receipt(self, expired_receipt):\n\n self._expired_receipt = expired_receipt",
"def expiration_date(self, expiration_date):\n\n self._expiration_date = expiration_date",
"def set_checkout(self, date):\n if type(date) != dt.datetime:\n raise TypeError('date must be a d... | [
"0.60269386",
"0.57053626",
"0.56998795",
"0.56605387",
"0.56249267",
"0.559118",
"0.5535894",
"0.5527538",
"0.5515417",
"0.5463983",
"0.5433253",
"0.54306763",
"0.54306763",
"0.54306763",
"0.54306763",
"0.54306763",
"0.54277307",
"0.5426469",
"0.5391571",
"0.53804374",
"0.53... | 0.8052585 | 0 |
Sets the report_form of this CommitteeReportsIEOnly. | def report_form(self, report_form):
self._report_form = report_form | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def report_type(self, report_type):\n if self.local_vars_configuration.client_side_validation and report_type is None: # noqa: E501\n raise ValueError(\"Invalid value for `report_type`, must not be `None`\") # noqa: E501\n\n self._report_type = report_type",
"def report_type(self, repo... | [
"0.6089353",
"0.5942421",
"0.5942421",
"0.5942421",
"0.57985973",
"0.53518367",
"0.50755554",
"0.50504196",
"0.50504196",
"0.50324154",
"0.4921049",
"0.48788553",
"0.48386428",
"0.48374614",
"0.47578046",
"0.47153276",
"0.4680999",
"0.46621644",
"0.46479723",
"0.4639893",
"0.... | 0.7788117 | 0 |
Sets the report_type of this CommitteeReportsIEOnly. | def report_type(self, report_type):
self._report_type = report_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def report_type(self, report_type):\n if self.local_vars_configuration.client_side_validation and report_type is None: # noqa: E501\n raise ValueError(\"Invalid value for `report_type`, must not be `None`\") # noqa: E501\n\n self._report_type = report_type",
"def committee_type(self, c... | [
"0.75791097",
"0.64409584",
"0.55999184",
"0.54621243",
"0.54309237",
"0.5350013",
"0.53220975",
"0.53220975",
"0.53131354",
"0.5247786",
"0.5247372",
"0.5247372",
"0.5199537",
"0.51929826",
"0.5169221",
"0.515097",
"0.50702053",
"0.5065246",
"0.5038664",
"0.50355124",
"0.502... | 0.78419554 | 0 |
Sets the report_type_full of this CommitteeReportsIEOnly. | def report_type_full(self, report_type_full):
self._report_type_full = report_type_full | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def disbursement_type_full(self, disbursement_type_full):\n\n self._disbursement_type_full = disbursement_type_full",
"def report_type(self, report_type):\n\n self._report_type = report_type",
"def report_type(self, report_type):\n\n self._report_type = report_type",
"def report_type(sel... | [
"0.59254366",
"0.5754019",
"0.5754019",
"0.5754019",
"0.5656994",
"0.54038584",
"0.522448",
"0.4565788",
"0.44521248",
"0.4375253",
"0.4269648",
"0.42665404",
"0.4256971",
"0.42056385",
"0.42028698",
"0.417778",
"0.41675296",
"0.41375792",
"0.41343766",
"0.41178763",
"0.41159... | 0.8142186 | 0 |
Sets the report_year of this CommitteeReportsIEOnly. | def report_year(self, report_year):
self._report_year = report_year | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_year (self, year):\n self.year = year",
"def setYear(self, *args):\n return _libsbml.Date_setYear(self, *args)",
"def set_calender_year(self, year):\n self.single_selection_from_kendo_dropdown(self.calender_year_kendo_dropdown_locator, year)",
"def year(self, year):\n\n se... | [
"0.6473104",
"0.6370867",
"0.61998963",
"0.6121222",
"0.5957584",
"0.56548584",
"0.5565564",
"0.55069035",
"0.54695237",
"0.54313934",
"0.54241484",
"0.5420516",
"0.53419244",
"0.53284234",
"0.5325662",
"0.5325662",
"0.5264467",
"0.5253071",
"0.5135512",
"0.5126228",
"0.51112... | 0.8226567 | 0 |
Given a DF with columns 'Date' and 'HourEnding', return an updated DF with a single DateTime column, in which every element is a DateTime object (see datetime module) | def combine_date_and_hour_columns(data_frame):
dates = data_frame["Date"].tolist()
hours = data_frame["HourEnding"].tolist()
date_hour_pairs = zip(dates, hours)
date_times = map(convert_date_time_tuple_into_date_time_object, date_hour_pairs)
data_frame["Date"] = date_times
return data_frame.dr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fix_up_dates(df):\n # Convert to interval:\n # df = convert_time_to_interval(df)\n\n # Convert op_date and op_hour from string and integer to datetime:\n # Note that doing this conversion, rather than reading the CSV with\n # `parse_dates=True` is >10x faster.\n # Make an operating timestamp\... | [
"0.6745224",
"0.5979369",
"0.591047",
"0.5901184",
"0.5779667",
"0.5600993",
"0.5582903",
"0.5576828",
"0.5533896",
"0.5505485",
"0.5501997",
"0.5495367",
"0.54589885",
"0.5426282",
"0.5371007",
"0.53696287",
"0.5326263",
"0.53156185",
"0.5301127",
"0.5224624",
"0.5217903",
... | 0.7477829 | 0 |
Given a string representation of date, return a dateTime object in which the date's hour is rounded up once by one hour | def round_utc_hour_up(dateString):
date_object = datetime.strptime(dateString, "%Y-%m-%d %H:%M:%S")
newHour = (date_object.hour + 1) % 24
date_object = date_object.replace(hour=newHour)
return date_object.strftime("%Y-%m-%d %H:00:00") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hour_from_string(date_str):\n date = dateutil.parser.parse(date_str)\n if date.tzinfo:\n date = pytz.utc.normalize(date).replace(tzinfo=None)\n return date.replace(microsecond=0, second=0, minute=0)",
"def date_hour(date):\n return date.hour",
"def from_hhmmh(s):\n h = int(s[0:0+2])\n... | [
"0.75395364",
"0.65073377",
"0.6194541",
"0.61286443",
"0.6079083",
"0.60127205",
"0.59829205",
"0.59477586",
"0.5938918",
"0.59387124",
"0.5890026",
"0.58892405",
"0.58095133",
"0.5804479",
"0.5787138",
"0.57858825",
"0.5777354",
"0.57765746",
"0.57721454",
"0.57716155",
"0.... | 0.6792973 | 1 |
Given two Pandas dataframes and a string column name, return a new data frame resulting from merging the two dataframes on the column given | def merge_data_frames_by_column(df1, df2, column_name):
return pd.merge(df1, df2, on=column_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge_df(merge_on_df, merge_with_df, merge_column=None):\n if merge_column is None:\n merge_column = ['hip', 'tycho2_id']\n merge_on_df = merge_on_df.merge(merge_on_df, merge_with_df, on=merge_column)\n return merge_on_df",
"def merge_df(self, first_df, second_df):\n self.file = pd.mer... | [
"0.6622187",
"0.6542528",
"0.64633894",
"0.6422753",
"0.6311145",
"0.6253348",
"0.6206703",
"0.60999644",
"0.6033587",
"0.60167545",
"0.5965435",
"0.5963836",
"0.5917566",
"0.5810555",
"0.58082414",
"0.57962096",
"0.5792705",
"0.578607",
"0.5778068",
"0.5766602",
"0.5765507",... | 0.8275326 | 0 |
Organizing function that calls helper functions need to compute aggrate load dataframe | def compute_aggregate_load_data():
# get a list of all the csv file names in the 'system_load_by_region' directory
files = get_all_csv_files_in_directory('system_load_by_region')
# Todo: Encapsulate this process into a helper function
if len(files) == 0:
# Unzip all files in current directory... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_data():\r\n df_agg = pd.read_csv('Aggregated_Metrics_By_Video.csv').iloc[1:,:]\r\n df_agg.columns = ['Video','Video title','Video publish time','Comments added','Shares','Dislikes','Likes',\r\n 'Subscribers lost','Subscribers gained','RPM(USD)','CPM(USD)','Average % viewed','Ave... | [
"0.66853935",
"0.63584805",
"0.6305485",
"0.62309897",
"0.6078051",
"0.60019743",
"0.59674025",
"0.59314895",
"0.58739984",
"0.5873103",
"0.58632946",
"0.5850827",
"0.58155316",
"0.5804957",
"0.57992905",
"0.57957923",
"0.5738463",
"0.5731073",
"0.5717255",
"0.571717",
"0.571... | 0.64380205 | 1 |
Given a DF and a path for the db, write the dataframe to the db. | def write_df_to_db(df, db_path):
print "Writing to 'results' table in db: ", db_path
conn = sqlite3.connect(db_path)
df.to_sql("results", con=conn,if_exists='replace') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_data(df: pd.DataFrame, database_filename: str) -> None:\n engine = create_engine(f\"sqlite:///{database_filename}\")\n df.to_sql(Path(database_filename).stem, engine, index=False, if_exists=\"replace\")",
"def save_to_database(filename,key, df, metadata = {}):\n\t# Opening the dataframe\n\tstore =... | [
"0.7610478",
"0.721667",
"0.7209077",
"0.7179516",
"0.70890963",
"0.7019222",
"0.6975038",
"0.6968156",
"0.6889669",
"0.6880802",
"0.68528885",
"0.67956847",
"0.67129856",
"0.6707401",
"0.66952765",
"0.6664032",
"0.6646143",
"0.658348",
"0.65537375",
"0.6549873",
"0.6514596",... | 0.83806866 | 0 |
Creates simulated data to test against. Create a line with slope of 2.0 between 0 and 5 on the xaxis. Then a line of slope of 3.0 between 5 and 10. The intersection is of course an elbow, at the break point of x=5. | def elbow_with_synthetic_data():
delta = 0.1
slope_2 = 2
slope_3 = 3
break_pt = 5
intercept_2 = 0.0
line_2 = np.arange(0, break_pt, delta) * slope_2 + intercept_2
line_3 = (
np.arange(break_pt, break_pt * 2, delta) * slope_3
+ (slope_2 - slope_3) * break_pt
)
x = np.a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_line(x = np.linspace(start = 0, stop = 50, num = 200), slope = 2, intercept = 0, noise = 3):\n \n return np.c_[x, slope * x + intercept + np.random.normal(loc = 0, scale = 3, size = len(x))]",
"def test():\n data1 = resources_vs_time(0.0, 50)\n data2 = resources_vs_time(1.0, 10)\n data3 =... | [
"0.63652897",
"0.5738486",
"0.5734434",
"0.5718421",
"0.567421",
"0.5666111",
"0.5666111",
"0.56614757",
"0.5645853",
"0.5644089",
"0.5614255",
"0.5589216",
"0.5583348",
"0.5571109",
"0.55542874",
"0.5546292",
"0.55298144",
"0.55185163",
"0.5513488",
"0.54960084",
"0.5490038"... | 0.7073965 | 0 |
Is the elbow where we expect it? For clean, perfect data. | def test__validate_with_synthetic_data(elbow_with_synthetic_data):
x, y, break_pt = elbow_with_synthetic_data
expected_elbow = np.argmin(np.abs(x - break_pt))
assert expected_elbow == find_elbow_point(x, y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def loss_check(self):\n if sum(x >= y for x, y in zip(self.elbos[-100:], self.elbos[-99:])) > 50 and\\\n self.elbos[-1] - self.elbos[-100] < 1e-3*abs(self.elbos[-100]):\n return True",
"def EyeColorTest(str):\n\n\tvalidcolors = ['amb', 'blu', 'brn', 'gry', 'grn', 'hzl', 'oth']\n\tret... | [
"0.62690496",
"0.62366074",
"0.6185306",
"0.61369866",
"0.59756863",
"0.5964108",
"0.59633064",
"0.59438276",
"0.59093726",
"0.59077257",
"0.5881735",
"0.58592397",
"0.5853067",
"0.5819601",
"0.58052075",
"0.5802202",
"0.5771879",
"0.57718074",
"0.5767446",
"0.57559705",
"0.5... | 0.6401146 | 0 |
Is the elbow where we expect it? For low noisy data. Use normally distributed noise, with standard deviation = 2% of the range of y. Elbow should be found within +/ 10 index positions from actual point | def test__validate_with_synthetic_data_plus_noise(elbow_with_synthetic_data):
# Test with an odd number of points
x, y, break_pt = elbow_with_synthetic_data
np.random.seed(12)
range = (y.max() - y.min()) * 0.02
y = y + np.random.randn(y.shape[0]) * range
expected_elbow = np.argmin(np.abs(x - bre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test__validate_with_synthetic_data(elbow_with_synthetic_data):\n x, y, break_pt = elbow_with_synthetic_data\n expected_elbow = np.argmin(np.abs(x - break_pt))\n assert expected_elbow == find_elbow_point(x, y)",
"def elbow_with_synthetic_data():\n delta = 0.1\n slope_2 = 2\n slope_3 = 3\n ... | [
"0.63364166",
"0.6300845",
"0.57688564",
"0.5711829",
"0.56185",
"0.55533564",
"0.5528265",
"0.5511153",
"0.5493394",
"0.5467666",
"0.5441936",
"0.5400041",
"0.53835",
"0.5382338",
"0.53568083",
"0.53203046",
"0.5310995",
"0.52976376",
"0.5294403",
"0.52937496",
"0.5282019",
... | 0.6961078 | 0 |
Interogates the PC to determine if a serial connection can be established | def detect():
try:
s = serial.Serial(port = 0, baudrate = 19200, parity = 'O', timeout=1)
except Exception, e:
log = logging.getLogger('root')
log.exception(e)
return False
else:
return True
finally:
s.close() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Check_Communications(self):\n self.serial_status = False\n try:\n self.serial_status = self.ser.isOpen()\n except Exception as e:\n print \"No communication to stage serial bus. Exception of type %s and args = \\n\"%type(e).__name__, e.args \n self.seria... | [
"0.79891056",
"0.7839696",
"0.7721121",
"0.7664557",
"0.7523275",
"0.74683416",
"0.73653704",
"0.71756095",
"0.7169662",
"0.70841116",
"0.70075476",
"0.7003815",
"0.7000329",
"0.69810635",
"0.69763786",
"0.69475776",
"0.69287586",
"0.6878123",
"0.6840983",
"0.6810559",
"0.678... | 0.8033996 | 0 |
Read method which returns data at index from the FPGA register via a serial interface | def read(self, index):
# Read Opcode
isNotFirstCmd = False
self.__ser_wr_trans(RG_RD, isNotFirstCmd)
# Read Address
self.__ser_wr_trans(index)
rdata = self.__port.read()
if rdata == '':
raise ValueError('Serial i/O error - ord() expects a character, bu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _read(self, register):\n\n assert register in _registers, 'Not a valid register. Register must be passed as string.'\n\n # send read command to register\n self.spi.writebytes([READ | _registers[register]])\n\n # return values in register\n return self.spi.readbytes(_register_... | [
"0.6662329",
"0.66061586",
"0.65505844",
"0.64894193",
"0.646203",
"0.6453723",
"0.642688",
"0.6394818",
"0.6356792",
"0.63451916",
"0.6341997",
"0.6331405",
"0.63269156",
"0.6301276",
"0.6301225",
"0.6280754",
"0.62744755",
"0.6268042",
"0.62434256",
"0.62431026",
"0.6238869... | 0.7036303 | 0 |
Write method which write data at index into the FPGA register via a serial interface | def write(self, index, data):
isNotFirstCmd = False
# Write Opcode
self.__ser_wr_trans(RG_WR, isNotFirstCmd)
isNotFirstCmd = True
# Write Address
self.__ser_wr_trans(index, isNotFirstCmd)
# Write Data
self.__ser_wr_trans(data, isNotFirstCmd) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_debug(self, index, value):\n if index == 1:\n currentvalue = self.device.readregister(1022)\n newvalue = currentvalue & 15\n newvalue = newvalue | (value << 4)\n self.device.writeregister(1022, newvalue)\n elif index == 2:\n currentvalu... | [
"0.7003057",
"0.6869434",
"0.67685974",
"0.66890585",
"0.66721225",
"0.6530444",
"0.64861274",
"0.6472482",
"0.64479136",
"0.64104694",
"0.64071816",
"0.64009774",
"0.64009774",
"0.6388177",
"0.6331268",
"0.62909716",
"0.62633276",
"0.6215199",
"0.61859906",
"0.6159796",
"0.6... | 0.77448255 | 0 |
if the Address or Data is between DLE and R_CMD7 then a DLE Command must be sent across the Serial Interface | def __send_dle(self, trans_val):
if (trans_val >= DLE and trans_val <= R_CMD7):
dle_str = chr(int(DLE))
self.__port.write(dle_str) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def r7_on_off():\n \n r7_cmd_packet = b'\\x04\\x14\\x40\\x00\\x00\\xa8\\x0f'\n ser_relay.write(r7_cmd_packet)",
"def comm(self, command):\r\n check = str(self.crc(command))\r\n check = check[2:].zfill(2)\r\n final_com = 'FFFFFFFF' + command + check\r\n bin_comm = ''\r\n ... | [
"0.6193168",
"0.6027306",
"0.59145355",
"0.590262",
"0.5897436",
"0.588937",
"0.5695353",
"0.5694131",
"0.56791586",
"0.5669456",
"0.56329036",
"0.56190574",
"0.56089336",
"0.5605356",
"0.5596845",
"0.55577785",
"0.5554721",
"0.55546385",
"0.5526272",
"0.55260783",
"0.5525399... | 0.6897342 | 0 |
Create a new tor circuit | def renew_tor():
try:
stem.socket.ControlPort(port = CONTROL_PORT)
except stem.SocketError as exc:
print ("Tor", "[!] Unable to connect to port %s (%s)" %(CONTROL_PORT , exc))
with Controller.from_port(port = CONTROL_PORT) as controller:
controller.authenticate()
controller.signal(stem.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _template_circuit(self, amp_param) -> QuantumCircuit:\n circuit = QuantumCircuit(1)\n circuit.x(0)\n circuit.append(Gate(name=self.__rabi_gate_name__, num_qubits=1, params=[amp_param]), (0,))\n circuit.measure_active()\n\n return circuit",
"def create_circuit(self, circuit,... | [
"0.62754154",
"0.6275148",
"0.6237748",
"0.61938924",
"0.61724156",
"0.61190903",
"0.6071825",
"0.601851",
"0.60034895",
"0.59688735",
"0.5945346",
"0.5787106",
"0.5764502",
"0.57044345",
"0.5692905",
"0.5656533",
"0.5625631",
"0.56078076",
"0.55784035",
"0.554342",
"0.550409... | 0.66726303 | 0 |
Colleen is turning n years old! Therefore, she has n candles of various heights on her cake, and candle i has height heighti. Because the taller candles tower over the shorter ones, Colleen can only blow out the tallest candles. Given the heighti for each individual candle, find and print the number of candles she can ... | def birthdayCakeCandles(n, ar):
tallest = max(ar)
return ar.count(tallest) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fuction_call(chest):\n\n for i in chest:\n max_i = maximum(chest,i)\n if max_i >= 2:\n print(\"The maximum size of a set Matyoshka Dolls with outermost doll\",i,\"is\",max_i)",
"def solve(n, x, blows):\n # max_dh = max(d - h for d, h in blows)\n\n r = float('inf')\n dh =... | [
"0.61891437",
"0.6137017",
"0.5824411",
"0.55480444",
"0.55425274",
"0.5509372",
"0.5508701",
"0.5458835",
"0.54583526",
"0.5444977",
"0.5439937",
"0.5437858",
"0.5435319",
"0.5431952",
"0.5431051",
"0.54063356",
"0.53909886",
"0.5368034",
"0.53601",
"0.53498054",
"0.5344903"... | 0.6265176 | 0 |
Reduce axs to N Axes. All further Axes are removed from the figure. | def trim_axs(axs, N):
axs = axs.flat
for ax in axs[N:]:
ax.remove()
return axs[:N] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trim_axs(axs, n):\n axs = axs.flat\n for ax in axs[n:]:\n ax.remove()\n return axs[:n]",
"def trim_axes(axes, N):\n if N>1:\n axes = axes.flat\n for ax in axes[N:]:\n ax.remove()\n return axes[:N]\n else:\n return [axes]",
"def clean_axes(axl):\n... | [
"0.69655955",
"0.6787775",
"0.64604056",
"0.6276629",
"0.60964745",
"0.57861215",
"0.57611245",
"0.57461184",
"0.572825",
"0.56456554",
"0.5568663",
"0.5565765",
"0.55521894",
"0.54167825",
"0.5408814",
"0.5401719",
"0.53952706",
"0.53217924",
"0.53145427",
"0.5268798",
"0.52... | 0.7065848 | 1 |
Converts eopatch to xarray Dataset | def eopatch_to_xrdataset(eopatch, remove_depth=True):
dataset = xr.Dataset()
for feature in eopatch.get_feature_list():
if not isinstance(feature, tuple):
continue
feature_type = feature[0]
feature_name = feature[1]
if feature_type.is_raster():
dataframe =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_xarray(self, errors: str = 'ignore'):\n\n # Download data\n if not self.parallel:\n if len(self.uri) == 1:\n ds = self.fs.open_dataset(self.uri[0])\n else:\n ds = self.fs.open_mfdataset(\n self.uri, method=\"sequential\", p... | [
"0.6516389",
"0.6272322",
"0.6063232",
"0.59409106",
"0.5886038",
"0.58596873",
"0.58586395",
"0.5794671",
"0.57022893",
"0.56885576",
"0.56878",
"0.56579685",
"0.5641739",
"0.5566072",
"0.54753685",
"0.54626226",
"0.54274744",
"0.5399295",
"0.5386482",
"0.5383968",
"0.536939... | 0.7974234 | 0 |
Resets items freq dist to zero for rebasing. | def resetItemsFreqDist(self):
from models import PostItem
results = PostItem.most_common.delete_everything()
#results = PostItem.objects.all().delete()
print "Resetting %s items..." % results.count()
return
updated = 0
for res in results:
if res.numer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_dist(self):\n\t\t# Called from CM1KEmulator.reset_indexcomp(), i.e., whenever LCOMP is updated\n\t\tlog.trace(\"Neuron.reset_dist()\")\n\n\t\tself.dist = 0",
"def reset(self) -> None:\n self._dist['current'] = np.copy(self._dist['initial'])",
"def reset(self):\n self.items = np.arange(s... | [
"0.68328303",
"0.6657597",
"0.6384211",
"0.6194489",
"0.61263984",
"0.6115445",
"0.6105554",
"0.60961056",
"0.5953802",
"0.59351456",
"0.59341395",
"0.5895994",
"0.5877837",
"0.58659106",
"0.58480626",
"0.58451056",
"0.5808223",
"0.58021677",
"0.57799864",
"0.577289",
"0.5766... | 0.7268843 | 0 |
Adds articles to entity. | def addArticlesToEntity(self, entity = {}):
from models import Entity, PostItem, SitePost
if len(entity) == 0:
entities = Entity.objects.all()
else:
entities = [entity]
c = 0
for ent in entities:
print "Matching articles for %s..." % ent.name
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_article(self, article):\n pass",
"def _add_articles_to_db(self, feed: Feed, articles: list[ArticleData]):\n\n delete_time = feed.delete_time if feed.delete_time is not None else settings.default_delete_time\n\n if delete_time == 0:\n date_cutoff = None\n else:\n ... | [
"0.77907413",
"0.6620439",
"0.66156465",
"0.64723223",
"0.6428082",
"0.6340163",
"0.6314213",
"0.6289883",
"0.628371",
"0.6187297",
"0.6183359",
"0.618085",
"0.61686426",
"0.61128134",
"0.6041951",
"0.59768665",
"0.5971921",
"0.5900137",
"0.58733845",
"0.58716524",
"0.5859045... | 0.7638403 | 1 |
Adds a new logging level to the `logging` module and the currently configured logging class. Uses the existing numeric level_num if already defined. | def add_logging_level(level_name, level_num, method_name=None):
if method_name is None:
method_name = level_name.lower()
# If the level name is already defined as a top-level `logging`
# constant, then adopt the existing numeric level.
if hasattr(logging, level_name):
existing_level_num... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_logging_level(static, level_name, level_num, method_name=None):\n if not method_name:\n method_name = level_name.lower()\n\n if hasattr(logging, level_name):\n raise AttributeError('{} already defined in logging module'.format(level_name))\n if hasattr(logging, me... | [
"0.7316759",
"0.7157246",
"0.6889511",
"0.6730145",
"0.66705316",
"0.6471453",
"0.6447827",
"0.6413672",
"0.63387257",
"0.6331167",
"0.6295447",
"0.62659407",
"0.6245024",
"0.61989486",
"0.61832595",
"0.60976845",
"0.60863143",
"0.6074189",
"0.60566163",
"0.6051111",
"0.60479... | 0.76642615 | 0 |
Go to Checkout page. | def checkout_btn(self):
self._checkout_btn.click() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_link_to_checkout(self):\n self.browser.find_element_by_link_text('Checkout').click()\n self.assertEqual(self.browser.current_url,\n self.live_server_url + self.CHECKOUT_URL)",
"def checkout(self): \n mtool = getToolByName(self.context, \"portal_membership\"... | [
"0.70187056",
"0.69317484",
"0.67266506",
"0.6698491",
"0.66244483",
"0.6443735",
"0.6319917",
"0.6256616",
"0.6152812",
"0.61185604",
"0.61045414",
"0.5910372",
"0.5810124",
"0.5808345",
"0.5779505",
"0.57567173",
"0.57567173",
"0.575391",
"0.57427096",
"0.5736552",
"0.56335... | 0.7163361 | 0 |
Clicks player to search market from dropdown by evaluating results ie there are many "Rodriguez" cards, this chooses the correct one by checking the player's rating | def go_to_tranfer_market_and_input_parameters(self, cardname, fullname, cardoverall):
try:
cardname = cardname.lower()
fullname = fullname.lower()
# Go to transfer market
self.driver.find_element(By.CLASS_NAME, 'icon-transfer').click()
self.sleep_appr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search_market_gather_players(self, name, max_price_to_pay, bids_allowed, bids_made, futbindata, min_bid, max_bid):\n if (int(max_bid) < 400):\n max_bid = 400\n # Ensure bid box is visible, then clear previous params\n self.sleep_approx(2)\n input = self.driver.find_elemen... | [
"0.63047534",
"0.6063526",
"0.5940932",
"0.5720564",
"0.5625749",
"0.560559",
"0.56010664",
"0.55677193",
"0.55344844",
"0.5486312",
"0.54847276",
"0.54371136",
"0.5431794",
"0.54245436",
"0.5406673",
"0.5397872",
"0.5390955",
"0.535276",
"0.52981144",
"0.5285327",
"0.5285151... | 0.6230938 | 1 |
Makes a bid on a player. Only called when player has been evaluated and we're sure they're underpriced this method just does the actual bid action. | def makebid_individualplayer(self, playernumber, max_price_to_pay):
status = self.checkState("transfermarket")
if status:
# Click player
playerbutton = "/html/body/main/section/section/div[2]/div/div/section[1]/div/ul/li[" + str(
playernumber) + "]/div"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bid(command):\n env_banner()\n\n game = Game.read()\n if game is None:\n game = Game.init_game()\n\n command = command.lower().strip()\n\n if command not in ['start', 'pause', 'resume']:\n click.echo('Valid options are start, pause or resume.')\n ... | [
"0.71281767",
"0.6758755",
"0.67057383",
"0.66218823",
"0.6602225",
"0.6592417",
"0.6477404",
"0.6432981",
"0.6409139",
"0.6402959",
"0.6353554",
"0.62648576",
"0.62391514",
"0.62175196",
"0.6214799",
"0.6211094",
"0.6098464",
"0.60671",
"0.60440916",
"0.6021284",
"0.6001464"... | 0.69956726 | 1 |
Stores user's coins (as class variable) on bot startup only called once on inits | def setStartingCoins(self):
num_coins = self.driver.find_element(
By.XPATH, '/html/body/main/section/section/div[1]/div[1]/div[1]').text
num_coins = str(num_coins)
if "," in num_coins:
num_coins = num_coins.replace(",", "")
num_coins = int(num_coins)
log_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main(connection, info, args, world) :\n money = shelve.open(\"money-%s.db\" % (world.hostnicks[connection.host]), writeback=True)\n money[info[\"sender\"]] = {\"money\":100000, \"maxmoney\":100000, \"items\":[], \"coinchance\":[True for x in range(50)] + [False for x in range(50)]}\n money.sync()\n ... | [
"0.6001863",
"0.5911041",
"0.59048885",
"0.58919036",
"0.58733785",
"0.57796943",
"0.5768613",
"0.5747069",
"0.57432914",
"0.5738255",
"0.57098705",
"0.5643643",
"0.56350905",
"0.5602974",
"0.5576322",
"0.5564678",
"0.5564081",
"0.554707",
"0.5540288",
"0.55388224",
"0.550720... | 0.69698185 | 0 |
Parses all players on current page of market. Saves info to data/market_logs.txt, to be used when parsing the market data to find the player's actual sell price | def getAllPlayerInfo(self):
status = self.checkState("transfermarket")
if status:
try:
players_on_page = self.driver.find_elements_by_tag_name(
"li.listFUTItem")
# page = self.driver.find_elements_by_tag_name("h1.title")
pag... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def players_onsale(self):\r\n headers = {\"Content-type\": \"application/x-www-form-urlencoded\", \"Accept\": \"text/plain\",\r\n 'Referer': 'http://' + self.domain + '/team_news.phtml', \"User-Agent\": user_agent}\r\n req = self.session.get('http://' + self.domain + '/teamInfo.phtm... | [
"0.64226735",
"0.6165685",
"0.5757312",
"0.5755547",
"0.57293993",
"0.57222086",
"0.5693599",
"0.56321335",
"0.5631084",
"0.5573693",
"0.557006",
"0.55696607",
"0.5544484",
"0.5534082",
"0.5525927",
"0.5467521",
"0.543659",
"0.54313225",
"0.5412079",
"0.5404834",
"0.54021406"... | 0.6619869 | 0 |
Returns player card name, based on ID | def getPlayerCardName(self, playerid):
with open('./data/players_database.csv', 'r', encoding="utf8") as read_obj:
csv_reader = reader(read_obj)
for player in csv_reader:
card = player[0]
firstname = player[1]
lastname = player[2]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def get_card_name(card_id):\n return ex.first_result(await ex.conn.fetchrow(\"SELECT name FROM blackjack.cards WHERE id = $1\", card_id))",
"def get_name(self):\n return self.card_name",
"def getCard(id):\n r = requests.get('https://api.scryfall.com/cards/multiverse/' + str(id))\n dat... | [
"0.76857877",
"0.7084229",
"0.67917186",
"0.6739327",
"0.66997284",
"0.6656645",
"0.65509874",
"0.65391034",
"0.65100324",
"0.6461712",
"0.646045",
"0.6424521",
"0.6421536",
"0.64204377",
"0.63824105",
"0.6369017",
"0.63581073",
"0.6317909",
"0.62443227",
"0.62283576",
"0.621... | 0.813598 | 0 |
Returns price to sell player at, for listing players/when calculating profit. | def getPlayerSellPrice(self, playerid):
# Get target players IDs
txt = open("./data/player_list.txt", "r", encoding="utf8")
for aline in txt:
values2 = aline.strip("\n").split(",")
line_id = int(values2[7])
inputid = int(playerid)
diff = line_id - ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sell_cost(self):\n return self._manager.get_sell_price(self.name)",
"def target_sell_price(self):\n return super(Player, self).target_sell_price",
"def selling_price(self):\n # If a system can't produce something, its price is zero.\n _good = self.tradeitem\n if self.plan... | [
"0.7372649",
"0.73344755",
"0.72019154",
"0.7177244",
"0.714004",
"0.69974625",
"0.6945912",
"0.6839833",
"0.6808803",
"0.6808803",
"0.6808803",
"0.6808444",
"0.67935747",
"0.67282236",
"0.6704061",
"0.66628844",
"0.6621804",
"0.65957785",
"0.6588244",
"0.65662366",
"0.656474... | 0.756267 | 0 |
Gets and stores users transfer list, watchlist size etc. For use in calculating available bids to make | def getWatchlistTransferlistSize(self):
# Click Transfer Market tab
self.sleep_approx(1)
self.driver.find_element(
By.XPATH, '/html/body/main/section/nav/button[3]').click()
self.sleep_approx(1)
transferlist_selling = self.driver.find_element(
By.XPATH, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getTransferListSummary(self):\n p_ids_and_prices = {}\n players = self.getAllPlayerInfoTransferlist()\n\n # Get IDs of all players\n log_event(self.queue, \"Gathering player prices... \")\n for p in players:\n p_bidstatus = p[1]\n p_id = p[8]\n ... | [
"0.5991234",
"0.5688729",
"0.5538818",
"0.55146474",
"0.5467182",
"0.54225963",
"0.54026425",
"0.53845423",
"0.5382673",
"0.53257275",
"0.5252403",
"0.5250163",
"0.5248029",
"0.5243101",
"0.5229669",
"0.5201439",
"0.5194823",
"0.51766795",
"0.5176094",
"0.51748496",
"0.516510... | 0.7133281 | 0 |
Analyzes all relevant info on watchlist num players won, expired, currently active. Stores values in user var's for display on GUI. | def getWatchlistSummary(self):
players = self.getAllPlayerInfoWatchlistFull()
# [ playernumber, bidstatus, rating, name, startprice, curbid_or_finalsoldprice, buynow, time, id ]
num_players_won = 0
num_players_expired = 0
wonplayers_sellprice_total = 0
wonplayers_bought... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getAllPlayerInfoWatchlist(self):\n status = self.checkState(\"watchlist\")\n if status:\n try:\n players_on_page = self.driver.find_elements_by_tag_name(\n \"li.listFUTItem\")\n # page = self.driver.find_elements_by_tag_name(\"h1.title\"... | [
"0.64996994",
"0.64603496",
"0.61576056",
"0.6087415",
"0.58758515",
"0.57920164",
"0.57624876",
"0.56475145",
"0.56005216",
"0.55749196",
"0.55729043",
"0.5567287",
"0.5537561",
"0.55100983",
"0.5474315",
"0.54130435",
"0.5408353",
"0.53969204",
"0.5372371",
"0.5368156",
"0.... | 0.6927917 | 0 |
Method returns info for ALL players on watchlist (not just top 6) If any player is Processing, method returns string "Processing". | def getAllPlayerInfoWatchlistFull(self):
status = self.checkState("watchlist")
if status:
try:
players_on_page = self.driver.find_elements_by_tag_name(
"li.listFUTItem")
# page = self.driver.find_elements_by_tag_name("h1.title")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getAllPlayerInfoWatchlist(self):\n status = self.checkState(\"watchlist\")\n if status:\n try:\n players_on_page = self.driver.find_elements_by_tag_name(\n \"li.listFUTItem\")\n # page = self.driver.find_elements_by_tag_name(\"h1.title\"... | [
"0.67264193",
"0.64774126",
"0.60724306",
"0.6061309",
"0.59563774",
"0.58687425",
"0.58518463",
"0.5849384",
"0.5763683",
"0.5658666",
"0.5643402",
"0.5599327",
"0.5583644",
"0.55375636",
"0.5521715",
"0.55198145",
"0.55173445",
"0.55131704",
"0.5480907",
"0.5474396",
"0.545... | 0.66458565 | 1 |
Refreshes web app and goes back to watchlist. Used during bid wars, when "Bid Status not Updated" error occurs. | def refreshPageAndGoToWatchlist(self):
try:
self.sleep_approx(1)
self.user_requests_made += 1
self.driver.refresh()
wait_for_shield_invisibility(self.driver)
WebDriverWait(self.driver, 30).until(
EC.visibility_of_element_located(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def refresh(self):\n\n self._refreshed_on = time.time() * 1000",
"def refresh_status() -> None:\n ...",
"def refresh(self):\n self.log_info(f\"Browser.refresh: Refreshing the page\")\n self.CORE.refresh()\n return",
"def go_to_watchlist(self):\n try:\n self.sl... | [
"0.5885404",
"0.5853068",
"0.58464164",
"0.57788473",
"0.5760806",
"0.5754544",
"0.57240576",
"0.5685008",
"0.5650147",
"0.56458825",
"0.5641459",
"0.5641459",
"0.5641459",
"0.5618939",
"0.5618939",
"0.5617876",
"0.56112474",
"0.55982983",
"0.55982983",
"0.55940586",
"0.55802... | 0.6544594 | 0 |
Returns number of active bids. Also stores number won, expired, etc. for display on GUI | def get_num_activebids(self):
try:
players = self.driver.find_elements_by_tag_name("li.listFUTItem")
playernumber = 1
activebids_counter = 0
expired_counter = 0
won_counter = 0
for player in players:
bidStatus = player.get_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_bids(self):\n return Bid.objects.filter(bid_busket=self).count()",
"def numberOfBids(self):\n return len([bid for bid in self.bids if bid.status in (\"active\", \"pending\")])",
"def numberOfBids(self):\n bids = [\n bid\n for bid in self.__parent__.bids\n ... | [
"0.7145601",
"0.7096751",
"0.6965938",
"0.6008998",
"0.6007573",
"0.59558076",
"0.5924273",
"0.5899332",
"0.58469385",
"0.5823364",
"0.5820417",
"0.5806662",
"0.5782391",
"0.5780355",
"0.57678884",
"0.5736642",
"0.57325655",
"0.5705339",
"0.56987196",
"0.569647",
"0.565831",
... | 0.8244046 | 0 |
Sends won players to the transfer list | def send_won_players_to_transferlist(self):
sleep(5)
playerswon = self.getWatchlistSummary()
self.clearExpired()
try:
players_to_send_to_transferlist = True
while players_to_send_to_transferlist:
# Check if topmost player exists that should be lis... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_msg_to_players(players, msg=\"\"):\n for player in players:\n player.player_socket.send(msg + \"\\n\")",
"async def tod_list(self, ctx, *args):\n message = \"__Currently Playing__\\n\"\n if len(self.players) == 0:\n message = \"There are currently no users playing.\"\n... | [
"0.6654176",
"0.6548151",
"0.65193623",
"0.6372593",
"0.63662595",
"0.6197295",
"0.6155794",
"0.61369956",
"0.61120605",
"0.6102095",
"0.609212",
"0.60721487",
"0.60275716",
"0.6021106",
"0.5997276",
"0.59954596",
"0.59914255",
"0.5984746",
"0.59775454",
"0.5965825",
"0.59520... | 0.85568124 | 0 |
Analyzes all relevant info on TL value of players, num players etc. Opens Futbin tab via chromedriver to fetch price, to avoid Futbin blocking user IP by overdoing their API. Returns dict of all their prices + all relevant info. TODO switch back to json call so no interrupt while running in background Stores dictionair... | def getTransferListSummary(self):
p_ids_and_prices = {}
players = self.getAllPlayerInfoTransferlist()
# Get IDs of all players
log_event(self.queue, "Gathering player prices... ")
for p in players:
p_bidstatus = p[1]
p_id = p[8]
# removed Filt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def poll_price_data():\n resp = requests.get(COINDESK_ENDPOINT) # Powered by CoinDesk\n if resp.status_code == 200:\n logging.info(\"GET request succeeded\")\n data = resp.json()\n data_dict = {\n \"id\": str(uuid.uuid1()),\n \"time\": data['time']['updated'],\n ... | [
"0.6556942",
"0.63523996",
"0.6237128",
"0.6037316",
"0.5991798",
"0.5874566",
"0.58031714",
"0.5750528",
"0.57173634",
"0.56329465",
"0.5597042",
"0.55944765",
"0.55720156",
"0.5568801",
"0.5565658",
"0.55450547",
"0.55408144",
"0.5522807",
"0.54977936",
"0.5427768",
"0.5403... | 0.6376033 | 1 |
Relists expired players on transfer list. I still don't love my transfer listing method, this is probably the 3rd version... | def relist_expired_players(self, p_ids_and_prices):
# TODO make this user configurable, like when I had Ronaldo on my transfer list
players_to_list = True
try:
while players_to_list:
# Check if topmost player exists that should be listed
topmost_player... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_unlisted_players(self, p_ids_and_prices):\n players_to_list = True\n try:\n while players_to_list:\n # Check if topmost player exists that should be listed\n topmost_player_location_unlisted = \"/html/body/main/section/section/div[2]/div/div/div/secti... | [
"0.6442666",
"0.63865805",
"0.6360504",
"0.6264284",
"0.6101484",
"0.60404193",
"0.6005897",
"0.5965685",
"0.58946",
"0.58505034",
"0.58374023",
"0.5795894",
"0.5785603",
"0.5781114",
"0.5656347",
"0.56165814",
"0.5481724",
"0.5427418",
"0.54255354",
"0.538128",
"0.5380303",
... | 0.7590007 | 0 |
Lists unlisted players on transfer list. | def list_unlisted_players(self, p_ids_and_prices):
players_to_list = True
try:
while players_to_list:
# Check if topmost player exists that should be listed
topmost_player_location_unlisted = "/html/body/main/section/section/div[2]/div/div/div/section[3]/ul/li... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ListIgnoredPlayers(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n raise NotImplementedError('Method not implemented!')",
"async def tod_list(self, ctx, *args):\n message = \"__Currently Playing__\\n\"\n if l... | [
"0.67716163",
"0.637877",
"0.6265547",
"0.62425447",
"0.61129206",
"0.60271925",
"0.59913105",
"0.5973464",
"0.5949822",
"0.58735806",
"0.5842144",
"0.58217037",
"0.57799274",
"0.5761503",
"0.5686107",
"0.56568307",
"0.5637608",
"0.5592943",
"0.5546718",
"0.5494409",
"0.54836... | 0.66584796 | 1 |
Clicks button via XPATH. | def clickButton(self, xpath):
WebDriverWait(self.driver, 20).until(
EC.element_to_be_clickable((By.XPATH, xpath))).click()
self.sleep_approx(1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def click_button(self):\n self.q(css='div#fixture button').first.click()",
"def click(self, xpath):\n self.driver.find_element_by_xpath(xpath=xpath).click()",
"def click_button(self):\n self.widgets.get('button').click()",
"def click_button(button_to_click):\n try:\n button_to_... | [
"0.7801966",
"0.75083435",
"0.7472694",
"0.7308744",
"0.7276833",
"0.7274536",
"0.7237779",
"0.7030628",
"0.68454856",
"0.67717737",
"0.670378",
"0.66009396",
"0.6371437",
"0.63418216",
"0.6331778",
"0.62964576",
"0.6289176",
"0.62633955",
"0.6240716",
"0.6229084",
"0.6227736... | 0.7919533 | 0 |
Clicks 'clear sold' button. | def clearSold(self):
try:
self.sleep_approx(1)
self.driver.find_element(
By.XPATH, "/html/body/main/section/section/div[2]/div/div/div/section[1]/header/button").click()
self.sleep_approx(1)
except:
log_event(self.queue, "No sold players to... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def click_clear_basket_link(self):\n self._basket.click_clear_basket_link()",
"def clear():\n click.clear()",
"def actionClear(self):\n self.setText(\"\")",
"def on_clear_clicked(self, event):\n\t\t\n\t\tself.list_partitions.clear_actions()\n\t\tself.list_partitions.clear_actions_view()",
... | [
"0.69359",
"0.67024153",
"0.65752596",
"0.62674546",
"0.6258836",
"0.60796165",
"0.5993444",
"0.59680825",
"0.5966062",
"0.59591675",
"0.59555995",
"0.589268",
"0.5861205",
"0.5837118",
"0.5837118",
"0.5837118",
"0.583571",
"0.5830596",
"0.57861716",
"0.5780114",
"0.57777774"... | 0.76489496 | 0 |
Clicks 'clear expired' button. | def clearExpired(self):
self.sleep_approx(1)
playersOnPage = self.driver.find_elements_by_tag_name("li.listFUTItem")
num_players_expired = 0
for player in playersOnPage:
bidStatus = player.get_attribute("class")
bidStatus = str(bidStatus)
if "expired... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_expired(self):\n raise NotImplementedError",
"def clear():\n click.clear()",
"def clear_expired_exceptions():\n print(\"Clearing out exceptions that have an expired TTL...\")\n clear_old_exceptions()\n print(\"Completed clearing out exceptions that have an expired TTL.\")",
"def ... | [
"0.68317664",
"0.63113266",
"0.62153214",
"0.5925498",
"0.58071023",
"0.5788592",
"0.5721657",
"0.57023746",
"0.5645735",
"0.5626091",
"0.5620311",
"0.5593434",
"0.55894697",
"0.55853134",
"0.5548694",
"0.553915",
"0.5526864",
"0.55159",
"0.5511984",
"0.546883",
"0.54686916",... | 0.6682279 | 1 |
Clicks Transfer Market button on sidebar. | def go_to_transfer_market(self):
try:
self.driver.find_element(By.CLASS_NAME, 'icon-transfer').click()
sleeptime = random.randint(1, 5)
self.sleep_approx(sleeptime)
WebDriverWait(self.driver, 10).until(
EC.visibility_of_element_located(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def click_download_button(self):\n self._basket.click_download_button()",
"def click_button(self):\n self.widgets.get('button').click()",
"def click_buy_page_inline_action_button(self, vendor):\n self.click_inline_action_button(self.vendors_div_id, vendor, self.grid_column_number)",
"def... | [
"0.7000497",
"0.6486263",
"0.6205805",
"0.6166563",
"0.6055613",
"0.60153806",
"0.60038847",
"0.58979285",
"0.58110565",
"0.58044946",
"0.58044446",
"0.57885617",
"0.5781514",
"0.5760585",
"0.5756426",
"0.5722221",
"0.5721797",
"0.57052684",
"0.5687746",
"0.56055075",
"0.5600... | 0.6501169 | 1 |
Clicks Watchlist button on sidebar. | def go_to_watchlist(self):
try:
self.sleep_approx(0.5)
self.driver.find_element(
By.XPATH, '/html/body/main/section/nav/button[3]').click()
self.sleep_approx(0.5)
self.driver.find_element(
By.XPATH, '/html/body/main/section/section/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sidebar_click(sidebar_item):\n #print('sidebar_click')\n sidebar = driver.find_element_by_class_name('m-menu__nav')\n return click_on(sidebar_item, scope=sidebar)",
"def click_button(self):\n self.widgets.get('button').click()",
"def click_button(self):\n self.q(css='div#fixture butt... | [
"0.68766767",
"0.6498872",
"0.6034641",
"0.590735",
"0.5762742",
"0.5762742",
"0.5715339",
"0.5676585",
"0.5672203",
"0.56678146",
"0.56643087",
"0.5591768",
"0.55739415",
"0.5545422",
"0.55229753",
"0.5508387",
"0.54562783",
"0.54414785",
"0.53956324",
"0.5394733",
"0.538464... | 0.6696842 | 1 |
Checks if element exists by XPATH. I think this method is unused. | def check_exists_by_xpath(self, xpath):
try:
self.driver.find_element_by_xpath(xpath)
except NoSuchElementException:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _does_webelement_with_xpath_exist(self, xpath, timeout=60):\n return self._search_element(By.XPATH, xpath, timeout=timeout)",
"def is_element_present_by_xpath(self, x_path, timeout=10):\n try:\n wait = WebDriverWait(self.web_driver, timeout)\n wait.until(lambda driver: sel... | [
"0.81370103",
"0.7536685",
"0.7396962",
"0.7142309",
"0.70801514",
"0.7062988",
"0.704314",
"0.7023487",
"0.69937104",
"0.6978855",
"0.6962577",
"0.6960801",
"0.6938621",
"0.6847055",
"0.6734133",
"0.6669578",
"0.66056794",
"0.65743935",
"0.6555464",
"0.65083796",
"0.64835465... | 0.8089057 | 1 |
Clears market logs in data/market_logs.txt in preparation for next search run. | def clearOldMarketLogs(self):
file = open("./data/market_logs.txt", "r+")
file.truncate(0)
file.close() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_log(self):\n\n self.__logs = []",
"def clearLog():\n logPath = getLogPath()\n\n with open(logPath, 'w') as f:\n f.write('')",
"def clearOldUserData(self):\n file = open(\"./data/market_logs.txt\", \"r+\")\n file.truncate(0)\n file.close()\n\n # Clear GU... | [
"0.71606624",
"0.69244665",
"0.69160056",
"0.66446495",
"0.649746",
"0.6476058",
"0.6423787",
"0.637029",
"0.6279373",
"0.62531537",
"0.62338465",
"0.6197727",
"0.61280435",
"0.61170447",
"0.61163014",
"0.6092899",
"0.6005176",
"0.59888464",
"0.59844404",
"0.59093636",
"0.583... | 0.8748719 | 0 |
Retrieves player list from GUI. | def getPlayerListFromGUI(self):
playerlist = []
# Tried to be cheeky and only have this called on initialization, but this made adding / removing to player list in real time impossible
# Get input list of target players
src = "./data/player_list.txt"
txt = open(src, "r", encoding... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getPlayerList(self):\n return(self.playerList)",
"def _player_list(self):\n game = self.ctrl.game\n return game.players[self.i_to_player_id(0)], game.players[self.i_to_player_id(1)]",
"async def do_playerlist():\n\n download = urllib.request.urlopen(server_api2)\n data = json... | [
"0.7331715",
"0.72618484",
"0.7224015",
"0.6801804",
"0.64365476",
"0.6429163",
"0.6417277",
"0.6360435",
"0.633511",
"0.62728333",
"0.6270158",
"0.62676555",
"0.6225909",
"0.6197644",
"0.61689395",
"0.6120725",
"0.6038387",
"0.601938",
"0.59868264",
"0.59105194",
"0.5890399"... | 0.77484626 | 0 |
Retrieves player internal ID from card name and rating | def getPlayerID(self, cardname, rating):
inputoverall = int(rating)
inputcardname = cardname.lower()
# First attempts to find ID in user input list
for player in self.getPlayerListFromGUI():
p_overall = int(player[2])
p_cardname = player[1]
p_cardname... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_player_id(self, player):\n url = self.base_url + \"/player/player/findplayer.html\"\n params = {\"q\": player, \"start\": 0, \"count\": \"Infinity\"}\n url += \"?\" + urllib.parse.urlencode(params)\n resp = self.fetch(url)\n resp_json = json.loads(resp)\n if len(re... | [
"0.66558915",
"0.65680575",
"0.65358037",
"0.63460386",
"0.63232607",
"0.63089913",
"0.6268086",
"0.62588334",
"0.6242057",
"0.6226273",
"0.6166309",
"0.6112787",
"0.61089164",
"0.6068297",
"0.60582346",
"0.605022",
"0.60428464",
"0.60352093",
"0.60187036",
"0.5998376",
"0.59... | 0.7460507 | 0 |
Fetches futbin price by opening a new tab (to avoid IP ban) | def getFutbinPrice_opentab(self, internalid):
browser = self.driver
driver = self.driver
futbinid = self.getFutbinID(internalid)
futbin_url = "https://www.futbin.com/22/player/" + str(futbinid)
tab_url = futbin_url
browser.execute_script("window.open('');")
bro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def track_price():\n r = requests.get('https://finance.yahoo.com/quote/EURPLN=X?p=EURPLN%3DX&.tsrc=fin-srch&guce_referrer'\n '=aHR0cHM6Ly9maW5hbmNlLnlhaG9vLmNvbS8_Z3VjZV9yZWZlcnJlcj1hSFIwY0hNNkx5OTNkM2N1WjI5d'\n 'loyeGxMbU52YlM4Jmd1Y2VfcmVmZXJyZXJfc2lnPUFRQUFB... | [
"0.61156344",
"0.6014177",
"0.5926498",
"0.5907548",
"0.58645344",
"0.584185",
"0.5821348",
"0.56952006",
"0.5665155",
"0.56533575",
"0.5629119",
"0.5624639",
"0.5607936",
"0.5607933",
"0.559359",
"0.554349",
"0.5495186",
"0.54529196",
"0.5436719",
"0.53981316",
"0.53933626",... | 0.76515895 | 0 |
Fetches user config variables from config.json. (same as other method just nonclass, for use on GUI) Also updates config options on GUI if they changed on backend. | def getUserConfigNonClass():
# Load Autobidder stats
userconfig_json = open('./data/config.json')
json1_str = userconfig_json.read()
configops = json.loads(json1_str)[0]
config_choices = []
for key, value in configops.items():
config_choices.append(value)
conserve_bids = config_ch... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_config():\n user_config = copy.deepcopy(config)\n user_config.pop(\"metadata\")\n user_config.pop(\"version\")\n user_config.pop(\"refers\")\n user_config.pop(\"pool_size\")\n return user_config",
"def get_user_config():\n\n user_config_file = os.path.join(\n os.path.expandus... | [
"0.6515324",
"0.6431173",
"0.63201547",
"0.6267635",
"0.6266487",
"0.6170776",
"0.61079705",
"0.59556484",
"0.5939437",
"0.5856379",
"0.585133",
"0.5843875",
"0.5810448",
"0.5794691",
"0.5782221",
"0.57571286",
"0.5748794",
"0.5748272",
"0.5746178",
"0.5737912",
"0.5733018",
... | 0.65610653 | 0 |
Create new board on board table. Insert player into game table with the new board id. Create new tiles for the new board Select all the new tiles Create edges between the new tiles | async def create(request):
data = await request.json()
player_id = data.get('playerID')
async with request.app['pool'].acquire() as db_conn:
board_query = "INSERT INTO board (playing) VALUES (%s)"
cursor = await db_conn.cursor()
await cursor.execute(board_query, (player_id))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_board(self):\n http = urllib3.PoolManager()\n r = http.request('GET', 'http://www.cse.msu.edu/~ruppmatt/itm891/tiles.pickle')\n tiles = pickle.loads(r.data)\n self.assets = tiles\n self.gameboard = Image.new('RGBA', (64*(self.world_width+2), 64*(self.world_height+2)))\n ... | [
"0.67567503",
"0.67411196",
"0.66598964",
"0.656336",
"0.6549",
"0.6545836",
"0.6394899",
"0.6390302",
"0.6382131",
"0.6315805",
"0.62701935",
"0.624404",
"0.6225175",
"0.62005585",
"0.6192223",
"0.61363196",
"0.61144805",
"0.60961473",
"0.60914254",
"0.60906595",
"0.6062174"... | 0.6912479 | 0 |
Returns a validator for a dictionary, that validates the keys according to key_validator, and the values according to value_validator. These validators should be methods that get the field name, and return the validator for that field. Set these validators to None to have empty validators, which will always return True... | def validate_dict(
field_name: str,
*, key_validator: Optional[Callable[[str], Callable[[TypeKey], bool]]] = None,
value_validator: Optional[Callable[[str], Callable[[TypeValue], bool]]] = None,
allow_none: bool = False) -> Callable[[Dict[TypeKey, TypeValue]], bool]:
def validator(di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_validator(self, t, **kwargs):\n def validator(val, field_name=''):\n if val is None and 'required' in kwargs and not kwargs['required']:\n return True\n elif val is None:\n raise ValidationError('%s: None is not allowed (field required)' % fie... | [
"0.67737865",
"0.6754165",
"0.6444088",
"0.6105773",
"0.5943651",
"0.5827183",
"0.58217263",
"0.57578635",
"0.573745",
"0.55716354",
"0.55479616",
"0.55331194",
"0.54919744",
"0.54573053",
"0.5453998",
"0.5443997",
"0.5441522",
"0.5434272",
"0.54272527",
"0.5386967",
"0.53803... | 0.72510326 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.