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 |
|---|---|---|---|---|---|---|
Test server config with no SaveTimeoutMinutes | def test_server_no_save_timeout(self):
with self.assertRaises(ConfigError) as cm:
imageroller.main.read_config(self._cmd_args,
imageroller.test.get_config_parser(
self._server_no_save_timeout))
self.assertE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_server_override_save_timeout(self):\n # Sanity check our override values do not overlap\n self.assertNotEqual(CONFIG_DATA[\"SaveTimeoutMinutes\"],\n CONFIG_DATA[\"OverrideSaveTimeoutMinutes\"])\n config_data = imageroller.main.read_config(\n self.... | [
"0.6959689",
"0.6632226",
"0.6554762",
"0.6283715",
"0.61925596",
"0.606692",
"0.6015291",
"0.6008195",
"0.5942722",
"0.59137046",
"0.5912978",
"0.5874995",
"0.5861105",
"0.5841601",
"0.58006907",
"0.5797114",
"0.5792655",
"0.5771651",
"0.57625806",
"0.5760515",
"0.5749733",
... | 0.77496415 | 0 |
Test server config with no RetainImageMinutes | def test_server_no_retain_image(self):
with self.assertRaises(ConfigError) as cm:
imageroller.main.read_config(self._cmd_args,
imageroller.test.get_config_parser(
self._server_no_retain_image))
self.assertE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_server_valid_minimal(self):\n config_data = imageroller.main.read_config(\n self._cmd_args,\n imageroller.test.get_config_parser(self._server_valid_minimal))\n self.assertEqual(config_data.concurrent_workers,\n CONFIG_DATA[\"ConcurrentWorkers\"])... | [
"0.6643698",
"0.62860173",
"0.611042",
"0.595032",
"0.5895772",
"0.58934045",
"0.5795838",
"0.5747833",
"0.573188",
"0.56955487",
"0.5650385",
"0.56106514",
"0.5571227",
"0.5533083",
"0.55236375",
"0.5507495",
"0.5482361",
"0.5480526",
"0.5468568",
"0.54684323",
"0.5453787",
... | 0.74305415 | 0 |
Test server config with no Region | def test_server_no_region(self):
with self.assertRaises(ConfigError) as cm:
imageroller.main.read_config(self._cmd_args,
imageroller.test.get_config_parser(
self._server_no_region))
self.assertEqual(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_no_server(self):\n with self.assertRaises(ConfigError) as cm:\n imageroller.main.read_config(\n self._cmd_args,\n imageroller.test.get_config_parser(self._no_server))\n self.assertEqual(str(cm.exception),\n \"You must configure... | [
"0.6784435",
"0.6625006",
"0.6513319",
"0.63742703",
"0.63140893",
"0.6310243",
"0.63017064",
"0.6204071",
"0.61998665",
"0.6198119",
"0.6183545",
"0.6154378",
"0.6122185",
"0.60712856",
"0.60609406",
"0.605602",
"0.605217",
"0.60511637",
"0.60368586",
"0.60146993",
"0.601394... | 0.78659654 | 0 |
Test auth config with no [AUTH] section | def test_no_section(self):
with self.assertRaises(ConfigError) as cm:
imageroller.main.read_authconfig(
imageroller.test.get_config_parser(self._no_section))
self.assertEqual(str(cm.exception), "AuthConfig must contain [AUTH]") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_auth0_config_anon(anontestapp, registry):\n _test_auth_config(anontestapp, registry)",
"def test_auth0_config_admin(testapp, registry):\n _test_auth_config(testapp, registry)",
"def test_auth_xml(self):\n\n config = get_config()\n\n if config.getboolean('auth_test', 'enabled'):\n\n... | [
"0.7873065",
"0.69291097",
"0.6817808",
"0.6696558",
"0.66886336",
"0.6626914",
"0.6590848",
"0.65906286",
"0.65906286",
"0.65871465",
"0.6572814",
"0.6558808",
"0.65585524",
"0.64958966",
"0.64958966",
"0.6461882",
"0.6431602",
"0.6424579",
"0.64236295",
"0.64075625",
"0.639... | 0.7019156 | 1 |
Test auth config with no ApiUser key | def test_no_user(self):
with self.assertRaises(ConfigError) as cm:
imageroller.main.read_authconfig(
imageroller.test.get_config_parser(self._no_user))
self.assertEqual(str(cm.exception), "AuthConfig must contain ApiUser") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_blank_user(self):\n with self.assertRaises(ConfigError) as cm:\n imageroller.main.read_authconfig(\n imageroller.test.get_config_parser(self._blank_user))\n self.assertEqual(str(cm.exception), \"AuthConfig must contain ApiUser\")",
"def test_auth0_config_anon(anon... | [
"0.7339472",
"0.7298195",
"0.70554227",
"0.6965093",
"0.6886279",
"0.6864067",
"0.6784296",
"0.6761126",
"0.6677262",
"0.6585729",
"0.6567952",
"0.6554833",
"0.6533842",
"0.65302294",
"0.6514896",
"0.65003186",
"0.6490403",
"0.64753026",
"0.64716136",
"0.64716136",
"0.6402134... | 0.7379715 | 0 |
Test auth config with a blank user | def test_blank_user(self):
with self.assertRaises(ConfigError) as cm:
imageroller.main.read_authconfig(
imageroller.test.get_config_parser(self._blank_user))
self.assertEqual(str(cm.exception), "AuthConfig must contain ApiUser") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_no_user(self):\n with self.assertRaises(ConfigError) as cm:\n imageroller.main.read_authconfig(\n imageroller.test.get_config_parser(self._no_user))\n self.assertEqual(str(cm.exception), \"AuthConfig must contain ApiUser\")",
"def test_auth0_config_anon(anontestap... | [
"0.76511014",
"0.7519222",
"0.7168198",
"0.7086292",
"0.7047256",
"0.7019916",
"0.688388",
"0.6857385",
"0.6839032",
"0.67510104",
"0.67419225",
"0.67419225",
"0.6716172",
"0.6712262",
"0.6696263",
"0.6686048",
"0.6667613",
"0.66638654",
"0.66455823",
"0.66379917",
"0.6637059... | 0.7996798 | 0 |
Test auth config with no ApiKey key | def test_no_key(self):
with self.assertRaises(ConfigError) as cm:
imageroller.main.read_authconfig(
imageroller.test.get_config_parser(self._no_key))
self.assertEqual(str(cm.exception), "AuthConfig must contain ApiKey") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_blank_key(self):\n with self.assertRaises(ConfigError) as cm:\n imageroller.main.read_authconfig(\n imageroller.test.get_config_parser(self._blank_key))\n self.assertEqual(str(cm.exception), \"AuthConfig must contain ApiKey\")",
"def a_valid_api_key(configuration)... | [
"0.7462683",
"0.73790747",
"0.72114646",
"0.69960606",
"0.6991453",
"0.6954508",
"0.6915566",
"0.6873325",
"0.68384326",
"0.68320215",
"0.6796821",
"0.6775761",
"0.6772674",
"0.6768656",
"0.6757531",
"0.6625573",
"0.66205496",
"0.6614271",
"0.65810287",
"0.656183",
"0.6548065... | 0.75365764 | 0 |
Test auth config with no a blank key | def test_blank_key(self):
with self.assertRaises(ConfigError) as cm:
imageroller.main.read_authconfig(
imageroller.test.get_config_parser(self._blank_key))
self.assertEqual(str(cm.exception), "AuthConfig must contain ApiKey") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_auth0_config_anon(anontestapp, registry):\n _test_auth_config(anontestapp, registry)",
"def test_no_key(self):\n with self.assertRaises(ConfigError) as cm:\n imageroller.main.read_authconfig(\n imageroller.test.get_config_parser(self._no_key))\n self.assertEqua... | [
"0.7694496",
"0.7436608",
"0.7070304",
"0.69526356",
"0.6780227",
"0.6725602",
"0.6614002",
"0.66021925",
"0.65208906",
"0.65193444",
"0.65103626",
"0.64611953",
"0.64362353",
"0.6419535",
"0.64037776",
"0.637668",
"0.6372135",
"0.6371621",
"0.6358505",
"0.6358146",
"0.635675... | 0.76383936 | 1 |
Test reading the correct values from a valid auth config | def test_valid(self):
auth_tuple = imageroller.main.read_authconfig(
imageroller.test.get_config_parser(self._valid))
self.assertTupleEqual(auth_tuple, (AUTH_DATA["ApiUser"],
AUTH_DATA["ApiKey"])) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_read_valid_configs(self):\n args = argparse.Namespace(server=None, force=False)\n with open(self._config) as config_f:\n with open(self._auth) as auth_config_f:\n (config_data, auth_tuple) = imageroller.main.read_configs(\n args,\n ... | [
"0.70976317",
"0.6990279",
"0.691208",
"0.69102895",
"0.68164396",
"0.6796548",
"0.6747319",
"0.6724052",
"0.66711295",
"0.6605471",
"0.6570809",
"0.6507571",
"0.64910465",
"0.6490409",
"0.64795727",
"0.647734",
"0.64402336",
"0.6436389",
"0.6413928",
"0.6388307",
"0.6376568"... | 0.77229595 | 0 |
help fuction for the command quit | def help_quit(self):
print("Quit command to exit the program") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def help_exit():\n print(\"Exits the application. Shorthand: x, q, or Ctrl-D.\")",
"def cmd_quit(args):",
"def quit():\n return 'quit'",
"def command_quit(arguments):\n global quitting\n quitting = True\n return 'Now quitting'",
"def onQuitHelp(self, eventDict = None):\n self.main... | [
"0.8069147",
"0.8005583",
"0.7944971",
"0.77239853",
"0.7676314",
"0.7575687",
"0.7440551",
"0.7440551",
"0.7440551",
"0.74403334",
"0.73035663",
"0.7279801",
"0.72764087",
"0.720424",
"0.71987927",
"0.71875477",
"0.7175753",
"0.7155176",
"0.71247745",
"0.71220374",
"0.710940... | 0.87633985 | 0 |
help fuction for the command EOF | def help_EOF(self):
print("EOF command to exit the program") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_EOF(self, args):\n print(\"\")\n return True",
"def do_EOF(self, arg):\n \treturn True",
"def do_EOF(self, _: str) -> None:\n print()\n exit(0)",
"def do_EOF(self, argv):\n return True",
"def test_EOF(self):\n _help = 'EOF method to exit cmd program\\n'\n... | [
"0.74875575",
"0.7452745",
"0.73875695",
"0.72969735",
"0.7260039",
"0.71954066",
"0.71954066",
"0.71954066",
"0.71819055",
"0.714039",
"0.7068059",
"0.7008917",
"0.7002109",
"0.6828262",
"0.6763543",
"0.67330056",
"0.66575915",
"0.6657217",
"0.645732",
"0.645732",
"0.645732"... | 0.888527 | 0 |
help function for the create command | def help_create(self):
print("create instances") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def help_create(self):\n print(CREATE)",
"def create():\n pass",
"def create():",
"def create():",
"def create(*args):",
"def create(ctx):\n pass",
"def test_createImplicitHelp(self):\n self.assertSuccessStatus(self._makeConfig(None), [\"create\"])\n self.assertSpacelessEqual... | [
"0.88401514",
"0.7236834",
"0.70661664",
"0.70661664",
"0.7053937",
"0.69409186",
"0.68577176",
"0.68252945",
"0.6768208",
"0.6767089",
"0.6767089",
"0.6745392",
"0.67440665",
"0.67011154",
"0.66908866",
"0.66798365",
"0.66751415",
"0.6654259",
"0.6593186",
"0.6550263",
"0.65... | 0.80406034 | 1 |
help function for the command destroy | def help_destroy(self):
print("delete an instance based on the class name and id") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def help_delete(self):\n print(DELETE)",
"def destroy():\n pass",
"def destroy():\n pass",
"def test_destroy(self):\n _help = \"[Usage: destroy <class name> <id>] or \"\\\n \"[Usage: <class name>.destroy(<id>)]\\n\"\n with patch('sys.stdout', new=StringIO()) as f:\n ... | [
"0.7465193",
"0.7441447",
"0.7441447",
"0.72776",
"0.70963293",
"0.70963293",
"0.70963293",
"0.6859817",
"0.6859817",
"0.6859817",
"0.6847406",
"0.68421733",
"0.66832083",
"0.6664977",
"0.6596545",
"0.6596545",
"0.6596545",
"0.6596545",
"0.6575466",
"0.6573312",
"0.6563",
"... | 0.7992728 | 0 |
test if val is a float | def is_float(self, val):
try:
float(val)
return True
except ValueError:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_float(val):\n try:\n float(val)\n return True\n except ValueError:\n return False",
"def could_be_float(val):\n if val == None:\n return False\n\n if isinstance(val, float):\n return True\n\n # allow coercion from str\n if isinst... | [
"0.85498303",
"0.8370734",
"0.82459515",
"0.82359195",
"0.81952125",
"0.81167376",
"0.80434555",
"0.8033463",
"0.80211973",
"0.7923834",
"0.78262275",
"0.7720911",
"0.77117264",
"0.7636596",
"0.76307315",
"0.7609729",
"0.75601584",
"0.7530903",
"0.75122285",
"0.74970454",
"0.... | 0.874475 | 0 |
test if val is an integer | def is_int(self, val):
try:
int(val)
return True
except ValueError:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_int(value):\n return isinstance(value, int)",
"def _is_int(test_val):\n try:\n int(test_val)\n return True\n except ValueError:\n return False",
"def could_be_int(val):\n if val == None:\n return False\n\n if isinstance(val, int):\n retur... | [
"0.8488975",
"0.8455279",
"0.8175506",
"0.7949293",
"0.7949293",
"0.78947884",
"0.7861544",
"0.78474236",
"0.78474236",
"0.7787958",
"0.7771183",
"0.77612114",
"0.774458",
"0.774458",
"0.7725738",
"0.76452625",
"0.764265",
"0.75920486",
"0.7519959",
"0.75052243",
"0.7462566",... | 0.85947824 | 0 |
Initializes the GitHub API client and prefetches the `organization` and repositories | def __init__(self, github_access_token, organization):
self.github_access_token = github_access_token
self.organization = organization
self.cli = Github(self.github_access_token)
self.org = self.cli.get_organization(organization)
# http://pygithub.readthedocs.io/en/latest/github... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_org_repos(self):\n url = f\"{BASE_URL}/orgs/{ORG}/repos\"\n return self.fetch_all_pages(url, flatten=True, query_params={\"per_page\": 100})",
"def fetch_repos(self):\n for repo in self.json_repos['repos']:\n title = str(repo[\"title\"])\n repo_url = str(repo['... | [
"0.5919781",
"0.58924395",
"0.58114034",
"0.5757505",
"0.5748955",
"0.56814504",
"0.56594944",
"0.5558187",
"0.5556813",
"0.553892",
"0.552035",
"0.54746497",
"0.5457529",
"0.5447828",
"0.54424405",
"0.54171425",
"0.5404409",
"0.53702736",
"0.53550637",
"0.5354887",
"0.531421... | 0.6803935 | 0 |
Returns a Markdownformatted message for this organization's pull requests | def pull_request_reminder(self):
greeting = random.choice([u'Hola', u'Como estas', u'Greetings', u'你好', u'Hello', u'Aloha', u'Ciao', u'Salut', u'안녕하세요', u'こんにちは', u'שלום', u'chào bạn',])
def pluralize(s, num):
plural_suffix = '' if num == 1 else 's'
value = '%s %s' % (num, s + p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_description(actor, commit, run_id):\n return (\"Requested by @%s on commit %s\\n\" % (actor, commit) +\n \"Last updated: %s \\n\" % _get_datetime() +\n \"**[View integration test log & download artifacts](https://github.com/firebase/firebase-cpp-sdk/actions/runs/%s)**\\n\" % run_id)",
... | [
"0.6124138",
"0.6103314",
"0.6079331",
"0.5917395",
"0.5885449",
"0.5763866",
"0.5757549",
"0.56883436",
"0.5672842",
"0.5661321",
"0.5658218",
"0.56393397",
"0.5609479",
"0.55583596",
"0.55504864",
"0.5479501",
"0.54087687",
"0.5397647",
"0.5391413",
"0.53760666",
"0.5362344... | 0.70357275 | 0 |
synthesize maze.array and characters' position to create a new graphic array to be rendered by plt | def update_synthetic_graph_array(self):
# create maze copy
array = self.maze.array.copy()
# delete the dot eaten by agent
self.dots.array[tuple(self.agent.position)] = 0
# draw the remaining dots
array[self.dots.mask()] = self.dots.color
# draw characters
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _updateGlyphs(self, pos, char=None):\n allVertices = []\n allIndices = []\n for k in range(len(self.text) - pos):\n idx = pos + k\n # Metric\n off, kern = self._updateMetric(idx, self.text[idx])\n # Handle special char\n if self.text[i... | [
"0.6105884",
"0.5895488",
"0.5793849",
"0.57509935",
"0.5704198",
"0.56873125",
"0.566696",
"0.5605523",
"0.5584395",
"0.5584395",
"0.55814326",
"0.5559567",
"0.55231863",
"0.5503865",
"0.547438",
"0.54722863",
"0.5451966",
"0.5424221",
"0.5420088",
"0.54180175",
"0.541554",
... | 0.68791425 | 0 |
query if exists timestamp from the ilm_ilm table | def check_observation_exists(dt, path=''):
conn = None
row = dict()
try:
params = utils.config(path)
conn = psycopg2.connect(**params)
cur = conn.cursor(cursor_factory=RealDictCursor)
# cur = conn.cursor()
condition_y = f"date_part('year', timestamp) = {dt.year}"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_timestamp_not_found(self, l):\n extract_columns(data=self.data, columns=['a'], timestamps=['timestamp'])\n l.check(\n ('pynts.util', 'WARNING', \"Couldn't find timestamps '['timestamp']' in data, using 'ts' instead\"),\n )",
"def table_has_any_timestamp_fields(table_objec... | [
"0.5996367",
"0.5624827",
"0.5526026",
"0.5505662",
"0.5434949",
"0.5400063",
"0.53975856",
"0.53547525",
"0.5338248",
"0.5178298",
"0.5156973",
"0.51147497",
"0.5104057",
"0.5053453",
"0.50414",
"0.5033617",
"0.50205195",
"0.50060344",
"0.49918357",
"0.49574208",
"0.49571142... | 0.62229854 | 0 |
The titles are currently stored in our dataframe in a list of size 1 with all the words mushed together. This method uses regex to separate the title based on capital letters | def fix_title(title):
words = re.findall('[A-Z][^A-Z]*', title[0])
final_str = ""
for word in words:
final_str += word + " "
return final_str.strip() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def title_words(self):\n\n if self._title_words == []:\n for s in self.title():\n for w in s.split():\n self._title_words.append(w)\n\n return self._title_words",
"def parse_title(self) -> list:\n scanning = False # start of a title is found, this may be the second of later par... | [
"0.71647316",
"0.7148444",
"0.6896605",
"0.6857615",
"0.68306935",
"0.67728394",
"0.6753042",
"0.6719203",
"0.6674731",
"0.6583614",
"0.65826327",
"0.6535938",
"0.6533552",
"0.65288967",
"0.6527536",
"0.65209734",
"0.6504784",
"0.6416431",
"0.6280896",
"0.6265228",
"0.6262413... | 0.71496415 | 1 |
Takes in a properly formatted title and mushes all the words together by removing the spaces. It does this to ensure that the given title is formatted the same way it was in our original dataframe. | def mush_title(title):
words = title.split(" ")
mushed_title = ""
for word in words:
mushed_title += word
return [mushed_title] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fix_title(title):\n words = re.findall('[A-Z][^A-Z]*', title[0])\n final_str = \"\"\n for word in words:\n final_str += word + \" \"\n return final_str.strip()",
"def format_title(self, title):\n new_title = ''.join(word.lower().strip('!\"#$%&\\'()*+,-./:;<=>?@[\\\\]^_`{|}~ ') for w... | [
"0.7328139",
"0.71050906",
"0.7095183",
"0.7065475",
"0.7046077",
"0.70116735",
"0.7010075",
"0.69378513",
"0.68239784",
"0.68130606",
"0.6794053",
"0.64888895",
"0.64503413",
"0.641238",
"0.6397636",
"0.6374499",
"0.63737845",
"0.6368508",
"0.6299889",
"0.62697107",
"0.62550... | 0.72873104 | 1 |
Se ejecuta cada consulta libre | def aplicarConsultasLibres(self):
for consultaCL in self.ConsultasLibres:
print(consultaCL)
resultoCL=self.consulta(consultaCL)
for resul in resultoCL['results']['bindings']:
uri = resul['s']['value']
uri=uri.replace('http://dbpedia.or... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ejecutarproceso(self):\n self.generarConsultasLibres()\n self.aplicarConsultasLibres()\n self.generarCombinaciones()\n self.generarConsultasConexion()\n self.archivoSalida()",
"def execute():",
"def generarConsultasConexion(self):\n for parRecursos in self.CombiCon... | [
"0.7146638",
"0.67087954",
"0.66027206",
"0.65353703",
"0.65353703",
"0.65353703",
"0.65353703",
"0.6222579",
"0.6189461",
"0.618236",
"0.6173142",
"0.61664903",
"0.607903",
"0.59206295",
"0.58861643",
"0.58819336",
"0.5822768",
"0.5807695",
"0.5807695",
"0.5807695",
"0.58076... | 0.7042241 | 1 |
Genera consultas de conexion entre dos recursos | def generarConsultasConexion(self):
for parRecursos in self.CombiConsultaLibre:
parRecursosL0=self.limpiaRecursos(parRecursos[0])
parRecursosL1=self.limpiaRecursos(parRecursos[1])
if self.nivel_profundidad>=1:
consultasparql = self.busConex1 % (pa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connections(self, recurse = True):\n \n return NeuroObject.connections(self, recurse) + [self.root] + self.arborizations(False) + self.gapJunctions(False) + self.innervations(False) + self.synapses(False)",
"def consultar_todos_DB(self):\n registros = db.session.query(ModelConcurso).all(... | [
"0.5836493",
"0.55842257",
"0.5556186",
"0.5312924",
"0.5305694",
"0.52962744",
"0.5291475",
"0.52738404",
"0.5213275",
"0.5210257",
"0.5199163",
"0.5190015",
"0.5181708",
"0.5173221",
"0.51505554",
"0.5121695",
"0.5102619",
"0.5076463",
"0.50670546",
"0.5057064",
"0.50567317... | 0.71117014 | 0 |
Ejecuta de forma sequencial el proceso de consultas a DBpedia y genera un archivo output | def ejecutarproceso(self):
self.generarConsultasLibres()
self.aplicarConsultasLibres()
self.generarCombinaciones()
self.generarConsultasConexion()
self.archivoSalida() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execute():",
"def run():\r\n table_names = [\"ram\", \"cpu\", \"ssd\", \"gpu\"]\r\n for table_name in table_names:\r\n create_table(table_name)\r\n page_data: List[str] = get_page_data(table_name=table_name)\r\n processed_data: List[Tuple] = process_page_data(page_data=page_data)\r... | [
"0.63309234",
"0.59563595",
"0.5876927",
"0.5794099",
"0.5786447",
"0.5759093",
"0.571206",
"0.5704333",
"0.57035947",
"0.569773",
"0.5697186",
"0.56905174",
"0.56905174",
"0.56905174",
"0.56905174",
"0.5688792",
"0.5677505",
"0.56663334",
"0.56569755",
"0.56553483",
"0.56426... | 0.64687485 | 0 |
args should not be allowed in a task definition | def test_010_args(self):
with self.assertRaisesRegex(RuntimeError, "Task .* contains an unsupported parameter \"[*]args\""):
self.get_caller([ArgsTaskOverride]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assert_task_args(cls, args: Dict[str, Any]):\n return",
"def assert_task_args(cls, args: \"DictConfig\", shared_state: \"SharedTaskState\") -> None:\n assert isinstance(\n shared_state, SharedStaticTaskState\n ), \"Cannot assert args on a non-static state\"\n super().as... | [
"0.7300057",
"0.6707132",
"0.65718824",
"0.6546681",
"0.6531192",
"0.64853865",
"0.64011043",
"0.637341",
"0.62507206",
"0.62507206",
"0.62474716",
"0.62417936",
"0.61952144",
"0.6191602",
"0.61845964",
"0.61643124",
"0.6163747",
"0.6155938",
"0.6085235",
"0.60706824",
"0.602... | 0.74214095 | 0 |
Test task override with kwargs | def test_020_kwargs(self):
caller = self.get_caller([KwargsTaskOverride])
self.assertEqual(["A", "B"], caller("A", "B")) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_task(self, *args, **kwargs):\n pass",
"def assert_task_args(cls, args: Dict[str, Any]):\n return",
"def task(self, **task):\n task[\"name\"] = task[\"name\"].replace(\"=\", \"--\")\n return task",
"def create_task(self, unused_parent, task, **kwargs):\n self.uri = tas... | [
"0.70350534",
"0.65053123",
"0.6387563",
"0.636143",
"0.6316874",
"0.6316874",
"0.6304503",
"0.62455857",
"0.6204302",
"0.6182599",
"0.61753386",
"0.6103784",
"0.6097735",
"0.60937583",
"0.60792834",
"0.6078696",
"0.6071058",
"0.6025925",
"0.59626514",
"0.59507996",
"0.591920... | 0.68400764 | 1 |
Get urlid via url query in database. | def get_urlid(self, url):
sql = "select rowid from urllist where url='%s'" % (url)
res = self.cur.execute(sql).fetchone()
if res is None:
return 0
else:
return res[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_id(self, url):\n return url.split('/')[-1]",
"def get_id_by_url(url):\n urllist = BlogHelper.get_bloglist_all()\n for el in urllist:\n if el.url == url:\n return el.id",
"def get_page_id(page_url):\r\n db = connect()\r\n cursor = db.cursor()\r\n s... | [
"0.74517095",
"0.7213803",
"0.7095645",
"0.6836921",
"0.68197596",
"0.6787198",
"0.6751158",
"0.6735911",
"0.66284186",
"0.66022027",
"0.6600756",
"0.6584072",
"0.65090793",
"0.6490704",
"0.6449923",
"0.6355983",
"0.6334379",
"0.6222055",
"0.61747503",
"0.6150939",
"0.6128295... | 0.7474152 | 0 |
Save the linkrelationship in the index database. | def save_pr(self):
sql = "drop table if exists pagelink"
self.cur.execute(sql)
sql = "create table pagelink(urlid integer, fromids text, toids text, pagerank real)"
self.cur.execute(sql)
for urlid in self.url_ids:
fromids = ' '.join([str(v) for v in self.from_ids[urlid]])
toids = ' '.join([str(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save(self):\n db.session.commit()",
"def save(self):\n self.session.commit()",
"def save(self):\n self.db.commit()",
"def save(self):\n self.__db.commit()",
"def save(self):\n self.__session.commit()",
"def save(self):\n self.__session.commit()",
"def save(... | [
"0.5978013",
"0.59757173",
"0.59041107",
"0.58396155",
"0.5831509",
"0.5831509",
"0.5831509",
"0.5831509",
"0.5831509",
"0.5831509",
"0.5831509",
"0.5831509",
"0.58116937",
"0.58116937",
"0.5803067",
"0.575889",
"0.57573664",
"0.57573664",
"0.57573664",
"0.57573664",
"0.57553... | 0.6058249 | 0 |
Calculate the pagerank scores from multiinterations. | def pagerank(self, limit=20):
for urlid in self.url_ids:
self.all_scores[urlid] = 1.0
for i in range(limit):
for urlid in self.url_ids:
score = self.all_scores[urlid]
for fromid in self.from_ids[urlid]:
score += self.all_scores[fromid] / \
(len(self.from_ids[fromid])+len(self.to... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ranked(pmi_ranking, tscore_ranking, logdice_ranking, tscore, PMI, logdice):\r\n tsc_rank = tscore_ranking[(float(tscore))]\r\n pmi_rank = pmi_ranking[float(PMI)]\r\n logdice_rank = logdice_ranking[float(logdice)]\r\n summary_tscpmi = tsc_rank + pmi_rank\r\n summary_logdpmi = logdice_rank + pmi_r... | [
"0.62129325",
"0.6156748",
"0.6016934",
"0.59804887",
"0.59745467",
"0.59488946",
"0.5915553",
"0.59055895",
"0.5882802",
"0.58264303",
"0.5813434",
"0.5784075",
"0.5780187",
"0.5749741",
"0.57261175",
"0.570904",
"0.56816393",
"0.56781435",
"0.5668995",
"0.56400824",
"0.5638... | 0.62262225 | 0 |
Adds the new transition using `time_step` to the replay buffer. Adds the transition from `self._prev_timestep` to `time_step` by `self._prev_action`. | def add_transition(self, prev_time_step, prev_action, time_step):
assert prev_time_step is not None
legal_actions = (
prev_time_step.observations["legal_actions"][self.player_id])
legal_actions_mask = np.zeros(self._num_actions)
legal_actions_mask[legal_actions] = 1.0
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _add_trajectory(self, prev_time_step, action, new_time_step):\n\n traj = tf_agents.trajectories.trajectory.from_transition(\n prev_time_step, action, new_time_step)\n\n self.replay_buffer.add_batch(traj)\n self.replay_buffer_position += 1\n\n if self.replay_buffer_positio... | [
"0.73648083",
"0.6423484",
"0.63654953",
"0.62825084",
"0.6085455",
"0.6005418",
"0.59090614",
"0.58365744",
"0.57959193",
"0.57572985",
"0.5752847",
"0.5746639",
"0.5743602",
"0.5651727",
"0.55769384",
"0.5573565",
"0.55378646",
"0.55239344",
"0.55213517",
"0.55170715",
"0.5... | 0.8534917 | 0 |
Returns a valid epsilongreedy action and valid action probs. Action probabilities are given by a softmax over legal qvalues. | def _epsilon_greedy(self, info_state, legal_actions, epsilon):
probs = np.zeros(self._num_actions)
if np.random.rand() < epsilon:
action = np.random.choice(legal_actions)
probs[legal_actions] = 1.0 / len(legal_actions)
else:
info_state = np.reshape(info_state,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_greedy_actions(self, state):\n state_action_values = self.get_action_values(state) # What are the value that we could get from current state\n\n max_action_value = max(state_action_values) # What is the higher value\n max_value_indices = [i for i, value in enumerate(state_action_valu... | [
"0.70859575",
"0.7050571",
"0.6991332",
"0.6853863",
"0.67608166",
"0.67448306",
"0.670126",
"0.6664196",
"0.665848",
"0.66441536",
"0.6631386",
"0.6608386",
"0.6590419",
"0.65791523",
"0.6576034",
"0.6574905",
"0.656424",
"0.6562835",
"0.6562835",
"0.6553221",
"0.65323573",
... | 0.72445875 | 0 |
Context manager to temporarily overwrite the mode. | def temp_mode_as(self, mode):
previous_mode = self._mode
self._mode = mode
yield
self._mode = previous_mode | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cooked_mode(self) -> ContextManager[None]:",
"def raw_mode(self) -> ContextManager[None]:",
"def reset(self, *_):\n with self._context.lock:\n super().reset()\n self.__context_init()",
"def context_reset(self):\n self._context_state = None\n logging.info('Resetting the ... | [
"0.71083087",
"0.6768748",
"0.65129864",
"0.6145239",
"0.6120121",
"0.6084248",
"0.59779245",
"0.59338236",
"0.5911715",
"0.5827784",
"0.57759017",
"0.57342297",
"0.5709189",
"0.56489307",
"0.56413794",
"0.56316674",
"0.5621746",
"0.5572465",
"0.5571708",
"0.55587006",
"0.554... | 0.7396102 | 0 |
set the variable for the softwareAutoPID emit signal to notify Thread store it in settings | def ITC_useAutoPID(self, boolean):
self.temp_ITC_useAutoPID = boolean
self.MTsigs["ITC"]["useAutocheck"].emit(boolean)
settings = QSettings("TUW", "CryostatGUI")
settings.setValue("ITC_useAutoPID", int(boolean))
del settings | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_int_auto():\n int_auto = request.params.get(\"int_auto\", 0) == \"true\"\n pid = request.params.get(\"pid\", 1, type=int)\n retval = RP_LIB.rp_PIDSetResetWhenRailed(pid, int_auto)\n if retval != 0:\n LOG.error(\"Failed to set PID automatical integrator reset. Error code: %s\",\n ... | [
"0.5780794",
"0.5640876",
"0.5605235",
"0.53688097",
"0.5313898",
"0.52056795",
"0.52055293",
"0.51833504",
"0.51833504",
"0.51531035",
"0.5111424",
"0.5095259",
"0.509191",
"0.50885946",
"0.50784993",
"0.50639915",
"0.50615203",
"0.5040517",
"0.50282407",
"0.5024706",
"0.501... | 0.6862474 | 0 |
restore a preset from a json file | def tempcontrol_preset_restore(self, filename: str) -> None:
if filename == "-":
return
filename = os.path.join(self.tempcontrol_presets_path, str(filename) + ".json")
# print(filename)
try:
with open(filename) as f:
tempcontrol_preset = json.loads... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def restore(self, filename=\".azimint.json\"):\n logger.debug(\"Restore\")\n if not os.path.isfile(filename):\n logger.error(\"No such file: %s\" % filename)\n return\n data = json.load(open(filename))\n setup_data = { \"poni\": self.poni.setText,\n# \"dete... | [
"0.6819465",
"0.681742",
"0.59871584",
"0.5828821",
"0.5716159",
"0.5630111",
"0.56096715",
"0.5575501",
"0.55467796",
"0.5539216",
"0.5455987",
"0.54179984",
"0.53913265",
"0.53611207",
"0.5346904",
"0.5345367",
"0.53257084",
"0.53080916",
"0.53048027",
"0.5291933",
"0.52915... | 0.7014069 | 0 |
save the current tempcontrol configuration (self.tempcontrol_conf) as a preset | def tempcontrol_preset_save(self):
with open(
self.tempcontrol_presets_path
+ "{}.json".format(self.tempcontrol_preset_currentFilename),
"w",
) as output:
output.write(json.dumps(self.tempcontrol_conf)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tempcontrol_preset_restore(self, filename: str) -> None:\n if filename == \"-\":\n return\n filename = os.path.join(self.tempcontrol_presets_path, str(filename) + \".json\")\n # print(filename)\n try:\n with open(filename) as f:\n tempcontrol_pre... | [
"0.67358756",
"0.66088444",
"0.660443",
"0.63791686",
"0.58871907",
"0.58554673",
"0.58323383",
"0.5802652",
"0.5794713",
"0.5696611",
"0.567023",
"0.5631236",
"0.56100434",
"0.5598275",
"0.55757743",
"0.55734867",
"0.5569818",
"0.5534407",
"0.55157834",
"0.5442798",
"0.54373... | 0.83489233 | 0 |
store key and value in self.tempcontrol_conf | def tempcontrol_conf_store(self, key: str, value: str) -> None:
self.tempcontrol_conf[key] = value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setitem__(self, keys, value):\n\n if isinstance(keys, str):\n keys = [keys]\n\n #print(\"KEYTYPE: {0}\".format(keys))\n self.__setInDict(self.__cfg, keys, value)\n self.write(self.__cfgFile)",
"def store(self, key, value):\n pass",
"def setKey(self, key, valu... | [
"0.5772307",
"0.5608097",
"0.556695",
"0.5446753",
"0.5427467",
"0.5424942",
"0.54161125",
"0.54157615",
"0.53682756",
"0.5357043",
"0.53424203",
"0.5292201",
"0.5232218",
"0.52251565",
"0.51920104",
"0.51503146",
"0.51280046",
"0.5127102",
"0.51229995",
"0.51179904",
"0.5111... | 0.86829364 | 0 |
Forces a page break, creating a new page. | def page_break(self):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def page_break(orientation):\n return [\n p.NextPageTemplate(orientation),\n p.PageBreak(),\n ]",
"def style_page_break(self) -> str:\n page_break = \"\"\".break-before\n {margin-top: 55px;\\n\n margin-bottom: 55px;\\n\n page-break-before: always;}\\n\"\"\"\n ... | [
"0.6583347",
"0.6578275",
"0.64983094",
"0.6205507",
"0.592676",
"0.5813764",
"0.5792061",
"0.5716074",
"0.56833565",
"0.5555459",
"0.55065304",
"0.5501869",
"0.54553056",
"0.5377034",
"0.5314578",
"0.53048015",
"0.52700055",
"0.5256713",
"0.52501875",
"0.5226771",
"0.5183566... | 0.754851 | 0 |
Starts a new paragraph, using the specified style name. | def start_paragraph(self, style_name, leader=None):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_paragraph(self, stylename=None):\n if stylename is None:\n stylename = _get_paragraph_style(self._item_level, self._ordered)\n super(PacktODFDocument, self).start_paragraph(stylename)",
"def para(text: str) -> Paragraph:\n normal_style = getSampleStyleSheet()[\"Normal\"]\n ... | [
"0.7518931",
"0.6282865",
"0.61091495",
"0.60780036",
"0.58181936",
"0.57754606",
"0.56231266",
"0.5555425",
"0.5482686",
"0.5405735",
"0.5393924",
"0.53562886",
"0.5329658",
"0.528081",
"0.51982284",
"0.51981676",
"0.51656705",
"0.5150641",
"0.51239157",
"0.51139706",
"0.509... | 0.8062328 | 0 |
Ends the current paragraph. | def end_paragraph(self):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end(text=None):\n global _current_line\n if _current_line is not None:\n _current_line.end(text)\n _current_line = None",
"def end(self):\n while self.position < len(self.document.characters\n ) and self.document.characters[\n ... | [
"0.7098995",
"0.70593345",
"0.64046276",
"0.64046276",
"0.62519324",
"0.62327486",
"0.61803997",
"0.60216105",
"0.593675",
"0.59351224",
"0.5920637",
"0.5846148",
"0.5844278",
"0.5840324",
"0.58324766",
"0.5777153",
"0.5777153",
"0.5777153",
"0.5747827",
"0.57358617",
"0.5727... | 0.8533664 | 0 |
Ends the current row on the current table. | def end_row(self):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_table(self):\n pass",
"def end_table(self):\n raise NotImplementedError",
"def end_cell(self):\n raise NotImplementedError",
"def end_table(self):\n self.result += \"</table>\\n\"",
"def endTableRow(self):\r\n self.text += \"</tr>\"\r\n if self.verbosity >= 1 : pri... | [
"0.8004755",
"0.7867141",
"0.7375522",
"0.681857",
"0.6737433",
"0.666918",
"0.6551896",
"0.62203187",
"0.601397",
"0.5982415",
"0.59667635",
"0.5905817",
"0.58938766",
"0.58916444",
"0.58801794",
"0.58764195",
"0.58764195",
"0.58764195",
"0.58646315",
"0.57765365",
"0.567206... | 0.8053807 | 0 |
Starts a new table cell, using the paragraph style specified. | def start_cell(self, style_name, span=1):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_table(self, name, style_name):\n raise NotImplementedError",
"def __cell_style(self):\n cell = TableCellStyle()\n self.default_style.add_cell_style(\"PLC-Cell\", cell)",
"def start_paragraph(self, style_name, leader=None):\n raise NotImplementedError",
"def make_cell(dim... | [
"0.6772431",
"0.6288013",
"0.6006508",
"0.5830384",
"0.57299834",
"0.57245344",
"0.569574",
"0.56612194",
"0.56464446",
"0.56065583",
"0.5532797",
"0.5516472",
"0.55044377",
"0.5457854",
"0.54185015",
"0.5389644",
"0.5367591",
"0.5282963",
"0.5229676",
"0.52050865",
"0.520242... | 0.70826566 | 0 |
Ends the current table cell. | def end_cell(self):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_table(self):\n pass",
"def end_table(self):\n raise NotImplementedError",
"def close_cell(self) -> str:\n self.html_table = self.html_table + \"\"\"</td>\\n\"\"\"\n return self.html_table",
"def end_row(self):\n raise NotImplementedError",
"def end_table(self):\n ... | [
"0.7762969",
"0.76964754",
"0.70904756",
"0.6946298",
"0.6702426",
"0.62307024",
"0.60976493",
"0.6073275",
"0.60001475",
"0.5933361",
"0.58905566",
"0.5871236",
"0.5831757",
"0.5831757",
"0.5831757",
"0.582958",
"0.5819289",
"0.58102936",
"0.57679534",
"0.57511073",
"0.57413... | 0.8534774 | 0 |
Writes the note's text and take care of paragraphs, depending on the format. | def write_note(self, text, format, style_name):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def take_note(self, text):\r\n\r\n self.date = str(datetime.datetime.now().date()) + \"%\" + str(datetime.datetime.now().hour) + \"+\" + str(\r\n datetime.datetime.now().minute) + \"}\"\r\n self.file_name = \"notes/\" + str(self.date).replace(\":\", \"-\") + \"-note.txt\"\r\n with o... | [
"0.6975784",
"0.64324677",
"0.61632895",
"0.61619383",
"0.612646",
"0.6100883",
"0.6068973",
"0.5896486",
"0.58870554",
"0.5886164",
"0.5840614",
"0.57641596",
"0.57601094",
"0.5733736",
"0.56231517",
"0.56069714",
"0.55996",
"0.5572478",
"0.5546628",
"0.5531431",
"0.5521199"... | 0.7870687 | 0 |
Convenience function to write a styledtext to the cairo doc. | def write_styled_note(self, styledtext, format, style_name,
contains_html=False, links=False):
text = str(styledtext)
self.write_note(text, format, style_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DocumentAppendStyledText(self, wave_id, wavelet_id, blip_id, text, style):\n raise NotImplementedError()",
"def writec(text, color='black', style='normal'):\n\n sys.stdout.write(strc(text, color, style))",
"def text_draw(self, x, y, text, style={}):",
"def DrawText(*args, **kwargs):\n return... | [
"0.6481409",
"0.57593817",
"0.57100415",
"0.5548344",
"0.55433697",
"0.5493164",
"0.5487207",
"0.5425144",
"0.5418512",
"0.54131836",
"0.54041564",
"0.5403337",
"0.53930247",
"0.5313948",
"0.53085357",
"0.5267586",
"0.52649045",
"0.52572465",
"0.5242134",
"0.5224046",
"0.5218... | 0.6646067 | 0 |
Method to write text with Gramps citation marks. | def write_text_citation(self, text, mark=None, links=None):
if not text:
return
parts = text.split("<super>")
markset = False
for piece in parts:
if not piece:
# a text '<super>text ...' splits as '', 'text..'
continue
p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_text(self, text, mark=None, links=False):\n raise NotImplementedError",
"def write_note(self, text, format, style_name):\n raise NotImplementedError",
"def bibtex(self):\n return \"@comment{%(id)s: %(message)s}\" % \\\n {'id': self.id, 'message': self.message}",
"def text(se... | [
"0.61993617",
"0.59277856",
"0.5381514",
"0.52257526",
"0.51669157",
"0.5128275",
"0.5094684",
"0.50933456",
"0.5084858",
"0.5084459",
"0.5056",
"0.5053324",
"0.5030647",
"0.5009573",
"0.49758017",
"0.4943831",
"0.4917365",
"0.48793906",
"0.48437178",
"0.48323014",
"0.4814023... | 0.61552864 | 1 |
Start a link section. This defaults to underlining. | def start_link(self, link):
self.start_underline() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_underline(self):\n pass",
"def stop_link(self):\n self.stop_underline()",
"def add_link(self, text, link, doc=None):\n if doc is None:\n doc = self.doc\n\n attributes = dict(height=13, width=800, align=None,\n style={'width': '800px',\n ... | [
"0.70389175",
"0.6805168",
"0.6023745",
"0.57308286",
"0.5663321",
"0.56625533",
"0.5653054",
"0.5649718",
"0.562604",
"0.56095695",
"0.56088525",
"0.5589731",
"0.5551246",
"0.554469",
"0.55201596",
"0.5511892",
"0.5470809",
"0.54240966",
"0.5386747",
"0.5386747",
"0.5386747"... | 0.84542066 | 0 |
Stop the link section. Defaults to stopping the underlining for docgen types that don't support links. | def stop_link(self):
self.stop_underline() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_underline(self):\n pass",
"def start_link(self, link):\n self.start_underline()",
"def remove_link():",
"def remove_link(self, dest):\n for i, link in enumerate(self.runscript.links):\n if link[1] == dest:\n del self.runscript.links[i]\n ... | [
"0.6294352",
"0.62934786",
"0.62264556",
"0.55343175",
"0.55035144",
"0.5487837",
"0.540984",
"0.5374769",
"0.5256436",
"0.52490723",
"0.51926935",
"0.51632124",
"0.51286364",
"0.51018393",
"0.5078943",
"0.50565135",
"0.50212383",
"0.50005454",
"0.49988937",
"0.4980357",
"0.4... | 0.822612 | 0 |
Start a section of underlining. This passes without error so that docgen types are not required to have this. | def start_underline(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def section_underline_overindented(): # noqa: D416",
"def section_underline_overindented_and_contentless(): # noqa: D416",
"def blank_line_before_underline(): # noqa: D416",
"def start_link(self, link):\n self.start_underline()",
"def write_headline(self, p: Position) -> None:\n if not p.h... | [
"0.6508974",
"0.6258308",
"0.6133218",
"0.61004007",
"0.59417766",
"0.582541",
"0.5711631",
"0.56272686",
"0.55545366",
"0.55396044",
"0.5461257",
"0.5451357",
"0.5337029",
"0.53258",
"0.53199047",
"0.52677226",
"0.52594554",
"0.52267236",
"0.5199596",
"0.5196952",
"0.5181517... | 0.7198486 | 0 |
Stops a section of underlining. This passes without error so that docgen ntypes are not required to have this. | def stop_underline(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_link(self):\n self.stop_underline()",
"def start_underline(self):\n pass",
"def no_underline(): # noqa: D416",
"def __unhighlight(self):\n self.unhighlight()",
"def section_underline_overindented(): # noqa: D416",
"def blank_line_before_underline(): # noqa: D416",
"def ... | [
"0.6618424",
"0.5991935",
"0.5964253",
"0.5730836",
"0.54945594",
"0.5405825",
"0.5369429",
"0.53599256",
"0.5326473",
"0.53113395",
"0.5280646",
"0.5279762",
"0.5268478",
"0.5262507",
"0.5260277",
"0.5250067",
"0.52368313",
"0.5201994",
"0.5160801",
"0.5156741",
"0.5155281",... | 0.6740704 | 0 |
Insert a Table of Contents at this point in the document. This passes without error so that docgen types are not required to have this. | def insert_toc(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insert_toc(c: Cmdr, kind: str) -> None:\n p, u = c.p, c.undoer\n w = c.frame.body.wrapper\n undoType = f\"Insert {kind.capitalize()} TOC\"\n if g.app.batchMode:\n c.notValidInBatchMode(undoType)\n return\n bunch = u.beforeChangeBody(p)\n w.deleteTextSelection()\n s = make_toc... | [
"0.64781064",
"0.6344477",
"0.62058264",
"0.6162228",
"0.612088",
"0.6100749",
"0.5970765",
"0.5955356",
"0.5919018",
"0.5889266",
"0.57309765",
"0.5712164",
"0.5663431",
"0.5590135",
"0.5576234",
"0.55694515",
"0.5555598",
"0.5514045",
"0.5490941",
"0.5464776",
"0.5420541",
... | 0.7686676 | 0 |
Insert an Alphabetical Index at this point in the document. This passes without error so that docgen types are not required to have this. | def insert_index(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insert(self, word,index):\n p = self.root\n p.index.append(index)\n for each in word:\n if each not in p.children:\n p.children[each] = TrieNode()\n p = p.children[each]\n p.index.append(index)\n p.is_a_word = (True,index)",
"def ins... | [
"0.6117387",
"0.6076294",
"0.6042403",
"0.58666694",
"0.5742819",
"0.5742819",
"0.5732037",
"0.571465",
"0.5665017",
"0.5653902",
"0.5652122",
"0.5642497",
"0.5638245",
"0.56135434",
"0.56046265",
"0.5557666",
"0.5545734",
"0.55332106",
"0.55086917",
"0.55016094",
"0.5497657"... | 0.70565987 | 0 |
Function that dilates the vessel into regions such that the contribution from each region can be calculated. Input | def syed_dilation(data, vessel): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _regions(self, voronoi_diagram, unique_id, ids, crs):\n vertices = pd.Series(voronoi_diagram.regions).take(voronoi_diagram.point_region)\n polygons = []\n for region in vertices:\n if -1 not in region:\n polygons.append(pygeos.polygons(voronoi_diagram.vertices[reg... | [
"0.5744071",
"0.5710745",
"0.5619926",
"0.55941314",
"0.5523651",
"0.54740584",
"0.54182553",
"0.5401973",
"0.539745",
"0.53945637",
"0.53676456",
"0.533588",
"0.53245455",
"0.53225464",
"0.5290939",
"0.5285925",
"0.5279961",
"0.52479005",
"0.5242811",
"0.5214664",
"0.5193782... | 0.6394514 | 0 |
Function that does a naive reverse diffusion, moving 1/6 of the concentration at each point into the locations adjacent. Sticks to the vessel walls Input | def rev_diffusion_dist(data, vessel):
#Pseudo reverse diffusion
data_temp = data
for t in np.arange(0,40):
for i in np.arange(1,data.shape[0]-1):
for j in np.arange(1,data.shape[1]-1):
for k in np.arange(1,data.shape[2]-1):
if vessel[i,j,k] == 0:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def edge_velocity(self):\n #reflext x values at x edges\n self.u[1,:,0] = -self.u[1,:,1]\n self.u[1,:,-1] = -self.u[1,:,-2]\n #mirror x values at y edges \n self.u[1,0,:] = self.u[1,1,:]\n self.u[1,-1,:] = self.u[1,-2,:]\n #mirror y values at x edges\n self.u[0,:,0] = se... | [
"0.6028458",
"0.5933501",
"0.55698293",
"0.5471902",
"0.5469467",
"0.54656565",
"0.5454209",
"0.54285806",
"0.5420669",
"0.5417958",
"0.5341796",
"0.5321655",
"0.5317063",
"0.5310864",
"0.5309835",
"0.5307491",
"0.52938974",
"0.5290875",
"0.5280223",
"0.52762026",
"0.52753603... | 0.666966 | 0 |
filePath full directory and filename for file Function returns True is file is successfully written to media data content to write to file fileType json JSON object txt text string csv Comman Separated Variable string option a append w overwrite c choose option based on file existance | def fileWrite(filePath,data,fileType,option="c"):
if option.lower() == "c":
if os.path.exists(filePath) and os.path.getsize(filePath) > 0:
print "Appending data to file:%s" %filePath
fileOp = "a"
else:
print "Creating file %s to write data to" %filePath
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fileUpload(fieldName):\n## we don't deal with OS specific \"\\n\"\n## because R does not have a problem (at least with Windows files)\n## no problem in R either with empty carriage returns at end of file\n \n if fs.has_key(fieldName):\n fileClient = fs[fieldName].file\n if not fileClient:\n... | [
"0.5958644",
"0.5942434",
"0.5919456",
"0.5766007",
"0.56870437",
"0.5670353",
"0.56379306",
"0.5612192",
"0.55821",
"0.5571146",
"0.55327785",
"0.5524186",
"0.54830813",
"0.5468874",
"0.54258573",
"0.5385638",
"0.53611887",
"0.5356854",
"0.53434277",
"0.53422385",
"0.5339622... | 0.696589 | 0 |
Method to start/stop active search | def start_stop_active_search(self):
delay = self.sb_sr_delay.value()
if self.pb_active_search.text() == "Stop Search":
self.active_search.stop_event = True
self.active_search.stop()
self.pb_active_search.setStyleSheet("color: rgb(85, 255, 127);")
self.pb_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def runNewSearch(self):\n self.__searchJob = self.__startSearch()\n\n self.monitorSearchJob()",
"def start_search(self):\n self._raise_not_supported()",
"def start_search(self):\r\n\r\n with _LOCK:\r\n if self.debounce_search:\r\n return\r\n self.debounce_se... | [
"0.7765862",
"0.71044886",
"0.71022546",
"0.6595779",
"0.65675974",
"0.64603025",
"0.6419131",
"0.6381665",
"0.6308246",
"0.62620336",
"0.6251231",
"0.6054184",
"0.6021081",
"0.59989226",
"0.5952524",
"0.5862942",
"0.5816167",
"0.5788221",
"0.57749885",
"0.5765927",
"0.574736... | 0.7590508 | 1 |
Method to start/stop feedback timer. sb_feedback_sec spinBox set seconds for timer pb_feedback pushBatton Off/On feedback_timer timer | def start_stop_feedback(self):
if self.pb_start_statistics.text() == "Statistics Accum On":
return 0
if self.mi_standard_fb is not None and self.mi_standard_fb.is_running():
self.error_box("Standard FeedBack is running!")
logger.info("start_stop_feedback: St.FB is ru... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _start_loop_feedback(self):\n self._stop_loop_feedback() # Stop any existing timer\n self._generator_feedback = self._set_feedback_loop() # Start the loop\n self._timerId_feedback = self.startTimer(0) # This is the idle timer\n self.fbtn.setIcon(self.style().standardIcon(QtWidge... | [
"0.6558898",
"0.6342375",
"0.62605155",
"0.6136657",
"0.58962643",
"0.58606404",
"0.58539665",
"0.5761194",
"0.5735097",
"0.5671131",
"0.56429166",
"0.5620733",
"0.55868334",
"0.5585489",
"0.55350286",
"0.5518307",
"0.5502709",
"0.54684657",
"0.54453486",
"0.5385995",
"0.5382... | 0.7382364 | 0 |
Method to the Orbit correctiion. Method calculate correctors strengths (kicks) and call function to calculate (self.calc_orbit()) and draw orbit on the plot but does not send it to the DOOCS server. | def correct(self):
stop_flag = False
self.orbit_class.online_calc = False
# read orbit devs
for elem in self.orbit.corrs:
try:
elem.kick_mrad = elem.mi.get_value()
except Exception as e:
stop_flag = True
logger.warni... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_up_orbit_correctors(ps_beg, delay, id_slice1, ds_slice, zplot, id_slices, U_core, lambdaref):\n SXSS = Chicane(3.2716, 0.362, 0.830399, delay[0])\n HXSS = Chicane(3.2, 0.3636, 0.5828, delay[1])\n\n OC2 = [CORR08, D1_SXSS, SXSS, D2_SXSS, QUAD09, CORR09]\n OC3 = [CORR15, D1_HXSS, HXSS, D2_HXSS, Q... | [
"0.5507916",
"0.5315639",
"0.5306188",
"0.5265168",
"0.5198827",
"0.5140444",
"0.5123679",
"0.5079869",
"0.5074128",
"0.50429016",
"0.5010374",
"0.50013024",
"0.49795583",
"0.49542204",
"0.49383435",
"0.49106684",
"0.4905977",
"0.4890795",
"0.48568112",
"0.48564076",
"0.48111... | 0.5705368 | 0 |
Method to set objective function from the GUI (channels A,B,C) or reload module obj_function.py | def set_obj_fun(self):
# disable button "Edit Objective Function"
# self.ui.pb_edit_obj_func.setEnabled(False)
a_str = str(self.le_a.text())
state_a = self.is_le_addr_ok(self.le_a)
b_str = str(self.le_b.text())
state_b = self.is_le_addr_ok(self.le_b)
c_str = str(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_objective_fn(self, objective_fn):\n self.objective_fn = objective_fn",
"def set_obj_func(self, funcName):\n if hasattr(funcName, '__call__'):\n self.func = funcName\n else:\n try:\n self.func = getattr(self, funcName)\n assert hasat... | [
"0.63489777",
"0.609357",
"0.5881538",
"0.55101573",
"0.5495193",
"0.54194385",
"0.5373759",
"0.53670764",
"0.53039956",
"0.5236558",
"0.52000755",
"0.51875633",
"0.51757866",
"0.51450723",
"0.51331764",
"0.5125311",
"0.51056546",
"0.50857586",
"0.5084916",
"0.508033",
"0.504... | 0.7173771 | 0 |
reconstruct = True, means we are reconstructing image data from filter data | def __init__(self,reconstruct=True,bytesPerPixel=3):
self.prev = None
self.reconstruct = reconstruct
self.bpp = bytesPerPixel
#filter dispatch
if reconstruct:
self.dispatch = {}
self.dispatch[1] = self.__rfilter_sub
self.dispatch[2] = self.__rf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reconstruct(self, num_samples=None):",
"def test_reconstruct_image(self):\n first_product = np.array([1])\n link = np.array([2])\n second_product = FilterImageConfig()\n second_product.gamma = 3 # 1*3+2\n self.assertEqual(localHDR.reconstruct_image(first_product, link, se... | [
"0.6538337",
"0.6091407",
"0.58898145",
"0.58214533",
"0.5815533",
"0.5801474",
"0.58008784",
"0.572688",
"0.5719219",
"0.5697579",
"0.5695703",
"0.56700957",
"0.56302565",
"0.56165177",
"0.55552924",
"0.5517811",
"0.5515225",
"0.5477502",
"0.5468337",
"0.54491526",
"0.544746... | 0.61021507 | 1 |
IEND MUST be the last chunk, so we are Done reading image. It is now safe to decompress IDAT. | def IEND(self,data=None,read=True):
if read:
try:
self.raster = self.getRaster()
except:
print "ERROR getRaster failed!"
raise
else:
return '' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_im_file_deinterlace(self):\n im = IMBackend()\n path = im.deinterlace(self.IMG_225x225)\n cmd = im.identify_cmd + [\n '-format', '%[interlace]', syspath(path, prefix=False),\n ]\n out = command_output(cmd).stdout\n self.assertTrue(out == b'None')",
"d... | [
"0.5838692",
"0.56159306",
"0.5504245",
"0.5379605",
"0.5366888",
"0.53569835",
"0.5352686",
"0.5322073",
"0.5261292",
"0.5238875",
"0.50136817",
"0.49694532",
"0.4962569",
"0.49542606",
"0.4915026",
"0.48784974",
"0.48695505",
"0.48464754",
"0.48415852",
"0.48218232",
"0.478... | 0.58778137 | 0 |
returns an integer raster, i = r<<16+g<<8+b if entire raster is one color that color is returned in a set if entire raster is blank, None is returned. | def iraster(self):
r = self.raster
n = len(r)
slic = itertools.islice
rast = [(a<<16)+(b<<8)+c for a,b,c in itertools.izip(slic(r,0,n,3), slic(r,1,n,3), slic(r,2,n,3))]
s = set(rast)
if len(s) == 1 and 0 in s:
return None
elif len(s) == 1:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def craster(self):\n r = self.iraster()\n if r:\n if len(r) == 1:\n return r\n head = self.data['IHDR']\n size = head['width']*head['height']\n r = pack('!%si'%size,*r)\n return compress(r)\n else:\n return None",... | [
"0.6603248",
"0.559438",
"0.5485492",
"0.53833705",
"0.5363174",
"0.5322997",
"0.531031",
"0.51986265",
"0.51509744",
"0.51048964",
"0.5091788",
"0.5086815",
"0.50762504",
"0.50531447",
"0.49975738",
"0.49967074",
"0.49777487",
"0.49686113",
"0.49679005",
"0.4951756",
"0.4938... | 0.7451694 | 0 |
same as iraster, but full rasters are compressed | def craster(self):
r = self.iraster()
if r:
if len(r) == 1:
return r
head = self.data['IHDR']
size = head['width']*head['height']
r = pack('!%si'%size,*r)
return compress(r)
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def iraster(self):\n r = self.raster\n n = len(r)\n slic = itertools.islice\n rast = [(a<<16)+(b<<8)+c for a,b,c in itertools.izip(slic(r,0,n,3), slic(r,1,n,3), slic(r,2,n,3))]\n s = set(rast)\n if len(s) == 1 and 0 in s:\n return None\n elif len(s) == 1:... | [
"0.6789966",
"0.5841765",
"0.58395094",
"0.583307",
"0.57281715",
"0.5673801",
"0.5658214",
"0.56158817",
"0.5583064",
"0.55811733",
"0.55515283",
"0.55441284",
"0.5536565",
"0.5522638",
"0.55075",
"0.549523",
"0.5475357",
"0.54460007",
"0.54305506",
"0.54136115",
"0.53942955... | 0.7366695 | 0 |
same as craster, but full rasters are compressed and base64 enocded | def b64raster(self):
r = self.craster()
if r:
if len(r) == 1:
return r
return b64encode(r)
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def craster(self):\n r = self.iraster()\n if r:\n if len(r) == 1:\n return r\n head = self.data['IHDR']\n size = head['width']*head['height']\n r = pack('!%si'%size,*r)\n return compress(r)\n else:\n return None",... | [
"0.74468833",
"0.5669294",
"0.561575",
"0.5503642",
"0.5499546",
"0.54981786",
"0.54701924",
"0.54641086",
"0.54507166",
"0.5364727",
"0.5316298",
"0.5266343",
"0.5258329",
"0.5250827",
"0.52449346",
"0.52053833",
"0.5189099",
"0.5165711",
"0.5162305",
"0.5161125",
"0.5144624... | 0.70211464 | 1 |
Checks that the ChemicalSystem component has the right solvent composition for an input nonbonded_methtod. | def validate_solvent(state: ChemicalSystem, nonbonded_method: str):
solv = [comp for comp in state.values()
if isinstance(comp, SolventComponent)]
if len(solv) > 0 and nonbonded_method.lower() == "nocutoff":
errmsg = "nocutoff cannot be used for solvent transformations"
raise ValueE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_nonbonded_cutoff_no_box_vectors(self, mod_cuoff, force_field):\n top = Topology.from_molecules(create_ethanol())\n assert top.box_vectors is None\n\n if mod_cuoff:\n # Ensure a modified, non-default cutoff will be propogated through\n force_field[\"vdW\"].cutoff ... | [
"0.56822634",
"0.55195063",
"0.54630405",
"0.52640486",
"0.52402157",
"0.52061313",
"0.519986",
"0.5194361",
"0.51770246",
"0.51097363",
"0.5093695",
"0.50805086",
"0.5070334",
"0.5030398",
"0.49898612",
"0.49614415",
"0.49533227",
"0.49497217",
"0.49421865",
"0.4940778",
"0.... | 0.73339194 | 0 |
Checks that the ChemicalSystem's ProteinComponent are suitable for the alchemical protocol. | def validate_protein(state: ChemicalSystem):
nprot = sum(1 for comp in state.values()
if isinstance(comp, ProteinComponent))
if nprot > 1:
errmsg = "Multiple ProteinComponent found, only one is supported"
raise ValueError(errmsg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_proportions(self):\r\n\r\n proportions = [\r\n v['proportion'] for k, v in self.composition.items()\r\n ]\r\n\r\n if sum(proportions) < 1.0:\r\n raise ValueError('Sum of proportions between host and pathogen must be 1.0.')\r\n elif sum(proportions) > 1.0:... | [
"0.57693607",
"0.5705589",
"0.56894934",
"0.565764",
"0.5498681",
"0.5441871",
"0.5433286",
"0.5318095",
"0.53150725",
"0.5292855",
"0.5272353",
"0.5251805",
"0.5226932",
"0.5207826",
"0.5193094",
"0.5156745",
"0.5147588",
"0.51380754",
"0.5118902",
"0.5116914",
"0.511461",
... | 0.7040162 | 0 |
Display the prefix(es) that the bot uses | async def prefix(self, ctx):
prefixes = await self.bot.get_prefix(ctx.message)
formatted = self._format_prefixes(prefixes)
await ctx.send(f"You can mention me or use any of the following "
f"prefixes like so: {formatted}") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def prefix(self, _bot, message: discord.Message):\n mention = [self.user.mention + ' ', f'<@!{self.user.id}> ']\n additional_prefixes = await self.get_prefixes(message.guild)\n return self.cfg['bot']['prefixes'] + mention + additional_prefixes",
"async def fetch_prefix(self, bot: 'Cont... | [
"0.76427406",
"0.7210642",
"0.71217066",
"0.6889288",
"0.68547624",
"0.67943585",
"0.67630345",
"0.65804684",
"0.6539357",
"0.6508667",
"0.6451726",
"0.6451726",
"0.64409614",
"0.6364881",
"0.6361315",
"0.63468766",
"0.63292545",
"0.62959814",
"0.62495947",
"0.61866593",
"0.6... | 0.7779845 | 0 |
Plot a graph between accuracy and support threshold. Plot a line graph between accuracy of the association rule mining based classifier and support threshold. | def accuracy_vs_support(confidence_threshold : float, coverage_threshold : int, top_k_rules : int):
print("\nPlotting accuracy vs support_threshold\n")
print("top_k_rules is {}".format(top_k_rules))
print("Confidence Threshold is {}".format(confidence_threshold))
print("Coverage Threshold is {}\n".forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_accuracy(self):\n plot_title, img_title = self.prep_titles(\"\")\n test_legend = ['training data', 'test data']\n\n # Data for plotting x- and y-axis\n x = np.arange(1, CFG.EPOCHS + 1)\n y = [self.tr_accuracy, self.test_accuracy]\n\n # prints x and y-axis values\n... | [
"0.71442026",
"0.7024128",
"0.701119",
"0.69742525",
"0.68908477",
"0.6856894",
"0.6614298",
"0.6551925",
"0.65339744",
"0.6517871",
"0.65104836",
"0.64675707",
"0.6421179",
"0.64156574",
"0.6359094",
"0.6357091",
"0.63095784",
"0.6272008",
"0.6243128",
"0.6218511",
"0.621710... | 0.72727525 | 0 |
Plot a graph between time taken to extract rules and support threshold. Plot a line graph between time taken to extract rules by the association rule mining based classifier and support threshold. | def timetaken_vs_support(confidence_threshold, coverage_threshold, top_k_rules):
print("\nPlotting time taken to extract rules vs support_threshold\n")
print("top_k_rules is {}".format(top_k_rules))
print("Confidence Threshold is {}".format(confidence_threshold))
print("Coverage Threshold is {}\n".forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def performancePlot(plot=\"ROC\"):\n fig, ax = plt.subplots()\n colors = {\"ML\": \"red\", \"Null YFP\": \"gold\", \"Null DAPI\": \"blue\"}\n mapp = pickle.load(open(\"pickles/mapp_fold_-1.pk\", \"rb\"))\n null_mapp = pickle.load(open(\"pickles/null_YFP_mapp_fold_-1.pk\", \"rb\"))\n null_DAPI_mapp =... | [
"0.61351424",
"0.61087435",
"0.60678357",
"0.60510236",
"0.6028423",
"0.60185486",
"0.60018605",
"0.59477055",
"0.589572",
"0.58820945",
"0.58809865",
"0.5858309",
"0.5854518",
"0.584884",
"0.5841052",
"0.581537",
"0.57936525",
"0.57912487",
"0.5787963",
"0.57848495",
"0.5766... | 0.688897 | 0 |
Plot a graph between accuracy and confidence threshold. Plot a line graph between accuracy of the association rule mining based classifier and confidence threshold. | def accuracy_vs_confidence(support_threshold, coverage_threshold, top_k_rules):
print("\nPlotting accuracy vs confidence_threshold\n")
print("top_k_rules is {}".format(top_k_rules))
print("Support Threshold is {}".format(support_threshold))
print("Coverage Threshold is {}\n".format(coverage_threshold))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_accuracy(self):\n plot_title, img_title = self.prep_titles(\"\")\n test_legend = ['training data', 'test data']\n\n # Data for plotting x- and y-axis\n x = np.arange(1, CFG.EPOCHS + 1)\n y = [self.tr_accuracy, self.test_accuracy]\n\n # prints x and y-axis values\n... | [
"0.737747",
"0.71737486",
"0.7107177",
"0.70691806",
"0.70633274",
"0.69389075",
"0.691535",
"0.6802025",
"0.6791968",
"0.6788698",
"0.6644952",
"0.6619942",
"0.66165996",
"0.6499661",
"0.6494702",
"0.64810693",
"0.6455338",
"0.64415747",
"0.6414957",
"0.63887984",
"0.6386974... | 0.72701806 | 1 |
Plot a graph between accuracy achieved at each iteration of GA optimization. Plot a line graph between accuracy of the association rule mining based classifier and iteration count of GA on the parameters support_threshold and confidence_threshold. | def accuracy_vs_ga_iteration(coverage_threshold, top_k_rules):
print("\nPlotting accuracy vs ga_iteration_count\n")
print("top_k_rules is {}".format(top_k_rules))
print("Coverage Threshold is {}\n".format(coverage_threshold))
gen, avg, mini, maxi = ga_optimize.main()
plt.plot(gen, avg, 'g',label='... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def accuracy_vs_pso_iteration(coverage_threshold, top_k_rules):\n print(\"\\nPlotting accuracy vs pso_iteration_count\\n\")\n print(\"top_k_rules is {}\".format(top_k_rules))\n print(\"Coverage Threshold is {}\\n\".format(coverage_threshold))\n\n gen, avg, mini, maxi = pso_optimize.main()\n\n plt.pl... | [
"0.70011044",
"0.6949147",
"0.66704",
"0.66012084",
"0.6554881",
"0.6508257",
"0.6494147",
"0.6462067",
"0.6427914",
"0.64067334",
"0.6404777",
"0.6397388",
"0.6348529",
"0.6348445",
"0.6341152",
"0.6325118",
"0.6286477",
"0.6234107",
"0.62300515",
"0.6225198",
"0.62233925",
... | 0.78101265 | 0 |
Plot a graph between accuracy achieved at each iteration of PSO optimization. Plot a line graph between accuracy of the association rule mining based classifier and iteration count of PSO on the parameters support_threshold and confidence_threshold. | def accuracy_vs_pso_iteration(coverage_threshold, top_k_rules):
print("\nPlotting accuracy vs pso_iteration_count\n")
print("top_k_rules is {}".format(top_k_rules))
print("Coverage Threshold is {}\n".format(coverage_threshold))
gen, avg, mini, maxi = pso_optimize.main()
plt.plot(gen, avg, 'g', lab... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_accuracy(self):\n plot_title, img_title = self.prep_titles(\"\")\n test_legend = ['training data', 'test data']\n\n # Data for plotting x- and y-axis\n x = np.arange(1, CFG.EPOCHS + 1)\n y = [self.tr_accuracy, self.test_accuracy]\n\n # prints x and y-axis values\n... | [
"0.68631935",
"0.67890394",
"0.6786908",
"0.67678726",
"0.67008984",
"0.66275793",
"0.6458183",
"0.63951457",
"0.6394947",
"0.635769",
"0.63556343",
"0.6347951",
"0.6318502",
"0.6196245",
"0.6185412",
"0.6133258",
"0.61163473",
"0.61127144",
"0.6105361",
"0.60849416",
"0.6079... | 0.77488637 | 0 |
Plot a graph between ChiSquare statistics and features. Plot 2 bar graphs side by side of ChiSquare stats of the feature and critical value for comparison. log is used to appropriately scaling for better visualization. | def chi2_stats_vs_feature():
print("\nPlotting chi square statistics vs Features\n")
features, chi2_critical, chi2_stats = chi2_feature_select.get_chi2_stats(verbose = True)
width = 0.8
chi2_critical = list(map(math.log, chi2_critical))
chi2_stats = list(map(math.log, chi2_stats))
x = lis... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_log(log):\n TRAIN_LOSS = 'loss'\n TRAIN_CI = 'c-index'\n VALID_LOSS = 'valid_loss'\n VALID_CI = 'valid_c-index'\n\n num_epochs = len(log[TRAIN_LOSS])\n\n # Plots Negative Log Likelihood vs. Epoch\n fig, ax1 = plt.subplots()\n # plt.figure()\n handles = []\n if TRAIN_LOSS in l... | [
"0.561332",
"0.55867183",
"0.54622185",
"0.5400168",
"0.53750765",
"0.5369569",
"0.53181034",
"0.53002053",
"0.5295591",
"0.5271235",
"0.52442217",
"0.5239486",
"0.5230252",
"0.52101517",
"0.5208167",
"0.5205645",
"0.5203274",
"0.5199911",
"0.5182119",
"0.5175128",
"0.5172823... | 0.78779906 | 0 |
Map a java staging request to the right args. | def _JavaStagingMapper(command_path, descriptor, app_dir, staging_dir):
del descriptor # Unused, app_dir is sufficient
java.CheckIfJavaIsInstalled('local staging for java')
java_bin = files.FindExecutableOnPath('java')
args = ([java_bin, '-classpath', command_path, _JAVA_APPCFG_ENTRY_POINT] +
_JAVA_A... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _map_arguments(self, args):\n data = args.get('data')\n comp = args.get('comp')\n library = args.get('library')\n dry_run = args.get('dry_run', False)\n\n self._set_link('srcmaps-catalog', SrcmapsCatalog_SG,\n comp=comp, data=data,\n ... | [
"0.6017885",
"0.58392483",
"0.5722679",
"0.56131077",
"0.5583179",
"0.5539837",
"0.55294675",
"0.55070996",
"0.5457469",
"0.5394366",
"0.5374629",
"0.5344398",
"0.5332569",
"0.5329219",
"0.52618796",
"0.52236944",
"0.5194549",
"0.51859313",
"0.5178749",
"0.51716286",
"0.51670... | 0.6265363 | 0 |
Invokes a staging command with a given .yaml and temp dir. | def Run(self, staging_area, descriptor, app_dir):
staging_dir = tempfile.mkdtemp(dir=staging_area)
args = self.mapper(self.GetPath(), descriptor, app_dir, staging_dir)
log.info('Executing staging command: [{0}]\n\n'.format(' '.join(args)))
out = cStringIO.StringIO()
err = cStringIO.StringIO()
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Stage(self, descriptor, app_dir, runtime, environment):\n command = self.registry.get((runtime, environment))\n\n if not command:\n # Many runtimes do not require a staging step; this isn't a problem.\n log.debug(('No staging command found for runtime [%s] and environment '\n '[... | [
"0.59549797",
"0.5601968",
"0.5523497",
"0.54830843",
"0.5405916",
"0.53542864",
"0.53230435",
"0.529425",
"0.52454895",
"0.5245015",
"0.5214834",
"0.52104264",
"0.5139466",
"0.5120196",
"0.5088174",
"0.5072716",
"0.5044337",
"0.5039698",
"0.50339854",
"0.5020265",
"0.4983468... | 0.7038176 | 0 |
Get the default stager. | def GetStager(staging_area):
return Stager(_STAGING_REGISTRY, staging_area) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetNoopStager(staging_area):\n return Stager({}, staging_area)",
"def default():\n return DefaultSwh.default()",
"def default():\n return DefaultTroughPhysicalProcessHeat.default()",
"def get_default():\n backend, opts = parse_default()\n assert backend is not None\n return load_b... | [
"0.6626528",
"0.6040375",
"0.5650979",
"0.56108373",
"0.5523717",
"0.5503264",
"0.54928696",
"0.54872453",
"0.54835373",
"0.54515314",
"0.5431681",
"0.5423156",
"0.5410595",
"0.5377566",
"0.5350336",
"0.5341537",
"0.52892715",
"0.52627534",
"0.52577394",
"0.5239429",
"0.52390... | 0.70513046 | 0 |
Get the beta stager, used for `gcloud beta ` commands. | def GetBetaStager(staging_area):
registry = _STAGING_REGISTRY.copy()
registry.update(_STAGING_REGISTRY_BETA)
return Stager(registry, staging_area) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetStager(staging_area):\n return Stager(_STAGING_REGISTRY, staging_area)",
"def getBeta(self):\n\t\treturn self.relativistic_beta",
"def get_stage():\n try:\n filename = os.path.join(get_var('SITE'), \".stage\")\n f = open(filename, \"r\")\n stage = f.readline().strip()\n f... | [
"0.6556233",
"0.5734347",
"0.5339389",
"0.5275761",
"0.51722306",
"0.5073851",
"0.50732416",
"0.50081617",
"0.4984521",
"0.4964786",
"0.49337322",
"0.4877737",
"0.48776495",
"0.48776495",
"0.48291856",
"0.48168102",
"0.47726825",
"0.47723192",
"0.47622555",
"0.4759047",
"0.47... | 0.7754161 | 0 |
Get a stager with an empty registry. | def GetNoopStager(staging_area):
return Stager({}, staging_area) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetStager(staging_area):\n return Stager(_STAGING_REGISTRY, staging_area)",
"def empty_fuselage():\n fus = Fuselage(construct_geometry=False)\n return fus",
"def empty_instance():\n from weighted_graph import Graph\n return Graph()",
"def empty_geno_from_cfg(cfg: Config):\n\n return from_... | [
"0.60954785",
"0.5456797",
"0.5439206",
"0.5302865",
"0.51240116",
"0.50146675",
"0.49316475",
"0.4911877",
"0.48640534",
"0.4820871",
"0.4803686",
"0.47734416",
"0.4734768",
"0.4719782",
"0.4719782",
"0.4700961",
"0.46697578",
"0.46250325",
"0.45343846",
"0.45178375",
"0.450... | 0.7218353 | 0 |
Quantize the RGB image along all 3 channels and assign values of the nearest cluster center to each pixel. Return the quantized image and cluster centers. | def quantizeRGB(origImg: np.ndarray, k: int) -> np.ndarray:
######################################################################################
## TODO: YOUR CODE GOES HERE ##
#########################################################################... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def color_quantization(self):\n Z = self.img.reshape((-1,3))\n\n # convert to np.float32\n Z = np.float32(Z)\n\n # define criteria, number of clusters(K) and apply kmeans()\n # Criteria arguments for termination of algorithm:\n # -type:\n # cv2.TERM_CRITERIA_EPS... | [
"0.7324053",
"0.6727255",
"0.66218585",
"0.66199434",
"0.6400934",
"0.6215788",
"0.614955",
"0.61396843",
"0.61250335",
"0.59294426",
"0.58548164",
"0.579158",
"0.5774267",
"0.574272",
"0.5727873",
"0.572403",
"0.5627672",
"0.5604825",
"0.55571586",
"0.5475474",
"0.54709697",... | 0.7571893 | 0 |
Convert the image to HSV, quantize the Hue channel and assign values of the nearest cluster center to each pixel. Return the quantized image and cluster centers. | def quantizeHSV(origImg: np.ndarray, k: int) -> np.ndarray:
######################################################################################
## TODO: YOUR CODE GOES HERE ##
#####################################################################... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def color_quantization(self):\n Z = self.img.reshape((-1,3))\n\n # convert to np.float32\n Z = np.float32(Z)\n\n # define criteria, number of clusters(K) and apply kmeans()\n # Criteria arguments for termination of algorithm:\n # -type:\n # cv2.TERM_CRITERIA_EPS... | [
"0.6265354",
"0.6262814",
"0.5994777",
"0.59220076",
"0.5856678",
"0.578487",
"0.57551867",
"0.5716351",
"0.56366295",
"0.54361105",
"0.543283",
"0.5390447",
"0.5356829",
"0.5345935",
"0.5342032",
"0.5335454",
"0.5307169",
"0.5293237",
"0.52601105",
"0.5250281",
"0.5228534",
... | 0.7783039 | 0 |
Calculate the quantization error by finding the sum of squared differences between the original and quantized images. Implement a vectorized version (using numpy) of this error metric. | def computeQuantizationError(origImg: np.ndarray, quantizedImg: np.ndarray) -> int:
######################################################################################
## TODO: YOUR CODE GOES HERE ##
##################################################... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quantize(im_orig, n_quant, n_iter):\n color_flag = False\n image = im_orig\n error = list()\n\n\n\n if len(im_orig.shape) == 3: #RGB image\n color_flag = True\n y_im = rgb2yiq(im_orig)\n image = y_im[:, :, 0]\n\n if np.all(image <= 1):\n image *= NORMALIZE\n my_his... | [
"0.6695613",
"0.65505815",
"0.6449519",
"0.63342696",
"0.61776596",
"0.6169704",
"0.6015784",
"0.5935706",
"0.59237593",
"0.579148",
"0.5766612",
"0.5756268",
"0.5723478",
"0.5676731",
"0.56618065",
"0.5654042",
"0.562562",
"0.56052434",
"0.557068",
"0.5567392",
"0.55470383",... | 0.8156114 | 0 |
Initialises a new QuestionnaireLoader instance to read and process data from files generated by the RED questionnaires. Arguments data_dir String. Path to the directory that contains data files that need to be loaded. Keyword Arguments output_path String. Path to the file in which processed data needs to be stored, or ... | def __init__(self, data_dir, output_path=None, task_name="Q1_Questions"):
# Remember the task name.
self._task_name = task_name
# Load all data.
self.load_from_directory(data_dir, task_name)
self.process_raw_data()
if not (output_path is None):
self.w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, data_dir, output_path=None, task_name=\"ReadingTest\", \\\n answer_file=None):\n \n # Define the default answer_file.\n if answer_file is None:\n answer_file = os.path.join( \\\n os.path.dirname(os.path.abspath(__file__)), \\\n ... | [
"0.6951691",
"0.59884197",
"0.5752641",
"0.5744129",
"0.5735763",
"0.5727048",
"0.56857824",
"0.5665455",
"0.56335807",
"0.5608833",
"0.55864763",
"0.55864143",
"0.5571363",
"0.55696005",
"0.55244786",
"0.55207115",
"0.5514098",
"0.5499985",
"0.54496783",
"0.54409695",
"0.543... | 0.79006445 | 0 |
Loads data from a single file. This function overwrites the parent's load_from_file function to allow for the checking of answers. Arguments file_path String. Path to the file that needs to be loaded. Keyword arguments delimiter String. Delimiter for the data file. Default = "," missing List. List of values that code f... | def load_from_file(self, file_path, delimiter=",", missing=None, \
auto_typing=True, string_vars=None):
# Load the data from a file.
raw = read_behaviour(file_path, delimiter=",", missing=None, \
auto_typing=True, string_vars=["Response"])
# If the file ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_from_file(self, file_path, delimiter=\",\", missing=None, \\\n auto_typing=True, string_vars=None):\n \n # Load the data from a file.\n raw = read_behaviour(file_path, delimiter=\",\", missing=None, \\\n auto_typing=True, string_vars=[\"Sentence\", \"Response\"])... | [
"0.6975702",
"0.5946088",
"0.5934415",
"0.58590823",
"0.5856287",
"0.5807811",
"0.57449085",
"0.5613772",
"0.5591136",
"0.55231375",
"0.5500807",
"0.5500807",
"0.54131764",
"0.5364186",
"0.5352303",
"0.5316944",
"0.5308802",
"0.53043306",
"0.52103776",
"0.5204313",
"0.5175644... | 0.73351383 | 0 |
Computes the variables that need to be computed from this task, and stores them in the self.data dict. This has one key for every variable of interest, and each of these keys points to a NumPy array with shape (N,) where N is the number of participants. The processed data comes from the self.raw dict, so make sure that... | def process_raw_data(self):
# Get all participant names, or return straight away if no data was
# loaded yet.
if hasattr(self, "raw"):
participants = self.raw.keys()
participants.sort()
else:
self.data = None
return
# Coun... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_raw_data(self):\n \n # Define some variables of interest.\n vor = [\"n_sentences\", \"n_correct\", \"p_correct\", \"median_RT\", \\\n \"mean_RT\", \"stdev_RT\", \"scaled_stdev_RT\"]\n \n # Get all participant names, or return straight away if no data was\n ... | [
"0.77129465",
"0.6487682",
"0.6245001",
"0.6159736",
"0.61587596",
"0.605451",
"0.58830714",
"0.58749247",
"0.5872119",
"0.5867332",
"0.58645785",
"0.58610857",
"0.5859825",
"0.5858521",
"0.57935315",
"0.5781761",
"0.5727336",
"0.57009387",
"0.5695921",
"0.569097",
"0.5668757... | 0.7354525 | 1 |
Method creates top model. This model will be added at the top of keras application model. | def create_model_tail(self, model):
# Creating a sequential model to at as top layers
top_model = keras.Sequential()
top_model.add(keras.layers.Flatten(input_shape=model.output_shape[1:]))
# Add multiple layers
for layer_num, layer_dim in enumerate(self.num_nodes):
t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_top_model(self):\n model = ModelHelper.load_model(filename_weight=self.top_model_path + '.h5',\n filename_model=self.top_model_path + '.json')\n\n return model",
"def build(bottom_model, num_classes):\n\n top_model = bottom_model.output\n top_mode... | [
"0.73633105",
"0.6960287",
"0.6919673",
"0.65092564",
"0.6374208",
"0.62201995",
"0.6214374",
"0.61819416",
"0.61679876",
"0.6164631",
"0.6162851",
"0.61620754",
"0.6161317",
"0.6142316",
"0.6136363",
"0.60989064",
"0.6071444",
"0.60667586",
"0.6061216",
"0.60570145",
"0.6054... | 0.80240077 | 0 |
Asserts a dict used for report_options argument for request_report method builds the correct string output. | def test_report_options_dict(self, api_instance: Reports):
report_type = "_GET_MERCHANT_LISTINGS_ALL_DATA_"
report_options = {"custom": True, "somethingelse": "abc"}
params = api_instance.request_report(
report_type=report_type,
report_options=report_options,
)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def report_info(self):\n report_values = ['test_description', 'expected_status']\n msg_data = ['']\n for report_value in report_values:\n msg_data.append(\"%s: %s\" %(report_value, getattr(self,report_value)))\n msg_data.append('')\n return '\\n'.join(msg_data)",
"de... | [
"0.623022",
"0.5702977",
"0.5667053",
"0.556668",
"0.5563734",
"0.55150807",
"0.54970586",
"0.5401925",
"0.5401899",
"0.5392235",
"0.53552467",
"0.533539",
"0.5312618",
"0.52750623",
"0.525618",
"0.5249005",
"0.5248258",
"0.5242961",
"0.5232989",
"0.52063745",
"0.5196568",
... | 0.71338964 | 0 |
GetReportRequestListByNextToken operation, via method decorator. | def test_get_report_request_list_by_next_token(self, api_instance: Reports):
params = api_instance.get_report_request_list(next_token="RXmLZ2bEgE")
self.assert_common_params(params, action="GetReportRequestListByNextToken")
assert params["NextToken"] == "RXmLZ2bEgE" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_report_request_list_by_next_token_alias(self, api_instance: Reports):\n params = api_instance.get_report_request_list_by_next_token(\"0hytxbkaOb\")\n self.assert_common_params(params, action=\"GetReportRequestListByNextToken\")\n assert params[\"NextToken\"] == \"0hytxbkaOb\"",
... | [
"0.7149306",
"0.64695066",
"0.63521045",
"0.615282",
"0.55566",
"0.55449754",
"0.5209582",
"0.51705134",
"0.51170003",
"0.50342846",
"0.4943365",
"0.4919686",
"0.48946315",
"0.48797098",
"0.48692414",
"0.4819015",
"0.48107344",
"0.47538847",
"0.47032452",
"0.469868",
"0.46135... | 0.7160382 | 0 |
GetReportRequestListByNextToken operation, via alias method. | def test_get_report_request_list_by_next_token_alias(self, api_instance: Reports):
params = api_instance.get_report_request_list_by_next_token("0hytxbkaOb")
self.assert_common_params(params, action="GetReportRequestListByNextToken")
assert params["NextToken"] == "0hytxbkaOb" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_report_request_list_by_next_token(self, api_instance: Reports):\n params = api_instance.get_report_request_list(next_token=\"RXmLZ2bEgE\")\n self.assert_common_params(params, action=\"GetReportRequestListByNextToken\")\n assert params[\"NextToken\"] == \"RXmLZ2bEgE\"",
"def get_... | [
"0.6910708",
"0.6662306",
"0.6528707",
"0.6078973",
"0.57382417",
"0.5244067",
"0.5197612",
"0.518452",
"0.5170337",
"0.5159851",
"0.4879205",
"0.48016202",
"0.4775895",
"0.47403857",
"0.47386762",
"0.4649952",
"0.46066344",
"0.45716977",
"0.45414442",
"0.45080552",
"0.439388... | 0.74515915 | 0 |
GetReportListByNextToken operation, via method decorator. | def test_get_report_list_by_next_token(self, api_instance: Reports):
params = api_instance.get_report_list(next_token="5u6Of2fS8B")
self.assert_common_params(params, action="GetReportListByNextToken")
assert params["NextToken"] == "5u6Of2fS8B" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_report_list_by_next_token_alias(self, api_instance: Reports):\n params = api_instance.get_report_list_by_next_token(\"3TczcliCkb\")\n self.assert_common_params(params, action=\"GetReportListByNextToken\")\n assert params[\"NextToken\"] == \"3TczcliCkb\"",
"def test_get_report_re... | [
"0.66905516",
"0.6613569",
"0.64893585",
"0.60615534",
"0.59936166",
"0.5860081",
"0.5392812",
"0.5087073",
"0.50503784",
"0.50227946",
"0.48552904",
"0.47947046",
"0.47892374",
"0.47791207",
"0.4736868",
"0.4721561",
"0.47197068",
"0.46979675",
"0.46659908",
"0.45979455",
"0... | 0.7060921 | 0 |
GetReportListByNextToken operation, via alias method. | def test_get_report_list_by_next_token_alias(self, api_instance: Reports):
params = api_instance.get_report_list_by_next_token("3TczcliCkb")
self.assert_common_params(params, action="GetReportListByNextToken")
assert params["NextToken"] == "3TczcliCkb" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_report_list_by_next_token(self, api_instance: Reports):\n params = api_instance.get_report_list(next_token=\"5u6Of2fS8B\")\n self.assert_common_params(params, action=\"GetReportListByNextToken\")\n assert params[\"NextToken\"] == \"5u6Of2fS8B\"",
"def test_get_report_request_lis... | [
"0.68943566",
"0.6753705",
"0.63234955",
"0.6186027",
"0.6056697",
"0.5688721",
"0.5504659",
"0.5388621",
"0.5301569",
"0.5269444",
"0.505247",
"0.4986589",
"0.4907537",
"0.48829532",
"0.4820589",
"0.4796963",
"0.473871",
"0.45952088",
"0.4557502",
"0.45428798",
"0.45394203",... | 0.71012926 | 0 |
GetReportScheduleListByNextToken operation, via method decorator. | def test_get_report_schedule_list_by_next_token(self, api_instance: Reports):
params = api_instance.get_report_schedule_list(next_token="Yj3hOfPcIE")
self.assert_common_params(params, action="GetReportScheduleListByNextToken")
assert params["NextToken"] == "Yj3hOfPcIE" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_report_schedule_list_by_next_token_alias(self, api_instance: Reports):\n params = api_instance.get_report_schedule_list_by_next_token(\"SAlt4JwJGv\")\n self.assert_common_params(params, action=\"GetReportScheduleListByNextToken\")\n assert params[\"NextToken\"] == \"SAlt4JwJGv\"",... | [
"0.7214671",
"0.6119341",
"0.58941936",
"0.5806378",
"0.5797272",
"0.50674",
"0.4855654",
"0.46173725",
"0.44975623",
"0.44815767",
"0.4422535",
"0.44143173",
"0.4395846",
"0.4378938",
"0.43526417",
"0.43431675",
"0.4337188",
"0.42387122",
"0.42283452",
"0.4218952",
"0.415708... | 0.72653776 | 0 |
GetReportScheduleListByNextToken operation, via alias method. | def test_get_report_schedule_list_by_next_token_alias(self, api_instance: Reports):
params = api_instance.get_report_schedule_list_by_next_token("SAlt4JwJGv")
self.assert_common_params(params, action="GetReportScheduleListByNextToken")
assert params["NextToken"] == "SAlt4JwJGv" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_report_schedule_list_by_next_token(self, api_instance: Reports):\n params = api_instance.get_report_schedule_list(next_token=\"Yj3hOfPcIE\")\n self.assert_common_params(params, action=\"GetReportScheduleListByNextToken\")\n assert params[\"NextToken\"] == \"Yj3hOfPcIE\"",
"def t... | [
"0.70539784",
"0.6051018",
"0.59134746",
"0.5835387",
"0.5290381",
"0.52705604",
"0.48901862",
"0.4872177",
"0.47756276",
"0.46665025",
"0.4660449",
"0.46446377",
"0.46302316",
"0.4542122",
"0.4532774",
"0.44435382",
"0.44096997",
"0.44037443",
"0.4384148",
"0.43458682",
"0.4... | 0.75384367 | 0 |
Using enums for report_type and schedule should produce the correct string literals when cleaned. | def test_manage_report_schedule_enums(
self, api_instance: Reports, report_type, schedule
):
params = api_instance.manage_report_schedule(
report_type=report_type,
schedule=schedule,
)
self.assert_common_params(params, action="ManageReportSchedule")
as... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_schedule(schedule: object) -> str:\n task_start = f'{schedule[\"job_type\"].lower()}'\n frequency_part = 'every'\n if schedule['frequency'] == 1:\n period = schedule[\"period\"].lower()\n period = period if period[-1] != 's' else period[:-1]\n freque... | [
"0.56080985",
"0.52214503",
"0.51899695",
"0.510352",
"0.49596563",
"0.49406767",
"0.49195257",
"0.48889175",
"0.48717275",
"0.48627582",
"0.4844954",
"0.4839614",
"0.48315242",
"0.48232314",
"0.4816217",
"0.48059005",
"0.4801257",
"0.48009866",
"0.47932735",
"0.47794887",
"0... | 0.5862392 | 0 |
Using enums for processing_status should produce the correct string literal when cleaned. | def test_cancel_report_requests_processing_enums(
self, api_instance: Reports, processing_status
):
params = api_instance.cancel_report_requests(
processing_statuses=processing_status,
)
assert params["ReportProcessingStatusList.Status.1"] == "_DONE_NO_DATA_" | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _parse_status(self, status):\n if status in (STATUS_FINISHED, 'FINISHED'):\n return STATUS_FINISHED\n elif status in (STATUS_ERROR, 'ERROR'):\n return STATUS_ERROR\n elif status in (STATUS_CANCELED, 'CANCELED'):\n return STATUS_CANCELED\n return STAT... | [
"0.58007187",
"0.5789415",
"0.57174045",
"0.5642962",
"0.56127065",
"0.5557556",
"0.5553899",
"0.5530445",
"0.5387015",
"0.5356812",
"0.5341199",
"0.52970165",
"0.52936935",
"0.52844214",
"0.5278655",
"0.52703166",
"0.5261816",
"0.5252551",
"0.52282244",
"0.5167192",
"0.51648... | 0.6085617 | 0 |
If the testlist is a list, returns an ast.Tuple with a Load context, otherwise returns the orginal node. | def ast_for_testlist(testlist):
if isinstance(testlist, list):
value = ast.Tuple()
value.elts = testlist
value.ctx = Load
else:
value = testlist
return value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def visit_List(self, node):\n self.generic_visit(node)\n if isinstance(node.ctx, ast.Load):\n return to_call(to_attribute(self.operator, '__list__'), node.elts)\n return node",
"def construct_tuple(self, node):\n return tuple(ImportLoader.construct_sequence(self, node))",
... | [
"0.61075395",
"0.55765885",
"0.55088764",
"0.5244893",
"0.5091899",
"0.50377476",
"0.49556306",
"0.4953547",
"0.493258",
"0.48798218",
"0.48778892",
"0.48450866",
"0.47435516",
"0.47435516",
"0.4739168",
"0.47115234",
"0.47113666",
"0.46894008",
"0.467768",
"0.4664838",
"0.46... | 0.8303997 | 0 |
Write the parser and lexer tables. | def write_tables(self):
parse_dir, parse_mod = self._tables_location()
# Using optimized = 0 force yacc to compare the parser signature to the
# parse_tab signature and will update it if necessary.
yacc.yacc(method='LALR',
module=self,
start='enaml',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _write_tables(cls):\n path = inspect.getfile(cls)\n parent = os.path.split(path)[0]\n # Need to change directories to get the file written at the right\n # location.\n cwd = os.getcwd()\n os.chdir(parent)\n tabname = cls._table_name('lex', relative=True)\n ... | [
"0.7924472",
"0.64918715",
"0.6107788",
"0.60145646",
"0.5772668",
"0.576855",
"0.57151103",
"0.5694963",
"0.5672761",
"0.5590488",
"0.55713576",
"0.553202",
"0.5461904",
"0.5454167",
"0.5438697",
"0.54264706",
"0.5375196",
"0.52743566",
"0.5273095",
"0.52514225",
"0.5228066"... | 0.80862355 | 0 |
Recursively sets the context of the node to the given context which should be Store or Del. If the node is not one of the allowed types for the context, an error is raised with an appropriate message. | def set_context(self, node, ctx, p):
# XXX passing the yacc production object to raise the error
# message is a bit flakey and gets things wrong occasionally
# when there are blank lines around the error. We can do better.
items = None
err_msg = ''
node_type = type(node)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _repair_context(self, context):\n\n if isinstance(context, Graph):\n return self._repair_context(context.identifier)\n elif isinstance(context, URIRef):\n return context\n else:\n return NULL_CONTEXT",
"def set_node_context(tree: ast.AST) -> ast.AST:\n ... | [
"0.54566246",
"0.51353014",
"0.51293916",
"0.51025873",
"0.49196404",
"0.48829606",
"0.48677322",
"0.48229265",
"0.47025347",
"0.4697414",
"0.4605316",
"0.45936322",
"0.45792598",
"0.45692173",
"0.45388123",
"0.45359603",
"0.45359603",
"0.45184538",
"0.4444074",
"0.4442087",
... | 0.65204215 | 0 |
Create a module object using the provided body and kwargs. | def create_module(self, body: list, **kwargs):
return ast.Module(body=body) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_module(cls, *args, **kwargs): # real signature unknown\n pass",
"def create_module(cls, *args, **kwargs): # real signature unknown\n pass",
"def new_module(name, doc=None):\n m = ModuleType(name, doc)\n m.__file__ = name + \".py\"\n sys.modules[name] = m\n return m",
"def _create... | [
"0.7453838",
"0.7453838",
"0.62670535",
"0.6161864",
"0.612389",
"0.60464525",
"0.60375047",
"0.600221",
"0.5957083",
"0.585883",
"0.5848532",
"0.5848485",
"0.58093244",
"0.57855964",
"0.57463646",
"0.5714698",
"0.56493086",
"0.56434226",
"0.5632257",
"0.5627497",
"0.56195116... | 0.8261751 | 0 |
Set the arguments for an ast.Call node. | def set_call_arguments(self, node, args):
node.args = args.args
node.keywords = args.keywords
node.starargs = args.starargs
node.kwargs = args.kwargs | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def visit_Call(self, node):\n assert hasattr(node, 'args')\n if node.args:\n assert isinstance(node.args[0], gast.Starred)\n # modify args\n if isinstance(node.args[0].value, gast.Name):\n node.args[0].value.id += '_new'\n\n assert hasattr(node, ... | [
"0.6789165",
"0.6417712",
"0.6367691",
"0.6176472",
"0.6143531",
"0.5933195",
"0.59189445",
"0.5901763",
"0.5901518",
"0.5772168",
"0.56409615",
"0.56347126",
"0.5560014",
"0.5504511",
"0.547756",
"0.542882",
"0.5413455",
"0.53256035",
"0.52822626",
"0.52221584",
"0.51943195"... | 0.79343903 | 0 |
Validate the correctness of names in an enamldef definition. This function ensures that identifiers do not shadow one another. | def _validate_enamldef(self, node, lexer):
ident_names = set()
def check_id(name, node):
if name in ident_names:
msg = "redeclaration of identifier '%s'"
msg += " (this will be an error in Enaml version 1.0)"
syntax_warning(msg % name, FakeTok... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_naming(self, reserved):\n for w in reserved:\n if w in self.decisions:\n raise ParseError('Duplicate variable/block name \"{}\"'.format(w))",
"def test_nonreserved_name(self):\n try:\n field_name_validator('_identifier')\n except ValidationErro... | [
"0.6987066",
"0.6381715",
"0.62525606",
"0.624345",
"0.6212416",
"0.61776954",
"0.5977371",
"0.59209687",
"0.58513546",
"0.5849773",
"0.5835992",
"0.5794952",
"0.577412",
"0.5767019",
"0.57391775",
"0.5735138",
"0.57254034",
"0.57044023",
"0.5649754",
"0.5619496",
"0.55980736... | 0.7759884 | 0 |
Validate the correctness of names in a template definitions. This function ensures that parameters, const expressions, and identifiers do not shadow one another. | def _validate_template(self, node, lexer):
param_names = set()
const_names = set()
ident_names = set()
def check_const(name, node):
msg = None
if name in param_names:
msg = "declaration of 'const %s' shadows a parameter"
elif name in c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_template_inst(self, node, lexer):\n names = set()\n if node.identifiers:\n names.update(node.identifiers.names)\n for binding in node.body:\n if binding.name not in names:\n msg = \"'%s' is not a valid template id reference\"\n ... | [
"0.669228",
"0.63677204",
"0.63198096",
"0.62554604",
"0.61504287",
"0.60716707",
"0.6013362",
"0.59895295",
"0.5974523",
"0.5945504",
"0.59359306",
"0.58169436",
"0.5808214",
"0.5807836",
"0.5769247",
"0.5764786",
"0.57481813",
"0.5730887",
"0.5723944",
"0.572081",
"0.571919... | 0.77258897 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.