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 |
|---|---|---|---|---|---|---|
Method to view virtual panels, if panel ID given then only return virtual panels from that panel | def view_virtual_panels(id=None):
if not id:
id = request.args.get('id')
if id:
panels = get_virtual_panels_by_panel_id(s, id)
else:
panels = get_virtual_panels_simple(s)
result = []
panel_name = "Virtual"
for i in panels:
row = dict(zip(i.keys(), i))
row... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def view_vpanel():\n id = request.args.get('id')\n try:\n version = request.form[\"versions\"]\n except KeyError:\n version = None\n if id:\n status = check_virtualpanel_status(s, id)\n if not status:\n message = \"This panel has changes which cannot be viewed her... | [
"0.6817255",
"0.6743722",
"0.6515746",
"0.64239585",
"0.61308205",
"0.59219176",
"0.57346356",
"0.55168694",
"0.54971176",
"0.54806674",
"0.5439954",
"0.5401917",
"0.52581835",
"0.52198446",
"0.51601046",
"0.5151167",
"0.51509696",
"0.5147451",
"0.5058827",
"0.504147",
"0.499... | 0.80881995 | 0 |
Method to view the regions in a virtual panel. The method checks permissions to determine if edit etc is available. | def view_vpanel():
id = request.args.get('id')
try:
version = request.form["versions"]
except KeyError:
version = None
if id:
status = check_virtualpanel_status(s, id)
if not status:
message = "This panel has changes which cannot be viewed here as they have no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def view_panel():\n id = request.args.get('id')\n try:\n version = request.form[\"versions\"]\n except KeyError:\n version = None\n if id:\n status = check_panel_status(s, id)\n if not status:\n message = \"This panel has changes which cannot be viewed here as the... | [
"0.6146995",
"0.56700337",
"0.5658867",
"0.5657484",
"0.5576248",
"0.5533098",
"0.55307925",
"0.54637206",
"0.5391918",
"0.52538276",
"0.52468014",
"0.5194485",
"0.51648325",
"0.5118682",
"0.51112306",
"0.51092696",
"0.50995123",
"0.5076863",
"0.50713927",
"0.50579756",
"0.50... | 0.62893504 | 0 |
Method for create virtual panel wizard. If request is "GET" method renders virtual panel process html. If request if "POST" the method checks if the virtual panel is to be made live and unlocks the panel for future editing. | def create_virtual_panel_process():
form = CreateVirtualPanelProcess()
if request.method == "POST":
make_live = request.form['make_live']
vp_id = request.args.get('id')
if make_live == "on":
make_vp_panel_live(s, vp_id)
add_to_starlims(vp_id)
panel_id = g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_panel_process():\n form = CreatePanelProcess()\n if request.method == \"POST\":\n make_live = request.form['make_live']\n panel_id = request.args.get('id')\n project_id = get_project_id_by_panel_id(s, panel_id)\n preftx_id = get_preftx_id_by_project_id(s, project_id)\n ... | [
"0.7490138",
"0.7386656",
"0.6583208",
"0.6571529",
"0.6242242",
"0.5805392",
"0.55935615",
"0.5549157",
"0.5532851",
"0.54516643",
"0.54052836",
"0.5399087",
"0.537762",
"0.53703177",
"0.53167623",
"0.5260761",
"0.52282465",
"0.5182984",
"0.51700354",
"0.51629823",
"0.515381... | 0.84285897 | 0 |
Method for edit virtual panel wizard. If request is "GET" the method locks the panel so it cannot be edited by any other user. It then retrieves all information about the current panel and virtual panel. The query associated with this method gets the virtual panel information with respect to the future version number s... | def edit_virtual_panel_process():
form = EditVirtualPanelProcess()
vp_id = request.args.get('id')
panel_id = get_panel_by_vp_id(s, vp_id)
if request.method == "POST":
if request.form['make_live'] == "on":
make_vp_panel_live(s, vp_id)
add_to_starlims(vp_id)
unlock... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def view_vpanel():\n id = request.args.get('id')\n try:\n version = request.form[\"versions\"]\n except KeyError:\n version = None\n if id:\n status = check_virtualpanel_status(s, id)\n if not status:\n message = \"This panel has changes which cannot be viewed her... | [
"0.72431135",
"0.6876697",
"0.660208",
"0.64722663",
"0.64284134",
"0.626455",
"0.592217",
"0.5538486",
"0.5535285",
"0.5225926",
"0.5187769",
"0.5110371",
"0.5093875",
"0.50041443",
"0.49602246",
"0.49470374",
"0.49301475",
"0.4923213",
"0.4913949",
"0.49104533",
"0.4892809"... | 0.74897695 | 0 |
Method to add virtual panel to DB. | def add_vp():
vp_name = request.json['vp_name']
panel_id = request.json['panel_id']
vp_id = create_virtualpanel_query(s, vp_name, panel_id)
if vp_id != -1:
lock_panel(s, current_user.id, panel_id)
return jsonify(vp_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_panel(self, panel):\n assert panel.PANEL_ID not in self.panels\n assert not self.tools, \"tools must be added after panels\"\n self.panels[panel.PANEL_ID] = panel\n panel.register_panel(self)",
"def create_virtual_panel_process():\n form = CreateVirtualPanelProcess()\n\n ... | [
"0.655961",
"0.5985063",
"0.5937451",
"0.576908",
"0.559643",
"0.5505857",
"0.5472811",
"0.5391672",
"0.5387777",
"0.5306345",
"0.5272926",
"0.52606857",
"0.52213275",
"0.5207247",
"0.5133307",
"0.5133307",
"0.5127811",
"0.51272595",
"0.5119451",
"0.5064431",
"0.5005942",
"... | 0.6955528 | 0 |
Method to add all regions for a gene to versions table | def add_all_regions_vp():
gene_id = request.json['gene_id']
vpanel_id = request.json['vpanel_id']
panel_id = request.json['panel_id']
add_all_regions_to_vp(s, panel_id, gene_id, vpanel_id)
return jsonify({"genes": [gene_id, ]}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_all_regions():\n gene_id = request.json['gene_id']\n panel_id = request.json['panel_id']\n tx_id = request.json['tx_id']\n gene_name = request.json['gene_name']\n project_id = get_project_id_by_panel_id(s, panel_id)\n\n add_preftxs_to_panel(s, project_id, [{\"gene\": gene_name, \"tx_id\":... | [
"0.66544604",
"0.6378839",
"0.5810066",
"0.5718972",
"0.557586",
"0.54156053",
"0.5386809",
"0.53579724",
"0.5317539",
"0.5312527",
"0.5252136",
"0.52013516",
"0.51998466",
"0.51921564",
"0.51599437",
"0.51550764",
"0.5132998",
"0.5104016",
"0.5098529",
"0.50962406",
"0.50761... | 0.6766564 | 0 |
Method to add new test to StarLIMS. Method calls bioinfoweb API method through commonlibs producers. The TESTCODE value returned is added to the virtual panels table. | def add_to_starlims(vpanelid):
details = get_vpanel_details_by_id(s, vpanelid)
print(details)
version = round(details.current_version,1)
panel_name = 'Analysis: ' + details.name + ' v' + str(version) + ' (' + details.panel_name + ')'
print(len(panel_name))
if len(panel_name) > 50:
#todo ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addTest(self, test):\r\n self.tests.append(test)\r\n return",
"def add_test(self, testsuite, test):\n self.tests[testsuite].append(TestCase(test, self))\n self.num_tests += 1",
"def add_test(self,test):\n l = test.id.split('.')\n s_obj = self\n while len(l) > 0:\n ... | [
"0.63559365",
"0.6069125",
"0.59046876",
"0.5759549",
"0.5705489",
"0.5694319",
"0.5653221",
"0.5620037",
"0.5569933",
"0.55606675",
"0.550797",
"0.55018616",
"0.5477621",
"0.5447666",
"0.54451877",
"0.542421",
"0.5414771",
"0.5409606",
"0.54056925",
"0.5385775",
"0.5385775",... | 0.65358037 | 0 |
given a panel id this method makes a panel live | def make_virtualpanel_live():
vpanelid = request.args.get('id')
panelid = get_panel_by_vp_id(s, vpanelid)
locked = check_if_locked(s, panelid)
if locked:
if current_user.id == get_locked_user(s, panelid):
make_vp_panel_live(s, vpanelid)
add_to_starlims(vpanelid)
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_live():\n panelid = request.args.get('id')\n locked = check_if_locked(s, panelid)\n if locked:\n unlock_panel_query(s, panelid)\n current_version = get_current_version(s, panelid)\n if not current_version:\n current_version = 0\n new_version = current_version + 1\n make_... | [
"0.7494106",
"0.6255343",
"0.62282526",
"0.6057684",
"0.5991913",
"0.5888008",
"0.57380563",
"0.573186",
"0.5687909",
"0.5653041",
"0.56348544",
"0.561588",
"0.5607468",
"0.56046987",
"0.554078",
"0.553629",
"0.55315703",
"0.55211776",
"0.5510027",
"0.5504226",
"0.54796404",
... | 0.69726217 | 1 |
toggles the locked status of a panel useful if someone has forgotten they have left a panel locked an admin can unlock | def toggle_locked():
panel_id = request.args.get('id')
json = False
if not panel_id:
json = True
panel_id = request.json['id']
project_id = get_project_id_by_panel_id(s, panel_id)
if current_user.id == get_locked_user(s, panel_id) and json:
unlock_panel_query(s, panel_id)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lockSliderPanel(self, flag): \n\t\tself.doLockSliderPanel = flag",
"def unlock_panel():\n panelid = request.args.get('panelid')\n unlock_panel_query(s, panelid)\n\n return redirect(url_for('panels.view_panels'))",
"def ToggleLock(self, event):\n pass",
"def toggleFrontPanelLock(self, un... | [
"0.6745608",
"0.6713125",
"0.6654994",
"0.65814847",
"0.6289808",
"0.620875",
"0.611685",
"0.59749204",
"0.59507865",
"0.5889249",
"0.586993",
"0.5864686",
"0.5826866",
"0.5818667",
"0.5771882",
"0.57535344",
"0.57477957",
"0.5727761",
"0.57048416",
"0.5700825",
"0.56826514",... | 0.8498502 | 0 |
scrape the goodreads quote page for the mood submitted | def how_you_feelin(mood):
to_scrape = "https://www.goodreads.com/quotes/tag?utf8=✓&id=" + mood
scraped = requests.get(to_scrape)
soup = BeautifulSoup(scraped.content, 'html.parser')
cleaned = soup.prettify()
quote_mess = soup.find_all(class_='quoteText')
return quote_mess | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieving_data():\n for x in range(1):\n page_number=random.randint(1,500)\n page_num=str(page_number)\n url = 'http://www.tastespotting.com/browse/'+page_num\n req = http.request('GET', url)\n data = BeautifulSoup(req.data,'html.parser')\n for each_div in data.find_all(\"div\", { \"cl... | [
"0.6069228",
"0.6050294",
"0.59508425",
"0.58939606",
"0.589346",
"0.58812517",
"0.5798072",
"0.5686617",
"0.5512013",
"0.5441507",
"0.5422525",
"0.54129744",
"0.5399996",
"0.5375564",
"0.5344539",
"0.5341562",
"0.5331536",
"0.5272266",
"0.525688",
"0.5251573",
"0.52459145",
... | 0.73806167 | 0 |
Prepares the directory of a target located at dst for copying and returns its full location as specified below. src can be the location of a source file target, which is (e.g.) used by a file copy or move operation. When dst is already a directory, calling this method has no effect and the dst path is returned, optiona... | def _prepare_dst_dir(self, dst, src=None, perm=None, **kwargs):
if self.isdir(dst):
full_dst = os.path.join(dst, os.path.basename(src)) if src else dst
elif self.isfile(dst):
full_dst = dst
else:
# interpret dst as a file name, create missing dirs
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _prepare_dst_dir(self, dst, src=None, perm=None, **kwargs):\n rstat = self.exists(dst, stat=True)\n\n if rstat:\n if self.file_interface.isdir(dst, stat=rstat) and src:\n full_dst = os.path.join(dst, os.path.basename(src))\n else:\n full_dst = d... | [
"0.7756741",
"0.66299",
"0.6474231",
"0.63675195",
"0.63613135",
"0.63447046",
"0.62880516",
"0.62483966",
"0.62306374",
"0.6207867",
"0.6207867",
"0.6200936",
"0.61562246",
"0.615402",
"0.61524415",
"0.60604155",
"0.6053617",
"0.6051028",
"0.6029516",
"0.59734154",
"0.593691... | 0.77938974 | 0 |
Constructs a Datastore key for a phone | def phone_key(phone_id=None):
return db.Key.from_path('Pictbook', phone_id or 'default_phone') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_key ():",
"def make_external_key(self, data):\n return data['key']",
"def build_key(cls, song_id):\n return ndb.Key(cls, song_id)",
"def ds_key(ip, port):\n return DS_PREFIX + ip + ':' + str(port)",
"def keygen(cls, device, **kwargs):\n key = '%s/%s' % (cls.__name__, ... | [
"0.70503455",
"0.6636935",
"0.64906794",
"0.6414169",
"0.62262106",
"0.62203693",
"0.61674833",
"0.6158786",
"0.6078497",
"0.59785026",
"0.59565264",
"0.5950048",
"0.5886137",
"0.58423275",
"0.58145356",
"0.5807809",
"0.5783175",
"0.57496804",
"0.5748418",
"0.57472914",
"0.57... | 0.7932787 | 0 |
Update the API key. This can be used when you've regenerated your service API key and want to update longlived clients. | def update_key(self, key):
self._api_key = key | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetAPIKey(self, api_key):\n self._api_key = api_key",
"def SetAPIKey(self, api_key):\n self._api_key = api_key",
"def set_api_key(new_api_key):\n global api_key\n api_key = new_api_key",
"def update_api_key(self, apikey_id, **kwargs):\n\n all_params = ['apikey_id', 'api_key']\n ... | [
"0.7447722",
"0.7447722",
"0.74372375",
"0.7170894",
"0.71437603",
"0.70787835",
"0.69710577",
"0.6895766",
"0.6862906",
"0.6694672",
"0.66607916",
"0.657263",
"0.6552993",
"0.6464547",
"0.64579034",
"0.64280456",
"0.6423422",
"0.6378686",
"0.6366006",
"0.63227934",
"0.632192... | 0.8198307 | 0 |
Create a TURN allocation. | async def connect(self):
request = stun.Message(message_method=stun.Method.ALLOCATE,
message_class=stun.Class.REQUEST)
request.attributes['LIFETIME'] = self.lifetime
request.attributes['REQUESTED-TRANSPORT'] = 0x11000000
try:
response, _ = awai... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_connection(location=None, bandwidth=None, connectionName=None):\n pass",
"def createTMsender():\n global s_tmSender\n nctrsTMfields = GRND.NCTRS.NCTRStmFields()\n nctrsTMfields.spacecraftId = int(UTIL.SYS.s_configuration.SPACECRAFT_ID)\n s_tmSender = TMsender(\n portNr=int(UTIL.SYS.s_configu... | [
"0.5665241",
"0.5590401",
"0.555418",
"0.5452348",
"0.54044276",
"0.5399572",
"0.5387226",
"0.5387226",
"0.5319276",
"0.5272297",
"0.5236255",
"0.5185947",
"0.5185715",
"0.5166859",
"0.51485175",
"0.5109881",
"0.5103653",
"0.50794905",
"0.50685924",
"0.5062864",
"0.505619",
... | 0.69904995 | 0 |
Periodically refresh the TURN allocation. | async def refresh(self):
while True:
await asyncio.sleep(5/6 * self.lifetime)
request = stun.Message(message_method=stun.Method.REFRESH,
message_class=stun.Class.REQUEST)
request.attributes['LIFETIME'] = self.lifetime
self.__add... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def release(self):\n if self.refresh_handle:\n self.refresh_handle.cancel()\n self.refresh_handle = None\n\n request = stun.Message(message_method=stun.Method.REFRESH,\n message_class=stun.Class.REQUEST)\n request.attributes['LIFETIME']... | [
"0.68299145",
"0.6135103",
"0.5778847",
"0.57332826",
"0.57332826",
"0.57332826",
"0.5703909",
"0.5703909",
"0.5681639",
"0.56502575",
"0.5648896",
"0.5647276",
"0.560292",
"0.55943274",
"0.55868673",
"0.55836076",
"0.55836076",
"0.5580496",
"0.5553782",
"0.5540401",
"0.55049... | 0.6948456 | 0 |
Releases the TURN allocation. | async def release(self):
if self.refresh_handle:
self.refresh_handle.cancel()
self.refresh_handle = None
request = stun.Message(message_method=stun.Method.REFRESH,
message_class=stun.Class.REQUEST)
request.attributes['LIFETIME'] = 0
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def release(self):\n if self._tr is not None:\n self._tr.release()",
"async def release(self) -> None:\n ...",
"async def release(self) -> None:\n ...",
"async def release(self) -> None:\n ...",
"def release(self):\r\n pass",
"def release(self):\n self... | [
"0.6602504",
"0.6601743",
"0.6601743",
"0.6601743",
"0.6311859",
"0.6118295",
"0.6088195",
"0.6069963",
"0.60375977",
"0.60316527",
"0.60200906",
"0.59722954",
"0.5802416",
"0.57991636",
"0.57692593",
"0.57690936",
"0.57463837",
"0.57463837",
"0.57463837",
"0.57463837",
"0.57... | 0.7737725 | 0 |
Execute a STUN transaction and return the response. | async def request(self, request, addr):
assert request.transaction_id not in self.transactions
transaction = stun.Transaction(request, addr, self)
self.transactions[request.transaction_id] = transaction
try:
return await transaction.run()
finally:
del sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transaction(self, transaction):\n # Allow for a list of blocks..\n transaction = utils.request_type(transaction)\n\n res = r.get(self.url + self.tx_info + str(transaction))\n return self.execute(res)",
"def _run_transaction(operation_name, txn):\n if not txn:\n r... | [
"0.6163789",
"0.59890455",
"0.57953054",
"0.57152027",
"0.56557715",
"0.56381756",
"0.556138",
"0.55261993",
"0.5462677",
"0.54577535",
"0.5392021",
"0.538656",
"0.5381371",
"0.53764015",
"0.5374454",
"0.5368948",
"0.5350154",
"0.5341703",
"0.5334163",
"0.5331038",
"0.5330173... | 0.6468085 | 0 |
Send a STUN message. | def send_stun(self, message, addr):
logger.debug('%s > %s %s', self, addr, message)
self.transport.sendto(bytes(message), addr) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_message(stdscr, username=None):\n # Show the cursor and echo output.\n curses.curs_set(1)\n curses.echo()\n stdscr.clear()\n stdscr.refresh()\n if username is None:\n safe_put(stdscr, \"Recipient username: \", (0, 0))\n username = stdscr.getstr(0, 20)\n stdscr.clear(... | [
"0.61616313",
"0.6152894",
"0.58543134",
"0.5825989",
"0.5467833",
"0.5367065",
"0.5363118",
"0.53626806",
"0.5354391",
"0.5348102",
"0.53142506",
"0.5306756",
"0.52913076",
"0.5251448",
"0.5242878",
"0.5239616",
"0.52390784",
"0.52369165",
"0.522766",
"0.5224386",
"0.5217544... | 0.72028255 | 0 |
Close the transport. After the TURN allocation has been released, the protocol's `connection_lost()` method will be called with None as its argument. | def close(self):
asyncio.ensure_future(self.__inner_protocol.release()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close(self) -> None:\n self.transport.close()",
"def close(self):\n if self.transport.isOpen():\n self.transport.close()",
"def close(self) -> None:\n if self.client is None:\n return\n\n if logger is not None:\n # If called from __del__(), modul... | [
"0.7232531",
"0.69609827",
"0.6923589",
"0.6796147",
"0.6639552",
"0.65796196",
"0.64923614",
"0.6464494",
"0.6451994",
"0.6403425",
"0.6360436",
"0.6339348",
"0.63273036",
"0.6292693",
"0.6274413",
"0.6261059",
"0.6217416",
"0.6202988",
"0.6185388",
"0.615356",
"0.6153044",
... | 0.71569246 | 1 |
Sends the `data` bytes to the remote peer given `addr`. This will bind a TURN channel as necessary. | def sendto(self, data, addr):
asyncio.ensure_future(self.__inner_protocol.send_data(data, addr)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sendto(self, data, addr=None):\n if not isinstance(data, (bytes, bytearray, memoryview)):\n raise TypeError(\"data: expecting a bytes-like instance, got {!r}\"\n .format(type(data).__name__))\n self._check_status()\n if not self._writable:\n ... | [
"0.69670016",
"0.66431624",
"0.63675064",
"0.63365537",
"0.6225546",
"0.6202067",
"0.61579084",
"0.61440784",
"0.60198617",
"0.6018413",
"0.59791154",
"0.5967798",
"0.5965921",
"0.596309",
"0.59398365",
"0.59398365",
"0.5916635",
"0.5850885",
"0.58379453",
"0.5826466",
"0.582... | 0.7759187 | 0 |
Get host info from request META | def get_host(req):
return req.META["HTTP_HOST"].split(":")[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getHostInfo():",
"def get_host(request):\n return request.META[\"HTTP_HOST\"].split(\":\")[0]",
"def _get_host(request):\n return request.headers.get('X-Forwarded-Host', request.headers['Host'])",
"def getHost():",
"def getHost():",
"def get_host_info(hass: HomeAssistant) -> dict[str, Any] | No... | [
"0.7799314",
"0.71128947",
"0.7056515",
"0.7014446",
"0.7014446",
"0.69996834",
"0.68279314",
"0.6817718",
"0.6813407",
"0.6598185",
"0.6563933",
"0.64535975",
"0.64207745",
"0.6417893",
"0.6402575",
"0.63990295",
"0.6384519",
"0.6373008",
"0.63592684",
"0.63389564",
"0.63380... | 0.75950074 | 1 |
Read 6dcmd txt files to numpy array. | def read_file(self, path, is_6dcmd = True):
if not os.path.isfile(path):
raise ValueError(f'Error: File not exist! {path}')
data = list()
txtFile = open(path)
if is_6dcmd:
cmd = list()
for row in txtFile:
row = row.split()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_txt_file(txtfile):\n array = np.genfromtxt(txtfile)\n return array",
"def _parse_txt(path, n_channels):\n f = open(path)\n lines = f.readlines()\n f.close()\n\n geom = np.zeros((0, 2))\n\n for i, line in zip(range(n_channels), lines):\n line = line.replace('\\r', '')\n ... | [
"0.68975633",
"0.67013437",
"0.66498756",
"0.64822465",
"0.6397323",
"0.63771707",
"0.631287",
"0.6249159",
"0.62446815",
"0.6187702",
"0.6152389",
"0.609308",
"0.60849917",
"0.60849917",
"0.60615635",
"0.6027606",
"0.6026791",
"0.60097194",
"0.5984443",
"0.598411",
"0.597623... | 0.75817925 | 0 |
saves the current ball state. puts all the general values in the simArgs dictionary subclasses should implement | def saveParameters(self):
# save current scale values into the ball state for the current ball
x = self.initialXScale.get()
y = self.initialYScale.get()
xVel = self.initialXVelScale.get()
yVel = self.initialYVelScale.get()
self.ballStates[self.currentBall] = [x, y, xVel, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def writeState(self, saveState: ghidra.framework.options.SaveState) -> None:\n ...",
"def save_state(self):\n pass",
"def saveGame(self) -> None:\n self.state[\"phase\"] = self._phase\n\n state_as_string = json.dumps(self.state)\n with open(self.save_location, \"w\") as File:... | [
"0.6960438",
"0.68173647",
"0.6787115",
"0.6763044",
"0.67436576",
"0.66671205",
"0.6664326",
"0.6580951",
"0.6552863",
"0.6498651",
"0.64759964",
"0.6463431",
"0.6384361",
"0.63266534",
"0.6282891",
"0.6272506",
"0.6190858",
"0.61732596",
"0.6162837",
"0.6148459",
"0.6140278... | 0.79439396 | 0 |
Saves parameters, generates the preview and displays it to the canvas | def generatePreview(self):
self.saveParameters()
image=self.simulation.generatePreview()
# convert pil image to a tkinter image
self.photo = ImageTk.PhotoImage(image)
# display image
self.preview.create_image(0, 0, anchor='nw', image=self.photo) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw(canvas_result,automatic_save,manual_save):\r\n if canvas_result is not None and canvas_result.image_data is not None and (automatic_save or manual_save):\r\n # Receive the user's drawing with the dimensions: 512X512X4\r\n img_data = canvas_result.image_data\r\n # the user's drawing... | [
"0.62056845",
"0.61532867",
"0.61443603",
"0.6139312",
"0.606531",
"0.59494275",
"0.5938108",
"0.58969593",
"0.58924055",
"0.5826511",
"0.5789883",
"0.5724899",
"0.56783843",
"0.5656564",
"0.5616673",
"0.5614471",
"0.55980814",
"0.55951744",
"0.5587141",
"0.55860794",
"0.5567... | 0.6919115 | 0 |
Changes what balls can be selected to change values for. Gets called when number of balls is changed Also saves the parameters | def changeFormation(self, *args):
# get the number of balls
# formation = self.numberOfBallsSelector.get(first=None, last=None)
newNBalls = int(self.numberOfBallsSelector.get())
if newNBalls >= self.nBalls:
for i in range(self.nBalls, newNBalls):
# for some ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def changeBall(self, *args):\n\n # set sliders to state for new ball\n self.currentBall = int(self.ballSelector.get())\n newState = self.ballStates[self.currentBall]\n self.initialXScale.set(newState[0])\n self.initialYScale.set(newState[1])\n self.initialXVelScale.set(new... | [
"0.6785369",
"0.5880804",
"0.58548313",
"0.5546707",
"0.5517481",
"0.5512108",
"0.5484628",
"0.5483159",
"0.5383988",
"0.537589",
"0.5337195",
"0.5318962",
"0.5283062",
"0.52816105",
"0.5265503",
"0.5248229",
"0.5230199",
"0.5221469",
"0.52191705",
"0.5217716",
"0.5216568",
... | 0.75181323 | 0 |
run when a different ball is selected. saveParameters and sets sliders to settings for new ball. | def changeBall(self, *args):
# set sliders to state for new ball
self.currentBall = int(self.ballSelector.get())
newState = self.ballStates[self.currentBall]
self.initialXScale.set(newState[0])
self.initialYScale.set(newState[1])
self.initialXVelScale.set(newState[2])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def saveParameters(self):\n # save current scale values into the ball state for the current ball\n x = self.initialXScale.get()\n y = self.initialYScale.get()\n xVel = self.initialXVelScale.get()\n yVel = self.initialYVelScale.get()\n self.ballStates[self.currentBall] = [x... | [
"0.6481118",
"0.616664",
"0.59381336",
"0.5876839",
"0.576337",
"0.5656577",
"0.5645619",
"0.5610462",
"0.5600084",
"0.55788124",
"0.55068946",
"0.5481602",
"0.5478214",
"0.54687715",
"0.5447701",
"0.54400563",
"0.54133815",
"0.5406938",
"0.539074",
"0.5374289",
"0.5361342",
... | 0.7484556 | 0 |
Saves parameters and starts simulation. | def startSimulation(self):
self.saveParameters()
self.simulation.main() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_simulation(self):\n pass",
"def performSimulation(self):\n \n if self.parameters['verbose']:\n print(\"=====================\\nStarting simulation with parameters\\n\",self.parameters)\n print(\"=====================\\nInitial Graph\\n\")\n self.show... | [
"0.688976",
"0.6853158",
"0.681872",
"0.67933166",
"0.66235477",
"0.65973157",
"0.6543065",
"0.65319335",
"0.65228367",
"0.64699984",
"0.64614207",
"0.6456239",
"0.64392173",
"0.64163697",
"0.63972443",
"0.6383207",
"0.63710415",
"0.6326187",
"0.632123",
"0.6271647",
"0.62544... | 0.85764873 | 0 |
initializes the super class and adds the height and widthScale for the Rectangle. | def initialize(self):
super(RectTab,self).initialize()
# special tkinter variables that will be changed with the scales
self.width = tk.IntVar()
self.height = tk.IntVar()
# make width scale
self.widthScale = tk.Scale(self, from_=1, to=5, orient=tk.HORIZONTAL,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, height, width):\n\n\t\t# _width and _height are internal (private) Rectangle Instance's attributes. This is something\n\t\t# We keep to ourselves to make sure the User can't just update these attrs randomly and also\n\t\t# so that the code has backward compatibility.\n\t\tself._width = None\n\t\... | [
"0.78380597",
"0.7689887",
"0.7388933",
"0.6878956",
"0.6873641",
"0.6873641",
"0.68665445",
"0.68665445",
"0.68665445",
"0.686135",
"0.68408537",
"0.68150795",
"0.68055373",
"0.67979264",
"0.6774993",
"0.67658263",
"0.67010826",
"0.6605518",
"0.6600063",
"0.6598783",
"0.6586... | 0.8060661 | 0 |
Saves super class parameters as well as height and width. Also initializes simulation if not already done or updates it. | def saveParameters(self):
super(RectTab,self).saveParameters()
self.simArgs['width'] = self.width.get()
self.simArgs['height'] = self.height.get()
# updates simulation if it exists
# makes one if it doesn't
try:
self.simulation.update(**self.kwargs)
ex... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def saveParameters(self):\n super(BuminTab,self).saveParameters()\n # updates simulation if it exists\n # makes one if it doesn't\n try:\n self.simulation.update(**self.kwargs)\n except AttributeError:\n self.simulation = Buminovich.Buminovich(**self.simArgs... | [
"0.66938424",
"0.6504182",
"0.6381987",
"0.6361401",
"0.6132515",
"0.6020849",
"0.58820665",
"0.5859305",
"0.5638845",
"0.56341285",
"0.5596021",
"0.5587229",
"0.55682236",
"0.5510473",
"0.544595",
"0.5442569",
"0.5404173",
"0.54035205",
"0.5392418",
"0.53837395",
"0.53671896... | 0.76072294 | 0 |
checks if the y position set will be outside the circle and will hold it at that point | def checkYPos(self, *args):
x = self.initialXScale.get()
y = self.initialYScale.get()
if x ** 2 + y ** 2 > self.radius**2:
if y > 0:
self.initialYScale.set(np.sqrt(self.radius**2 - x ** 2))
else:
self.initialYScale.set(-np.sqrt(self.radius... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_boundary(self):\n\n\t\tif self.Bubble_initial_pos[0] <= self.Bubble_radius or self.Bubble_initial_pos[0] >= self.tk_pic.width - self.Bubble_radius:\n\t\t\tself.Bubble_vel[0] = -self.Bubble_vel[0]",
"def point_inside_circle(x,y,center_x,center_y,radius):\n return (x-center_x)**2 + (y - center_y)**2 < r... | [
"0.6409995",
"0.64027065",
"0.6278436",
"0.62465423",
"0.6142362",
"0.6125373",
"0.60288906",
"0.6002736",
"0.5950301",
"0.59413105",
"0.5895492",
"0.5886205",
"0.5884686",
"0.5869564",
"0.5853532",
"0.58382905",
"0.5837317",
"0.58295673",
"0.579188",
"0.57895184",
"0.5787874... | 0.72029173 | 0 |
checks if the x position set will be outside the circle and will hold it at that point | def checkXPos(self, *args):
x = self.initialXScale.get()
y = self.initialYScale.get()
if x ** 2 + y ** 2 > self.radius**2:
if x > 0:
self.initialXScale.set(np.sqrt(self.radius**2 - y ** 2))
else:
self.initialXScale.set(-np.sqrt(self.radius... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def incircle(self,xpos,ypos,cellx,celly):\n xcell, ycell = self.getcellcenter(cellx,celly)\n if ((xpos - xcell)**2 + (ypos - ycell)**2) < self.crad2:\n return True\n return False\n\n return cellx, celly",
"def point_inside_circle(x,y,center_x,center_y,radius):\n return (x-... | [
"0.6634102",
"0.65800136",
"0.6350049",
"0.63221407",
"0.6293997",
"0.62786114",
"0.62291116",
"0.6227815",
"0.6144363",
"0.6010454",
"0.59905386",
"0.5946691",
"0.58729887",
"0.58541554",
"0.5845365",
"0.584352",
"0.5834603",
"0.5824528",
"0.57955706",
"0.577924",
"0.5777117... | 0.72299653 | 0 |
Saves super class parameters. Updates or initializes the simulation | def saveParameters(self):
super(BuminTab,self).saveParameters()
# updates simulation if it exists
# makes one if it doesn't
try:
self.simulation.update(**self.kwargs)
except AttributeError:
self.simulation = Buminovich.Buminovich(**self.simArgs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def saveParameters(self):\n super(LorentzTab,self).saveParameters()\n # updates simulation if it exists\n # makes one if it doesn't\n try:\n self.simulation.update(**self.kwargs)\n except AttributeError:\n self.simulation = Lorentz.Lorentz(**self.simArgs)",
... | [
"0.73744684",
"0.72086346",
"0.69888663",
"0.6818995",
"0.63069427",
"0.62870556",
"0.6189242",
"0.60028684",
"0.5987332",
"0.5974823",
"0.58391196",
"0.58210707",
"0.5813146",
"0.58054054",
"0.580224",
"0.57546777",
"0.5752146",
"0.5731866",
"0.5727853",
"0.5727853",
"0.5727... | 0.73409647 | 1 |
Saves super class parameters. Updates or initializes the simulation | def saveParameters(self):
super(LorentzTab,self).saveParameters()
# updates simulation if it exists
# makes one if it doesn't
try:
self.simulation.update(**self.kwargs)
except AttributeError:
self.simulation = Lorentz.Lorentz(**self.simArgs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def saveParameters(self):\n super(BuminTab,self).saveParameters()\n # updates simulation if it exists\n # makes one if it doesn't\n try:\n self.simulation.update(**self.kwargs)\n except AttributeError:\n self.simulation = Buminovich.Buminovich(**self.simArgs... | [
"0.73409647",
"0.72086346",
"0.69888663",
"0.6818995",
"0.63069427",
"0.62870556",
"0.6189242",
"0.60028684",
"0.5987332",
"0.5974823",
"0.58391196",
"0.58210707",
"0.5813146",
"0.58054054",
"0.580224",
"0.57546777",
"0.5752146",
"0.5731866",
"0.5727853",
"0.5727853",
"0.5727... | 0.73744684 | 0 |
Converts raw Smartsheet Sheet objects into a nice and tidy pandas DataFrame, just like mum used to make | def sheet_to_df(access_token, sheet_id):
api_prefix_url = 'https://api.smartsheet.com/2.0/sheets/' # base Smartsheet api url for Requests
url = api_prefix_url + str(sheet_id) # full url for requests
header = { # heade... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pandas_convert(self):\n data = {}\n\n for names in self.data[0]:\n col_values = []\n\n if names in objects:\n for items in self.data[0][names]:\n col_values = []\n\n col_name = names + \"_\" + items\n\n ... | [
"0.63097835",
"0.59798735",
"0.5798734",
"0.5794549",
"0.57478553",
"0.5717758",
"0.569768",
"0.5680193",
"0.5665196",
"0.5657219",
"0.5641252",
"0.56317824",
"0.5627899",
"0.5621413",
"0.55911493",
"0.5583642",
"0.55697036",
"0.5564284",
"0.554248",
"0.5540877",
"0.5535269",... | 0.7096664 | 0 |
Consolidate deflines and sequences from FASTA as dictionary | def fasta_to_dict(fasta_file):
deflines = []
sequences = []
sequence = ""
with open(fasta_file, "r") as file:
for line in file:
if line.startswith(">"):
deflines.append(line.rstrip().lstrip('>'))
if sequence:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_fasta(fasta_file):\n\n seq_dict = dict() # Declare a new dictionary\n\n with open(fasta_file,'r') as f:\n lines = f.readlines()\n defline = \"\"\n for li in lines:\n li = li.rstrip() # remove newlines\n if '>' in li:\n defline = li # if i use... | [
"0.72562164",
"0.70544577",
"0.6914604",
"0.68844557",
"0.6714899",
"0.6711567",
"0.66311735",
"0.66147506",
"0.6589891",
"0.65830344",
"0.6581496",
"0.6561404",
"0.6552191",
"0.65519196",
"0.6500437",
"0.6498833",
"0.64926106",
"0.64874583",
"0.6474808",
"0.6440401",
"0.6311... | 0.7505833 | 0 |
Perform multiple sequence alignment and isolate consensus from each group in grouped_hits.txt | def isolate_consensus(groups, fasta):
with open(groups,"r") as f:
file = f.readlines()
sequences_in_out = open("sequences_in_out.table","w")
consensus_sequences = open("consensus_sequences.fasta","w")
for consensus_num, line in enumerate(file):
group_sequences = line.rsplit()
o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main(argv):\n \n ### gets data from csv, sets variables\n seq1, seq2 = get_seqs('../data/seq.csv')\n \n \n # Assign the longer sequence to s1, and the shorter to s2\n l1, l2 = len(seq1), len(seq2)\n if l1 >= l2:\n s1, s2 = ((l2 - 1) * \".\" + seq1 + (l2 - 1) * \".\"), seq2\n ... | [
"0.6396494",
"0.6360484",
"0.61174154",
"0.6071524",
"0.6041381",
"0.60301906",
"0.6022921",
"0.5965225",
"0.5931068",
"0.5860453",
"0.580393",
"0.57993835",
"0.57979983",
"0.5702784",
"0.57027584",
"0.5686417",
"0.5671133",
"0.5648115",
"0.56212074",
"0.55878824",
"0.5586022... | 0.7334227 | 0 |
Determine which transcripts were not grouped and concatenate both contigs_collapsed.fasta and ungrouped contigs into new transcriptome | def isolate_ungrouped_contigs(fasta_dict, groups):
with open(groups) as f:
grouped_contigs = list(chain.from_iterable(
[i.split() for i in f.readlines()]
)
)
db_deflines = fasta_dict.keys(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isolate_consensus(groups, fasta):\n with open(groups,\"r\") as f:\n file = f.readlines()\n\n sequences_in_out = open(\"sequences_in_out.table\",\"w\")\n consensus_sequences = open(\"consensus_sequences.fasta\",\"w\")\n\n for consensus_num, line in enumerate(file):\n group_sequences = ... | [
"0.5484953",
"0.54577637",
"0.53773695",
"0.53639716",
"0.5157762",
"0.50608796",
"0.50549304",
"0.5024335",
"0.5011397",
"0.50003254",
"0.49951127",
"0.4984907",
"0.4974743",
"0.4969747",
"0.49636707",
"0.49043584",
"0.4893198",
"0.48811284",
"0.48798373",
"0.48621103",
"0.4... | 0.62633854 | 0 |
Helper function for creating and running a Python subprocess executing the given string as Python code. | async def async_run_subproc_from_code(sub_proc_code: str) -> asyncio.subprocess.Process:
return await asyncio.create_subprocess_exec(sys.executable, '-c', sub_proc_code, stdout=asyncio.subprocess.PIPE) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_run(cmd_string, stdin=None):\n process_object=subprocess.Popen(shlex.split(cmd_string),\n stdin=stdin,\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE)\n return process_object",
"def run_... | [
"0.6948954",
"0.6686626",
"0.6629013",
"0.65176725",
"0.6339211",
"0.6338575",
"0.6203015",
"0.60847574",
"0.6064163",
"0.60511017",
"0.60285914",
"0.6006691",
"0.59902215",
"0.5979476",
"0.5975541",
"0.59750855",
"0.5935459",
"0.5928149",
"0.5910659",
"0.5901592",
"0.5889579... | 0.6972163 | 0 |
Try to find the project root directory based on expected lists of files and/or directories it contains, recursively ascending from a given starting directory. Given a starting file assumed to be a descendent of the project root directory (or the root directory itself), examine that file to see if it is the project root... | def find_proj_root(self, descendant: Path, file_names: list, dir_names: list, max_levels: int = 25):
count_test_files = len(file_names) if isinstance(file_names, list) else 0
count_test_files += len(dir_names) if isinstance(dir_names, list) else 0
if count_test_files == 0:
raise Runt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _find_project_root_dir(target: Path) -> Path:\n p = Path(\".\").resolve()\n for _ in range(1000):\n try:\n candidate = _search_for_dir(target, p)\n return candidate.parent\n except DirectoryNotFoundException:\n p = p.parent\n raise DirectoryNotFoundExcept... | [
"0.6449977",
"0.63446194",
"0.59693354",
"0.589468",
"0.57563084",
"0.57514924",
"0.56900877",
"0.5676506",
"0.5509007",
"0.54974484",
"0.54620385",
"0.5414883",
"0.5392206",
"0.5351022",
"0.53417945",
"0.533628",
"0.53257906",
"0.53238785",
"0.52965724",
"0.52953446",
"0.528... | 0.6357597 | 1 |
Test the parse_request_type method of the RequestHandler on the basic test JOB request example, checking for auth. | def test_parse_request_type_1b(self):
req_type, errors = self._exec_parse(test_source=MessageEventType.MAAS_REQUEST, session_secret=self.session_secret,
check_for_auth=True)
self.assertEqual(req_type, MessageEventType.MAAS_REQUEST) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_parse_request_type_1d(self):\n self.test_job_data.pop('model')\n req_type, errors = self._exec_parse(test_source=MessageEventType.MAAS_REQUEST, session_secret='some_string',\n check_for_auth=True)\n self.assertEqual(req_type, MessageEventType... | [
"0.6846396",
"0.65539205",
"0.64534205",
"0.62383395",
"0.6118661",
"0.6015404",
"0.59169805",
"0.59136623",
"0.5874284",
"0.5861507",
"0.57382715",
"0.5665503",
"0.56611925",
"0.5578788",
"0.552031",
"0.5486631",
"0.5465408",
"0.5462342",
"0.545905",
"0.54447556",
"0.5372402... | 0.6644406 | 1 |
Test the parse_request_type method of the RequestHandler on the basic test JOB request example, but modified to be without model. | def test_parse_request_type_1d(self):
self.test_job_data.pop('model')
req_type, errors = self._exec_parse(test_source=MessageEventType.MAAS_REQUEST, session_secret='some_string',
check_for_auth=True)
self.assertEqual(req_type, MessageEventType.INVALID) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_parse_request_type_1b(self):\n req_type, errors = self._exec_parse(test_source=MessageEventType.MAAS_REQUEST, session_secret=self.session_secret,\n check_for_auth=True)\n self.assertEqual(req_type, MessageEventType.MAAS_REQUEST)",
"def test_parse_... | [
"0.6338693",
"0.5977034",
"0.5941005",
"0.59170467",
"0.583181",
"0.57952213",
"0.5737453",
"0.57250804",
"0.5709618",
"0.5697139",
"0.56422365",
"0.55725694",
"0.5562102",
"0.54347223",
"0.5388378",
"0.53538543",
"0.5335091",
"0.5228585",
"0.52276796",
"0.52191585",
"0.52041... | 0.7518315 | 0 |
Test the parse_request_type method of the RequestHandler on the basic test AUTHENTICATION request example, but with a modified, too short username | def test_parse_request_type_2c(self):
self.test_auth_data['username'] = 'short'
req_type, errors = self._exec_parse(test_source=MessageEventType.SESSION_INIT, session_secret=self.session_secret,
check_for_auth=True)
self.assertEqual(req_type, MessageEv... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_parse_request_type_2e(self):\n self.test_auth_data.pop('username')\n req_type, errors = self._exec_parse(test_source=MessageEventType.SESSION_INIT, session_secret=self.session_secret,\n check_for_auth=True)\n self.assertEqual(req_type, Messag... | [
"0.6582576",
"0.6092927",
"0.60866356",
"0.5909042",
"0.58209646",
"0.5802963",
"0.57239425",
"0.5721285",
"0.56978977",
"0.5697544",
"0.56666356",
"0.5660978",
"0.56190515",
"0.56169957",
"0.5615925",
"0.5603473",
"0.55940366",
"0.5578598",
"0.5573344",
"0.5537729",
"0.55265... | 0.65109897 | 1 |
Test the parse_request_type method of the RequestHandler on the basic test AUTHENTICATION request example, but with a modified, too short user_secret | def test_parse_request_type_2d(self):
self.test_auth_data['user_secret'] = 'short'
req_type, errors = self._exec_parse(test_source=MessageEventType.SESSION_INIT, session_secret=self.session_secret,
check_for_auth=True)
self.assertEqual(req_type, Messag... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_parse_request_type_2f(self):\n self.test_auth_data.pop('user_secret')\n req_type, errors = self._exec_parse(test_source=MessageEventType.SESSION_INIT, session_secret=self.session_secret,\n check_for_auth=True)\n self.assertEqual(req_type, Mes... | [
"0.6868755",
"0.6550271",
"0.6417075",
"0.5802363",
"0.5790747",
"0.56437844",
"0.5623763",
"0.56027114",
"0.5575092",
"0.55328166",
"0.55166173",
"0.5513767",
"0.55094415",
"0.5427882",
"0.5422552",
"0.5422503",
"0.54216367",
"0.5387786",
"0.5385843",
"0.5295982",
"0.5274673... | 0.68579394 | 1 |
Test the parse_request_type method of the RequestHandler on the basic test AUTHENTICATION request example, but modified to be missing username | def test_parse_request_type_2e(self):
self.test_auth_data.pop('username')
req_type, errors = self._exec_parse(test_source=MessageEventType.SESSION_INIT, session_secret=self.session_secret,
check_for_auth=True)
self.assertEqual(req_type, MessageEventTyp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_parse_request_type_2c(self):\n self.test_auth_data['username'] = 'short'\n req_type, errors = self._exec_parse(test_source=MessageEventType.SESSION_INIT, session_secret=self.session_secret,\n check_for_auth=True)\n self.assertEqual(req_type, ... | [
"0.6654907",
"0.63609856",
"0.6065126",
"0.5986271",
"0.5873989",
"0.5833712",
"0.577218",
"0.5721933",
"0.5668901",
"0.5649751",
"0.5642403",
"0.55796313",
"0.5571298",
"0.5557869",
"0.55527097",
"0.54972166",
"0.5489206",
"0.54751295",
"0.54433227",
"0.5423554",
"0.5412894"... | 0.6986922 | 0 |
Test the parse_request_type method of the RequestHandler on the basic test AUTHENTICATION request example, but modified to be missing user_secret | def test_parse_request_type_2f(self):
self.test_auth_data.pop('user_secret')
req_type, errors = self._exec_parse(test_source=MessageEventType.SESSION_INIT, session_secret=self.session_secret,
check_for_auth=True)
self.assertEqual(req_type, MessageEvent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_parse_request_type_2e(self):\n self.test_auth_data.pop('username')\n req_type, errors = self._exec_parse(test_source=MessageEventType.SESSION_INIT, session_secret=self.session_secret,\n check_for_auth=True)\n self.assertEqual(req_type, Messag... | [
"0.68752295",
"0.6823082",
"0.6565441",
"0.6135257",
"0.61087584",
"0.60270864",
"0.5897579",
"0.5829118",
"0.5743995",
"0.5722806",
"0.55755186",
"0.5556302",
"0.55216575",
"0.55189157",
"0.5506603",
"0.5503659",
"0.54570746",
"0.5452072",
"0.5439107",
"0.54367673",
"0.54231... | 0.70758444 | 0 |
Returns the moves for the pawn at the given location | def get_pawn_moves(self, state):
pawn_moves = []
if self.color == cc.WHITE_ACTIVE:
forward_1 = add_vectors(self.coord, cc.V_UP)
forward_2 = add_vectors(self.coord, cc.V_UP_2)
attacks = get_crawler_moves(self.coord, cc.W_PAWN_CAPTURE_VECTORS)
starting_rank... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_piece_moves(self, x, y):\n\n piece = self.get_piece(x, y)\n moves = []\n\n if not piece:\n return moves\n\n if piece.name == 'rook' or piece.name == 'queen':\n direcs = ['up', 'down', 'left', 'right']\n moves = [self._get_moves_indirection(x, y,... | [
"0.7060851",
"0.69786894",
"0.6970851",
"0.691838",
"0.6903573",
"0.68918544",
"0.6812156",
"0.6720306",
"0.6709956",
"0.6701223",
"0.6660928",
"0.66348755",
"0.65792215",
"0.6563159",
"0.65361404",
"0.6500815",
"0.64763135",
"0.6462871",
"0.64623004",
"0.6432862",
"0.6432696... | 0.7350092 | 0 |
Returns the moves for the knight at the given location | def get_knight_moves(self, state):
knight_moves = []
if self.color == cc.WHITE_ACTIVE:
enemy_set = cc.BLACK_PIECES
elif self.color == cc.BLACK_ACTIVE:
enemy_set = cc.WHITE_PIECES
else:
raise Exception("get_knight_moves: Invalid Knight Color")
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_legal_moves(self):\n moves = []\n if self.player_locations[self.whose_turn] is None:\n return self.get_blank_locations()\n matrix = [(1,0), (-1,0), (0,1), (0,-1), (1,1), (1,-1), (-1, 1), (-1,-1)]\n\n for dx, dy in matrix:\n x,y = self.player_locations[self.... | [
"0.6674116",
"0.64829564",
"0.64223623",
"0.6395059",
"0.6389674",
"0.6372455",
"0.6314743",
"0.6305518",
"0.62892103",
"0.6274054",
"0.6225394",
"0.6195604",
"0.6182217",
"0.6175854",
"0.6158496",
"0.61548793",
"0.61211133",
"0.61066663",
"0.6094043",
"0.6078156",
"0.6041899... | 0.6953485 | 0 |
Returns the moves for the king at the given location. Makes sure that the King doesn't put himself in check. | def get_king_moves(self, state):
#king_moves = []
possible_moves = []
if self.color == cc.WHITE_ACTIVE:
enemy_color = cc.BLACK_ACTIVE
enemy_pieces = cc.BLACK_PIECES
elif self.color == cc.BLACK_ACTIVE:
enemy_color = cc.WHITE_ACTIVE
enemy_pie... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_valid_moves(self):\n if self.king:\n valid_moves = [[self.row + 1, self.col + 1],\n [self.row + 1, self.col - 1],\n [self.row - 1, self.col - 1],\n [self.row - 1, self.col + 1]]\n else:\n if se... | [
"0.6816272",
"0.68159825",
"0.6712147",
"0.667524",
"0.66631305",
"0.6642847",
"0.658078",
"0.6434977",
"0.64293206",
"0.63750225",
"0.6243731",
"0.6235143",
"0.622932",
"0.62285656",
"0.6218373",
"0.6215783",
"0.6200796",
"0.6177311",
"0.61664575",
"0.6161181",
"0.61515874",... | 0.708593 | 0 |
Returns a tuple of possible moves based on the starting position and the vectors. Used for Knights, Pawns, and Kings | def get_crawler_moves(coord, vectors):
possible_moves = []
for vector in vectors:
try:
move = (coord[0]+vector[0], coord[1]+vector[1])
except TypeError as e:
print("coord: {}".format(coord))
print("vector: {}".format(vector))
if move[0] in cc.VALID_RAN... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_possible_moves(self, current_x: int, current_y: int) -> List[(int, int)]:\n pass",
"def get_possible_moves(self, current_x: int, current_y: int) -> List[(int, int)]:\n pass",
"def get_possible_moves(self, current_x: int, current_y: int) -> List[(int, int)]:\n pass",
"def get_poss... | [
"0.69245857",
"0.69245857",
"0.69245857",
"0.69245857",
"0.69245857",
"0.69245857",
"0.69245857",
"0.67829096",
"0.65028155",
"0.6499266",
"0.64990675",
"0.6449157",
"0.64386046",
"0.63928956",
"0.6390314",
"0.6385454",
"0.6357725",
"0.6330005",
"0.63225853",
"0.6311004",
"0.... | 0.70559174 | 0 |
Returns the moves for the bishop at the given location | def get_bishop_moves(state, coord):
# Movement Options
# Diagonals
# no piece = add move, enemy = add move & break loop, friendly = break loop
bishop_moves = []
if state.active_color == cc.WHITE_ACTIVE:
for vector in cc.BISHOP_VECTORS:
bishop_moves.extend(get_direction_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def traverseBishop(self):\n\t\tmoves = np.empty(14, dtype=object)\n\t\tcnt = [0]\n\t\tPiece.traverse(self, cnt, moves, -1, -1)\n\t\tPiece.traverse(self, cnt, moves, -1, 1)\n\t\tPiece.traverse(self, cnt, moves, 1, -1)\n\t\tPiece.traverse(self, cnt, moves, 1, 1)\n\t\treturn moves[:cnt[0]]",
"def get_bishop_moves(s... | [
"0.71127635",
"0.6942288",
"0.6672812",
"0.6465321",
"0.6382628",
"0.6379456",
"0.6155536",
"0.6119805",
"0.6104786",
"0.6047381",
"0.6000614",
"0.59988225",
"0.5961775",
"0.5960223",
"0.59416145",
"0.594005",
"0.59387296",
"0.58761156",
"0.58495075",
"0.5841314",
"0.58346194... | 0.74600714 | 0 |
this method parse the file line.txt to create a list of StopOfGraph which is much easier to use to create a graph | def read_file(self, path, route_id):
#uncoded_route_id = route_id.decode("utf-8")
route_id = str(route_id)
path += "/line_" + route_id + ".txt"
with io.open(path, encoding="utf-8") as f:
lines = f.readlines()
stop_of_graph_list = list()
# So here we're exam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse(self, f):\n lines = []\n for line in f:\n _line = line.split(\"//\")[0].strip()\n if _line.startswith(\"(\"): # is a label\n label_name = _line[1:-1]\n self.labels[label_name] = len(lines) # line number / address of label\n el... | [
"0.6563644",
"0.6518964",
"0.61344117",
"0.6097468",
"0.604421",
"0.6015144",
"0.59337026",
"0.59075713",
"0.58815616",
"0.58800524",
"0.5870289",
"0.5836382",
"0.5812531",
"0.5802812",
"0.5800502",
"0.5797739",
"0.57955956",
"0.57904834",
"0.57658803",
"0.5762743",
"0.575028... | 0.6849259 | 0 |
this function finds the complete list of stops based on the list of the main stops the bus is doing through | def find_complete_stops_list(self, list_main_stops):
# List contains the main stops
# list_of_list contains the little stops which are not in the timetable
list_of_lists = list()
previous_stop = list_main_stops[0]
for current_stop in list_main_stops[1:]:
missing_sto... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def info_for_model(stop_list, stops, route):\n\n # Need to know where the bus number 1 and 2 are\n # This if and elif were put in due to an error where the bus list for bus 1 would come up empty, but not sure if necessary\n if len(stops[0]) == 0:\n bus_1 = stops[1][len(stops[1]) - 1]\n elif len(... | [
"0.7045815",
"0.6997676",
"0.6822802",
"0.6821542",
"0.66974765",
"0.6560196",
"0.6510856",
"0.6391744",
"0.63823456",
"0.6375212",
"0.6310557",
"0.63099355",
"0.62924623",
"0.6262218",
"0.6256029",
"0.61674494",
"0.61529994",
"0.6052756",
"0.6003775",
"0.5965702",
"0.5963759... | 0.7113685 | 0 |
Return filtered by search value queryset. | def get_queryset(self):
qs = super().get_queryset()
search_value = self.request.GET.get('search_box')
if search_value is not None:
qs = qs.search_by(search_value)
return qs | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def queryset(self, request, queryset):\n # Compare the requested value (either '80s' or 'other')\n # to decide how to filter the queryset.\n\n if self.value() is None:\n return queryset.all()\n\n return queryset.filter(firm__pk=self.value())",
"def get_queryset(self):\n ... | [
"0.715664",
"0.71247804",
"0.70761645",
"0.703622",
"0.7035118",
"0.68929595",
"0.6786135",
"0.67200524",
"0.669921",
"0.6685121",
"0.6676126",
"0.6639637",
"0.66092557",
"0.6591136",
"0.6586185",
"0.6503779",
"0.6502065",
"0.64994085",
"0.6464354",
"0.6445284",
"0.64293295",... | 0.791173 | 0 |
Return only available for user objects. | def get_queryset(self):
queryset = super().get_queryset()
return queryset.available_for_user(self.request.user) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_in_users(self, obj):\n try:\n user = self.context.get('request').user\n except Exception:\n # raise serializers.ValidationError('Could not access request.user')\n return False\n if user in obj.users.all():\n return True\n else:\n ... | [
"0.7111527",
"0.69771284",
"0.6968059",
"0.6935108",
"0.68565166",
"0.68484193",
"0.68204546",
"0.67346036",
"0.6713047",
"0.6699355",
"0.66954744",
"0.6626666",
"0.66193235",
"0.659172",
"0.65581006",
"0.65302825",
"0.6526931",
"0.65193975",
"0.65113837",
"0.64569193",
"0.64... | 0.72600186 | 0 |
Test that the JordanWigner convention places the Zstring on lower indices. | def test_jw_convention(self):
qubit_op = QubitOperator('Z0 X1')
transformed_op = reverse_jordan_wigner(qubit_op)
expected_op = FermionOperator('1^')
expected_op += FermionOperator('1')
self.assertTrue(transformed_op == expected_op) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_compress_offset_less_len1(self):\n text = 'ababab'\n actual = LZ77.compress(text)\n expected = bytearray([32]) + bytearray(b'ab') + bytearray([0, 18])\n self.assertEqual(actual, expected)",
"def test_zernike_indexing(self):\n basis = ZernikePolynomial(L=8, M=4, spectra... | [
"0.6065288",
"0.59248656",
"0.5903232",
"0.5901062",
"0.5656905",
"0.56236637",
"0.55714595",
"0.5567075",
"0.5561326",
"0.5499509",
"0.547115",
"0.5381495",
"0.53753805",
"0.53739816",
"0.53625846",
"0.53501177",
"0.534338",
"0.5318929",
"0.53051966",
"0.5287866",
"0.5277039... | 0.6192689 | 0 |
Plot the difference between models. Uses plotly as the backend. | def plot_difference_plotly(mdiff, title="", annotation=None):
import plotly.graph_objs as go
import plotly.offline as py
annotation_html = None
if annotation is not None:
annotation_html = [
[
"+++ {}<br>--- {}".format(", ".join(int_tokens), ", ".join(diff_tokens))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_derivative(self):\n for trace in self.plotWidget.plotDataItems:\n dt = float(trace.attrs['dt'])\n dtrace = np.diff(trace.data)\n x = pgplot.make_xvector(dtrace, dt)\n self.plotWidget.plot(x, dtrace, pen=pg.mkPen('r'))",
"def plot_difference_plotly(mdiff, ti... | [
"0.6336095",
"0.62351954",
"0.60471606",
"0.6010149",
"0.58498794",
"0.5847658",
"0.58359987",
"0.5812058",
"0.57991797",
"0.5774976",
"0.57747",
"0.57411087",
"0.5719466",
"0.57165027",
"0.57083726",
"0.5705856",
"0.5704397",
"0.5674093",
"0.56470126",
"0.5645467",
"0.563357... | 0.6257385 | 1 |
given a username, return some representation of that user Generally, this will be an anchor ref of a mailto URL | def user2Link(user):
# could also look up mail addrs via a table lookup, etc
return '<a href="mailto:%(user)s@somewebsite.com">%(user)s</a>' % {"user": user} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_ref_to_username(value):\n # strip the '<@' and '>'\n user_id = reference_to_id(value.group())\n user_profile = get_user_profile(user_id)\n return '@' + user_profile['name'] or user_id",
"def user(inp):\n user = inp.text.lower().replace(' ', '-')\n return 'http://www.wikidot.com/user:in... | [
"0.7166675",
"0.7055912",
"0.70320725",
"0.6992083",
"0.6992083",
"0.6817144",
"0.6804579",
"0.67751735",
"0.67302954",
"0.6635375",
"0.6424747",
"0.6411638",
"0.6411059",
"0.640774",
"0.63793653",
"0.63757735",
"0.63612443",
"0.63392115",
"0.6334134",
"0.6333766",
"0.632456"... | 0.74790764 | 0 |
Return the first dict item that matches from pairs of dicts and keys. Will throw a KeyError if missing. _dig_first((dict1, "key1"), (dict2, "key2"), ...) | def _dig_first(*pairs: Tuple[Mapping[str, Setting], str], ignore_empty: bool = False) -> Setting:
if not pairs:
raise ValueError("pairs cannot be empty")
for dict_like, key in pairs:
if key in dict_like:
value = dict_like[key]
if ignore_empty and value == "":
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dict_get_first_of(d: dict, key, *opt_keys, return_key: bool = False, **kw):\n knf = KeyNotFound()\n k = key\n v = d.get(key, knf)\n n = len(opt_keys)\n i = 0\n while isinstance(v, KeyNotFound) and i < n:\n k = opt_keys[i]\n v = d.get(k, knf)\n i += 1\n\n if isinstance(... | [
"0.7321539",
"0.6594973",
"0.6331456",
"0.6306491",
"0.617117",
"0.6135461",
"0.60428375",
"0.6006988",
"0.5986996",
"0.5967618",
"0.59050506",
"0.5897276",
"0.5889747",
"0.581803",
"0.58139414",
"0.5798729",
"0.5781374",
"0.57479256",
"0.57039523",
"0.5695982",
"0.56894183",... | 0.69398 | 1 |
Returns True if an option with this name is allowed in the [tool.cibuildwheel.] section of a config file. | def _is_valid_platform_option(self, name: str) -> bool:
disallowed_platform_options = self.disallow.get(self.platform, set())
if name in disallowed_platform_options:
return False
allowed_option_names = self.default_options.keys() | self.default_platform_options.keys()
retur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_option(self, key):\n\n return key in self.__opt",
"def is_Configure_allowed(self):\n handler = self.get_command_object(\"Configure\")\n return handler.check_allowed()",
"def config_has_option(section, option):\n return __CONFIG.has_option(section, option)",
"def has_option(sel... | [
"0.6914015",
"0.6797586",
"0.6748813",
"0.66980386",
"0.6659934",
"0.65959734",
"0.65254307",
"0.64785737",
"0.64204913",
"0.63361555",
"0.62722063",
"0.6266686",
"0.6265161",
"0.6200039",
"0.616609",
"0.6163951",
"0.6161151",
"0.612342",
"0.61111915",
"0.6098968",
"0.6005089... | 0.7029227 | 0 |
Load a toml file, returns global and platform as separate dicts. | def _load_file(self, filename: Path) -> Tuple[Dict[str, Any], Dict[str, Any]]:
with filename.open("rb") as f:
config = tomli.load(f)
global_options = config.get("tool", {}).get("cibuildwheel", {})
platform_options = global_options.get(self.platform, {})
return global_option... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _load_datas(self) -> tp.Dict[str, dict]:\n with open(self._file, \"r\") as stream:\n try:\n load: tp.Dict[str, dict] = yaml.safe_load(stream)\n logger.info(\"YAML imported\")\n return load\n except yaml.YAMLError as exc:\n ... | [
"0.5698216",
"0.56965494",
"0.56819564",
"0.5641362",
"0.55809826",
"0.5508169",
"0.54958004",
"0.5484023",
"0.5451482",
"0.5424716",
"0.53777593",
"0.5351504",
"0.5334559",
"0.532896",
"0.53215915",
"0.5309104",
"0.527987",
"0.52624243",
"0.5254605",
"0.52134854",
"0.5206858... | 0.6246138 | 0 |
Get and return the value for the named option from environment, configuration file, or the default. If env_plat is False, then don't accept platform versions of the environment variable. If this is an array it will be merged with "sep" before returning. If it is a table, it will be formatted with "table['item']" using ... | def get(
self,
name: str,
*,
env_plat: bool = True,
sep: Optional[str] = None,
table: Optional[TableFmt] = None,
ignore_empty: bool = False,
) -> str:
if name not in self.default_options and name not in self.default_platform_options:
raise... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_value(self, section_name: str, attr_name: str, env_override: bool = False) -> typing.Optional[str]:\n config = ConfigParser(allow_no_value=True)\n config.read(self.connection_string)\n result = None\n\n if env_override is True:\n result = os.getenv(f'{section_name}_{a... | [
"0.55509925",
"0.5523774",
"0.54046524",
"0.5343538",
"0.52567863",
"0.52536374",
"0.5241531",
"0.522168",
"0.522168",
"0.52107966",
"0.5202625",
"0.5192449",
"0.5190362",
"0.5177892",
"0.5089966",
"0.5081989",
"0.50755405",
"0.50751054",
"0.5050369",
"0.50461185",
"0.504509"... | 0.815719 | 0 |
Return rectangle representing the Done button | def get_done_rect(self):
return pygame.Rect(self.button_data.done_x, self.button_data.y, self.button_data.large_width, self.button_data.height) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_cancel_rect(self):\n return pygame.Rect(self.button_data.cancel_x, self.button_data.y, self.button_data.large_width, self.button_data.height)",
"def get_pay_rect(self):\n return pygame.Rect(self.button_data.pay_x, self.button_data.y, self.button_data.large_width, self.button_data.height)",
... | [
"0.61522835",
"0.5975798",
"0.59413844",
"0.5822093",
"0.57887036",
"0.5761346",
"0.5751224",
"0.5625157",
"0.560466",
"0.55835086",
"0.55598813",
"0.55518174",
"0.55303395",
"0.5497481",
"0.549238",
"0.5456099",
"0.5433463",
"0.5418277",
"0.5418277",
"0.5418277",
"0.5418144"... | 0.81077373 | 0 |
Return rectangle representing the Pay button | def get_pay_rect(self):
return pygame.Rect(self.button_data.pay_x, self.button_data.y, self.button_data.large_width, self.button_data.height) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_amount_rect(self):\n return pygame.Rect(self.amount.x, self.amount.y, self.amount.width, self.button_data.height)",
"def _get_button_region(self):\n # XXXX Only rectangulars for now\n if not self._sensitive:\n return None\n if not self._insidetemporal():\n ... | [
"0.703257",
"0.6708636",
"0.6072446",
"0.6055187",
"0.5909128",
"0.58895695",
"0.5883365",
"0.5796211",
"0.57874066",
"0.5740925",
"0.568164",
"0.56528354",
"0.56363374",
"0.5625496",
"0.5503014",
"0.54720646",
"0.54671466",
"0.5442511",
"0.54301876",
"0.54194665",
"0.5407715... | 0.83420265 | 0 |
Return rectangle representing the Cancel button | def get_cancel_rect(self):
return pygame.Rect(self.button_data.cancel_x, self.button_data.y, self.button_data.large_width, self.button_data.height) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cancelButton(self):\n return self.__cancelButton",
"def cancelButton(self):\n return self.__cancelButton",
"def cancelButton(self):\n return self.__cancelButton",
"def get_done_rect(self):\n return pygame.Rect(self.button_data.done_x, self.button_data.y, self.button_data.large... | [
"0.70682716",
"0.70682716",
"0.70682716",
"0.65052885",
"0.6482575",
"0.62415266",
"0.62338424",
"0.61535877",
"0.61140287",
"0.6066416",
"0.6013982",
"0.6001875",
"0.5925659",
"0.59174865",
"0.58720326",
"0.5870998",
"0.5853521",
"0.5830382",
"0.5830382",
"0.5786672",
"0.577... | 0.8576048 | 0 |
Return rectangle representing the top information bar | def get_top_bar_rect(self):
return pygame.Rect(self.top_bar.x, self.top_bar.y, self.top_bar.width, self.button_data.height) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _rect_top(self):\n\treturn max(self.y, self.y + self.h)",
"def DrawTop(screen, top_x, top_y, top_len, top_width):\n pygame.draw.rect(screen, (255,0,0),(top_x, top_y, top_len*2, top_width*2), 4)",
"def draw_top(self):\n return group()",
"def drawUI(self):\n cv2.rectangle(self.root, (0... | [
"0.6610852",
"0.6593702",
"0.64745486",
"0.6129006",
"0.6054198",
"0.59405684",
"0.5939769",
"0.5931584",
"0.59063864",
"0.59063864",
"0.5879101",
"0.5859516",
"0.5808413",
"0.5802447",
"0.58016765",
"0.5800475",
"0.57628614",
"0.5745136",
"0.5725048",
"0.57205886",
"0.571909... | 0.726646 | 0 |
Return rectangle representing the total amount bar | def get_amount_rect(self):
return pygame.Rect(self.amount.x, self.amount.y, self.amount.width, self.button_data.height) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bar_length(stage, fraction):\n x1, y1, x2, y2 = canvas.coords('bar_' + stage)\n canvas.coords(\n 'bar_' + stage,\n 20,\n y1,\n 20 + round(fraction * (width - 40)),\n y2,\n )",
"def get_bars(self):\n return self.percent_2_bars(... | [
"0.6459064",
"0.64523906",
"0.63721067",
"0.6196911",
"0.61125314",
"0.61101776",
"0.6100009",
"0.6002434",
"0.5970846",
"0.595529",
"0.5952238",
"0.5951107",
"0.5946098",
"0.5916032",
"0.58980125",
"0.5888238",
"0.5865675",
"0.5840044",
"0.580254",
"0.5791656",
"0.57573295",... | 0.6932268 | 0 |
Return rectangle representing the up scroll button | def get_up_scroll_rect(self):
return pygame.Rect(self.scroll.x, self.scroll.up_y, self.scroll.width, self.scroll.height) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_down_scroll_rect(self):\n return pygame.Rect(self.scroll.x, self.scroll.dn_y, self.scroll.width, self.scroll.height)",
"def scrollUp_y(self):\r\n if self.y_stack>0:\r\n self.y_stack-=1\r\n \r\n self.pixmap3=self.drawPixmap(\"xz\")\r\n self.lbl3.se... | [
"0.67192155",
"0.6316986",
"0.6173602",
"0.6136128",
"0.61354804",
"0.609783",
"0.6021287",
"0.60154986",
"0.5984156",
"0.59422266",
"0.59341276",
"0.59182394",
"0.59066033",
"0.5906058",
"0.5906037",
"0.590299",
"0.58598703",
"0.58307093",
"0.58299977",
"0.58195907",
"0.5783... | 0.81178427 | 0 |
Return rectangle representing the down scroll button | def get_down_scroll_rect(self):
return pygame.Rect(self.scroll.x, self.scroll.dn_y, self.scroll.width, self.scroll.height) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_up_scroll_rect(self):\n return pygame.Rect(self.scroll.x, self.scroll.up_y, self.scroll.width, self.scroll.height)",
"def buttonDownPos(self, btn=None):\n if btn is None:\n btn = self.button()\n return Point(self.currentItem.mapFromScene(self._buttonDownScenePos[btn]))",
... | [
"0.7188937",
"0.6204293",
"0.62015027",
"0.61635894",
"0.61521184",
"0.6064291",
"0.59770024",
"0.5958718",
"0.58810395",
"0.5874888",
"0.5863888",
"0.5783592",
"0.57748634",
"0.577476",
"0.57615274",
"0.5755299",
"0.5751036",
"0.5721733",
"0.57195115",
"0.57188267",
"0.57070... | 0.8037389 | 0 |
Returns a rectangle representing the description display for a product | def get_description_rect(self, index):
y_position = self.product_entries.top_y + (self.product_entries.row_h * index)
return pygame.Rect(self.product_entries.desc_x, y_position, self.product_entries.desc_w, self.button_data.height) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_description():\n desc = dict()\n desc[\"cache\"] = 3600\n desc[\"data\"] = True\n desc[\n \"description\"\n ] = \"\"\"This plot is not meant for interactive use, but a backend for\n SPS plots.\n \"\"\"\n desc[\"arguments\"] = [\n dict(\n type=\"text\",\n ... | [
"0.6610947",
"0.6592959",
"0.6475347",
"0.6304326",
"0.62589735",
"0.6158773",
"0.6146244",
"0.61412126",
"0.61374414",
"0.61354303",
"0.6127795",
"0.6126339",
"0.61020863",
"0.60996103",
"0.609043",
"0.60874915",
"0.6083631",
"0.60741735",
"0.6074143",
"0.60647815",
"0.60647... | 0.74717224 | 0 |
Returns a rectangle representing the price display for a product | def get_price_rect(self, index):
y_position = self.product_entries.top_y + (self.product_entries.row_h * index)
return pygame.Rect(self.product_entries.price_x, y_position, self.product_entries.price_w, self.button_data.height) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def showrect(context):\r\n #context[\"products\"] = BlogPostForm()\r\n data=[{'time':'2003','price':'6800'},\r\n {'time':'2004','price':'7800'},\r\n {'time':'2005','price':'8800'},\r\n {'time':'2006','price':'9800'},\r\n {'time':'2007','price':'10800'},\r\n {'time... | [
"0.66148126",
"0.6425636",
"0.6408066",
"0.6388764",
"0.63350195",
"0.63350195",
"0.5850726",
"0.58149785",
"0.58066714",
"0.56577665",
"0.564943",
"0.5617745",
"0.56055164",
"0.5587808",
"0.55845076",
"0.5541297",
"0.5503129",
"0.54867107",
"0.5484257",
"0.5461903",
"0.54541... | 0.7220666 | 0 |
Returns a rectangle representing the remove button for a product | def get_remove_rect(self, index, width):
y_position = self.product_entries.top_y + (self.product_entries.row_h * index)
return pygame.Rect(self.product_entries.remove_x, y_position, width, self.button_data.height) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_price_rect(self, index):\n y_position = self.product_entries.top_y + (self.product_entries.row_h * index)\n return pygame.Rect(self.product_entries.price_x, y_position, self.product_entries.price_w, self.button_data.height)",
"def _remove_button_width(self):\n removew = self.width - ... | [
"0.6206437",
"0.60439533",
"0.59111506",
"0.57449245",
"0.5735818",
"0.5700898",
"0.55577743",
"0.55432266",
"0.5529115",
"0.55252004",
"0.5517157",
"0.5499525",
"0.5495325",
"0.54349494",
"0.5414864",
"0.5401785",
"0.54001504",
"0.54001504",
"0.5365234",
"0.53408545",
"0.532... | 0.7680152 | 0 |
Update the total spend value | def update_total(self):
self.objects[self.ids.AMOUNT].setText("Total Spend: \xA3%.2f" % (self.owner.total_price() / 100)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_total(self):\n # the 'or 0' sets order_total as 0 instead of None,\n # preventing an error when calculating delivery_costs\n self.order_total = self.lineitems.aggregate(\n Sum('lineitem_total'))['lineitem_total__sum'] or 0\n if self.order_total < settings.FREE_DELI... | [
"0.72733474",
"0.7256667",
"0.70726025",
"0.70486337",
"0.70019245",
"0.682015",
"0.67827046",
"0.67650783",
"0.6759054",
"0.6743769",
"0.66739947",
"0.6569658",
"0.65474904",
"0.64809436",
"0.646712",
"0.64240855",
"0.6417558",
"0.6404048",
"0.6404048",
"0.63580096",
"0.6353... | 0.81530696 | 0 |
The width of the remove button depends on whether the up/dn buttons are displayed | def _remove_button_width(self):
removew = self.width - self.layout.product_entries.remove_x - Widths.BORDER
if self._test_display_down_button() or self._test_display_up_button():
removew -= (self.layout.scroll.width + Widths.BORDER)
return removew | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable_remove(self):\n n_t = self.tree_ctrl.GetCount()\n n_t_t = self.tree_ctrl_theory.GetCount()\n if n_t + n_t_t <= 0:\n self.bt_remove.Disable()\n else:\n self.bt_remove.Enable()",
"def on_width(self, instance_toolbar, width: float) -> None:\n\n if ... | [
"0.5788891",
"0.57431185",
"0.56472933",
"0.56221867",
"0.55743104",
"0.5545128",
"0.5536082",
"0.549052",
"0.54834133",
"0.53839856",
"0.5378169",
"0.53288573",
"0.5291649",
"0.5290926",
"0.5288311",
"0.52758807",
"0.5266669",
"0.5258391",
"0.5257666",
"0.5237212",
"0.523644... | 0.83062744 | 0 |
Returns TRUE if the up button should be displayed | def _test_display_up_button(self):
return (self.product_displays.top_index > 0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isUp ( self ) :\n return not self.isDown()",
"def move_up(event: EventType, widget: WidgetType) -> bool:\n return event.key == KEY_MOVE_UP",
"def is_pressed(self) -> bool:\n return True",
"def rightButtonUp(self):\n\t\tautopy.mouse.toggle(False,autopy.mouse.RIGHT_BUTTON)",
"d... | [
"0.7570521",
"0.72280705",
"0.7115068",
"0.71126646",
"0.7043401",
"0.70227927",
"0.700404",
"0.6908078",
"0.6845273",
"0.6813771",
"0.6766018",
"0.67114484",
"0.6708478",
"0.6696725",
"0.66916925",
"0.66751057",
"0.66570747",
"0.66532713",
"0.66235787",
"0.66235787",
"0.6595... | 0.7942494 | 0 |
Reset the products list to nothing | def clear_products(self):
self.product_displays.clear() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def empty(self):\n self.items = []\n self.totalWeight = 0",
"def reset(self):\n self.elements = [0] * len(self)",
"def reset(self):\n self._data = []",
"def clear(self):\n self._items = []",
"def clear(self):\n self.__list = []",
"def __init__(self): \n s... | [
"0.6782221",
"0.67685705",
"0.6734079",
"0.6694723",
"0.6681738",
"0.66100025",
"0.66018546",
"0.65946543",
"0.65911126",
"0.65647316",
"0.6526661",
"0.6521588",
"0.6521588",
"0.6521588",
"0.65129584",
"0.6501035",
"0.64841735",
"0.64841735",
"0.64841735",
"0.64841735",
"0.64... | 0.82027036 | 0 |
Scan down the product list and set the visible state of the product objects | def _set_show_hide_products(self):
visible_count = 0
for (counter, product) in enumerate(self.product_displays):
if (counter < self.product_displays.top_index):
# Hide all the products above the list product top
product.set_visible(False)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _draw_products(self, window):\n \n # Iterate over all products in list\n index = 0\n for product in self.product_displays:\n if product.visible:\n product.draw(self.layout, index, self._remove_button_width(), window)\n index += 1",
"def get... | [
"0.63815486",
"0.610703",
"0.58968854",
"0.58574975",
"0.5814728",
"0.5778437",
"0.5778437",
"0.57648104",
"0.5710969",
"0.5639458",
"0.56277835",
"0.562654",
"0.55940884",
"0.5580036",
"0.5571813",
"0.5565017",
"0.5561356",
"0.5540053",
"0.5487899",
"0.5480094",
"0.5470553",... | 0.7236825 | 0 |
Draw all visible product objects on the window | def _draw_products(self, window):
# Iterate over all products in list
index = 0
for product in self.product_displays:
if product.visible:
product.draw(self.layout, index, self._remove_button_width(), window)
index += 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw(self, window):\n window.fill(Colours.BG)\n\n self._set_show_hide_products()\n self._draw_products(window)\n self._draw_static_objects(window)\n\n pygame.display.flip()",
"def draw(self):\n for obj in self.objects:\n obj.draw()",
"def draw(self): \n ... | [
"0.7319963",
"0.71650875",
"0.68041396",
"0.68041396",
"0.68041396",
"0.68041396",
"0.68041396",
"0.68041396",
"0.68041396",
"0.68041396",
"0.67512876",
"0.6708001",
"0.66253144",
"0.6591921",
"0.65150344",
"0.64464444",
"0.6332542",
"0.63218254",
"0.6319037",
"0.62770903",
"... | 0.8326296 | 0 |
Draw all the static objects on the window | def _draw_static_objects(self, window):
self.update_total()
## Draw border
for draw_object in self.border.get_border().values():
draw_object.draw(window)
# Draw the fixed objects
static_objs = [
self.objects[self.ids.TOPBAR],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw(self): \n pygame.event.clear()\n self.window = ocempgui.widgets.Box(GG.utils.SCREEN_SZ[0], GG.utils.SCREEN_SZ[1])\n self.paintScreen()\n self.paintAvatar()\n self.paintTags()\n self.paintCustomizeZone()\n self.paintButtons()\n self.window.zOrder = 90000\n self.window.depth = 2\... | [
"0.73159957",
"0.7200247",
"0.7053506",
"0.70143944",
"0.69643205",
"0.6928434",
"0.6911108",
"0.683837",
"0.6818077",
"0.67656994",
"0.67541057",
"0.6746994",
"0.6725112",
"0.67019",
"0.66835344",
"0.6659916",
"0.66531104",
"0.66452307",
"0.66397053",
"0.66258734",
"0.661867... | 0.78646946 | 0 |
Creates correlated ability parameters based on an input correlation matrix. This is a helper function for use in synthesizing multidimensional data assuming multivariate normal distribution | def create_correlated_abilities(correlation_matrix, n_participants, seed=None):
rng = np.random.default_rng(seed)
lower = np.linalg.cholesky(correlation_matrix)
return lower @ rng.standard_normal((correlation_matrix.shape[0], n_participants)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def correlate_columns(matrix):\n return np.dot(matrix.T, matrix) / (la.norm(matrix) ** 2)",
"def correl_vars(ds,cutoff=0.65, is_cor_mat_return=True):\n cor_mat = ds.corr() # correl matrix\n \n var1 = []; var2 = []\n for i in range(len(cor_mat.columns)):\n for j in range(len(cor_mat.index)):... | [
"0.58267885",
"0.57044107",
"0.56744105",
"0.5665763",
"0.5665763",
"0.5660631",
"0.5652028",
"0.5646071",
"0.5644198",
"0.560361",
"0.5593867",
"0.55926245",
"0.55782807",
"0.55476695",
"0.55410445",
"0.55390596",
"0.5536928",
"0.5492058",
"0.54820085",
"0.54800165",
"0.5469... | 0.69881344 | 0 |
Creates dichotomous unidimensional synthetic IRT data. Creates synthetic IRT data to test parameters estimation functions. Only for use with dichotomous outputs Assumes the model P(theta) = 1.0 / (1 + exp(discrimination (theta difficulty))) | def create_synthetic_irt_dichotomous(difficulty, discrimination, thetas,
guessing=0, seed=None):
rng = np.random.default_rng(seed)
if np.ndim(guessing) < 1:
guessing = np.full_like(difficulty, guessing)
continuous_output = irt_evaluation(difficulty, discriminat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_synthetic_mirt_dichotomous(difficulty, discrimination, thetas,\n seed=None):\n rng = np.random.default_rng(seed)\n\n # If the input is just a vector of discriminations\n if (np.ndim(discrimination) == 1) or (discrimination.shape[0] == 1):\n discrimina... | [
"0.72807664",
"0.64221025",
"0.5949613",
"0.5845599",
"0.58318764",
"0.57768965",
"0.5752076",
"0.5745334",
"0.5730884",
"0.5682785",
"0.56709635",
"0.5626789",
"0.5555776",
"0.55365014",
"0.5451153",
"0.5448884",
"0.5415505",
"0.539355",
"0.5340234",
"0.53331894",
"0.5330826... | 0.6925462 | 1 |
Creates dichotomous multidimensional synthetic IRT data. Assumes the model P(theta) = 1.0 / (1 + exp(1 (dot(discrimination,theta) + difficulty))) | def create_synthetic_mirt_dichotomous(difficulty, discrimination, thetas,
seed=None):
rng = np.random.default_rng(seed)
# If the input is just a vector of discriminations
if (np.ndim(discrimination) == 1) or (discrimination.shape[0] == 1):
discrimination = np.v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_synthetic_irt_dichotomous(difficulty, discrimination, thetas,\n guessing=0, seed=None):\n rng = np.random.default_rng(seed)\n\n if np.ndim(guessing) < 1:\n guessing = np.full_like(difficulty, guessing)\n\n continuous_output = irt_evaluation(difficulty,... | [
"0.6372233",
"0.6330223",
"0.599442",
"0.56800026",
"0.5632845",
"0.5620684",
"0.5599266",
"0.5580485",
"0.55694973",
"0.55557424",
"0.55496943",
"0.55215365",
"0.5489964",
"0.54840696",
"0.54775316",
"0.5472303",
"0.5399753",
"0.53778225",
"0.53512293",
"0.5343214",
"0.53361... | 0.725456 | 0 |
Creates polytomous unidimensional synthetic IRT data. Creates polytomous output with specified number of levels from [1, levels] | def create_synthetic_irt_polytomous(difficulty, discrimination, thetas,
model='grm', seed=None):
difficulty = np.atleast_2d(difficulty)
n_items, n_levels = difficulty.shape
if n_levels == 1:
raise AssertionError("Polytomous items must have more than 1 threshold")... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fullfact(levels):\n n = len(levels) # number of factors\n nb_lines = np.prod(levels) # number of trial conditions\n H = np.zeros((nb_lines, n))\n \n level_repeat = 1\n range_repeat = np.prod(levels)\n for i in range(n):\n range_repeat //= levels[i]\n lvl = []\n for j... | [
"0.55394226",
"0.5507189",
"0.5322405",
"0.5317046",
"0.5283658",
"0.52765316",
"0.52758163",
"0.526203",
"0.5245328",
"0.51992226",
"0.5163439",
"0.5163245",
"0.51610357",
"0.51115924",
"0.5107499",
"0.50974375",
"0.5083864",
"0.50748754",
"0.50553256",
"0.5054883",
"0.50454... | 0.6119926 | 0 |
Returns the list of overhead satellite objects given the window | def get_overhead_satellites_dicts(lat, lng, radius):
overhead_satellites_dict = []
for sat in satellites:
try:
sat_dict = sat.serialize_if_is_in_radius(lat, lng, radius)
except Exception:
continue
if sat_dict:
overhead_satellites_dict.append(sat_dict)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getweigths():\n ls = []\n for i_lay in range(1, len(layers)):\n ls.append(layers[i_lay][\"weigths\"])\n return ls",
"def get_stamp_windows(self):\n early_window = self.get_earliest_stamp_window()\n late_window = self.get_latest_stamp_window()\n window_delta = late_window... | [
"0.5603363",
"0.55234873",
"0.5378708",
"0.5343043",
"0.53272885",
"0.52247155",
"0.5222112",
"0.5221188",
"0.5184873",
"0.51602006",
"0.515069",
"0.51086634",
"0.5056692",
"0.5036433",
"0.5034132",
"0.502715",
"0.49924698",
"0.4959075",
"0.4943926",
"0.49367803",
"0.49186295... | 0.61297077 | 0 |
Returns satellites of a certain constellation | def get_constellation(startswith):
constellation = []
for sat in satellites:
if sat.name.startswith(startswith):
serialized = sat.serialize()
if serialized:
constellation.append(serialized)
return constellation | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stations():\n\n return station_list",
"def get_all_stations(session: Session) -> List[Row]:\n return session.query(PlanningWeatherStation.station_code).all()",
"def getStations(self) :\n return self._stations",
"def get_stations(self):\n return self.__request('stations')['stations']",... | [
"0.635593",
"0.61479795",
"0.6025066",
"0.5984918",
"0.57712275",
"0.5671119",
"0.5607439",
"0.5596467",
"0.55761504",
"0.5566055",
"0.55554676",
"0.5551738",
"0.55312026",
"0.55017",
"0.5489086",
"0.545151",
"0.54460144",
"0.5422619",
"0.5419575",
"0.5411057",
"0.5371812",
... | 0.7290711 | 0 |
Return the TLE from sat_id | def get_tle(sat_id):
for sat in satellites:
if sat.name == sat_id:
return sat.tle
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_tier(pkmn_id):\n if pkmn_id in tiers.TIERS[\"0\"]:\n return 0\n elif pkmn_id in tiers.TIERS[\"1\"]:\n return 1\n elif pkmn_id in tiers.TIERS[\"2\"]:\n return 2\n elif pkmn_id in tiers.TIERS[\"3\"]:\n return 3\n else:\n return 4",
"def _get_tier_color(pkm... | [
"0.54744244",
"0.5327852",
"0.5293958",
"0.5189246",
"0.5185192",
"0.5171703",
"0.51700526",
"0.51252013",
"0.5116307",
"0.5108249",
"0.5074463",
"0.49921268",
"0.4957534",
"0.49423563",
"0.49208283",
"0.49129754",
"0.48870516",
"0.48595324",
"0.4837113",
"0.4836963",
"0.4833... | 0.72863823 | 0 |
Populates the satellites array from TLEs | def populate_satellites_array():
total_tles = 0
tles = storage.get_tles_from_cache()
metadata = storage.get_metadata()
last_updated.append(metadata.get('last_updated'))
if len(last_updated) > 1:
del last_updated[0]
if not tles:
print('Fetching from spacetrack')
cron_refr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stations():\n\n return station_list",
"def __init__(\n self,\n num_satellites,\n fix_type):\n self.num_satellites = num_satellites\n self.fix_type = fix_type",
"def get_stations():\n response = requests.get('https://api.hh.ru/metro/160')\n todos = jso... | [
"0.588268",
"0.56820977",
"0.5487302",
"0.53803194",
"0.53755254",
"0.5344415",
"0.52817106",
"0.52787256",
"0.5267636",
"0.52112997",
"0.5177532",
"0.5159447",
"0.51321965",
"0.5129857",
"0.50877666",
"0.50871104",
"0.50531954",
"0.50431925",
"0.50205386",
"0.50128496",
"0.5... | 0.79974955 | 0 |
Refreshes the cache from spacetrack daily | def cron_refresh_spacetrack_cache():
s = SpaceTrackApi()
updated_tles_str = s.get_all_tles()
storage.save_tle_cache(updated_tles_str)
last_updated[0] = int(time.time())
metadata = {
'last_updated': last_updated[0],
}
storage.save_metadata(metadata) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _refresh_cache(self, data_dict):\r\n pass",
"def refresh(self):\n\n self._refreshed_on = time.time() * 1000",
"async def _timein_refresh(self):\n\t\t\n\t\tawait self.refresh_cache()",
"def update_cache(self, rfid):\n\n values = {'id' : rfid}\n data = urllib.parse.urlencode(val... | [
"0.6387744",
"0.62355447",
"0.6228594",
"0.61083984",
"0.6058347",
"0.60180247",
"0.60163856",
"0.59902626",
"0.5981703",
"0.5968459",
"0.59570175",
"0.5755967",
"0.5755143",
"0.5724268",
"0.568075",
"0.56786877",
"0.5677507",
"0.56684744",
"0.5660523",
"0.5646071",
"0.564557... | 0.82856715 | 0 |
Envia os produtos novos para o site | def enviar_novos():
template = 'produtos/form-enviar-produtos.html'
form = EnviarProdutosNovosForm()
imagens = read_images().keys()
task = current_app.enviar_novos_task
clear_task = request.args.get('clear_task', None)
if clear_task and clear_task == 'yes':
if task and task.state == 'S... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def excavar(self, sentido_giro, rpm, minutos):\n pass",
"def ejecutarproceso(self):\n self.generarConsultasLibres()\n self.aplicarConsultasLibres()\n self.generarCombinaciones()\n self.generarConsultasConexion()\n self.archivoSalida()",
"def atualiza_base():\n templ... | [
"0.582344",
"0.5736055",
"0.5695689",
"0.55553174",
"0.54479647",
"0.5444111",
"0.5412343",
"0.538099",
"0.5352548",
"0.53012",
"0.5286463",
"0.5281915",
"0.5279147",
"0.52585804",
"0.52194196",
"0.5212064",
"0.5198973",
"0.51872057",
"0.5181836",
"0.5137674",
"0.51251155",
... | 0.65614074 | 0 |
Atualiza a base de dados com produtos ja enviados | def atualiza_base():
template = 'produtos/form-atualiza-base.html'
form = EnviarProdutosNovosForm()
if form.validate_on_submit():
produtos = productList()
atualizar_base(produtos)
success('Base atualizada com sucesso')
return redirect(url_for('produtos.atualiza_base'))
... | {
"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 actualizar(self):\n if self.obraSocialSeleccionada!=None:\n self.cargar_pro... | [
"0.5921855",
"0.5573658",
"0.5570171",
"0.5525268",
"0.54616237",
"0.54220945",
"0.54185116",
"0.53700054",
"0.53599256",
"0.5307463",
"0.5303823",
"0.52824324",
"0.5279865",
"0.5278441",
"0.5268684",
"0.52643067",
"0.52426183",
"0.5233388",
"0.5212365",
"0.5201543",
"0.52003... | 0.65626353 | 0 |
Generates the penalty matrix associated with the Bspline basis `bspline` and the variation `variation`. If the chosen variation needs some parameters to be defined, they must be included on the kwargs. Returns np.ndarray of shape (`bspline.n_int` + `bspline.int_forw` + `bspline.int_back` + `bspline.deg`, `bspline.n_int... | def get_penalty_matrix(self, **kwargs) -> np.ndarray:
if self.variation not in ("diff",):
raise ValueError("Penalty matrix type not valid.")
if self.variation == "diff":
self.matrixD = self.get_diff_matrix(**kwargs)
return self.matrixD.T @ self.matrixD | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bspline_array(self, nspline=13, log=False, get_matrix=True):\n if get_matrix:\n bspl = utils.bspline_templates(wave=self.spec_wobs*1.e4,\n degree=3,\n df=nspline,\n log=log,\n ... | [
"0.44813386",
"0.44633934",
"0.4418267",
"0.43117476",
"0.4301847",
"0.42865905",
"0.42623934",
"0.42274022",
"0.42186657",
"0.42178455",
"0.42045256",
"0.41992435",
"0.4193804",
"0.41628328",
"0.41511914",
"0.41399053",
"0.41374248",
"0.40915483",
"0.40820405",
"0.40713498",
... | 0.541615 | 0 |
Create new navigation property to connectors for print. Create new navigation property to connectors for print. | def create_connectors(
self,
body, # type: "models.MicrosoftGraphPrintConnector"
**kwargs # type: Any
):
# type: (...) -> "models.MicrosoftGraphPrintConnector"
cls = kwargs.pop('cls', None) # type: ClsType["models.MicrosoftGraphPrintConnector"]
error_map = {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_connectors(\n self,\n print_connector_id, # type: str\n select=None, # type: Optional[List[Union[str, \"models.Enum28\"]]]\n expand=None, # type: Optional[List[str]]\n **kwargs # type: Any\n ):\n # type: (...) -> \"models.MicrosoftGraphPrintConnector\"\n ... | [
"0.5191692",
"0.498154",
"0.47918597",
"0.47604012",
"0.46645373",
"0.46233404",
"0.45859265",
"0.45806047",
"0.4573805",
"0.45636976",
"0.45020878",
"0.44743195",
"0.44632915",
"0.44620514",
"0.4429466",
"0.43730986",
"0.4357729",
"0.43509617",
"0.43456122",
"0.4344421",
"0.... | 0.53582543 | 0 |
Get connectors from print. Get connectors from print. | def get_connectors(
self,
print_connector_id, # type: str
select=None, # type: Optional[List[Union[str, "models.Enum28"]]]
expand=None, # type: Optional[List[str]]
**kwargs # type: Any
):
# type: (...) -> "models.MicrosoftGraphPrintConnector"
cls = kwargs.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_connectors_list(self):\n pass",
"def list_connectors(\n self,\n orderby=None, # type: Optional[List[Union[str, \"models.Get5ItemsItem\"]]]\n select=None, # type: Optional[List[Union[str, \"models.Get6ItemsItem\"]]]\n expand=None, # type: Optional[List[str]]\n ... | [
"0.6209401",
"0.58279985",
"0.5698457",
"0.55695814",
"0.55657",
"0.5535963",
"0.55350536",
"0.55105424",
"0.5420437",
"0.5364777",
"0.53070045",
"0.5268804",
"0.5262208",
"0.5258166",
"0.52504754",
"0.5227817",
"0.52085537",
"0.5199218",
"0.51769245",
"0.5168415",
"0.5168355... | 0.596397 | 1 |
Update the navigation property connectors in print. Update the navigation property connectors in print. | def update_connectors(
self,
print_connector_id, # type: str
body, # type: "models.MicrosoftGraphPrintConnector"
**kwargs # type: Any
):
# type: (...) -> None
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rdf_update_connections(rdf, prop, obj, subj, owl):\n conname = prop.split('#')[-1]\n print(\"createcon \"+str(obj)+ \" \" + str(subj))\n obj.relationships.create(conname, subj)\n for i in rdf.objects(subject=prop, predicate=RDFS.subPropertyOf):\n print(i)\n rdf_update_connections(rdf... | [
"0.5477307",
"0.49132034",
"0.49064565",
"0.4866146",
"0.48580322",
"0.4847276",
"0.48211145",
"0.4750198",
"0.47499287",
"0.47480568",
"0.46613815",
"0.46569315",
"0.463708",
"0.46352023",
"0.45975387",
"0.45714426",
"0.4561662",
"0.4557477",
"0.45368984",
"0.45348784",
"0.4... | 0.5036696 | 1 |
Create new navigation property to operations for print. Create new navigation property to operations for print. | def create_operations(
self,
body, # type: "models.MicrosoftGraphPrintOperation"
**kwargs # type: Any
):
# type: (...) -> "models.MicrosoftGraphPrintOperation"
cls = kwargs.pop('cls', None) # type: ClsType["models.MicrosoftGraphPrintOperation"]
error_map = {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_operations(\n self,\n print_operation_id, # type: str\n select=None, # type: Optional[List[Union[str, \"models.Enum31\"]]]\n expand=None, # type: Optional[List[str]]\n **kwargs # type: Any\n ):\n # type: (...) -> \"models.MicrosoftGraphPrintOperation\"\n ... | [
"0.4949499",
"0.49028972",
"0.48541674",
"0.4756891",
"0.4756891",
"0.47505158",
"0.47417718",
"0.4694572",
"0.4610008",
"0.4575893",
"0.4546058",
"0.45327964",
"0.4529304",
"0.45105064",
"0.44938353",
"0.44624767",
"0.44544595",
"0.4443512",
"0.44328377",
"0.44179463",
"0.44... | 0.49647254 | 0 |
Get printerShares from print. Get printerShares from print. | def list_printer_shares(
self,
orderby=None, # type: Optional[List[Union[str, "models.Enum59"]]]
select=None, # type: Optional[List[Union[str, "models.Enum60"]]]
expand=None, # type: Optional[List[Union[str, "models.Enum61"]]]
**kwargs # type: Any
):
# type: (...)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_printer_shares(\n self,\n printer_share_id, # type: str\n select=None, # type: Optional[List[Union[str, \"models.Enum62\"]]]\n expand=None, # type: Optional[List[Union[str, \"models.Enum63\"]]]\n **kwargs # type: Any\n ):\n # type: (...) -> \"models.Microsof... | [
"0.5811979",
"0.5719837",
"0.5379649",
"0.53750217",
"0.5357973",
"0.53297055",
"0.528701",
"0.51888907",
"0.50321615",
"0.4997966",
"0.49812928",
"0.49800614",
"0.49704927",
"0.4904655",
"0.48964918",
"0.48660332",
"0.48171493",
"0.47529054",
"0.46977648",
"0.46971932",
"0.4... | 0.5929783 | 0 |
Create new navigation property to printerShares for print. Create new navigation property to printerShares for print. | def create_printer_shares(
self,
body, # type: "models.MicrosoftGraphPrinterShare"
**kwargs # type: Any
):
# type: (...) -> "models.MicrosoftGraphPrinterShare"
cls = kwargs.pop('cls', None) # type: ClsType["models.MicrosoftGraphPrinterShare"]
error_map = {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_shares(\n self,\n body, # type: \"models.MicrosoftGraphPrinterShare\"\n **kwargs # type: Any\n ):\n # type: (...) -> \"models.MicrosoftGraphPrinterShare\"\n cls = kwargs.pop('cls', None) # type: ClsType[\"models.MicrosoftGraphPrinterShare\"]\n error_map = ... | [
"0.57783026",
"0.5231743",
"0.50983196",
"0.4851825",
"0.48485887",
"0.47849977",
"0.47806564",
"0.45574224",
"0.45157352",
"0.44472182",
"0.44129157",
"0.4376351",
"0.4357706",
"0.4355947",
"0.43264663",
"0.4274848",
"0.42341945",
"0.4221774",
"0.41627723",
"0.41623652",
"0.... | 0.6013365 | 0 |
Get printerShares from print. Get printerShares from print. | def get_printer_shares(
self,
printer_share_id, # type: str
select=None, # type: Optional[List[Union[str, "models.Enum62"]]]
expand=None, # type: Optional[List[Union[str, "models.Enum63"]]]
**kwargs # type: Any
):
# type: (...) -> "models.MicrosoftGraphPrinterShar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_printer_shares(\n self,\n orderby=None, # type: Optional[List[Union[str, \"models.Enum59\"]]]\n select=None, # type: Optional[List[Union[str, \"models.Enum60\"]]]\n expand=None, # type: Optional[List[Union[str, \"models.Enum61\"]]]\n **kwargs # type: Any\n ):\n ... | [
"0.5929783",
"0.5719837",
"0.5379649",
"0.53750217",
"0.5357973",
"0.53297055",
"0.528701",
"0.51888907",
"0.50321615",
"0.4997966",
"0.49812928",
"0.49800614",
"0.49704927",
"0.4904655",
"0.48964918",
"0.48660332",
"0.48171493",
"0.47529054",
"0.46977648",
"0.46971932",
"0.4... | 0.5811979 | 1 |
Update the navigation property printerShares in print. Update the navigation property printerShares in print. | def update_printer_shares(
self,
printer_share_id, # type: str
body, # type: "models.MicrosoftGraphPrinterShare"
**kwargs # type: Any
):
# type: (...) -> None
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_shares(\n self,\n printer_share_id, # type: str\n body, # type: \"models.MicrosoftGraphPrinterShare\"\n **kwargs # type: Any\n ):\n # type: (...) -> None\n cls = kwargs.pop('cls', None) # type: ClsType[None]\n error_map = {\n 401: Client... | [
"0.60168207",
"0.58797425",
"0.5139873",
"0.50018686",
"0.49725",
"0.489075",
"0.47493216",
"0.46902797",
"0.46506637",
"0.4645971",
"0.44011953",
"0.43775907",
"0.43299082",
"0.4329202",
"0.43075097",
"0.42506906",
"0.42386127",
"0.42100638",
"0.4194462",
"0.41872737",
"0.41... | 0.613246 | 0 |
Delete navigation property printerShares for print. Delete navigation property printerShares for print. | def delete_printer_shares(
self,
printer_share_id, # type: str
if_match=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> None
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_shares(\n self,\n printer_share_id, # type: str\n if_match=None, # type: Optional[str]\n **kwargs # type: Any\n ):\n # type: (...) -> None\n cls = kwargs.pop('cls', None) # type: ClsType[None]\n error_map = {\n 401: ClientAuthenticationE... | [
"0.5683588",
"0.5448751",
"0.5174152",
"0.5008662",
"0.49760768",
"0.49688616",
"0.4931828",
"0.4845979",
"0.48247477",
"0.47982392",
"0.47931978",
"0.47914562",
"0.4761925",
"0.47239703",
"0.46946055",
"0.46627745",
"0.46516562",
"0.46299604",
"0.46165127",
"0.46001336",
"0.... | 0.5776565 | 0 |
Create new navigation property to services for print. Create new navigation property to services for print. | def create_services(
self,
body, # type: "models.MicrosoftGraphPrintService"
**kwargs # type: Any
):
# type: (...) -> "models.MicrosoftGraphPrintService"
cls = kwargs.pop('cls', None) # type: ClsType["models.MicrosoftGraphPrintService"]
error_map = {
40... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_services(\n self,\n print_service_id, # type: str\n select=None, # type: Optional[List[Union[str, \"models.Enum80\"]]]\n expand=None, # type: Optional[List[Union[str, \"models.Enum81\"]]]\n **kwargs # type: Any\n ):\n # type: (...) -> \"models.MicrosoftGraph... | [
"0.47759324",
"0.46511307",
"0.46290323",
"0.46284688",
"0.4617787",
"0.45360902",
"0.45328298",
"0.45328298",
"0.4516657",
"0.45115456",
"0.4414093",
"0.43213654",
"0.43100104",
"0.43074372",
"0.4304879",
"0.42978",
"0.4257366",
"0.4256935",
"0.4253727",
"0.42359823",
"0.423... | 0.51095986 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.