query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Modify the messages created by internal validation for each tool parameter. This method is called after internal validation.
def updateMessages(self, parameters): return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateMessages(self):\r\n\t\tif self.approach.altered:\r\n\t\t\tif self.approach.value == \"Locations in the DEM generated from field observations\":\r\n\t\t\t\tif not self.point_vectors.altered:\r\n\t\t\t\t\tself.point_vectors.setIDMessage(\"ERROR\", 735, self.point_vectors.displayName)\r\n\t\t\t\tif not self...
[ "0.6273159", "0.6227692", "0.6219737", "0.59080434", "0.5856812", "0.58277136", "0.58220965", "0.5643958", "0.5557881", "0.5524887", "0.5496125", "0.54695207", "0.546242", "0.54500085", "0.54273695", "0.54027027", "0.5402662", "0.53470194", "0.5334184", "0.533179", "0.5312135...
0.0
-1
The source code of the tool.
def execute(self, parameters, messages): distance = float(parameters[2].valueAsText) azi = float(parameters[3].valueAsText) report = parameters[4].valueAsText latit_sp = float(parameters[1].valueAsText) longit_sp = float(parameters[0].valueAsText) #Calculates Angular Di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSource():", "def get_source(self):", "def source(self):\n return self._source_code", "def main(source):\n pass", "def source_code(self):\n return str(self.source)", "def code(self):\n code = self._code\n if code is None:\n raise IOError('source code not av...
[ "0.6976744", "0.6808354", "0.6787117", "0.6779767", "0.6597557", "0.65216976", "0.65216976", "0.6430955", "0.6402018", "0.6374443", "0.63550276", "0.6350019", "0.634154", "0.6261334", "0.6227401", "0.6182353", "0.6170003", "0.6145274", "0.6106932", "0.6088493", "0.6088493", ...
0.0
-1
Define the tool (tool name is the name of the class).
def __init__(self): self.label = "Oblate Tools" self.description = "This tool calculates the range and bearing between" + \ "two points (initial point and final point) if given the initial point, " + \ "range and bearing." self.canRunInBackground = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, toolName):\n\t\tself.toolName = toolName", "def __init__(self):\n self.label = \"Create\"\n self.alias = \"\"\n\n # List of tool classes associated with this toolbox\n if core.get_pass():\n self.tools = [Fbound, Roads, Diekdikisi]\n else:\n ...
[ "0.78886044", "0.74191546", "0.73680484", "0.7317306", "0.72275203", "0.7022156", "0.6999495", "0.6988887", "0.6932704", "0.6919116", "0.6890748", "0.68180656", "0.6817103", "0.67857397", "0.6773338", "0.6738541", "0.6737494", "0.673033", "0.6693258", "0.6666185", "0.6644223"...
0.0
-1
Set whether tool is licensed to execute.
def isLicensed(self): return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isLicensed(self):\r\n try:\r\n if arcpy.CheckExtension(\"Spatial\") != \"Available\":\r\n raise Exception\r\n except Exception:\r\n return False # tool cannot be executed\r\n return True ...
[ "0.67699075", "0.67699075", "0.65453637", "0.65453637", "0.65453637", "0.65453637", "0.65453637", "0.65453637", "0.65453637", "0.65453637", "0.64823943", "0.64823943", "0.64823943", "0.64823943", "0.64823943", "0.64823943", "0.64823943", "0.64823943", "0.64823943", "0.63907814"...
0.6332177
52
Modify the values and properties of parameters before internal validation is performed. This method is called whenever a parameter has been changed.
def updateParameters(self, parameters): return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateParameters(self, parameters):\n # if parameters[0].altered:\n # parameters[1].value = arcpy.ValidateFieldName(parameters[1].value,\n # parameters[0].value)\n return", "def parameters_changed(self):\n pass", "def ...
[ "0.76899844", "0.751904", "0.7070387", "0.7068485", "0.7065783", "0.6884809", "0.68828654", "0.68828654", "0.68828654", "0.68828654", "0.68828654", "0.68828654", "0.68828654", "0.68828654", "0.6848302", "0.6843053", "0.6829334", "0.6812083", "0.677713", "0.67592853", "0.67535...
0.6617421
34
Modify the messages created by internal validation for each tool parameter. This method is called after internal validation.
def updateMessages(self, parameters): return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateMessages(self):\r\n\t\tif self.approach.altered:\r\n\t\t\tif self.approach.value == \"Locations in the DEM generated from field observations\":\r\n\t\t\t\tif not self.point_vectors.altered:\r\n\t\t\t\t\tself.point_vectors.setIDMessage(\"ERROR\", 735, self.point_vectors.displayName)\r\n\t\t\t\tif not self...
[ "0.6274046", "0.6227765", "0.6219631", "0.59084237", "0.5856715", "0.58282226", "0.5822354", "0.56436193", "0.5557941", "0.55249864", "0.5496139", "0.5470021", "0.5462678", "0.5450089", "0.54279625", "0.5402762", "0.5402674", "0.5347718", "0.5333788", "0.5331576", "0.5312478"...
0.0
-1
The source code of the tool.
def execute(self, parameters, messages): latit_ep = float(parameters[3].valueAsText) longit_ep = float(parameters[2].valueAsText) deg_to_rad = math.pi/180 delta_lat = math.fabs(latit_ep-float(parameters[1].valueAsText)) delta_long = math.fabs(longit_ep-float(parameters[0].value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSource():", "def get_source(self):", "def source(self):\n return self._source_code", "def main(source):\n pass", "def source_code(self):\n return str(self.source)", "def code(self):\n code = self._code\n if code is None:\n raise IOError('source code not av...
[ "0.6976744", "0.6808354", "0.6787117", "0.6779767", "0.6597557", "0.65216976", "0.65216976", "0.6430955", "0.6402018", "0.6374443", "0.63550276", "0.6350019", "0.634154", "0.6261334", "0.6227401", "0.6182353", "0.6170003", "0.6145274", "0.6106932", "0.6088493", "0.6088493", ...
0.0
-1
Define the tool (tool name is the name of the class).
def __init__(self): self.label = "PFRR Ranger" self.description = "This tool plots the predicted impact point (Lon,Lat) " + \ "then calculates a 3sigma cirlce centered on the predicted impact point, and " + \ "intersects the circle with underlying Land Ownership to output a new " + \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, toolName):\n\t\tself.toolName = toolName", "def __init__(self):\n self.label = \"Create\"\n self.alias = \"\"\n\n # List of tool classes associated with this toolbox\n if core.get_pass():\n self.tools = [Fbound, Roads, Diekdikisi]\n else:\n ...
[ "0.7890142", "0.7419741", "0.7368317", "0.7318259", "0.72284335", "0.70211124", "0.70000625", "0.698991", "0.69333744", "0.69196504", "0.68901396", "0.68190086", "0.68181336", "0.6786494", "0.67741674", "0.67384523", "0.6738265", "0.67304075", "0.669395", "0.66669303", "0.664...
0.0
-1
Set whether tool is licensed to execute.
def isLicensed(self): return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isLicensed(self):\r\n try:\r\n if arcpy.CheckExtension(\"Spatial\") != \"Available\":\r\n raise Exception\r\n except Exception:\r\n return False # tool cannot be executed\r\n return True ...
[ "0.67727894", "0.67727894", "0.65478224", "0.65478224", "0.65478224", "0.65478224", "0.65478224", "0.65478224", "0.65478224", "0.65478224", "0.64847887", "0.64847887", "0.64847887", "0.64847887", "0.64847887", "0.64847887", "0.64847887", "0.64847887", "0.64847887", "0.63919765"...
0.63335377
54
Modify the values and properties of parameters before internal validation is performed. This method is called whenever a parameter has been changed.
def updateParameters(self, parameters): return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateParameters(self, parameters):\n # if parameters[0].altered:\n # parameters[1].value = arcpy.ValidateFieldName(parameters[1].value,\n # parameters[0].value)\n return", "def parameters_changed(self):\n pass", "def ...
[ "0.76883876", "0.7518859", "0.70704037", "0.7068409", "0.70658046", "0.68841404", "0.6881881", "0.6881881", "0.6881881", "0.6881881", "0.6881881", "0.6881881", "0.6881881", "0.6881881", "0.6847986", "0.68418837", "0.6828794", "0.68119735", "0.6776793", "0.6758866", "0.6753030...
0.66163677
35
Modify the messages created by internal validation for each tool parameter. This method is called after internal validation.
def updateMessages(self, parameters): return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateMessages(self):\r\n\t\tif self.approach.altered:\r\n\t\t\tif self.approach.value == \"Locations in the DEM generated from field observations\":\r\n\t\t\t\tif not self.point_vectors.altered:\r\n\t\t\t\t\tself.point_vectors.setIDMessage(\"ERROR\", 735, self.point_vectors.displayName)\r\n\t\t\t\tif not self...
[ "0.6274046", "0.6227765", "0.6219631", "0.59084237", "0.5856715", "0.58282226", "0.5822354", "0.56436193", "0.5557941", "0.55249864", "0.5496139", "0.5470021", "0.5462678", "0.5450089", "0.54279625", "0.5402762", "0.5402674", "0.5347718", "0.5333788", "0.5331576", "0.5312478"...
0.0
-1
The source code of the tool.
def execute(self, parameters, messages): # local variables and env arcpy.CreateFileGDB_management("E:/gina/poker/gdb", parameters[0].valueAsText) arcpy.env.workspace = "E:/gina/poker/gdb/" + parameters[0].valueAsText + ".gdb" arcpy.env.overwriteOutput = True adnr_lo_shp = "E:/gi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSource():", "def get_source(self):", "def source(self):\n return self._source_code", "def main(source):\n pass", "def source_code(self):\n return str(self.source)", "def code(self):\n code = self._code\n if code is None:\n raise IOError('source code not av...
[ "0.69761056", "0.68079245", "0.6786019", "0.67787606", "0.65962404", "0.6521082", "0.6521082", "0.6431018", "0.63997984", "0.63775516", "0.63536316", "0.6349879", "0.6339741", "0.6260727", "0.6225589", "0.6183039", "0.61693907", "0.61451274", "0.6105426", "0.608915", "0.60891...
0.0
-1
A GET request should simply return a 200.
def test_get(self): response = self.client.get(self.url) self.assertEqual(response.status_code, 200)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_response_200_on_get(self):\n pass", "def test_get(self):\n self.assertEqual(200, self.response.status_code)", "def test_get(self):\n self.assertEqual(200, self.response.status_code)", "def test_get(self):\n self.assertEqual(200, self.resp.status_code)", "def test_get(se...
[ "0.83019894", "0.7618177", "0.7618177", "0.7606511", "0.7606511", "0.74461186", "0.7405459", "0.71480525", "0.7101645", "0.70365584", "0.69865036", "0.6959429", "0.69543254", "0.6887673", "0.68825656", "0.6864004", "0.6860572", "0.6855868", "0.6817767", "0.6748019", "0.674660...
0.7089127
10
A successful POST request
def test_successful_post(self): response = self.client.post(self.url, data=self.data) self.assertEqual(response.status_code, 302) users = User.objects.all() self.assertEqual(1, users.count()) user = users[0] self.assertFalse(user.is_active) self.assertEqual(self.d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post(self):\n return self.doRequest(self.url, method=\"POST\", body=self.input)", "def post(self):", "def post(self):\n code, status = run_handlers.handle_data_post(self.request.headers, self.request.body)\n self.set_status(code)\n self.write(status)\n self.finish()"...
[ "0.78214085", "0.78077644", "0.7683847", "0.7657719", "0.7657719", "0.7657719", "0.7657719", "0.7657719", "0.7657719", "0.7657719", "0.7657719", "0.7657719", "0.7657719", "0.7657719", "0.7657719", "0.7657719", "0.7657719", "0.7633044", "0.7623431", "0.7612631", "0.7545264", ...
0.0
-1
A POST request that includes the honeypot field
def test_honeypot_post(self, sf_post): self.data['superpriority'] = 1 response = self.client.post(self.url, data=self.data) self.assertEqual(response.status_code, 403) self.assertFalse(sf_post.called) users = User.objects.all() self.assertEqual(0, users.count())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_honeypot_value(request, field_name):\n verifier = getattr(settings, 'HONEYPOT_VERIFIER', honeypot_equals)\n if request.method == 'POST':\n field = field_name or settings.HONEYPOT_FIELD_NAME\n if field not in request.POST or not verifier(request.POST[field]):\n return HttpR...
[ "0.6378446", "0.62081236", "0.62081236", "0.61488765", "0.56500125", "0.5613306", "0.5580668", "0.55471486", "0.55471486", "0.5521731", "0.55113757", "0.5483834", "0.54833925", "0.54643595", "0.54568756", "0.5456125", "0.5434137", "0.541984", "0.540796", "0.54050064", "0.5390...
0.5814416
4
Function to get activation code for the given email id from SQLite3 database
def get_activation_code(self, email): from registration.models import RegistrationProfile return RegistrationProfile.objects.get(user__email=email).activation_key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_active_code(email):\n key = 9\n encry_str = '%s|%s' % (email, time.strftime('%Y-%m-%d', time.localtime(time.time())))\n active_code = encrypt(key, encry_str)\n return active_code", "def get_email_code():\n try:\n if check_magic_cookie(current_app.config):\n eppn = request...
[ "0.7783734", "0.6583201", "0.63923746", "0.63744974", "0.6349737", "0.6197634", "0.619453", "0.6177607", "0.61225206", "0.6034107", "0.59878886", "0.59654486", "0.59224087", "0.5918931", "0.5893357", "0.58384615", "0.5756389", "0.5736205", "0.5704148", "0.5697767", "0.5692908...
0.7825948
0
Function to set the SMS telephone number for the organization
def set_sms_telephone_number(self, telephone_number, email): ngo_user_profile = NGOUserProfile.objects.get(user__email=email) org_setting = OrganizationSetting.objects.get(organization__org_id=ngo_user_profile.org_id) smsc = SMSC(vumi_username="smsc") smsc.save() outgoing_number ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sms_phone_number(self, sms_phone_number):\n\n self._sms_phone_number = sms_phone_number", "def telephone(self, telephone: str):\n\n self._telephone = telephone", "def telephone(self, telephone):\n\n self._telephone = telephone", "def setPhone(self,phone):\r\n self.phone = phon...
[ "0.7111448", "0.7108275", "0.69927394", "0.6978297", "0.69381905", "0.6781706", "0.6633915", "0.65183043", "0.6491202", "0.6484134", "0.6484134", "0.6484134", "0.6484134", "0.64426327", "0.6379249", "0.6379249", "0.6379249", "0.6379249", "0.6379249", "0.6274541", "0.62223303"...
0.8054854
0
Function to delete all the organization related details
def delete_organization_all_details(self, email): from django.contrib.auth.models import User user = User.objects.get(email = email) ngo_user_profile = NGOUserProfile.objects.get(user=user) org = Organization.objects.get(org_id = ngo_user_profile.org_id) org_setting = Organizatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_organization(self):\n pass", "def delete_organization_buildings(request):\n org_id = request.GET.get('org_id', '')\n return tasks.delete_organization_buildings(org_id)", "def organization_del_no_login(self, client, id):\n assert client.delete('/organizations/' + id, headers=...
[ "0.7227863", "0.6669952", "0.65060586", "0.64845306", "0.64831233", "0.64286613", "0.636024", "0.6312484", "0.6202136", "0.61951476", "0.6182339", "0.6164368", "0.60052854", "0.5990238", "0.5983369", "0.59587985", "0.59122294", "0.58964324", "0.5870292", "0.58384836", "0.5828...
0.75068665
0
sort table by given column number col
def sort(self, col, order): self.emit(SIGNAL("layoutAboutToBeChanged()")) self.mylist = sorted(self.mylist, key=operator.itemgetter(col)) if order == Qt.DescendingOrder: self.mylist.reverse() self.emit(SIGNAL("layoutChanged()"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sortTable(self, table, cols):\n #productive\n profprint()\n for col in reversed(cols):\n table = sorted(table, key=operator.itemgetter(col))\n return table", "def sortTable(self, table, cols):\r\n # productive\r\n profprint()\r\n for col in reversed(cols):\r\n table = sorted(ta...
[ "0.75284255", "0.7457057", "0.70447445", "0.7014967", "0.698253", "0.68400204", "0.67165816", "0.6608785", "0.6580399", "0.6565263", "0.6557455", "0.6550415", "0.6538714", "0.6514777", "0.6506555", "0.64969945", "0.64861035", "0.6406978", "0.63401574", "0.6319542", "0.6281820...
0.63679785
18
Sets up IO ports for GPIO Simulator
def __init__(self): GPIO.setup(PIN_BTN, GPIO.IN, GPIO.PUD_UP) GPIO.setup(PIN_RED_LED_0, GPIO.OUT, GPIO.LOW) GPIO.setup(PIN_BLUE_LED, GPIO.OUT, GPIO.LOW)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_gpio(self):\n logger.info(\"Setting up GPIO pins\")\n gpio.setmode(gpio.BOARD)\n gpio.setup(self.pins[\"SCLK\"], gpio.OUT)\n gpio.setup(self.pins[\"SDO\"], gpio.OUT)\n gpio.setup(self.pins[\"SDI\"], gpio.IN)\n gpio.setup(self.pins[\"IO_UPDATE\"], gpio.OUT)\n ...
[ "0.7367972", "0.7273375", "0.70788515", "0.69543004", "0.6916394", "0.68494195", "0.67607903", "0.6663471", "0.6635496", "0.66263944", "0.6588739", "0.6570507", "0.65695316", "0.65407616", "0.6535145", "0.6529399", "0.650451", "0.6485681", "0.6442556", "0.6411805", "0.6354022...
0.64383346
19
Reads signal coming from button input and makes sure it is valid Raises KeyboardInterrupt error when pressing Ctrl+C to escape infinite loop
def read_signals(self): last_state_BTN = 0 stop = 0 try: while True: time.sleep(0.01) input = GPIO.input(PIN_BTN) input_check = GPIO.input(PIN_BTN) #Compare two button inputs to lower c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def catch_keyboard_interrupt() -> Callable:\n return signal.signal(signal.SIGINT, keyboard_interrupt_handler)", "def signal_handler(self, signum, frame):\n if signum == signal.SIGINT:\n self.terminate = True\n elif signum == signal.SIGALRM:\n self.button_handler(self.BUTTON...
[ "0.68630767", "0.66138023", "0.6591542", "0.65760833", "0.6262444", "0.62043595", "0.62043595", "0.61973286", "0.6095569", "0.6094475", "0.6085296", "0.6064025", "0.60463226", "0.60421455", "0.60175776", "0.5980073", "0.59134895", "0.5882914", "0.5869988", "0.5858536", "0.583...
0.726642
0
The name of the Event.
def event_name(self): return dict.get(self, 'event_name', None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_name(self):\n return self._event_name", "def getName(self):\n return _libsbml.Event_getName(self)", "def cal_name(self):\n return self.event_name", "def event_name(self, event_name):\n self['event_name'] = event_name", "def setName(self, *args):\n return _libsbm...
[ "0.914251", "0.8779574", "0.8218363", "0.7748643", "0.7721498", "0.771181", "0.75794125", "0.7545769", "0.7544376", "0.7417364", "0.7392395", "0.73624647", "0.7352431", "0.72882885", "0.72882885", "0.72882885", "0.72882885", "0.72882885", "0.72882885", "0.72882885", "0.728828...
0.88853073
1
Set the event name.
def event_name(self, event_name): self['event_name'] = event_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_name(self, event_name):\n\n self._event_name = event_name", "def setName(self, *args):\n return _libsbml.Event_setName(self, *args)", "def set_name(self, _name):\n self.name = _name", "def event_def_name(self, event_def_name):\n\n self._event_def_name = event_def_name", ...
[ "0.8554447", "0.8545698", "0.7631831", "0.76218736", "0.76011735", "0.7582119", "0.7563849", "0.7563849", "0.75514656", "0.75162405", "0.7503605", "0.7490394", "0.7490394", "0.7490394", "0.7490394", "0.7490394", "0.7444846", "0.7444846", "0.74408394", "0.7368176", "0.7335487"...
0.87372917
0
Reparameterization trick by sampling fr an isotropic unit Gaussian. Arguments
def sampling(args): z_mean, z_log_var = args batch = K.shape(z_mean)[0] dim = K.int_shape(z_mean)[1] # by default, random_normal has mean=0 and std=1.0 epsilon = K.random_normal(shape=(batch, dim)) return z_mean + K.exp(0.5 * z_log_var) * epsilon
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_stat(sample_size, sparsity = 0, amplitude = 0, sigma = 1):\n var = generate_variable(sample_size, sparsity, amplitude, sigma)\n y_obs = var[0]\n \n \"\"\" \n f is equal to -X(t,theta) and we will minimize f (max. X)\n \"\"\"\n def f(x):\n \"\"\" \n ...
[ "0.6339151", "0.6202189", "0.61070704", "0.60892224", "0.60673374", "0.6012377", "0.5940982", "0.5890484", "0.5855432", "0.5814822", "0.5760141", "0.5724288", "0.570652", "0.5678124", "0.5676469", "0.5627207", "0.5615986", "0.56059116", "0.5600625", "0.55942696", "0.5591951",...
0.0
-1
Grabs (the number, the string, etc.) and returns its FimVariableType and length
def GrabVariableInitializerType(line: str) -> (FClass.FiMVariableTypes,int): # Boolean if line.startswith( FGlobal.Methods['Variable Boolean Array'] ): length = len( _findFirst(FGlobal.Methods['Variable Boolean Array'], lambda x: line.startswith(x)) ) return FClass.FiMVariableTypes.BOOL_ARRAY, l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_variable_info(self, variable_info):\n \n try:\n # Take the data type associated to the variable\n t = self.fmu.get_variable_data_type(variable_info.name)\n \n # According to the data type read, select one of these methods to get the information\n ...
[ "0.64187276", "0.6326492", "0.61455476", "0.5973403", "0.59730524", "0.59331995", "0.5925267", "0.5854947", "0.5836881", "0.57892615", "0.5777393", "0.5727039", "0.57248425", "0.57117987", "0.56861895", "0.5674377", "0.56599545", "0.56452334", "0.56042564", "0.55989367", "0.5...
0.7007432
0
Sanitizes knowntype string to the proper value
def ConvertUnknownStringToProperValue(value: str, vtype: FClass.FiMVariableTypes): if value == "nothing": no_value = { FClass.FiMVariableTypes.BOOL: False, FClass.FiMVariableTypes.NUMBER: 0, FClass.FiMVariableTypes.STRING: "\"\"", FClass.FiMVariableTypes.CHAR:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sanitize_string(self, string):\n # get the type of a unicode string\n unicode_type = type(Pyasciigraph._u('t'))\n input_type = type(string)\n if input_type is str:\n if sys.version < '3':\n info = unicode(string)\n else:\n info = ...
[ "0.7154394", "0.7148529", "0.7049661", "0.6780913", "0.6704926", "0.6582161", "0.65569156", "0.64896065", "0.64698887", "0.6448103", "0.6444366", "0.64289296", "0.6426208", "0.6395309", "0.6382495", "0.6377094", "0.63181514", "0.6278824", "0.62773836", "0.6217411", "0.6209055...
0.67707366
4
Returns the variable value and its guessed type. Only allow prefix artihmetic if value doesn't contain `and`
def BlindConvertStringToProperValue(value: str, variables: dict, report, run_once=False, allowPrefixArithmetic=False) -> (object, FClass.FiMVariableTypes): if value == "nothing": return 0, FClass.FiMVariableTypes.NUMBER # Char if value.startswith("'") and value.endswith("'") and len(value[1:-1]) ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _extract_filter_type_and_value(data):\n if data.startswith(\"in:\"):\n value = list(six.text_type(data[3:]).split(\",\"))\n filter_type = 'in'\n elif data.startswith(\"nin:\"):\n value = list(six.text_type(data[4:]).split(\",\"))\n filter_type = 'nin'\n elif data.startswith...
[ "0.53930664", "0.5375928", "0.52706516", "0.516305", "0.5159147", "0.5108086", "0.509953", "0.5085125", "0.5083509", "0.5073622", "0.5028905", "0.5026602", "0.5009004", "0.50046426", "0.49874958", "0.49823833", "0.4949878", "0.49334052", "0.49121347", "0.48503202", "0.4826429...
0.5360501
2
Parses [(the VAR_TYPE) VAR_NAME] lines Returns the string and the type
def InterpretVariableDeclaration(line: str, variables: dict, report) -> (str,FClass.FiMVariable): line_split = line.split(' ') variable_name: str = "" variable_type: FClass.FiMVariableTypes = FClass.FiMVariableTypes.UNKNOWN variable_value = None variable_constant = False # Grab variable na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GrabVariableInitializerType(line: str) -> (FClass.FiMVariableTypes,int):\n # Boolean\n if line.startswith( FGlobal.Methods['Variable Boolean Array'] ):\n length = len( _findFirst(FGlobal.Methods['Variable Boolean Array'], lambda x: line.startswith(x)) )\n return FClass.FiMVariableTypes.BOOL...
[ "0.72110385", "0.6684339", "0.6570947", "0.6499427", "0.6297661", "0.62916815", "0.6266233", "0.6097753", "0.6085287", "0.59952575", "0.5978942", "0.5960347", "0.58345133", "0.58036333", "0.5784733", "0.5764294", "0.576198", "0.5746267", "0.5746129", "0.57393914", "0.5738034"...
0.6406134
4
Parse array variable line. Returns the variable name and 0based index
def GetVariableArrayDetails(line: str, variables: dict, report) -> (str, int): if re.sub(r" (\d+)$", "", line ) in variables: var_name = re.sub(r" (\d+)$", "", line ) if not var_name in variables: raise Exception(f"Couldn't find variable {var_name}") if not variables[ var_name ]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indices_of_var(v):\n name = v.varName\n indices = name[2:].split(',')\n i, j = int(indices[0]), int(indices[1])\n return i, j", "def convert_to_array(line):\n line = line.strip()\n #VPR doesn't handle names that start with \"_\"\n if VPR_SAFE and line.startswith(\"_\"):\n...
[ "0.6036696", "0.58602184", "0.5832068", "0.5821593", "0.578838", "0.56220657", "0.5594634", "0.55855143", "0.55632436", "0.5492416", "0.53304476", "0.5276537", "0.5265253", "0.5260184", "0.5254695", "0.52503854", "0.5199804", "0.51745635", "0.516934", "0.51369214", "0.5134181...
0.70073694
0
Test check_price with price above min_price.
def test_check_price_ok() -> None: data = check_price(min_price=1, data={'p': 2.0}) assert data == {'p': 2.0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_min_value(self, tracked_price):\n if tracked_price < self.min_value and self.warning_calls <= 2:\n print(f'Warning! Price dropeed under {self.min_value} pln {tracked_price}')\n self.make_phone_call()\n self.warning_calls += 1\n elif tracked_price < self.min_...
[ "0.74070835", "0.70297384", "0.6977393", "0.6955922", "0.6880591", "0.67013264", "0.66409075", "0.65952086", "0.6568215", "0.640399", "0.63509536", "0.62894654", "0.6214502", "0.6202996", "0.61953896", "0.6140859", "0.6129352", "0.6083786", "0.6081506", "0.6043964", "0.597165...
0.70343876
1
Test check_price with price not above min_price.
def test_check_price_exception() -> None: with raises(StopProcessing): check_price(min_price=4, data={'p': 2.0})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_min_value(self, tracked_price):\n if tracked_price < self.min_value and self.warning_calls <= 2:\n print(f'Warning! Price dropeed under {self.min_value} pln {tracked_price}')\n self.make_phone_call()\n self.warning_calls += 1\n elif tracked_price < self.min_...
[ "0.75230813", "0.73155284", "0.7140825", "0.7079589", "0.7073982", "0.7000379", "0.66809785", "0.66455823", "0.65867", "0.6580177", "0.6520217", "0.63813746", "0.63410133", "0.6291216", "0.62864596", "0.6259314", "0.6231596", "0.6179011", "0.6167336", "0.6107868", "0.6060801"...
0.6645239
8
ipywidgets for controlling peak variables
def widgets(self): raise NotImplementedError("This method is not ready to be used yet")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_monitor(self, model, dataset, algorithm):\n A, b = model.layers[0].get_param_values()\n self.adjust_plot(A, b)", "def changeValue(self):\n #productive #onUpDnArrow\n profprint()\n widget = slicer.modules.NeedleFinderWidget\n widget.scrollPointButton.setText('Scroll Point for...
[ "0.5771094", "0.5744693", "0.5580443", "0.55698293", "0.554083", "0.55339617", "0.55050105", "0.5488327", "0.5441005", "0.54214644", "0.5402043", "0.53952193", "0.53938454", "0.53908014", "0.5384737", "0.53830445", "0.53733826", "0.53710103", "0.5334542", "0.53216964", "0.530...
0.0
-1
Load peak definitions. The method must assign a peak definition dictionary to the self._peak_definitions attribute. The dictionary must have the keys 'center', 'sigma', 'amplitude', 'gamma', with value of [value_P1, bounds_P1, (fraction, distance) wrt P1 for P2, ... (fraction, distance) wrt P1 for Pn] Examples self._pe...
def _read_peak_definitions(self, *args, **kwargs): raise NotImplementedError("This method must be implemented when sub-classing")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_peak_def_high():\n\n high_cf_opts = np.arange(50, 90, 1)\n\n # Generate peak definitions\n while True:\n\n cur_cen = np.random.choice(high_cf_opts)\n cur_pw = np.random.choice(PW_OPTS, p=PW_PROBS)\n cur_bw = np.random.choice(BW_OPTS, p=BW_PROBS)\n\n peak = [cur_cen, cur...
[ "0.63168603", "0.6046201", "0.5977809", "0.58854425", "0.58608097", "0.58536106", "0.5828217", "0.5789251", "0.5698267", "0.56628263", "0.56188095", "0.56003404", "0.5578688", "0.55731547", "0.556175", "0.5560203", "0.5547177", "0.5529511", "0.5503513", "0.5497738", "0.548399...
0.7050395
0
fixes all variables (but only for this ensemble)
def _fix_full(self, prefix): for k in self.params: if k.startswith(prefix): self.params[k].vary = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fix_variables(m, variables):\r\n\r\n for var_name, values in variables.items():\r\n for var_index, var_value in values.items():\r\n m.__getattribute__(var_name)[var_index].fix(var_value)\r\n\r\n return m", "def unfix_variables(m, variables):\r\n\r\n for var_name...
[ "0.65907675", "0.63603765", "0.61633873", "0.6162592", "0.6125305", "0.60627306", "0.5985794", "0.59559405", "0.59445125", "0.591364", "0.5852942", "0.58325815", "0.5824469", "0.5805916", "0.57937115", "0.5761622", "0.5745255", "0.574317", "0.5738241", "0.57210153", "0.571230...
0.0
-1
Tests the AddArguments function.
def testAddArguments(self): argument_parser = argparse.ArgumentParser( prog='cli_helper.py', description='Test argument parser.', add_help=False, formatter_class=cli_test_lib.SortedArgumentsHelpFormatter) storage_format.StorageFormatArgumentsHelper.AddArguments(argument_parser) out...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AddArguments(cls, argument_group):", "def test_variadic_addition_takes_arbitrary_arguments(self):\n self.assertEqual(\n variadic_addition(1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15), 90\n )", "def add_val_arguments(self):\n self.add_test_arguments()", "def add_args(self):\n...
[ "0.7502053", "0.7305629", "0.7059979", "0.7022747", "0.6988829", "0.6949564", "0.68986076", "0.68986076", "0.6873056", "0.68521637", "0.68225586", "0.6778889", "0.6778889", "0.6778889", "0.6778889", "0.6778889", "0.6778889", "0.6778889", "0.6778889", "0.6601322", "0.658504", ...
0.70412487
3
Tests the ParseOptions function.
def testParseOptions(self): options = cli_test_lib.TestOptions() options.storage_format = 'sqlite' options.task_storage_format = 'sqlite' test_tool = tools.CLITool() storage_format.StorageFormatArgumentsHelper.ParseOptions(options, test_tool) self.assertEqual(test_tool._storage_format, options...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testParseOptions(self):\n options = cli_test_lib.TestOptions()\n\n output_module = MockOutputModule()\n server_config.ServerArgumentsHelper.ParseOptions(options, output_module)\n\n with self.assertRaises(errors.BadConfigObject):\n server_config.ServerArgumentsHelper.ParseOptions(options, None)...
[ "0.76278573", "0.7261784", "0.6988826", "0.6817748", "0.67921877", "0.67795414", "0.6500902", "0.6449844", "0.6420433", "0.64187175", "0.64091617", "0.63865316", "0.62818694", "0.62485826", "0.6245095", "0.6241722", "0.62382", "0.62180233", "0.620515", "0.6143495", "0.6136967...
0.7682984
0
Test Queue's repr or str. fn is repr or str. expect_id is True if we expect the Queue's id to appear in fn(Queue()).
def _test_repr_or_str(self, fn, expect_id): def gen(): when = yield self.assertAlmostEqual(0.1, when) when = yield 0.1 self.assertAlmostEqual(0.2, when) yield 0.1 loop = self.new_test_loop(gen) q = asyncio.Queue(loop=loop) sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_values_dequeue_in_correct_order():\n queue = Queue('ab')\n assert queue.dequeue() == 'a'", "def test_queue_enqueue_command(runner, tmpworkdir, queue, target_factory): # pylint: disable=unused-argument\n\n atarget = target_factory.build(queue=queue)\n apath = Path('ips.txt')\n apath.write...
[ "0.5626087", "0.5512492", "0.5478984", "0.5464747", "0.54113114", "0.5356273", "0.52189934", "0.5200133", "0.5196002", "0.51892626", "0.5184694", "0.5144224", "0.51123935", "0.50581205", "0.50434726", "0.5043352", "0.5029708", "0.5026211", "0.50201356", "0.5016761", "0.500636...
0.762492
0
Initialize a sqlite3 device table
def initializetable(perms=False): cfg = Utility.read_configuration(config="DEVICEDETECT") if not os.path.exists(cfg["devicedb"]): connection = sqlite3.connect(cfg["devicedb"]) dataframe = pandas.read_csv("templates/devicetable.csv") dataframe.to_sql(cfg["tablename"],...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_create_device_table(db_path):\n try:\n # Open a connection to the 'db_path' database file, the database file\n # will be created automatically the first time we try to connect to it.\n # The 'connect' method returns 'Connection' object that represents the\n # database.\n ...
[ "0.73561305", "0.72131217", "0.69904935", "0.69413596", "0.69371575", "0.69371575", "0.6877122", "0.68751943", "0.68699396", "0.6842722", "0.67815596", "0.67632675", "0.67560834", "0.67523825", "0.67511", "0.6749537", "0.6732081", "0.67283523", "0.67143506", "0.6713166", "0.6...
0.7181669
2
Get connection info and table name
def get_connection_info(haconf=False): cfg = Utility.read_configuration(config="DEVICEDETECT") if haconf: from glob import glob # Read one other than cfg["devicedb"] dbs = glob("cache/*devices.db") for db in dbs: if db != cfg["devicedb"]:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_info(self):\n #TODO move up?\n self._logger.info(ME + '._set_info()')\n return CONNECTION_VALUES['table'], CONNECTION_VALUES['schema']", "def info(self) -> ConnectionInfo:\n return ConnectionInfo(self.pgconn)", "def info_table(table):\n print \"\\nSCHEMA de la taula \",t...
[ "0.7042505", "0.6624533", "0.6566078", "0.64525384", "0.6450652", "0.64455223", "0.63108194", "0.63067824", "0.63067824", "0.6287367", "0.6283566", "0.62006044", "0.6177689", "0.61658067", "0.61627334", "0.6138631", "0.6116917", "0.61109644", "0.6103924", "0.60940456", "0.608...
0.63533044
6
Get current entries in the database
def read_sqlite3_current(jsondata=False): connection, tablename = HomeNetwork.get_connection_info() query = "SELECT * from {table}".format(table=tablename) if jsondata: return pandas.read_sql_query(query, connection).to_json(orient='records') return pandas.read_sql_query(qu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all(self):\n return self.db", "def entries():\n\n\treturn [entry.value for entry in db.session.query(Entry).all()]", "def getItems(self):\n for object in self.database:\n print(object)", "def get_entries_all(self):\n if self.database is None:\n raise Databas...
[ "0.6892752", "0.6807296", "0.65574366", "0.65050447", "0.6465532", "0.6429659", "0.63991565", "0.62561125", "0.62476254", "0.62436056", "0.62436056", "0.6224733", "0.62020177", "0.6198918", "0.61875474", "0.61791414", "0.61259425", "0.61225206", "0.61204094", "0.61158484", "0...
0.0
-1
Get relevant entry from the database
def get_hostname_specificdata(host, index=None): connection, tablename = HomeNetwork.get_connection_info() query = 'SELECT * from {0} WHERE hostname="{1}"'.format(\ tablename, host) output = pandas.read_sql_query(query, connection).to_json(orient='records') if index:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def specific_entry():\n u_id = request.args(0) or redirect(URL('moderation', 'new_entries'))\n row = db(db.lioli_main.unique_id==u_id).select().first()\n return dict(row=row)", "def retrieve_from_db(self):\n pass", "def db_row(self):\n return self._model_cls.query.get(self._pk)", "def ...
[ "0.69697934", "0.69396836", "0.6832164", "0.6762123", "0.672575", "0.66667116", "0.65976083", "0.65439963", "0.65409255", "0.6537493", "0.648025", "0.6454338", "0.6431758", "0.6361824", "0.63396746", "0.6332045", "0.6328187", "0.63005894", "0.62585217", "0.6244965", "0.624139...
0.0
-1
Get all hosts in the sqlite3 db
def get_allhosts(): connection, tablename = HomeNetwork.get_connection_info() query = 'SELECT hostname from {}'.format(tablename) output = pandas.read_sql_query(query, connection).to_json(orient='records') for host in json.loads(output): yield host["hostname"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_hosts():\n db = sqlite3.connect('/home/tropius/TROPIUS/TROPIUS.db')\n res = hosts.get_all(db)\n res = {'list': res}\n return jsonify(res)", "def all_hosts(self):\n ...", "def get_all_index_servers(self):\n try:\n conn = psycopg2.connect(\"dbname='{0}'\".format(DATA...
[ "0.7736205", "0.72115093", "0.68987846", "0.6766225", "0.6706228", "0.66647464", "0.6644789", "0.6626815", "0.6574912", "0.6552498", "0.647382", "0.6434455", "0.64322376", "0.6368944", "0.6285019", "0.6262168", "0.62507373", "0.62336105", "0.6210645", "0.6204508", "0.6191099"...
0.7696335
1
Faster network discovery with scapy
def create_tree(): basey = 960/2 basex = 600/2 newstruct = defaultdict(dict) homenw = Utility.read_configuration(config="HOME_NETWORK") alive, _ = srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst=homenw),\ timeout=2, verbose=0) for idx in range...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_forever(self):\n scapy.sniff(prn=self.arp_cb, filter=\"arp\", store=0, count=0)", "def sniffing():\n sniff(store=False, prn=lambda p: threading.Thread(target=next, args=(p,)).start(), iface=IFACE)", "def scan(ip):\n arp_request = scapy.ARP(pdst=ip)\n broadcast = scapy.Ether(dst=\"ff:ff:ff:f...
[ "0.6568397", "0.63426375", "0.6237762", "0.59553033", "0.59536284", "0.58477724", "0.5839151", "0.5742585", "0.5724322", "0.5685759", "0.5667462", "0.5660228", "0.56492436", "0.56371456", "0.5551914", "0.5549216", "0.5548877", "0.55437076", "0.55098903", "0.5507294", "0.54767...
0.0
-1
Create tree from sqlite data
def create_d3json(jsonfile="static/data/graph.json"): gateway = None devices = defaultdict(list) colors = {} jsdata = HomeNetwork.read_sqlite3_current(jsondata=True) devices["nodes"] = json.loads(jsdata) for anode in devices["nodes"]: if "osfamily" in anod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieveTrees(c):\n\n all_nodes = dict()\n root_nodes = list()\n c.execute('''SELECT id, parent_id, title FROM node''')\n data_db = c.fetchall()\n \n # Initialize nodes list\n for data_line in data_db:\n db_child_id = data_line[0]\n db_parent_id = data_line[1]\n child_...
[ "0.69889605", "0.66388494", "0.6530566", "0.64830005", "0.64660484", "0.64467305", "0.6440712", "0.63859665", "0.63048893", "0.6299472", "0.6292835", "0.62872106", "0.62469125", "0.62220967", "0.62200874", "0.6200817", "0.6181151", "0.6166043", "0.6156164", "0.6149793", "0.61...
0.0
-1
Encodes a tree to a single string.
def serialize(self, root): if(not root) : return "X" else : return ",".join([str(root.val), self.serialize(root.left), self.serialize(root.right)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tree_to_string(tree):\n if type(tree) == Tree:\n return sum(list(map(tree_to_string, tree.children)), [])\n else:\n return [str(tree)]", "def serialize(node, tree=\"\"):\n \n \n if (not node): #Base case\n tree += \"# \"\n return tree\n tree += (str(node.val) + \" ...
[ "0.72254354", "0.7174656", "0.70803744", "0.706792", "0.7032909", "0.7030312", "0.7020698", "0.69704413", "0.6961067", "0.69334626", "0.692108", "0.6879218", "0.6797347", "0.6790119", "0.6790119", "0.6789466", "0.67704153", "0.6743968", "0.6743425", "0.6740732", "0.67361337",...
0.655611
42
Decodes your encoded data to tree.
def deserialize(self, data): self.data = data if(data[0] == "X") : return None else : t = TreeNode(int(self.data[: self.data.find(",")])) t.left = self.deserialize(self.data[self.data.find(",") + 1 :]) t.right = self.deserialize(self.data[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deserialize(self, data):\n # if data:\n # root = TreeNode(data.pop(0))\n # # root.val = data.pop\n if not data:\n return None\n data = data.split(' ')\n data = iter(data)\n\n def resucsbuild():\n try:\n val = next(dat...
[ "0.75939554", "0.7463827", "0.7094851", "0.7064511", "0.705998", "0.7053173", "0.7051886", "0.7046027", "0.70459527", "0.7039219", "0.69926393", "0.6987736", "0.6933219", "0.6915955", "0.69115806", "0.68922126", "0.68773776", "0.68404627", "0.68312407", "0.6817558", "0.681745...
0.69776005
12
>>> a = [[1, 2], [3, 4]] >>> b = [[2, 2], [2, 2]] >>> add_matrices(a, b) [[3, 4], [5, 6]] >>> c = [[8, 2], [3, 4], [5, 7]] >>> d = [[3, 2], [9, 2], [10, 12]] >>> add_matrices(c, d) [[11, 4], [12, 6], [15, 19]] >>> c [[8, 2], [3, 4], [5, 7]] >>> d [[3, 2], [9, 2], [10, 12]]
def add_matrices(m1, m2): output = [] for index in range(len(m1)): row_1 = m1[index] row_2 = m2[index] new_row = [] for index2 in range(len(row_1)): sum = row_1[index2] + row_2[index2] new_row.append(sum) output.append(new_row) return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_matrices(mat1, mat2):\n if mat_shape(mat1) != mat_shape(mat2):\n return None\n if type(mat1[0]) == int:\n return [mat1[i] + mat2[i] for i in range(len(mat1))]\n else:\n return [add_matrices(mat1[i], mat2[i]) for i in range(len(mat1))]", "def add_matrices(mat1, mat2):\n\n ...
[ "0.80355763", "0.7923703", "0.78619474", "0.7861174", "0.75374496", "0.7442682", "0.7293554", "0.7254391", "0.71103257", "0.7096675", "0.7056793", "0.6789391", "0.67255837", "0.6712634", "0.6535319", "0.64049625", "0.64011973", "0.6356694", "0.6340926", "0.63218904", "0.62666...
0.76291114
4
>>> row_times_column([[1, 2], [3, 4]], 0, [[5, 6], [7, 8]], 0) 19 >>> row_times_column([[1, 2], [3, 4]], 0, [[5, 6], [7, 8]], 1) 22 >>> row_times_column([[1, 2], [3, 4]], 1, [[5, 6], [7, 8]], 0) 43 >>> row_times_column([[1, 2], [3, 4]], 1, [[5, 6], [7, 8]], 1) 50
def row_times_column(m1, row, m2, column): sum = 0 for index in range(len(m1)): product = m1[row][index] * m2[index][column] sum += product return sum
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def row_times_column(m1, row, m2, column):\n\n pass", "def row_times_column(m1, row, m2, column):\n\tsum = 0\n\tfor i in range(len(m1[0])):\n\t\tsum += (m2[i][column] * m1[row][i])\n\treturn sum", "def get_time_cols(self):\n # Retrieve first column only\n time_cols = list()\n n = self.c...
[ "0.7639624", "0.6696174", "0.59364796", "0.5893528", "0.57418704", "0.56003237", "0.55548483", "0.5544584", "0.55429316", "0.55376613", "0.5346057", "0.5311607", "0.53045905", "0.5233595", "0.5192839", "0.5163948", "0.5155237", "0.5125312", "0.50878966", "0.5074226", "0.50586...
0.6321024
2
>>> matrix_mult([[1, 2], [3, 4]], [[5, 6], [7, 8]]) [[19, 22], [43, 50]] >>> matrix_mult([[1, 2, 3], [4, 5, 6]], [[7, 8], [9, 1], [2, 3]]) [[31, 19], [85, 55]] >>> matrix_mult([[7, 8], [9, 1], [2, 3]], [[1, 2, 3], [4, 5, 6]]) [[39, 54, 69], [13, 23, 33], [14, 19, 24]]
def matrix_mult(m1, m2): output = [] for rowIndex, row in enumerate(m1): #go through rows in m1 new_row = [] for columnIndex in range(len(m2[0])): #go through indices for each column of m2 sum = 0 for index3 in range(len(row)): product = m1[rowIndex][ind...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrix_mult(m1, m2):\n pass", "def matrix_mult(m1, m2):\n\ttemp = []\n\tfor i in range(len(m1)):\n\t\te = []\n\t\tfor j in range(len(m2[0])):\n\t\t\te.append(row_times_column(m1,i,m2,j))\n\t\ttemp.append(e)\n\treturn temp", "def matrix_mult_matrix(matrix_a, matrix_b):\n m = len(matrix_a)\n n = len(...
[ "0.79977393", "0.78580046", "0.7722217", "0.74430877", "0.7204228", "0.7204228", "0.7172555", "0.7136884", "0.70192224", "0.6969425", "0.6952268", "0.69500834", "0.69146705", "0.68869436", "0.6829271", "0.68284243", "0.68214583", "0.67747104", "0.6735128", "0.6721545", "0.671...
0.7775381
2
Creates an NLTK Parse Tree from the user input msg.
def __call__(self, msg: str): # Remove punctuation from the string msg = re.sub(r"[.?']+\ *", " ", msg, flags=re.VERBOSE) # Parse sentence into list of tokens containing # only entities and commands. tokens = self._...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buildtree(text):\n tokens = text.strip().replace('//TT_ERR','').replace('\\n','').replace('(', ' ( ').replace(')', ' ) ').split()\n # print 'tokens = {}'.format(tokens)\n queue = processtext(tokens)\n # print 'queue = {}'.format(queue)\n stack = []\n while queue:\n token = queue.pop(0)...
[ "0.6411171", "0.6261072", "0.57774585", "0.5727645", "0.5545047", "0.55288285", "0.55222535", "0.5504249", "0.5500528", "0.54955226", "0.54773927", "0.5462137", "0.5436885", "0.5395603", "0.53827703", "0.53827703", "0.53696024", "0.5360188", "0.52904207", "0.5270398", "0.5268...
0.7164881
0
Generates RegEx patterns from command signifiers.
def _unary_command_regexes(self): patterns = {} for intent, keys in self.keywords.get("unary").items(): if keys: patterns[intent] = re.compile(r'\b' + r'\b|\b'.join(keys) + r'\b') return patterns
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _binary_command_regexes(self):\n patterns = {}\n for intent, keys in self.keywords.get(\"binary\").items():\n if keys:\n patterns[intent] = re.compile(r'\\b' + r'\\b|\\b'.join(keys) + r'\\b')\n return patterns", "def build_command_pattern(command: str) -> re.Pat...
[ "0.66550136", "0.653379", "0.6328662", "0.6173036", "0.610725", "0.5850984", "0.5816659", "0.5816576", "0.5813355", "0.5812216", "0.5787904", "0.5764316", "0.5734072", "0.57315695", "0.57271516", "0.56949216", "0.56752104", "0.5669257", "0.5629325", "0.56085503", "0.55786955"...
0.6484083
2
Generates RegEx patterns from command signifiers.
def _terminal_command_regexes(self): patterns = {} for intent, keys in self.keywords.get("terminal").items(): if keys: patterns[intent] = re.compile(r'\b' + r'\b|\b'.join(keys) + r'\b') return patterns
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _binary_command_regexes(self):\n patterns = {}\n for intent, keys in self.keywords.get(\"binary\").items():\n if keys:\n patterns[intent] = re.compile(r'\\b' + r'\\b|\\b'.join(keys) + r'\\b')\n return patterns", "def build_command_pattern(command: str) -> re.Pat...
[ "0.66543615", "0.65331167", "0.6484126", "0.6172773", "0.6107237", "0.5850929", "0.5816953", "0.58164525", "0.5812901", "0.58121854", "0.57885414", "0.57643104", "0.57336867", "0.5731554", "0.5727157", "0.5694666", "0.5675593", "0.56686103", "0.5629586", "0.5608498", "0.55780...
0.632853
3
Generates RegEx patterns from command signifiers.
def _binary_command_regexes(self): patterns = {} for intent, keys in self.keywords.get("binary").items(): if keys: patterns[intent] = re.compile(r'\b' + r'\b|\b'.join(keys) + r'\b') return patterns
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_command_pattern(command: str) -> re.Pattern:\n # swap every expression wiht the format <vaiable> to ?Pvariable\n # this way the .match method from re can be called\n logger.info(f\"Building new command partter for command: {command}\")\n command_regex = re.sub(r\"(<\\w+>)\", r\"(?P\\1.+)\", c...
[ "0.653379", "0.6484083", "0.6328662", "0.6173036", "0.610725", "0.5850984", "0.5816659", "0.5816576", "0.5813355", "0.5812216", "0.5787904", "0.5764316", "0.5734072", "0.57315695", "0.57271516", "0.56949216", "0.56752104", "0.5669257", "0.5629325", "0.56085503", "0.55786955",...
0.66550136
0
Lexes an input string into a list of tokens. This lexer first looks for Entities in the input string and parses them into tokens of the same name (i.e. 'blah U2 blah' > ['U2']). Next, the lexer will look for Commands by searching for keywords that signify the command. These keyword+command pairings are defined in the c...
def _lexer(self, msg: str): def lexing_algorithm(text): # TODO: >= O(n^2) (horrible time complexity). In the interest of # making forward progress, optimize this later. Could use a # bloom filter to look for matches, then binary search on # entities/commands fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(self, string):\n tokens = [tok if tok in self.token_to_ix else self.unk\n for tok in string.split()]\n return [self.bos] + tokens + [self.eos]", "def tokenize(self, input_string: str) -> List[str]:", "def _next_tokens(self, context):\n state = context.state\n ...
[ "0.6456831", "0.645226", "0.63548565", "0.6297312", "0.6186637", "0.61487323", "0.6142615", "0.6064563", "0.60500246", "0.5996603", "0.5989371", "0.5983331", "0.59758335", "0.59153837", "0.5849638", "0.5826889", "0.5813295", "0.58122796", "0.5797753", "0.57843983", "0.573577"...
0.6951192
0
Generates a Parse Tree from a list of tokens provided by the Lexer.
def _parser(self, tokens: List[str]): # TODO: Improve the CFG work for the following: # - Play songs faster than despicito # - Play something similar to despicito but faster # - Play something similar to u2 and justin bieber def gen_lexing_patter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_expression_tree(tokens):\n S = [] # we use Python list as stack\n for t in tokens:\n if t in '+-*/': # t is an operator symbol\n S.append(t) # push the operator symbol\n elif t not in '()': # consider t to be a literal\n S.append(ExpressionTree(t)) # push tr...
[ "0.6466953", "0.644608", "0.62583", "0.6232822", "0.61200607", "0.60248965", "0.5829405", "0.57602966", "0.565705", "0.56212145", "0.55818355", "0.5572948", "0.55724984", "0.55428964", "0.5542429", "0.549909", "0.5480207", "0.5452097", "0.54445064", "0.543944", "0.54228836", ...
0.6064762
5
Adds a new user and if the first user makes the user an admin and the owner.
def add_user(self, user, role=OrganizationUserRole.MEMBER): users_count = self.users.all().count() if users_count == 0: role = OrganizationUserRole.OWNER org_user = self._org_user_model.objects.create( user=user, organization=self, role=role ) if users_cou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_users():\n try:\n User.objects.get(username='admin').delete()\n except User.DoesNotExist:\n pass\n User.objects.create_superuser(username='admin', password='admin', email='')\n print('> Superuser was created')\n\n try:\n User.objects.get(username='user1').delete()\n e...
[ "0.71427906", "0.7075445", "0.70696133", "0.6956832", "0.69370914", "0.69226545", "0.69196904", "0.6876954", "0.6860897", "0.6851691", "0.68289316", "0.6813722", "0.6799126", "0.678046", "0.6766399", "0.6734122", "0.670535", "0.67013645", "0.6671155", "0.6652721", "0.663768",...
0.64889866
42
Used to identify billing contact for stripe.
def email(self): billing_contact = self.owner.organization_user.user return billing_contact.email
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def billing_contact(self):\n return self._billing_contact", "def get_billing_phone(self):\n if self.billing_phone:\n return self.billing_phone\n else:\n return self.contact.phone", "def get_billing_name(self):\n if self.billing_name:\n return self.bi...
[ "0.7473322", "0.70917904", "0.70506287", "0.67928725", "0.6522469", "0.6520297", "0.6471558", "0.64629865", "0.6441742", "0.62100846", "0.62100846", "0.62100846", "0.62068194", "0.6200433", "0.61957145", "0.61838496", "0.61838496", "0.61832756", "0.61832756", "0.6139515", "0....
0.5277616
44
Non pending means active
def is_active(self): return not self.pending
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pending(self):\n return 0", "def is_pending(self):\n if self.status == \"PENDING\":\n return True\n else:\n return False", "def is_pending(self):\n return self._state == \"PENDING\"", "def active(self):\n resp = self.server.request(\"get\", \"/jobs...
[ "0.7105372", "0.66958797", "0.6692705", "0.6672039", "0.6651602", "0.662965", "0.6618941", "0.6522897", "0.6522897", "0.6522897", "0.6522897", "0.65002215", "0.6440229", "0.6407704", "0.63877517", "0.63579935", "0.6328006", "0.6260277", "0.6249674", "0.62359685", "0.62300056"...
0.7400021
0
This function parses the database path that get from the load file function
def parse(database_path: str) -> str: new_path = database_path.split("/") database_file_name = './' + new_path[-1] return database_file_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_file():\n global list_of_table, data_base, new_data\n open_name = askopenfilename()\n\n if Path(open_name).suffix == '.db':\n data_base = open_name\n data_base = str(data_base)\n new_data_base = parse(data_base)\n new_data = update_list_tables(new_data_base)\n n...
[ "0.6662973", "0.6634628", "0.6515047", "0.62259877", "0.62149435", "0.6212921", "0.61982244", "0.61602557", "0.6147627", "0.61391324", "0.61344475", "0.6088236", "0.60781986", "0.60295606", "0.6013678", "0.5962346", "0.59537405", "0.5914958", "0.5899533", "0.5890997", "0.5873...
0.72006804
0
This function creates a database table with columns Name, Author and Year of publication and writes the data in columns
def create_table(enter_data_base: str, enter_table: str, enter_data: list): if type(enter_table) is not str: raise ValueError('имя таблицы должно быть строковым!') # тут переделать, ошибка должна выводиться графически con = sqlite3.connect(enter_data_base) cur = con.cursor() q = """ CR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_tables(con):\n\n with con:\n con.execute(\"\"\"\n CREATE TABLE authorpapers (\n id TEXT NOT NULL PRIMARY KEY,\n value TEXT\n );\n \"\"\")\n \n \n #w...
[ "0.70978755", "0.6764927", "0.6701975", "0.6687749", "0.66081023", "0.6574021", "0.6573256", "0.65608567", "0.65482867", "0.6460649", "0.64566964", "0.643671", "0.64175105", "0.6406719", "0.63872653", "0.63358754", "0.6276282", "0.62323153", "0.62129724", "0.62066215", "0.618...
0.6143731
23
This function gets the list of tables from the database and displays them on the main screen
def update_list_tables(special_data: str) -> list: global list_of_table data_for_list_of_table = get_inform_from_db(special_data) list_of_table = Listbox(root, selectmode=SINGLE, height=7) but_load = ttk.Button(text=" Загрузить ", command=output) for i in data_for_list_of_table: for j in i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showTables():\n global cursor\n #cursor.execute('SELECT * FROM *')\n cursor.execute('''SELECT * FROM sqlite_master WHERE type='table' ''')\n\n tables = cursor.fetchall()\n print \"Tables available are:\"\n print tables[0]", "def show_tables(db_name):\n output = execute_sql(db_name, \"SEL...
[ "0.81856877", "0.7911885", "0.771189", "0.7709573", "0.76837826", "0.735472", "0.7247656", "0.72004396", "0.7198398", "0.7196348", "0.71636117", "0.7123414", "0.7094931", "0.7079472", "0.7044024", "0.7031659", "0.70177275", "0.7013747", "0.69522774", "0.6946213", "0.69361037"...
0.0
-1
This function displays a window for the enter data to the user when creating a table
def create_win_create_table(): global data_base, table, enter_table_name, win_create_table, enter_column_values if data_base == '': mistake_load_table() else: win_create_table = Toplevel(root) win_create_table.title("Ввод") win_create_table.geometry('320x150') win_cre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_enter_window():\n global data, record, column_names, win_create_add_str\n try:\n column_names = data[0]\n win_create_add_str = Toplevel(root, relief=SUNKEN, bd=10, bg=\"light sky blue\")\n win_create_add_str.title(\"Окно ввода\")\n win_create_add_str.minsize(width=500, ...
[ "0.73735327", "0.6828619", "0.6776213", "0.6675097", "0.6648047", "0.6610913", "0.6559444", "0.6490088", "0.64710647", "0.6443968", "0.6404274", "0.63451195", "0.63008195", "0.6294918", "0.6258528", "0.6209054", "0.6143737", "0.61309594", "0.6127621", "0.61190337", "0.6094487...
0.7440231
0
This function create new database file with table
def create_new_db(): global data_base, table data_base = asksaveasfilename(title="Select file", filetypes=(("DATA BASE", "*.db"), ("all files", "*.*")), defaultextension='.db') if Path(data_base).suffix == '.db': create_win_create_table() else: mistake_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_table(dbname, table_name, list_of_columns):\r\n\r\n\tc = sqlite3.connect(dbname)\r\n\tcolums = [ c_name +' ' +data_type for c_name, data_type in list_of_columns ]\r\n\tcreate_columns_str = ', '.join(colums)\r\n\tcurs = c.cursor()\r\n\tcurs.execute( ''' create table {0} ({1})'''.format(table_name, create...
[ "0.7579963", "0.75358784", "0.7362639", "0.73544276", "0.73512906", "0.7316812", "0.7285391", "0.72684366", "0.7264738", "0.7213389", "0.7213389", "0.72087604", "0.72061014", "0.7203377", "0.71530145", "0.71448", "0.7108601", "0.70948476", "0.70811826", "0.70739156", "0.70737...
0.791012
0
This function displays an error message when loading a database file if the user tries to download a file with a different extension
def mistake_db_file(): win_mistake_load_file = Toplevel(root) win_mistake_load_file.title("Ошибка") win_mistake_load_file.geometry('270x40') message = Label(win_mistake_load_file, text="Файл должен быть с расширением .db!", width=45, height=2) message.place(x=-30, y=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_error(self, error=None):\n if error is not None or str(error).strip() != \"\":\n dial = wx.MessageDialog(self.parent, str(error),\n 'Error Loading File',\n wx.OK | wx.ICON_EXCLAMATION)\n dial.ShowModal()", ...
[ "0.6676496", "0.6330044", "0.6121887", "0.6109673", "0.60543114", "0.5953958", "0.58574927", "0.5721498", "0.5705456", "0.56341153", "0.56212044", "0.56002396", "0.55826026", "0.5580493", "0.5550471", "0.54714227", "0.5465321", "0.5450314", "0.54160666", "0.5412863", "0.54100...
0.660544
1
This function loads a file with the extension .db and displays a list of tables
def load_file(): global list_of_table, data_base, new_data open_name = askopenfilename() if Path(open_name).suffix == '.db': data_base = open_name data_base = str(data_base) new_data_base = parse(data_base) new_data = update_list_tables(new_data_base) new_data.clear(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enumerate_tables(self, files=False):\n dbinfo = self.stru.readrec(1)\n if dbinfo[:1] != b\"\\x03\":\n print(\"WARN: expected dbinfo to start with 0x03\")\n try:\n dbdef = self.decode_db_definition(dbinfo[1:])\n except Exception as e:\n print(\"ERROR ...
[ "0.68099165", "0.67694", "0.6673958", "0.65166104", "0.6402736", "0.6373919", "0.6368217", "0.6343859", "0.6336732", "0.6333176", "0.6332147", "0.63183755", "0.63158333", "0.6315517", "0.63022494", "0.6299106", "0.6241761", "0.62272054", "0.61859334", "0.61509603", "0.6133241...
0.7127736
0
This function displays an error message when deleting a system table from database
def mistake_del_table(): win_mistake_del_table = Toplevel(root) win_mistake_del_table.title("Ошибка") win_mistake_del_table.geometry('350x40') message = Label(win_mistake_del_table, text="Эта таблица является системной и не может быть удалена!", width=45, height=2) message.place(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_table():\n global data_base, table, output_on_display\n try:\n sqlite3_simple_delete_table(data_base, table)\n list_tables = update_list_tables(data_base)\n list_tables.clear()\n output_on_display.delete(1.0, END)\n output_on_display.insert(END, '')\n return\...
[ "0.6654895", "0.65877056", "0.65477324", "0.64933014", "0.6381418", "0.62227684", "0.62015164", "0.6181133", "0.6078354", "0.6063406", "0.6061685", "0.6028653", "0.60269797", "0.6018508", "0.59979624", "0.59774035", "0.5962228", "0.59599286", "0.59167427", "0.59083545", "0.58...
0.661488
1
This function deletes a table from the database and displays an updated list of tables
def del_table(): global data_base, table, output_on_display try: sqlite3_simple_delete_table(data_base, table) list_tables = update_list_tables(data_base) list_tables.clear() output_on_display.delete(1.0, END) output_on_display.insert(END, '') return except sq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _delete_table(self, db, table_name):\n pass", "def delete_table(self, name: str) -> None:", "def deleteTable(self):\n return self.db.table_drop(self.entity).run(self.r)", "def refresh_tables(db):\r\n try:\r\n c = db.cursor()\r\n c.execute(\"DROP TABLE waiting\")\r\n ...
[ "0.7162452", "0.70870405", "0.68540466", "0.6841408", "0.67404747", "0.6705394", "0.663939", "0.6615974", "0.6569918", "0.65626705", "0.65599054", "0.6553217", "0.6483717", "0.6467993", "0.64381915", "0.64352286", "0.64161044", "0.63911146", "0.632093", "0.6311984", "0.630951...
0.7946719
0
This function delete all records from selected table
def clear_data_from_table(): global data_base, table sqlite3_simple_clear_table(data_base, table) output_on_display.delete(1.0, END) output_on_display.insert(END, '') return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_all_records():\n delete_alles = Customer.delete().where(Customer.name >= '')\n delete_alles.execute()", "def delete_all_rows(self, table):\n sql = f\"DELETE FROM {table}\"\n connection = self.__create_connection()\n cur = connection.cursor()\n cur.execute(sql)\n c...
[ "0.79204607", "0.7904079", "0.76957136", "0.76453316", "0.7552188", "0.75232035", "0.7377418", "0.71285075", "0.71117514", "0.707288", "0.70441645", "0.69829375", "0.6958193", "0.69394964", "0.69227576", "0.686041", "0.68498546", "0.6835985", "0.6813856", "0.68101794", "0.678...
0.63344795
70
This function displays data from the table on the main screen
def output() -> tuple: global new_data, data, table, list_of_table, import_lst, win_create_add_str, win_create_delete_str, \ win_create_update_str clear_table = ttk.Button(root, text=" Очистить таблицу ", command=clear_data_from_table) delete_table = ttk.Button(root, text=" Удалить таблицу ", com...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_data():", "def show_table():\n\n title_list = ('ID', 'Platform', 'Producer', 'Year', 'Elements')\n \n return table, title_list", "def show_table(table):\n # id: string\n # Unique and random generated (at least 2 special char()expect: ';'),\n # 2 number, 2 lower and 2 upper case lette...
[ "0.72488123", "0.70464164", "0.6966951", "0.68588865", "0.68008476", "0.67844445", "0.6752285", "0.6730072", "0.66814035", "0.66735846", "0.661881", "0.6599597", "0.6593331", "0.65307325", "0.6511588", "0.6490939", "0.6447004", "0.6427497", "0.6349858", "0.63227373", "0.62970...
0.5868106
88
This function gets list of tables from database
def get_inform_from_db(database_file_name: str) -> list: global data con = sqlite3.connect(database_file_name) cur = con.cursor() master = 'sqlite_master' query = "SELECT name FROM " + master + " WHERE type = 'table'" cur.execute(query) data = cur.fetchall() return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tables(self, db_name):\n pass", "def query_tables(self):\n # Find all tables\n tables_q = \"SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE \\'sqlite_%\\';\"\n tables = self.query(tables_q)\n # print(tables)\n return tables", "def list_tab...
[ "0.8151764", "0.80917966", "0.8024629", "0.80212116", "0.80164826", "0.80131805", "0.8008313", "0.80006474", "0.7976403", "0.7919773", "0.78916883", "0.78312516", "0.78238815", "0.78136", "0.7807571", "0.77961", "0.7795113", "0.77885765", "0.77870834", "0.7719374", "0.771922"...
0.6685399
64
This function displays an error message when user try to do operation with strings before loading table
def mistake_load_table(): text_message = "Сначала загрузите таблицу!" if data_base == '': text_message = 'Сначала загрузите базу данных или создайте новую!' win_mistake_load_table = Toplevel(root) win_mistake_load_table.title("Ошибка") win_mistake_load_table.geometry('330x40') message = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_error(self, error=None):\n if error is not None or str(error).strip() != \"\":\n dial = wx.MessageDialog(self.parent, str(error),\n 'Error Loading File',\n wx.OK | wx.ICON_EXCLAMATION)\n dial.ShowModal()", ...
[ "0.60021985", "0.58556074", "0.5767596", "0.5670003", "0.5546288", "0.5544397", "0.5540195", "0.55215293", "0.5498016", "0.54782134", "0.54715085", "0.5402569", "0.53950846", "0.53866684", "0.5357994", "0.5324931", "0.5294169", "0.52918345", "0.5287677", "0.52796155", "0.5273...
0.6704388
0
This function creates a window for entering data when adding a row to the table
def create_enter_window(): global data, record, column_names, win_create_add_str try: column_names = data[0] win_create_add_str = Toplevel(root, relief=SUNKEN, bd=10, bg="light sky blue") win_create_add_str.title("Окно ввода") win_create_add_str.minsize(width=500, height=200) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self):\n try:\n self.active_table.add_row(Row.Row([obj.get() for obj in self.enter_values]))\n self.parent.display_content()\n self.master.withdraw()\n except UnableToCastException as err:\n messagebox.showerror(\"Error\", err)", "def create_win_c...
[ "0.76981956", "0.7102062", "0.7040199", "0.68071455", "0.6736525", "0.6724013", "0.6650073", "0.660719", "0.66064", "0.6562622", "0.6537641", "0.64963937", "0.6444856", "0.63859785", "0.6373158", "0.63544244", "0.6330035", "0.6299755", "0.62529474", "0.62145746", "0.6196938",...
0.8013944
0
This function creates input fields when adding a new string depending on the number of columns in the table
def create_enter_entry(window) -> list: global record, column_names count = len(column_names) x = 0 y = 0 width = 100 height = 15 while count != 0: for i in column_names: sign = Label(window, text=str(i), width=10, height=2, bg="light sky blue", fg="black", bd=10) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(table):\n\n generated = common.generate_random(table)\n\n list_labels = ['Title: ', 'Manufacturer: ', 'Price: ', 'Number in stock: ']\n\n inputs = list_labels[:]\n\n while not inputs[2].isdigit() or not inputs[3].isdigit():\n inputs = ui.get_inputs(list_labels, 'Provide data: ')\n\n i...
[ "0.67563856", "0.653038", "0.64419556", "0.6365631", "0.608615", "0.6031318", "0.6004402", "0.59778625", "0.5957364", "0.59535515", "0.59236443", "0.5833057", "0.581279", "0.5760553", "0.5755834", "0.5738046", "0.56586844", "0.5634953", "0.5591093", "0.5568975", "0.554224", ...
0.5126834
62
This function displays an error message when the user has not completed all fields
def mistake_enter_fields(): win_mistake_enter_fields = Toplevel(root) win_mistake_enter_fields.title("Ошибка") win_mistake_enter_fields.geometry('200x40') message = Label(win_mistake_enter_fields, text="Сначала заполните все поля!", width=30, height=2) message.place(x=-5, y=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_entries(self):\n message = ''\n if self.class_name.text() == '' or \\\n self.title.text() == '' or \\\n self.description.text() == '' or \\\n self.module_name.text() == '' or \\\n self.plugin_version.text() == '' or \\\n self.qgis_minimum...
[ "0.6311876", "0.621369", "0.6174244", "0.61621666", "0.6060079", "0.60552263", "0.60515344", "0.6045178", "0.6025438", "0.59987116", "0.59888566", "0.5968636", "0.5968636", "0.59649473", "0.5945739", "0.59429103", "0.5912132", "0.59105366", "0.58923626", "0.5861865", "0.58495...
0.5602053
47
This function creates a field for entering data and selecting a parameter for searching
def create_delete_entry(columns: list, win, x: int, y: int): global choice, search_delete_enter window_for_search = Frame(win) window_for_search.place(x=x, y=y) search_delete_enter = ttk.Combobox(window_for_search, values=columns, height=3) search_delete_enter.set(u'Выбор параметра') search_dele...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enter_searching_option(field):\n valid_data = False\n # used to keep track of the values and change them in other scopes\n input_data = {field: ''}\n\n tasks_entries = Task.select()\n data_set = set() # this way we guarantee no repeated elements.\n for task in tasks_entries:\n if fiel...
[ "0.6321956", "0.60505444", "0.60505444", "0.5935494", "0.5850035", "0.5839338", "0.57026756", "0.5670232", "0.5662422", "0.56608534", "0.5652583", "0.5640161", "0.56091267", "0.55623454", "0.5528236", "0.5508247", "0.5484483", "0.5478965", "0.54679734", "0.5464777", "0.541193...
0.0
-1
This function displays an error message when the user has not selected value from list
def mistake_select_value(): win5 = Toplevel(root) win5.title("Ошибка") win5.geometry('270x40') lbl12 = Label(win5, text="Сначала выберите значение из списка!", width=45, height=2) lbl12.place(x=-30, y=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_error():\n print(\"Incorrect Selection, try again!\\n\")", "def validate_input(value):\n try:\n values = ['1', '2', '3', '4']\n if value not in values:\n raise ValueError\n except ValueError:\n print(f\"Invalid selection, you typed '{value}'. Please try again.\\...
[ "0.667603", "0.6644358", "0.6129078", "0.6110774", "0.60784805", "0.6046811", "0.60174584", "0.6001039", "0.5969605", "0.58870775", "0.58794403", "0.5866474", "0.58491445", "0.5805711", "0.5803251", "0.5781381", "0.57663655", "0.5760106", "0.5709198", "0.57025206", "0.5667328...
0.6572737
2
This function displays an error message when value not found in database
def mistake_not_found(): win6 = Toplevel(root) win6.title("Ошибка") win6.geometry('270x40') lbl13 = Label(win6, text="Значение не найдено в базе данных!", width=45, height=2) lbl13.place(x=-30, y=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_err(qry):\n if qry is None:\n QtGui.QMessageBox.critical(None, \"Database Error\", \"An unknown error occurred\")\n else:\n QtGui.QMessageBox.critical(None, \"Database Error\", qry.lastError().text())\n return", "def not_found(error):\n pass", "def _make_not_found_message(index...
[ "0.69354254", "0.68821234", "0.6453071", "0.6453027", "0.6096106", "0.60848355", "0.6070349", "0.6036732", "0.60326976", "0.60308945", "0.6019939", "0.5994712", "0.5992942", "0.59832376", "0.5959293", "0.5921559", "0.59122944", "0.5865269", "0.5856475", "0.58353066", "0.58343...
0.66639805
2
This function get list of results from table
def get_result_from_db() -> list: global choice, confirmation, res, data, column_names, result, choice_row column_names = data[0] try: confirmation.after(1, confirmation.destroy) except AttributeError: pass choice_row = choice.get() res = place_for_enter.get() if choice_row i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_rows(self, tbl):\n statmt = \"select * from %s\" % tbl\n self.cur.execute(statmt)\n rows = list(self.cur.fetchall())\n return rows", "def parse_results(table):\n results = []\n\n # FILL IN THE BLANK: Read each row from the table and append it to\n # `results` as a lis...
[ "0.7201663", "0.69741863", "0.6922706", "0.6825981", "0.6722853", "0.67207307", "0.66294307", "0.65991855", "0.6567037", "0.65582037", "0.6554799", "0.6532715", "0.653177", "0.65274173", "0.6497115", "0.6490826", "0.6462165", "0.6444761", "0.64141095", "0.6394525", "0.6381276...
0.0
-1
This function display list of results on the delete screen
def choice_of_param(): global output1, confirmation, win_create_delete_str, result result = get_result_from_db() if result == 'Значение не найдено в базе данных!': output1.delete(1.0, END) mistake_not_found() output1.delete(1.0, END) if len(result) == 1: confirmation = Label...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteResults(self):\n if self.results is None:\n self.results = self.dat.flowsheet.results\n else:\n if self.results.empty:\n self.results = self.dat.flowsheet.results\n\n msgBox = QMessageBox()\n msgBox.setText(\"Delete selected data?\")\n ...
[ "0.6687541", "0.61791056", "0.60764945", "0.60736763", "0.60502845", "0.6036262", "0.6014524", "0.6014524", "0.6014524", "0.60058546", "0.5941081", "0.5936041", "0.59142554", "0.58997744", "0.58760244", "0.58523536", "0.5825482", "0.5813378", "0.5812556", "0.58099663", "0.578...
0.0
-1
This function deletes the label, the display field and the input field in the delete window
def cancel(): global confirmation, output1, place_for_enter output1.delete(1.0, END) confirmation.after(1, confirmation.destroy) place_for_enter.delete(0, END)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _del_label(self):\n label = self.combobox.currentText()\n if label:\n button = QMessageBox.warning(self, \"Delete label\", \n \"Are you sure that you want to delete label %s ?\" % label,\n QMessageBox.Yes,\n QMessageBox.No)\n ...
[ "0.68570364", "0.6694559", "0.6560293", "0.65464425", "0.64800674", "0.627046", "0.6270104", "0.6245564", "0.6212683", "0.6194225", "0.6186369", "0.6146294", "0.61425877", "0.6127438", "0.6122861", "0.6100436", "0.60654384", "0.6043302", "0.60417825", "0.6039158", "0.60209805...
0.0
-1
This function removes the selected row from the database table and clears the output window
def delete_record(): global data_base, table, choice, res, confirmation, output1, place_for_enter, choice_row choice_row = choice.get() sqlite3_simple_delete_record(data_base, table, choice_row, res) output1.delete(1.0, END) confirmation.after(1, confirmation.destroy) place_for_enter.delete(0, E...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_selected_rows(self):\n self._export_mode = 'delete'\n self._counter_update_data += 1", "def remove_row(self):\n if len(self.columns[\"rows\"].children) > 0:\n self.selects.pop()\n self.button_groups.pop()\n self.buttons[\"edit\"].pop()\n ...
[ "0.74557406", "0.7219241", "0.7186674", "0.6908784", "0.6822604", "0.680543", "0.66769534", "0.6656673", "0.65913564", "0.6481285", "0.6470902", "0.6469954", "0.64637715", "0.6451161", "0.6443345", "0.6439615", "0.64303637", "0.6414022", "0.64056695", "0.63812506", "0.6377254...
0.7020794
3
This function update value in table
def update_record(): global data_base, table, choice, res, output1, result, column_names, choice_row, number_str a = output1.get('1.0', END) a = a[0:-1] changed_string = a.split('\n') changed_string = changed_string[0:-2] number_str = int(number_str) - 1 source_string = [] for i in resu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_item(self, table, item):", "def update(table, id_):\n\n # your code\n key = common.check_for_key(id_,table)\n if key == None:\n ui.print_error_message('Key does not exist')\n else:\n return_inputs = ui.get_inputs(['Name', 'Age'], 'Enter New Values')\n modif_index = ke...
[ "0.7195626", "0.71301425", "0.7083458", "0.6921272", "0.6920826", "0.69184405", "0.67723674", "0.6649345", "0.6602674", "0.65975416", "0.6586811", "0.65607226", "0.6554011", "0.65178514", "0.64959", "0.6476502", "0.64595133", "0.6450942", "0.64192855", "0.6414283", "0.6407026...
0.5903115
75
This function display list of results on the main screen
def choice_param_of_search(): global result, output_on_display, choice, entry1, place_for_enter, search_delete_enter, import_lst import_lst.clear() choice = search_delete_enter place_for_enter = entry1 result = get_result_from_db() if result == 'Значение не найдено в базе данных!': outpu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_results():\n pass", "def _display_results(self):\n self._display_summary()\n self._display_domain_record()\n self._display_ip_record()\n self._display_cert_details()\n self._display_ti_data()\n self._display_screenshot()\n self._display_related_aler...
[ "0.83260554", "0.7667323", "0.72036177", "0.71791404", "0.71505195", "0.7126996", "0.71076846", "0.71017224", "0.70743674", "0.70631224", "0.70126164", "0.69848496", "0.69785136", "0.6952008", "0.69464207", "0.6874601", "0.687232", "0.6776341", "0.67375004", "0.67318404", "0....
0.0
-1
This function create window for delete record in the table of database
def create_delete_window(): global data, column_names, output1, win_create_delete_str, place_for_enter try: column_names = data[0] win_create_delete_str = Toplevel(root, relief=SUNKEN, bd=10, bg="light sky blue") win_create_delete_str.title("Окно выбора данных") win_create_delete...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_record():\n global data_base, table, choice, res, confirmation, output1, place_for_enter, choice_row\n choice_row = choice.get()\n sqlite3_simple_delete_record(data_base, table, choice_row, res)\n output1.delete(1.0, END)\n confirmation.after(1, confirmation.destroy)\n place_for_enter....
[ "0.728897", "0.6733543", "0.64978063", "0.64593697", "0.64210594", "0.63642997", "0.632088", "0.6294666", "0.6282508", "0.6248629", "0.61855114", "0.6184242", "0.61679405", "0.61418015", "0.6137974", "0.61366755", "0.6108344", "0.61065406", "0.60431963", "0.6028281", "0.60151...
0.73253214
0
This function displays a string to update if more than one match has been found
def get_choose(): global result, choose, win_update_concurrence, output1, confirmation, win_create_update_str, number_str number_str = choose.get() result = result[int(number_str) - 1] output1.delete(1.0, END) for i in result: output1.insert(END, str(i) + '\n') confirmation.destroy() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multiple_matches():\n message = \"\"\"\nFound multiple matches for the commit you specified.\nTry perhaps switching to change ID instead of commit:\n\n $ {0}\n\n\"\"\".format(crayons.red(\"commtrack --changeid xyz\"))\n return message", "def find_replace_next(self):\n old_term = self.text_fin...
[ "0.6190434", "0.59913266", "0.5901115", "0.5901115", "0.5871796", "0.5871796", "0.57230914", "0.56985223", "0.56985223", "0.56765187", "0.56706536", "0.56257224", "0.5538803", "0.55297375", "0.55297375", "0.5523892", "0.5502385", "0.5478487", "0.54620564", "0.5458424", "0.545...
0.0
-1
This function displays a data selection window if more than one row was found during the update
def find_more_one_str(): global win_update_concurrence, choose win_update_concurrence = Toplevel(win_create_update_str) win_update_concurrence.title("Выберите значение") win_update_concurrence.geometry('240x60') win_update_concurrence.resizable(height=False, width=False) lbl12 = Label(win_update...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleTableSelectionChange(self):\n self.selectEntireRow()\n self.showSelectedDataset()", "def choice_of_update_param() -> list:\n global choice, output1, confirmation, res, data, column_names, win_create_update_str, result, \\\n choice_row, my_lst, zero, place_for_enter\n column_n...
[ "0.6324238", "0.6166158", "0.61161274", "0.5934321", "0.58876103", "0.58652633", "0.58027035", "0.57484275", "0.57359034", "0.5689515", "0.5619296", "0.5567521", "0.55573434", "0.55040693", "0.5499293", "0.5486833", "0.5486389", "0.54587406", "0.54385203", "0.54080194", "0.54...
0.5169337
49
This function searches the database and displays founded values found on the screen of updating string
def choice_of_update_param() -> list: global choice, output1, confirmation, res, data, column_names, win_create_update_str, result, \ choice_row, my_lst, zero, place_for_enter column_names = data[0] try: confirmation.after(1, confirmation.destroy) except AttributeError: pass ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_query(self):\n text = self.lineedit.text()\n self.results = self.lookup(text)\n self.update_ui()\n self.copy_entry(self.table.currentRow(), self.table.currentColumn())", "def search():\n query = input('Please enter your search query\\n')\n # For now, we will just prin...
[ "0.6535333", "0.6395913", "0.62180847", "0.6058535", "0.6045834", "0.59272116", "0.59269756", "0.5834729", "0.5821672", "0.58050346", "0.5800894", "0.5800497", "0.5795469", "0.57894886", "0.5775377", "0.57641786", "0.5762918", "0.575037", "0.57325363", "0.57288337", "0.570192...
0.540927
41
This function create window for update record in the table of database
def create_update_window(): global data, column_names, output1, place_for_enter, win_create_update_str try: column_names = data[0] win_create_update_str = Toplevel(root, relief=SUNKEN, bd=10, bg="light sky blue") win_create_update_str.title("Окно выбора данных") win_create_update...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_enter_window():\n global data, record, column_names, win_create_add_str\n try:\n column_names = data[0]\n win_create_add_str = Toplevel(root, relief=SUNKEN, bd=10, bg=\"light sky blue\")\n win_create_add_str.title(\"Окно ввода\")\n win_create_add_str.minsize(width=500, ...
[ "0.62114245", "0.6144669", "0.61412287", "0.6117684", "0.6080887", "0.60511154", "0.60195816", "0.59972525", "0.59922194", "0.598121", "0.5960823", "0.59477824", "0.5914867", "0.58772355", "0.5807761", "0.5768228", "0.576147", "0.5749111", "0.57381135", "0.57372934", "0.57203...
0.6832931
0
This function clears the main screen after the search and displays information from the table again
def cancel_main(): entry1.delete(0, END) output_on_display.delete(1.0, END) output()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_search(self, widget, data=None):\n self.artist_name.set_text(\"\")\n self.song_name.set_text(\"\")\n self.status_bar.hide()\n self.lyrics_view.hide()\n self.scroll.hide()\n self.window.resize(self.width, self.height)", "def search_frame():\r\n global file, spl...
[ "0.6433768", "0.64058405", "0.6371596", "0.62849873", "0.62610984", "0.62200284", "0.6216858", "0.6130722", "0.6079597", "0.6079251", "0.6056053", "0.6053226", "0.6045311", "0.6016955", "0.6003708", "0.595994", "0.59328634", "0.59241474", "0.58641803", "0.5832321", "0.5821074...
0.0
-1
This function receives information from the main screen and writes it to a file with the extension txt
def save_txt_file(): global output_on_display if data_base == '': mistake_load_table() else: save_name = asksaveasfilename(title="Select file", filetypes=(("TXT", "*.txt"), ("all files", "*.*")), defaultextension='.txt') if Path(save_name).suffix...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_file():\n filepath = asksaveasfilename(\n defaultextension=\"txt\",\n filetypes=[(\"Text Files\", \"*.txt\"), (\"All Files\", \"*.*\")],\n )\n if not filepath:\n return\n with open(filepath, \"w\") as output_file:\n text = txt_edit.get(\"1.0\", tk.END)\n outp...
[ "0.74791944", "0.69363564", "0.68939584", "0.6844553", "0.6811746", "0.6766754", "0.6766161", "0.6702598", "0.67015916", "0.6581492", "0.6572639", "0.65541923", "0.65033996", "0.6441865", "0.6434158", "0.6432803", "0.64298", "0.6387638", "0.63765246", "0.63361615", "0.6323934...
0.73890835
1
This function receives information from the main screen and writes it to a file with the extension csv
def save_csv_file(): global output_on_display, import_lst, column_names, data if data_base == '': mistake_load_table() else: column_names = data[0] save_name = asksaveasfilename(title="Select file", filetypes=(("CSV", "*.csv"), ("all files", "*.*")), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataSave():\n # NR5G = gui_reader()\n try: #Python3\n f = open(__file__ + \".csv\",'wt', encoding='utf-8')\n except:\n f = open(__file__ + \".csv\",'wb')\n f.write('%s,'%(entryCol.entry0.get()))\n f.write('%s,'%(entryCol.entry1.get()))\n f.write('%s,'%(entryCol.entry2.get()))\n ...
[ "0.7729314", "0.7327067", "0.7005893", "0.6922315", "0.6882394", "0.68259627", "0.67552376", "0.6754796", "0.6724929", "0.6693639", "0.6688815", "0.66777986", "0.66453063", "0.6644166", "0.6636141", "0.6627853", "0.6618472", "0.6584091", "0.65767205", "0.65737665", "0.6528909...
0.73807514
1
This function receives information from the main screen and writes it to a file with the extension xml
def save_xml_file(): global output_on_display, import_lst, column_names, data if data_base == '': mistake_load_table() else: column_names = data[0] step = len(column_names) save_name = asksaveasfilename(title="Select file", filetypes=(("XML", "*.xml"), ("all files", "*.*")),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saving_file(xml):\r\n\r\n xml_string = etree.tostring(xml)\r\n parsed = minidom.parseString(xml_string)\r\n with open(self.app_path + \"\\\\temp_\\\\\" + file_name + \".xml\", \"w\") as file:\r\n file.write(parsed.toprettyxml(indent=\" \"))", "def Write_...
[ "0.6510305", "0.638419", "0.6030191", "0.59556884", "0.59091735", "0.58452505", "0.5840679", "0.5830671", "0.5812823", "0.5803744", "0.5800278", "0.57718843", "0.5763647", "0.5753673", "0.57429624", "0.570022", "0.56939936", "0.5663963", "0.5662339", "0.5658424", "0.5623261",...
0.59940106
3
This function receives information from the main screen and writes it to a file with the extension json
def save_json_file(): global output_on_display, import_lst, column_names, data, new_data if data_base == '': mistake_load_table() else: column_names = new_data step = len(column_names) save_name = asksaveasfilename(title="Select file", filetypes=(("JSON", "*.json"), ("all fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_to_file(data):\n\ttry:\n\t\toutput_file = open(\"output.json\", \"w\")\n\t\toutput_file.write(json.dumps(data))\n\texcept:\n\t print(Fore.GREEN + \"File not found or path is incorrect\")\n\tfinally:\n\t print(Fore.GREEN + \"Success go to output.json to look at the json\")", "def save(filename, ...
[ "0.6821808", "0.6820264", "0.68076766", "0.67360204", "0.6712457", "0.66676414", "0.66601896", "0.6612663", "0.6594357", "0.6560248", "0.6553303", "0.65516794", "0.6528116", "0.65225524", "0.65145713", "0.6495577", "0.6492085", "0.6475345", "0.6475345", "0.6472494", "0.646146...
0.6361456
30
This function create the help window and displays buttons
def create_help_window(): global help_window help_window = Toplevel(root, relief=SUNKEN, bd=10, bg="light sky blue") help_window.title("Справка") help_window.minsize(width=1000, height=550) help_window.resizable(height=False, width=False) main_win_button = ttk.Button(help_window, text=" Главно...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def launchHelpWindow(self):\r\n self.popup(\"Help\",HELP,geom=\"350x200\")", "def displayhelp(self):\n helper = HelpView(self)\n helper.activateWindow()\n helper.exec()\n self.activateWindow()", "def createHelpWindow(self):\n if (not hasattr(self, \"help_window\")):\n ...
[ "0.79253644", "0.7679262", "0.7674966", "0.75641143", "0.75594574", "0.7547027", "0.7531756", "0.7351548", "0.7341674", "0.72861767", "0.7257575", "0.7244118", "0.72432363", "0.72406936", "0.72369003", "0.7235147", "0.7235147", "0.7222865", "0.7207013", "0.7119255", "0.710910...
0.73606557
7
This function changes list of pictures and call help_main function, which create display for pictures
def help_add_db(): global picture_lst picture_lst = ["test/db1.jpg", "test/db2.jpg", "test/db3.jpg", "test/db4.jpg", "test/db5.jpg", "test/db6.jpg", "test/db7.jpg", "test/db8.jpg", "test/db9.jpg", "test/db10.jpg"] help_main()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_main_but():\n global picture_lst\n picture_lst = [\"test/main.png\", \"test/main2.jpg\", \"test/main3.jpg\", \"test/main4.jpg\", \"test/main5.jpg\",\n \"test/main6.jpg\"]\n help_main()", "def help_update_str():\n global picture_lst\n picture_lst = [\"test/update1.jpg\", ...
[ "0.794318", "0.7763487", "0.73832935", "0.7381354", "0.7262264", "0.71328026", "0.68740636", "0.6628999", "0.653108", "0.64236224", "0.63365847", "0.62702984", "0.6181143", "0.60906637", "0.60878396", "0.6066349", "0.605013", "0.6044749", "0.6041085", "0.60362417", "0.6031439...
0.6516445
9
This function changes list of pictures and call help_main function, which create display for pictures
def help_main_but(): global picture_lst picture_lst = ["test/main.png", "test/main2.jpg", "test/main3.jpg", "test/main4.jpg", "test/main5.jpg", "test/main6.jpg"] help_main()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_update_str():\n global picture_lst\n picture_lst = [\"test/update1.jpg\", \"test/update2.jpg\", \"test/update3.jpg\", \"test/update4.jpg\", \"test/update5.jpg\",\n \"test/update6.jpg\"]\n help_main()", "def help_load_file():\n global picture_lst\n picture_lst = [\"test/l...
[ "0.77632856", "0.7383563", "0.738099", "0.7261219", "0.713248", "0.6875759", "0.6629382", "0.6531717", "0.6516548", "0.6424569", "0.6337515", "0.6271372", "0.61820304", "0.6091347", "0.6087788", "0.60684943", "0.60505813", "0.60440516", "0.60422367", "0.6038367", "0.6031686",...
0.7941817
0
This function changes list of pictures and call help_main function, which create display for pictures
def help_add_str(): global picture_lst picture_lst = ["test/add1.jpg", "test/add2.jpg", "test/add3.jpg", "test/add4.jpg"] help_main()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_main_but():\n global picture_lst\n picture_lst = [\"test/main.png\", \"test/main2.jpg\", \"test/main3.jpg\", \"test/main4.jpg\", \"test/main5.jpg\",\n \"test/main6.jpg\"]\n help_main()", "def help_update_str():\n global picture_lst\n picture_lst = [\"test/update1.jpg\", ...
[ "0.79425746", "0.77630895", "0.73836595", "0.72621405", "0.7133004", "0.6876637", "0.66291463", "0.6532651", "0.6516761", "0.6424798", "0.63387024", "0.62726146", "0.6183507", "0.60914105", "0.6088568", "0.6069086", "0.6051887", "0.60462165", "0.60432994", "0.60386354", "0.60...
0.73811275
3
This function changes list of pictures and call help_main function, which create display for pictures
def help_load_file(): global picture_lst picture_lst = ["test/load1.png", "test/load2.png", "test/load3.png", "test/load4.png"] help_main()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_main_but():\n global picture_lst\n picture_lst = [\"test/main.png\", \"test/main2.jpg\", \"test/main3.jpg\", \"test/main4.jpg\", \"test/main5.jpg\",\n \"test/main6.jpg\"]\n help_main()", "def help_update_str():\n global picture_lst\n picture_lst = [\"test/update1.jpg\", ...
[ "0.794318", "0.7763487", "0.7381354", "0.7262264", "0.71328026", "0.68740636", "0.6628999", "0.653108", "0.6516445", "0.64236224", "0.63365847", "0.62702984", "0.6181143", "0.60906637", "0.60878396", "0.6066349", "0.605013", "0.6044749", "0.6041085", "0.60362417", "0.60314393...
0.73832935
2
This function changes list of pictures and call help_main function, which create display for pictures
def help_del_str(): global picture_lst picture_lst = ["test/del1.jpg", "test/del2.jpg", "test/del3.jpg", "test/del4.jpg", "test/del5.jpg"] help_main()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_main_but():\n global picture_lst\n picture_lst = [\"test/main.png\", \"test/main2.jpg\", \"test/main3.jpg\", \"test/main4.jpg\", \"test/main5.jpg\",\n \"test/main6.jpg\"]\n help_main()", "def help_update_str():\n global picture_lst\n picture_lst = [\"test/update1.jpg\", ...
[ "0.794318", "0.7763487", "0.73832935", "0.7381354", "0.7262264", "0.68740636", "0.6628999", "0.653108", "0.6516445", "0.64236224", "0.63365847", "0.62702984", "0.6181143", "0.60906637", "0.60878396", "0.6066349", "0.605013", "0.6044749", "0.6041085", "0.60362417", "0.60314393...
0.71328026
5
This function changes list of pictures and call help_main function, which create display for pictures
def help_download_file(): global picture_lst picture_lst = ["test/download1.png", "test/download2.png", "test/download3.png", "test/download4.png", "test/download5.png", "test/download6.png", "test/download7.png", "test/download8.png", "test/download9.png", "test/download10...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_main_but():\n global picture_lst\n picture_lst = [\"test/main.png\", \"test/main2.jpg\", \"test/main3.jpg\", \"test/main4.jpg\", \"test/main5.jpg\",\n \"test/main6.jpg\"]\n help_main()", "def help_update_str():\n global picture_lst\n picture_lst = [\"test/update1.jpg\", ...
[ "0.7941817", "0.77632856", "0.7383563", "0.738099", "0.7261219", "0.713248", "0.6875759", "0.6531717", "0.6516548", "0.6424569", "0.6337515", "0.6271372", "0.61820304", "0.6091347", "0.6087788", "0.60684943", "0.60505813", "0.60440516", "0.60422367", "0.6038367", "0.6031686",...
0.6629382
7