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
Test for delete_resource_from_index_position method
def test_delete_resource_from_index_position(self): s1 = System() b1 = Books("1984", "George Orwell", "Harvill Secker", "1949", "0123456789123") self.assertEqual(s1.delete_resource_from_index_position(0), print()) self.assertEqual(s1.delete_resource_from_index_position(-1), print()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_removing_index(self):", "def test_index_delete(self):\n a = self.test_index()\n a.delete()\n es = self.es\n es.refresh()\n r = es.search(query=StringQuery('zool'))\n eq_(r['hits']['total'], 0, \"We shouldn't get any hits.\")", "def test_delete_document(index_w...
[ "0.716394", "0.7033717", "0.6886999", "0.68802756", "0.6583773", "0.6499626", "0.64575", "0.6355071", "0.6347227", "0.63249075", "0.63136363", "0.6283639", "0.6282689", "0.6277738", "0.62753356", "0.62416536", "0.6220821", "0.6220821", "0.6212967", "0.6180838", "0.61782694", ...
0.82605475
0
Test for lending_process method
def test_lending_process(self): s1 = System() b1 = Books("1984", "George Orwell", "Harvill Secker", "1949", "0123456789123") m1 = Members("Richard", "Blackmore", "14-04-1945", "Weston") m2 = Members("Eric", "Eric Clapton", "30-03-1945", "Riplay") #test what happens if book not in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_startProcess(self):\r\n self.pm.addProcess(\"foo\", [\"foo\"])\r\n self.pm.startProcess(\"foo\")\r\n self.assertIsInstance(self.pm.protocols[\"foo\"], LoggingProtocol)\r\n self.assertIn(\"foo\", self.pm.timeStarted.keys())", "def process():\n pass", "def test_start_proce...
[ "0.6173282", "0.5930779", "0.589129", "0.58374673", "0.5807327", "0.57782507", "0.5777092", "0.5739012", "0.57290083", "0.56662744", "0.56134325", "0.55600566", "0.551325", "0.5463071", "0.5449737", "0.54214317", "0.54202276", "0.5412321", "0.5412321", "0.5412321", "0.5399937...
0.6112398
1
Test for return_book_process method
def return_book_process(self): s1 = System() b1 = Books("1984", "George Orwell", "Harvill Secker", "1949", "0123456789123") m1 = Members("Richard", "Blackmore", "14-04-1945", "Weston") s1.add_resource(b1) s1.lending_process(b1, m1) s1.remove_resource(b1) #prove th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_book():\n return render_template('process_book.html')", "def return_book(self, book_id, return_date):\r\n for book in LibraryDB.book_list:\r\n if book.book_id == book_id and book_id in [i.book_id for i in self.issued_books]:\r\n book.availability = True\r\n ...
[ "0.62140787", "0.61643386", "0.6148973", "0.5966506", "0.5959692", "0.59526885", "0.59435666", "0.57925487", "0.57628417", "0.57617724", "0.5734467", "0.5713324", "0.56746566", "0.5623255", "0.5604597", "0.55610216", "0.54859006", "0.54459155", "0.543411", "0.5414501", "0.538...
0.78834885
0
Test for send_notification method
def send_notification(self): s1 = System() b1 = Books("1984", "George Orwell", "Harvill Secker", "1949", "0123456789123") m1 = Members("Richard", "Blackmore", "14-04-1945", "Weston") s1.send_notification("Please return book") self.assertEqual(m1.get_notifications(), None) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_registered_with_notification(self):\n now = datetime.datetime.now()\n notification = reminders.Notification.objects.create(num_days=1,\n time_of_day=now)\n reminders.SentNotification.objects.create(notification=notification,\...
[ "0.73693633", "0.736051", "0.7148425", "0.7107555", "0.70434356", "0.70280105", "0.6939029", "0.69161195", "0.6906033", "0.6807772", "0.68013173", "0.6771862", "0.6753163", "0.6710827", "0.67098886", "0.67033494", "0.66510314", "0.6616835", "0.66149366", "0.66149366", "0.6571...
0.7050926
4
handle ADVISE updates received from the API
def parse_fields(self, cxn, data): trade_flag = False quote_flag = False pid = 'API_Symbol(%s)' % self.symbol if data == None: self.api.force_disconnect('LIVEQUOTE Advise has been terminated by API for %s' % pid) return self.update_rawdata(data) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_updates(self, update):\r\n self.__manage_pump()", "def _update_from_rest_data(self) -> None:", "async def _receive_updated_response(self, data):\n serialized_text_responses = await serialize_text_algo_api_response(data)\n await self.send_serialized_data(serialized_text_responses...
[ "0.60427433", "0.5982816", "0.5875664", "0.584655", "0.5830139", "0.57291996", "0.5651025", "0.5650159", "0.5627274", "0.56108737", "0.56108737", "0.56008923", "0.5590502", "0.5588436", "0.5569", "0.55347794", "0.5530559", "0.55248404", "0.55153596", "0.55139554", "0.5506361"...
0.0
-1
callable is stored and used to return results later
def __init__(self, api, id, label, callable, timeout=0): self.api = api self.id = id self.label = label self.callable = callable self.started = time.time() self.timeout = timeout or api.callback_timeout['DEFAULT'] self.api.debug(f"{self}.__init__(..., {self.id}, {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCallable():", "def __call__(self):\n return self.fn()", "def __call__(self, *args, **kw):\n return self.callable(*args, **kw)", "def call(self):", "def __call__():", "def __call__():", "def __call__():", "def __call__():", "def __call__():", "def __call__(fun_name):", "def ...
[ "0.75026315", "0.68841547", "0.6700387", "0.66829556", "0.66778564", "0.66778564", "0.66778564", "0.66778564", "0.66778564", "0.65903527", "0.6529461", "0.6515489", "0.6473615", "0.6470478", "0.63678133", "0.6330051", "0.63238966", "0.6317023", "0.6317023", "0.63108605", "0.6...
0.0
-1
complete callback by calling callable function with value of results
def complete(self, results): self.api.debug(f"{self}.complete({repr(results)[:DEBUG_TRUNCATE_RESULTS]})") self.elapsed = time.time() - self.started if not self.done: ret = self.format_results(results) # TODO: fix sendString test if self.callable.callback.__nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def callback(self, fun: Callable[[], None] | None) -> None:", "def callback(self, function: Optional[Callable[[int], None]]) -> None:", "def run_callback(func, plus, result):\n data = result.value\n error = None if result.successful() else \"%s\" % result.exception\n try:\n ...
[ "0.7457204", "0.70491445", "0.68082875", "0.67983425", "0.6777269", "0.6598992", "0.6598992", "0.65590227", "0.64615554", "0.6367073", "0.62865394", "0.6274837", "0.62670946", "0.62670946", "0.6266958", "0.61772156", "0.60854393", "0.60761684", "0.60678756", "0.6055987", "0.6...
0.61946976
15
handle input from rtgw
def gateway_receive(self, msg): if self.debug_api_messages: self.dump_input_message(msg) try: o = json.loads(msg) except Exception as e: return self.receive_exception(sys.exc_info()[0], e, msg) msg_type = o['type'] msg_id = o['id'] m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_input(data: dict):", "def _handleInput(self, paramInput):\n pass", "def process_input(self,r,g,b):\n pass", "def processInputs(self):", "def server_do(self,input, connstream):\r\n pass", "def scan_input(self):\n proc = subprocess.Popen([\"ssh\", \"-tt\", \"pi@127.0.0.1\...
[ "0.6189445", "0.59328586", "0.5913091", "0.5756145", "0.57243013", "0.57033956", "0.5689806", "0.5636688", "0.5594414", "0.5576588", "0.55494845", "0.5536093", "0.55195916", "0.5503228", "0.54935", "0.5488789", "0.5474541", "0.54526436", "0.54488224", "0.5446376", "0.5431604"...
0.0
-1
Upon connection to rtgw, start automatic queries
def setup_local_queries(self): #what='BANK,BRANCH,CUSTOMER,DEPOSIT' self.output("Sending initial Accounts query...") what = '*' self.rtx_request( 'ACCOUNT_GATEWAY', 'ORDER', 'ACCOUNT', what, '', 'accounts', self.handle_accounts, self.accountdata_callbacks, self.ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n self.conn.start()", "def _run_query(self):", "def run(self):\n print(\"[CONNEXION_MANAGER] start connecting\")\n while True:\n self.connexion_init()", "def run(self):\n self.connect()", "def start_task():\n get_results_from_message_queue()\n t...
[ "0.6515159", "0.6490055", "0.637998", "0.63385695", "0.62499195", "0.6226698", "0.6120617", "0.611012", "0.6016056", "0.60100394", "0.593291", "0.58946085", "0.5854323", "0.5812457", "0.58014137", "0.57888764", "0.5777909", "0.5777844", "0.5770826", "0.5759801", "0.57579243",...
0.6350499
3
send a rendered order out to clients
def send_order_update(self, fields, mapped=False): self.debug(f"{self} send_order_update({fields})") symbol = fields['symbol'] if not fields.get('cusip'): if mapped: self.debug(f"{self} order update is still missing CUSIP after mapping, continuing...") els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_order(self, p_order, p_in_out, count):\n pass", "def View_Inorder( self ):\r\n cb.order = 1\r\n self.system.Draw( )", "def View_Postorder( self ):\r\n cb.order = 2\r\n self.system.Draw( )", "def order_report():", "def update_order():", "def update_order():", ...
[ "0.6410005", "0.60245323", "0.5860148", "0.5844451", "0.58294475", "0.58294475", "0.57627046", "0.5727182", "0.5697262", "0.5686734", "0.55757695", "0.54803777", "0.54319847", "0.54175246", "0.54003465", "0.5390121", "0.5374137", "0.5370205", "0.532239", "0.5300777", "0.52997...
0.0
-1
send a rendered execution out to clients
def send_execution_update(self, fields, mapped=False): self.debug(f"{self} send_execution_update({fields})") symbol = fields['DISP_NAME'] if not fields.get('CUSIP'): if mapped: self.debug(f"{self} execution update is still missing CUSIP after mapping, continuing...") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render():\n html = request.get_data().decode('utf-8')\n sio.emit('render', html)\n return 'OK'", "def execute():\n # print('Wow')\n result = gui.controller.main('execute')\n print(result)\n\n return render_template('results.html', data=json.dumps(result))", "def run(self) -...
[ "0.67892045", "0.67863506", "0.667443", "0.65264904", "0.6506276", "0.6436311", "0.63117224", "0.6292312", "0.6266779", "0.62642807", "0.60074526", "0.60074526", "0.5999174", "0.5973102", "0.5965556", "0.5928218", "0.5914374", "0.58973056", "0.5872228", "0.5870342", "0.586916...
0.0
-1
Parse TQL ascii time field returning datetime.time
def parse_tql_time(self, data, pid, label): field = self.parse_tql_field(data, pid, label) if field: hour, minute, second = [int(i) for i in field.split(':')[0:3]] field = datetime.time(hour, minute, second) return field
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time(text_time):\n # return Observer.datetime_to_astropy_time(dt.datetime.strptime(text_time, '%d/%m/%Y %H:%M'))\n the_time = dt.datetime.strptime(text_time, '%d/%m/%Y %H:%M')\n return Time(the_time.strftime('%Y-%m-%d %H:%M'))\n #date = [int(i) for i in date.split('/')]", "def _parse_time_str...
[ "0.70914274", "0.70201325", "0.68314403", "0.67921424", "0.6737764", "0.66979635", "0.6697224", "0.6691148", "0.6679622", "0.6647432", "0.6640266", "0.6632124", "0.6588161", "0.6530218", "0.6529041", "0.65162116", "0.6500483", "0.64943856", "0.64922947", "0.64789206", "0.6478...
0.83321196
0
return API time corrected for local timezone
def localize_time(self, apitime): return self.feedzone.localize(apitime).astimezone(self.localzone)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timezone():\n \n pass", "def local_time():\n return datetime.datetime.now().isoformat()[:len('2017-01-24T10:44:00')]", "def _get_tz():\n return 'UTC'", "def _get_datetime():\n pst_now = datetime.datetime.utcnow().astimezone(pytz.timezone(\"America/Los_Angeles\"))\n return pst_now.strftime(\"...
[ "0.7212565", "0.7133227", "0.69550765", "0.67883587", "0.67642075", "0.66765994", "0.6640911", "0.6601219", "0.6600101", "0.6597976", "0.6597636", "0.6594265", "0.6589398", "0.6536743", "0.64989436", "0.6493774", "0.64692587", "0.6456862", "0.644002", "0.64021087", "0.6392668...
0.6696543
5
reverse localize_time to convert local timezone to API time
def unlocalize_time(self, apitime): return self.localzone.localize(apitime).astimezone(self.feedzone)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def localize_time(self, apitime):\n return self.feedzone.localize(apitime).astimezone(self.localzone)", "def localize_time_utc(non_utc_time):\n return pytz.utc.localize(non_utc_time)", "def localize_time_utc(non_utc_time):\n return pytz.utc.localize(non_utc_time)", "def localize(dt):\n if dt....
[ "0.70825297", "0.701795", "0.701795", "0.6822421", "0.652934", "0.652934", "0.652934", "0.64643", "0.642147", "0.64163226", "0.6324556", "0.626879", "0.6254991", "0.62439936", "0.6230229", "0.6203875", "0.62010545", "0.6193468", "0.6165171", "0.6119015", "0.60487807", "0.60...
0.6317597
11
called when staged order ticket request has been submitted with 'poke' and Ack has returned
def ticket_submit_ack_callback(self, data): self.output('staged order ticket submission acknowledged: %s' % repr(data))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def order_submit_ack_callback(self, data):\n self.output('order submission acknowleded: %s' % repr(data))", "def ticket_submit_callback(self, data):\n self.output('staged order ticket submitted: %s' % repr(data))", "def acknowledged(self):\n ...", "def handleSent(): \r\n gl...
[ "0.65402454", "0.6140557", "0.6103491", "0.6096946", "0.6077967", "0.6076535", "0.6049912", "0.5990767", "0.59754926", "0.5922344", "0.5860195", "0.5799573", "0.57155365", "0.57155365", "0.5699258", "0.56790817", "0.5563556", "0.55532837", "0.55094004", "0.5504198", "0.550243...
0.7298359
0
called when staged order ticket request has been submitted with 'poke' and OnOtherAck has returned
def ticket_submit_callback(self, data): self.output('staged order ticket submitted: %s' % repr(data))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ticket_submit_ack_callback(self, data):\n self.output('staged order ticket submission acknowledged: %s' % repr(data))", "def order_submit_ack_callback(self, data):\n self.output('order submission acknowleded: %s' % repr(data))", "def acknowledged(self):\n ...", "def ack(self, other, ...
[ "0.69958776", "0.6328598", "0.5991518", "0.5967797", "0.5919578", "0.589803", "0.5893169", "0.58567333", "0.5825594", "0.5496221", "0.5490138", "0.541741", "0.5410801", "0.53815657", "0.5380933", "0.5376747", "0.533026", "0.5316723", "0.52969855", "0.52912843", "0.52878857", ...
0.6000672
2
called when order has been submitted with 'poke' and Ack has returned
def order_submit_ack_callback(self, data): self.output('order submission acknowleded: %s' % repr(data))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ack(self):\n self.consumer.ack(self)", "def ticket_submit_ack_callback(self, data):\n self.output('staged order ticket submission acknowledged: %s' % repr(data))", "async def ack(self, offset: int):", "def acknowledged(self):\n ...", "def handleReceived():\r\n global receivedAck...
[ "0.6417594", "0.63553673", "0.6310921", "0.6280499", "0.6235027", "0.6160638", "0.615443", "0.61338025", "0.61163735", "0.61023057", "0.59978265", "0.5971444", "0.5940968", "0.5938956", "0.5914693", "0.5914693", "0.5908057", "0.5868182", "0.5846094", "0.5846094", "0.5846094",...
0.70445883
0
called when order has been submitted with 'poke' and OnOtherAck has returned
def order_submit_callback(self, data): self.output('order submitted: %s' % repr(data))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def order_submit_ack_callback(self, data):\n self.output('order submission acknowleded: %s' % repr(data))", "def ack(self, other, city):\n pass", "def on_order(self, order: OrderData):\n pass", "def on_order(self, order: OrderData):\n pass", "def on_order(self, order: OrderData)...
[ "0.68128896", "0.64465505", "0.63373786", "0.63373786", "0.63373786", "0.6235354", "0.60953945", "0.60290235", "0.60039335", "0.5901038", "0.58900285", "0.58529925", "0.5822434", "0.57951164", "0.5768062", "0.5766398", "0.57113135", "0.5708668", "0.56988627", "0.5646987", "0....
0.5715031
16
Return a copy of this session with different max_retries.
def with_retry(self, retry: Optional[urllib3.util.retry.Retry]) -> "Session": return type(self)( master=self._master, user=self._user, auth=self._auth, cert=self._cert, max_retries=retry, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_session_retry(self, retries=3, backoff_factor=0.2,\n status_forcelist=(404, 500, 502, 504),\n session=None):\n session = session or requests.Session()\n retry = Retry(total=retries, read=retries, connect=retries,\n backoff...
[ "0.6693097", "0.6055224", "0.6011351", "0.5991151", "0.5978382", "0.5869661", "0.5861507", "0.5788364", "0.5755023", "0.57389003", "0.5561054", "0.5491818", "0.54451287", "0.5423037", "0.54150796", "0.53628075", "0.5357361", "0.53417206", "0.5197484", "0.5182304", "0.51763517...
0.6716732
0
The hashing function takes a string input and converts it into a hash using the SHA256 hashing technique present in the hashlib library in python. Arguments
def hashing(word) : ans = hashlib.sha256(word.encode()) return ans.hexdigest()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def h(x):\n\n hasher = hashlib.sha256()\n hasher.update(x)\n return hasher.digest()", "def get_256_hash_from_string(string):\n\n sha256 = hashlib.sha256()\n sha256.update(string.encode('utf-8'))\n\n return sha256.hexdigest()", "def sha256_2_string(string_to_hash):\n\n # Solutio...
[ "0.7626421", "0.74969774", "0.7493603", "0.73092085", "0.7217957", "0.71965355", "0.7123386", "0.71210426", "0.71210426", "0.7113178", "0.70950216", "0.7090701", "0.70856744", "0.7085671", "0.7048058", "0.70315", "0.70186573", "0.7007464", "0.6985593", "0.6978819", "0.6970663...
0.77725095
0
Add a measurement to the stored ones.
def add(self, measurement, index=None): notification = ContainerChange(obj=self, name='measurements') if index is None: index = len(self.measurements) self.measurements.append(measurement) else: self.measurements.insert(index, measurement) notificatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addMeasurement(self, measurement):\n if measurement != None:\n assert isinstance(measurement, VMMeasurement), \"Invalid measurement %s\" % (measurement)\n self.measruements.append(measurement)", "def add_measurement(self):\n key, ok = QInputDialog.getText(self, 'Add measur...
[ "0.78313416", "0.734542", "0.7235791", "0.7067416", "0.6823846", "0.68176687", "0.6805293", "0.6725209", "0.66872317", "0.6647406", "0.6298246", "0.6266476", "0.6228618", "0.6212711", "0.6071609", "0.6071609", "0.6034524", "0.60152614", "0.5991599", "0.5955154", "0.58952105",...
0.73238003
2
Remove a measurement or a list of measurement.
def remove(self, measurements): if not isinstance(measurements, Iterable): measurements = [measurements] notification = ContainerChange(obj=self, name='measurements') for measurement in measurements: old = self.measurements.index(measurement) del self.measure...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_measurement():\n meas_id = request.args.get('id', type=int)\n if meas_id is not None:\n db.session.query(Measurement).filter(Measurement.id == meas_id).delete()\n db.session.commit()\n\n return redirect('/measurements')", "def remove_measurement(self):\n idx = self.measur...
[ "0.7006039", "0.6825674", "0.6718692", "0.6366676", "0.59642595", "0.5941515", "0.58450425", "0.5829295", "0.57420117", "0.57420117", "0.5720286", "0.57030857", "0.56745726", "0.56653845", "0.5613495", "0.56089056", "0.56086564", "0.5605919", "0.5605919", "0.55991286", "0.558...
0.75901985
0
some attribute such as state distribution or the true value function are very costly to compute, so they are only evaluated, if really needed
def __getattr__(self, name): if name == "mu": self.mu = self.mdp.stationary_distribution( seed=1000, iterations=100000, policy=self.target_policy) return self.mu elif name == "beh_mu": self.beh_mu = self.mdp.stationary_distribution( see...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(self, state):\n abstract", "def critic_compute_vvalue(dict_states, val_func):\n\n values = val_func.predict(dict_states['states'])\n dict_states['values'] = values", "def _optimise(self):\n pass", "def Eval(state):\n\n# H1 = htest2(state)\n# return H1\n ...
[ "0.6278617", "0.62057346", "0.6162016", "0.61589915", "0.6142543", "0.6142543", "0.6127977", "0.59733987", "0.5966657", "0.59584475", "0.59096265", "0.5894172", "0.5893256", "0.58858305", "0.58858305", "0.58840144", "0.58717525", "0.583482", "0.5832933", "0.5832933", "0.58298...
0.0
-1
produce the feature representation of all states of mdp as a vertically stacked matrix,
def Phi(self): if not hasattr(self, "Phi_"): Phil = [] for s in self.mdp.states: if hasattr(self.phi, "expectation"): f = self.phi.expectation(s) else: f = self.phi(s) Phil.append(f) Phi =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def columns_state_to_matrix(state):\n m = []\n lits = []\n for key, values in state.items():\n if key != \"parity\":\n m.append(values)\n lits.append(key)\n m += [state[\"parity\"]]\n m = np.array(m).T.tolist()\n return m, lits", "def getstate(self):\n out = ...
[ "0.61598355", "0.60036", "0.5909275", "0.5774589", "0.5735121", "0.5707198", "0.5678175", "0.5677035", "0.56657124", "0.56510586", "0.5636868", "0.55877", "0.55837166", "0.55326474", "0.55307454", "0.5521124", "0.5488227", "0.5486122", "0.54806095", "0.5446708", "0.5425378", ...
0.0
-1
the bellman operator T(V) = R + gamma P V details see Chapter 3 of Sutton, R. S., Maei, H. R., Precup, D., Bhatnagar, S., Silver, D.,
def bellman_operator(self, V, policy="behavior"): if policy == "behavior": policy = self.behavior_policy elif policy == "target": policy = self.target_policy if hasattr(self, "R"): R = self.R else: R = self.mdp.P * self.mdp.r * policy.tab[:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RobustBellmanOp(P, Sigma, state, action, gamma):\n BV = 0\n # Here there is a strong assumption that\n # sum(p(s'|(s,a)) * R(s,a,s')) = R(s,a,s') = R(s,a)\n for t in P[state][action]:\n probability = t[0]\n nextstate = t[1]\n cost = t[2]\n done = t[3]\n # BV += ...
[ "0.6993826", "0.6638062", "0.6402498", "0.63068825", "0.63002235", "0.6225984", "0.6225984", "0.6225984", "0.6161945", "0.61532336", "0.61231595", "0.60717344", "0.60529256", "0.5978915", "0.5965468", "0.5915182", "0.5911414", "0.58930737", "0.5885514", "0.58462185", "0.58028...
0.65719485
2
computes the KL Divergence between the behavioral and target policy while assuming that the steady state distribution is the state distribution of the behavioral policy!
def kl_policy(self): r = .5 * (np.trace(np.dot(self.behavior_policy.precision, self.target_policy.noise)) - self.behavior_policy.dim_A - np.log(np.linalg.det(self.target_policy.noise) / np.linalg.det(self.behavior_policy.noise))) dtheta = (self.behavior_policy.theta - self.target_poli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_policy_network(policy_model, old_policy_model, A_hat, j, state_part_mean, state_part_std, config = PPO_config):\n \n # TODO: How to implement KL early stopping? \n \n learning_rate = np.amax([0.01, 1-j/config['J']]) * config['LR_policy']\n #PPO_loss = compute_surr_objective(A_hat, old_poli...
[ "0.659929", "0.6538596", "0.62946427", "0.6181068", "0.610246", "0.6092874", "0.60754335", "0.60436636", "0.6020627", "0.60204685", "0.59982336", "0.59855235", "0.596544", "0.59235543", "0.59141713", "0.5912177", "0.5882478", "0.5874837", "0.58348036", "0.58177924", "0.581293...
0.64414257
2
some attribute such as state distribution or the true value function are very costly to compute, so they are only evaluated, if really needed
def __getattr__(self, name): if name == "mu" or name == "mu_next" or name == "mu_r" or name == "mu_phi" or name == "mu_phi_next": self.mu, self.mu_r, self.mu_next, self.mu_phi, self.mu_phi_next = mdp.samples_distribution(self.mdp, policy=self.target_policy, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(self, state):\n abstract", "def critic_compute_vvalue(dict_states, val_func):\n\n values = val_func.predict(dict_states['states'])\n dict_states['values'] = values", "def _optimise(self):\n pass", "def Eval(state):\n\n# H1 = htest2(state)\n# return H1\n ...
[ "0.6278617", "0.62057346", "0.6162016", "0.61589915", "0.6142543", "0.6142543", "0.6127977", "0.59733987", "0.5966657", "0.59584475", "0.59096265", "0.5894172", "0.5893256", "0.58858305", "0.58858305", "0.58840144", "0.58717525", "0.583482", "0.5832933", "0.5832933", "0.58298...
0.0
-1
Mean Squared Bellman Error
def MSPBE_tar(self, theta): V = np.array((theta * self.mu_phi_tar).sum(axis=1)) V2 = self.gamma * np.array((theta * self.mu_phi_next_tar).sum(axis=1)) return np.mean(np.array((V - np.dot(self.projection_operator(), V2 + self.mu_r_tar))) ** 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MeanSqError(self):\r\n\t\treturn self.mse", "def mean_squared_error(self):\n print('Mean squared error regression loss: ' + str(mean_squared_error(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def calc...
[ "0.70723593", "0.69170547", "0.69018835", "0.6720891", "0.66452754", "0.65128696", "0.64996177", "0.64721024", "0.64610255", "0.6454748", "0.64024305", "0.638498", "0.6380651", "0.63781095", "0.63774097", "0.63773036", "0.6377058", "0.63701975", "0.6365091", "0.6322976", "0.6...
0.0
-1
Mean Squared Bellman Error
def MSPBE(self, theta): V = np.array((theta * self.mu_phi).sum(axis=1)) V2 = self.gamma * np.array((theta * self.mu_phi_next).sum(axis=1)) return np.mean(np.array((V - np.dot(self.projection_operator(), V2 + self.mu_r))) ** 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MeanSqError(self):\r\n\t\treturn self.mse", "def mean_squared_error(self):\n print('Mean squared error regression loss: ' + str(mean_squared_error(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def calc...
[ "0.70723593", "0.69170547", "0.69018835", "0.6720891", "0.66452754", "0.65128696", "0.64996177", "0.64721024", "0.64610255", "0.6454748", "0.64024305", "0.638498", "0.6380651", "0.63781095", "0.63774097", "0.63773036", "0.6377058", "0.63701975", "0.6365091", "0.6322976", "0.6...
0.0
-1
Mean Squared Bellman Error
def MSBE_tar(self, theta): V = np.array((theta * self.mu_phi_tar).sum(axis=1)) V2 = self.gamma * np.array((theta * self.mu_phi_next_tar).sum(axis=1)) return np.mean((V - V2 - self.mu_r_tar) ** 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MeanSqError(self):\r\n\t\treturn self.mse", "def mean_squared_error(self):\n print('Mean squared error regression loss: ' + str(mean_squared_error(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def calc...
[ "0.7074351", "0.69184774", "0.6903365", "0.67231107", "0.66480696", "0.65150756", "0.650225", "0.6472207", "0.64625514", "0.6456857", "0.64040864", "0.6387255", "0.6382737", "0.63803643", "0.63794786", "0.63790506", "0.6377615", "0.6370702", "0.63663834", "0.6324409", "0.6314...
0.0
-1
Mean Squared Bellman Error
def MSE(self, theta): V = np.array((theta * self.mu_phi).sum(axis=1)) return np.mean((V - self.mu_accum_r) ** 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MeanSqError(self):\r\n\t\treturn self.mse", "def mean_squared_error(self):\n print('Mean squared error regression loss: ' + str(mean_squared_error(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def calc...
[ "0.70734775", "0.6917913", "0.6903449", "0.67222446", "0.6645739", "0.6514049", "0.6500719", "0.6472024", "0.6461973", "0.64560336", "0.6403752", "0.6385571", "0.63817215", "0.63791734", "0.6379055", "0.6377998", "0.6377281", "0.6370479", "0.6365752", "0.6324615", "0.6314102"...
0.0
-1
Mean Squared Bellman Error
def MSBE(self, theta): V = np.array((theta * self.mu_phi).sum(axis=1)) V2 = self.gamma * np.array((theta * self.mu_phi_next).sum(axis=1)) return np.mean((V - V2 - self.mu_r) ** 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MeanSqError(self):\r\n\t\treturn self.mse", "def mean_squared_error(self):\n print('Mean squared error regression loss: ' + str(mean_squared_error(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def calc...
[ "0.70723593", "0.69170547", "0.69018835", "0.6720891", "0.66452754", "0.65128696", "0.64996177", "0.64721024", "0.64610255", "0.6454748", "0.64024305", "0.638498", "0.6380651", "0.63781095", "0.63774097", "0.63773036", "0.6377058", "0.63701975", "0.6365091", "0.6322976", "0.6...
0.0
-1
some attribute such as state distribution or the true value function are very costly to compute, so they are only evaluated, if really needed
def __getattr__(self, name): if name == "V_true": self.V_true = dynamic_prog.estimate_V_LQR( self.mdp, lambda x, y: self.bellman_operator( x, y, policy="target"), gamma=self.gamma) return self.V_true elif name == "mu_phi_full": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(self, state):\n abstract", "def critic_compute_vvalue(dict_states, val_func):\n\n values = val_func.predict(dict_states['states'])\n dict_states['values'] = values", "def _optimise(self):\n pass", "def Eval(state):\n\n# H1 = htest2(state)\n# return H1\n ...
[ "0.627793", "0.6207085", "0.6162446", "0.61590654", "0.61424214", "0.61424214", "0.61269885", "0.5973244", "0.5966853", "0.5959342", "0.5910448", "0.5893535", "0.5892798", "0.588487", "0.5884815", "0.5884815", "0.5872024", "0.5835179", "0.58326495", "0.58326495", "0.5829513",...
0.0
-1
the bellman operator for the behavioral policy as a python function which takes the value function s^T P s + b represented as a numpy squared array P T(P,b) = R + theta_p^T Q theta_p + gamma (A + B theta_p)^T P (A + B theta_p), gamma (b + tr(P Sigma))
def bellman_operator(self, P, b, policy="behavior"): Q = np.matrix(self.mdp.Q) R = np.matrix(self.mdp.R) A = np.matrix(self.mdp.A) B = np.matrix(self.mdp.B) Sigma = np.matrix(np.diag(self.mdp.Sigma)) if policy == "behavior": theta = np.matrix(self.behavior_po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RobustBellmanOp(P, Sigma, state, action, gamma):\n BV = 0\n # Here there is a strong assumption that\n # sum(p(s'|(s,a)) * R(s,a,s')) = R(s,a,s') = R(s,a)\n for t in P[state][action]:\n probability = t[0]\n nextstate = t[1]\n cost = t[2]\n done = t[3]\n # BV += ...
[ "0.71001726", "0.68565446", "0.6523547", "0.6306089", "0.6291289", "0.6230942", "0.61771154", "0.6148315", "0.60413855", "0.5933376", "0.5930906", "0.5928049", "0.5900982", "0.5886188", "0.5881746", "0.58785963", "0.58734393", "0.5857429", "0.58492917", "0.5840334", "0.581764...
0.7670253
0
Mean Squared Bellman Error
def MSBE(self, theta): V = np.array((theta * self.mu_phi).sum(axis=1)) theta_trans = features.squared_tri(self.mdp.dim_S).param_forward( *self.bellman_operator(*self.phi.param_back(theta))) V2 = np.array((theta_trans * self.mu_phi_full).sum(axis=1)) return np.mean((V - V2) **...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MeanSqError(self):\r\n\t\treturn self.mse", "def mean_squared_error(self):\n print('Mean squared error regression loss: ' + str(mean_squared_error(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def calc...
[ "0.70734775", "0.6917913", "0.6903449", "0.67222446", "0.6645739", "0.6514049", "0.6500719", "0.6472024", "0.6461973", "0.64560336", "0.6403752", "0.6385571", "0.63817215", "0.63791734", "0.6379055", "0.6377998", "0.6377281", "0.6370479", "0.6365752", "0.6324615", "0.6314102"...
0.0
-1
Mean Squared Projected Bellman Error
def MSPBE(self, theta): V = np.matrix((theta * np.asarray(self.mu_phi)).sum(axis=1)).T theta_trans = features.squared_tri(self.mdp.dim_S).param_forward( *self.bellman_operator(*self.phi.param_back(theta))) v = np.asarray(V - self.projection_operator( ) * np.matrix(self.mu_phi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MeanSqError(self):\r\n\t\treturn self.mse", "def error(b, m, x_data):\n\n totalError = 0\n for i in range(0, len(x_data)):\n x = x_data[i]\n y = 2 * x_data[i] + 50 + 5 * np.random.random()\n\n totalError += (y - (m * x + b)) ** 2 # total error of gradient\n\n return total...
[ "0.6716116", "0.6491055", "0.64184654", "0.63085115", "0.626515", "0.62538904", "0.62059987", "0.61504513", "0.6075646", "0.60743934", "0.60544276", "0.60458714", "0.6041923", "0.5958656", "0.5950878", "0.59448355", "0.59426767", "0.5940715", "0.59404093", "0.59390706", "0.59...
0.0
-1
Return all softmasked regions as a BED3 format string.
def get_masked_regions(contig): masked_regions = "" seq = contig.seq contig_end = len(seq)-1 masked = False for i, n in enumerate(seq): # mark the starting position of a softmasked region if not masked and n.islower(): masked = True start = i # mark ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_regions_mask(self, input):", "def dump(self, contents=False):\n print(self)\n for region in self.regions:\n print(region)\n hexdump(region.data, address=region.address)", "def read_BEC_region_mask(grid):\n region_mask_file = '/home/ivan/Python/data/BEC_REGION_MASK...
[ "0.59224325", "0.54149204", "0.5379897", "0.53791404", "0.52565", "0.5155345", "0.5125964", "0.50116074", "0.5007976", "0.50038373", "0.50032556", "0.49970403", "0.49952328", "0.49776202", "0.494399", "0.49382335", "0.4912289", "0.49092403", "0.48832148", "0.48810032", "0.486...
0.6836982
0
Convert a byte string to it's hex string representation e.g. for output.
def ByteToHex( byteStr ): # Uses list comprehension which is a fractionally faster implementation than # the alternative, more readable, implementation below # # hex = [] # for aChar in byteStr: # hex.append( "%02X " % ord( aChar ) ) # # return ''.join( hex ).stri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bytes_to_hex(s):\n\n return s.encode(\"hex\")", "def hex(string):\n return string.encode('hex')", "def ByteToHex( byteStr ):\r\n \r\n # Uses list comprehension which is a fractionally faster implementation than\r\n # the alternative, more readable, implementation below\r\n # \r\n # ...
[ "0.83955294", "0.7957785", "0.78720164", "0.7845213", "0.76932746", "0.76224846", "0.757223", "0.75030285", "0.74330866", "0.7401707", "0.73670447", "0.73555", "0.73397434", "0.733254", "0.7318627", "0.7313053", "0.7272483", "0.72406524", "0.72354645", "0.723096", "0.7204742"...
0.7827128
4
Abstracts the common pattern of allowing both an object or an object's ID (UUID) as a parameter when dealing with relationships.
def getid(obj): # Try to return the object's UUID first, if we have a UUID. try: if obj.uuid: return obj.uuid except AttributeError: pass try: return obj.id except AttributeError: return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model_relationship_id(\n thing: Union[\"ModelRelationship\", t.ModelRelationshipId, UUID, str]\n) -> t.ModelRelationshipId:\n if isinstance(thing, UUID):\n return t.ModelRelationshipId(thing)\n elif isinstance(thing, ModelRelationship):\n return thing.id\n return t.ModelRelationsh...
[ "0.6406559", "0.6314725", "0.61052245", "0.60958296", "0.6060378", "0.5935831", "0.58920884", "0.5865537", "0.5811203", "0.58053535", "0.5791913", "0.5752252", "0.5696992", "0.5696992", "0.5696992", "0.5696992", "0.5696992", "0.5696992", "0.5696992", "0.5696992", "0.5696992",...
0.6084481
4
Builds a resource URL for the given kwargs. Given an example collection where `collection_key = 'entities'` and `key = 'entity'`, the following URL's could be generated.
def build_url(self, dict_args_in_out=None): if dict_args_in_out is None: dict_args_in_out = {} url = dict_args_in_out.pop('base_url', None) or '' url += '/%s' % self.collection_key # do we have a specific entity? entity_id = dict_args_in_out.pop('%s_id' % self.key, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_collection_url(self, **kwargs):\n\n url = self._generate_url(url_type='collection', **kwargs)\n return url", "def _build_uri(self, **kwargs):\n target_uri, version = str(), None\n\n if kwargs.get('category') not in ['performance', 'common']:\n version = self._build_...
[ "0.65982926", "0.64410657", "0.6376219", "0.5949595", "0.59395957", "0.5937871", "0.5891844", "0.5872246", "0.5872246", "0.58385074", "0.58289504", "0.5797399", "0.5791687", "0.57855177", "0.57543904", "0.5751335", "0.57417595", "0.573921", "0.57283247", "0.5718494", "0.57029...
0.7582599
0
????? Find a single item with attributes matching ``kwargs``.
def find(self, **kwargs): url = self.build_url(dict_args_in_out=kwargs) rl = self._list( '%(url)s%(query)s' % { 'url': url, 'query': '?%s' % urllib.urlencode(kwargs) if kwargs else '', }, self.collection_key) num = len(rl) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(cls, **kwargs):\n key = [key for key in kwargs][0]\n objects = cls.get_all()\n if isinstance(objects, dict):\n return objects\n results = []\n for i in objects:\n if is_substring(kwargs[key], getattr(i, key)):\n results.append(i)\n ...
[ "0.64905286", "0.6422516", "0.63054526", "0.6150706", "0.6042665", "0.60273176", "0.60062563", "0.5960116", "0.59406686", "0.5893654", "0.58933294", "0.58470035", "0.5840514", "0.58035016", "0.5785908", "0.57597953", "0.57567614", "0.5733581", "0.57248026", "0.57049215", "0.5...
0.6048774
4
Test user can get all sales
def test_get_all_sales(self): self.register_user() result = self.login_user() access_token = json.loads(result.data.decode())['token'] response = self.client.get(self.sl_url, headers=dict(Authorization="Bearer " + access_token)) result = json.loads(response.data.decode()) self.assertEqual(response.stat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_sale_records(self):\n reply = self.admin_add_product()\n\n resp = self.admin_create_user()\n reply = self.attendant_login()\n token = reply['token']\n sale = dict(products = [\n {\n \"prod_name\":\"NY_denims\", \n \"quanti...
[ "0.7474644", "0.73433435", "0.7226546", "0.71686345", "0.68853", "0.68461", "0.68375087", "0.6793282", "0.67523843", "0.6588984", "0.6573936", "0.6551599", "0.6486141", "0.6473017", "0.64615905", "0.64156425", "0.6399153", "0.63895774", "0.6347083", "0.63440025", "0.63045716"...
0.8110322
0
test create a sale record
def test_post_sale_record(self): self.register_user() result = self.login_user() access_token = json.loads(result.data.decode())['token'] res = self.client.post(self.p_url, data=self.products_data, headers=dict(Authorization="Bearer " + access_token)) result = json.loads(res.data.decode()) self.asser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_sale_record(self):\n reply = self.admin_add_product()\n\n resp = self.admin_create_user()\n reply = self.attendant_login()\n token = reply['token']\n sale = dict(products = [\n {\n \"prod_name\":\"NY_denims\", \n \"quantity\":...
[ "0.78964686", "0.7810856", "0.7591687", "0.7530914", "0.7336629", "0.70531434", "0.70490855", "0.70409393", "0.6985339", "0.692475", "0.69237953", "0.68040955", "0.677054", "0.6726252", "0.6721466", "0.67095804", "0.6703448", "0.6622187", "0.66104954", "0.65952396", "0.657949...
0.7876173
1
test get a specific sale_record by id
def test_get_one_sale_record(self): self.register_user() result = self.login_user() access_token = json.loads(result.data.decode())['token'] response = self.client.post('/api/v1/sales', data=self.sales_data, headers=dict(Authorization="Bearer " + access_token)) self.assertEqual(response.status_code,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_specific_sale_record(self):\n \n self.register_admin_test_account()\n token = self.login_admin_test()\n\n response = self.app_test_client.get(\n '{}/saleorder'.format(self.base_url), json={\n 'sale_id': 1,\n 'name': \"Sample Bags\",\n ...
[ "0.8488579", "0.734553", "0.706829", "0.69891703", "0.68932825", "0.6712079", "0.66892236", "0.6686362", "0.66299886", "0.6611321", "0.6520579", "0.6505532", "0.64531493", "0.6440169", "0.63657", "0.63465416", "0.6296529", "0.6288324", "0.62848693", "0.6208785", "0.6182311", ...
0.7370436
1
test a non existing sale_record cannot be retrieved
def test_get_non_existing_sale_record(self): self.register_user() result = self.login_user() access_token = json.loads(result.data.decode())['token'] response = self.client.get('/api/v1/sale/100', headers=dict(Authorization="Bearer " + access_token)) self.assertEqual(response.status_code, 404) result =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_cannot_get_empty_sales(self):\n reply = self.admin_add_product()\n\n resp = self.admin_create_user()\n reply = self.attendant_login()\n token = reply['token']\n\n resp = self.client.get(\n '/api/v1/sales/1',\n headers={'Authorization': 'Bearer {}'.f...
[ "0.67065454", "0.65563065", "0.6445439", "0.6376305", "0.6364539", "0.63549346", "0.6344477", "0.63023585", "0.6260622", "0.62462413", "0.6177097", "0.61122227", "0.6104429", "0.6096169", "0.60852754", "0.6059171", "0.6040166", "0.6034094", "0.6025876", "0.60226256", "0.60205...
0.83915794
0
test create a sale record with quantity as string
def test_post_sale_record_with_quantity_string(self): self.register_user() result = self.login_user() access_token = json.loads(result.data.decode())['token'] res = self.client.post(self.sl_url, data=self.string_sales, headers=dict(Authorization="Bearer " + access_token)) result = json.loads(res.data.d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_sale_with_invalid_quantity(self):\n self.register_admin_test_account()\n token = self.login_admin_test()\n \n response = self.app_test_client.post('{}/saleorder'.format(\n self.base_url), json={'name': \"Hand Bag\", 'price': 1500, 'quantity': \"5\", 'totalamt': \...
[ "0.73696387", "0.7272735", "0.6952385", "0.6769718", "0.6723913", "0.65521663", "0.6526882", "0.6447317", "0.642388", "0.6377979", "0.6343794", "0.63268614", "0.628641", "0.6271526", "0.6246291", "0.6237712", "0.62305063", "0.6228506", "0.61977756", "0.6193409", "0.6190083", ...
0.82792795
0
Reads input.yml file and returns the list for the fixture
def required_packages(): with open(r"required-packages.yml") as file: inputs = yaml.load(file, Loader=yaml.FullLoader) return inputs["required_packages"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_data(self):\n return read_yaml(self.file_path)", "def read_input_files(input_file: str) -> list[Food]:\n with open(input_file) as input_fobj:\n foods = [Food.from_raw(line.strip()) for line in input_fobj]\n return foods", "def _read_file(self, input_file):\n with io.open(in...
[ "0.69811755", "0.64664984", "0.6385069", "0.6166269", "0.6110681", "0.59187686", "0.5884266", "0.5877623", "0.584026", "0.5834622", "0.58186245", "0.5811489", "0.57915", "0.57771146", "0.5776398", "0.57444304", "0.5741574", "0.57310414", "0.572478", "0.5699813", "0.56599563",...
0.0
-1
Reads input.yml and returns a list of optional packages for the fixture
def optional_packages(): with open(r"tests/input.yml") as file: inputs = yaml.load(file, Loader=yaml.FullLoader) return inputs["optional_packages"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def python_packages():\n with open(r\"tests/input.yml\") as file:\n inputs = yaml.load(file, Loader=yaml.FullLoader)\n return inputs[\"python_packages\"]", "def required_packages():\n with open(r\"required-packages.yml\") as file:\n inputs = yaml.load(file, Loader=yaml.FullLoader)\n ret...
[ "0.74960756", "0.72168744", "0.6479338", "0.59237087", "0.5857561", "0.5720948", "0.5557785", "0.54705644", "0.54513747", "0.54507947", "0.5422149", "0.5409515", "0.5387675", "0.5322175", "0.5320085", "0.52968514", "0.52756894", "0.5262094", "0.52328485", "0.52328485", "0.522...
0.82169074
0
Reads input.yml and returns a list of python related packages
def python_packages(): with open(r"tests/input.yml") as file: inputs = yaml.load(file, Loader=yaml.FullLoader) return inputs["python_packages"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def required_packages():\n with open(r\"required-packages.yml\") as file:\n inputs = yaml.load(file, Loader=yaml.FullLoader)\n return inputs[\"required_packages\"]", "def optional_packages():\n with open(r\"tests/input.yml\") as file:\n inputs = yaml.load(file, Loader=yaml.FullLoader)\n ...
[ "0.7422069", "0.6971301", "0.6811929", "0.6220798", "0.6169701", "0.60719687", "0.5946472", "0.58931", "0.58555245", "0.5743362", "0.57142967", "0.5677042", "0.56702876", "0.5617658", "0.5599167", "0.5591488", "0.5534712", "0.5522331", "0.5520315", "0.55116594", "0.55114037",...
0.83976966
0
Generates a synthetic dataset of a single neuron with a jittered firing pattern.
def jittered_neuron(t=None, feature=None, n_trial=61, jitter=1.0, gain=0.0, noise=0.05, seed=1234): # default time base if t is None: t = np.linspace(-5, 5, 150) # default feature if feature is None: feature = lambda tau: np.exp(-(t-tau)**2) # noise matrix np.random.seed(seed)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_synthetic_noise_dataset(cfg):\n from colorednoise import powerlaw_psd_gaussian\n\n betas = np.linspace(cfg['data.mix_synthetic_noise.min_beta'],\n cfg['data.mix_synthetic_noise.max_beta'],\n num=cfg['data.mix_synthetic_noise.num_samples'])\n sample_...
[ "0.62634385", "0.59594214", "0.59539413", "0.584299", "0.5822103", "0.57358575", "0.57198215", "0.5702747", "0.5693655", "0.5630784", "0.5625543", "0.5619661", "0.561871", "0.5601612", "0.5601363", "0.5598875", "0.5587372", "0.5576973", "0.55743957", "0.5572822", "0.5543306",...
0.5840544
4
Wraps the core BERT model as a keras.Model.
def get_bert_model(input_word_ids, input_mask, input_type_ids, config=None, name=None, float_type=tf.float32, share_parameter_across_layers=False): bert_model_layer = BertModel( config=config, float_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_model(self):\n\n\t\t# Input layers\n\t\tinput_bert_ids = Input(shape=(self.batch_max_sentences, self.bert_wrapper.max_seq_len), name='bert_input_ids', dtype='int32')\n\t\tinput_bert_att = Input(shape=(self.batch_max_sentences, self.bert_wrapper.max_seq_len), name='bert_attention_ids', dtype='int32')\n\t...
[ "0.72094166", "0.71153945", "0.6757933", "0.6557551", "0.6524431", "0.65141064", "0.6411738", "0.6394894", "0.6390862", "0.6388574", "0.63608235", "0.6341187", "0.63348085", "0.63262266", "0.6325279", "0.6321138", "0.6299965", "0.6294272", "0.62942296", "0.6273413", "0.627213...
0.65128464
6
Create a new Job object. All jobs are created in state Not Submitted.
def __init__(self, pipeline, job_name, threads, stdout_path, stderr_path, script_path, epilog_path, mem, email_list, mail_options, env, depends_on, queue, walltime): self.pipeline = pipeline self.job_name = job_name self.threads = threads self.stdout_pat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, validated_data):\n return Job.objects.create(**validated_data)", "def create_job(self, context=None):\n return self._client.call_method(\n 'UserAndJobState.create_job',\n [], self._service_ver, context)", "def job_create(self, sender, name=None):\n se...
[ "0.7540965", "0.7418147", "0.70385385", "0.69179034", "0.6895612", "0.68949133", "0.68898284", "0.6832433", "0.67487454", "0.658722", "0.6584338", "0.6550805", "0.64806885", "0.6474937", "0.64289117", "0.63990796", "0.63067824", "0.630018", "0.62902296", "0.6271461", "0.62333...
0.0
-1
Scans the database for jobs that are eligible to run; in other words, those with an empty dependency list and the status "Not Submitted".
def scan_for_runnable(limit=None): logging.debug('Finding runnable jobs') ready_jobs_query = Session.query(Job).filter(~Job.depends_on.any()). \ filter_by(status_id=Status.NOT_SUBMITTED) if limit: ready_jobs_query = ready_jobs_query.limit(limit) ready_jobs = ready...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_waiting_jobs(self):\n return []", "def run_pending(self):\n logger.debug(\"available jobs: \" + str(self.jobs))\n runnable_jobs = (job for job in self.jobs if job.should_run())\n logger.debug(\"runnable jobs: \" + str(self.jobs))\n for job in runnable_jobs:\n ...
[ "0.6436594", "0.64285314", "0.62542844", "0.61889505", "0.6012798", "0.6004328", "0.5882026", "0.5847893", "0.58347625", "0.5828717", "0.5812674", "0.5812287", "0.57511747", "0.5739757", "0.5721309", "0.57154495", "0.57145697", "0.56779337", "0.5662949", "0.56397986", "0.5629...
0.6924647
0
Counts the frequency of double and triple letters in a string.
def count_twos_threes(line): c = Counter(line).values() return [2 in c, 3 in c]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frequencyLetterDic(s):\n pass", "def frequency(string):\n string=string.lower()\n string=[\"%s%s \" %(string[i],string[i+1]) for i in range(len(string)-1)]\n return Counter(string)", "def get_letter_counts(str_):\n return dict(Counter(str_))", "def tally_letters(string):\n output = dict...
[ "0.7622363", "0.7536927", "0.7222884", "0.7205999", "0.70403767", "0.6936676", "0.69063616", "0.68783313", "0.6791417", "0.67859", "0.66984016", "0.6663252", "0.6615753", "0.6591209", "0.6547494", "0.65383995", "0.6534882", "0.6507763", "0.6465973", "0.6456511", "0.64520377",...
0.0
-1
Tally up all the results of the count_tows_threes and multiply them together.
def calculate_checksum(lines): twos = 0 threes = 0 for box in lines: counts = count_twos_threes(box) if counts[0]: twos += 1 if counts[1]: threes += 1 return twos * threes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_weighted_results():\n pass", "def T(w):\n\tif w < 1: return 0 # Less than 1 penny has no possible combinations\n\tif counts.has_key(w): return counts[w] # If already in dict, return that sum\n\n\t# Solve by taking all possible combinations recursively\n\t\n\tval = 0\n\tfor coin in coins:\n\t\tva...
[ "0.5664931", "0.5544347", "0.52679944", "0.5193733", "0.51744133", "0.5158381", "0.5132905", "0.5086527", "0.5042575", "0.5033788", "0.50311965", "0.5029944", "0.502499", "0.50198984", "0.49910232", "0.49615347", "0.49170852", "0.49108252", "0.48988318", "0.487201", "0.484676...
0.0
-1
passed a list of post_ids returns the page content for those posts
def getmfpages(params): url = 'https://www.metafilter.com/' page = requests.get(url+params).content
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_contents(\n self, post_ids: List[str], datetime_filter_fn: Optional[Callable[[datetime], bool]] = None\n ) -> List[str]:\n contents = []\n url = f\"http://blog.naver.com/PostView.nhn\"\n params = {\"blogId\": self.naver_id}\n for post_id in post_ids:\n param...
[ "0.7112241", "0.66041744", "0.6226108", "0.6030695", "0.6012791", "0.59088683", "0.5856071", "0.5844909", "0.58421594", "0.58397", "0.5830324", "0.5742852", "0.5716763", "0.57092553", "0.5698524", "0.5687093", "0.56828797", "0.56304216", "0.5629964", "0.5596571", "0.55841935"...
0.0
-1
takes the input from user and gets it ready to extract.
def extractData(coords: str) -> (str, float, float, float, float): aircraft_type = coords.split(":", 1) x_coord, y_coord, heading, speed = aircraft_type[1].split(",") return aircraft_type, float(x_coord), float(y_coord), float(heading), float(speed)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_input(user_input):\n return input(user_input)", "def parse(self, input):\n pass", "def _get_input(self):\n return self.__input", "def _get_input(self):\n return self.__input", "def _get_input(self):\n return self.__input", "def _get_input(self):\n return self.__input", "de...
[ "0.66469276", "0.66302055", "0.64704967", "0.64704967", "0.64704967", "0.64704967", "0.64704967", "0.64704967", "0.64704967", "0.6442752", "0.6415056", "0.6387806", "0.6328002", "0.6300582", "0.62887466", "0.62386596", "0.6186972", "0.6157094", "0.61116576", "0.60960203", "0....
0.0
-1
Save dataframe on disk
def save_features(df, name, path=None): if path is not None : os.makedirs( f"{path}/{name}" , exist_ok=True) if isinstance(df, pd.Series): df0=df.to_frame() else: df0=df log( f"{path}/{name}/features.parquet" ) log(df0, list(df0.columns)) df0.to_parque...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_df(data_frame, file_path):\r\n data_frame.to_csv(file_path)\r\n return None", "def save(df, out_file):\n print('------------< save >------------')\n out_path = './data'\n makedirs(out_path, exist_ok=True)\n print(f'path: {out_path}/{out_file}')\n print(f'shape: {df.shape}')\n df....
[ "0.8346727", "0.78104883", "0.7778965", "0.77468526", "0.7705605", "0.77024066", "0.7682654", "0.7468174", "0.73673975", "0.73214656", "0.7293688", "0.72540563", "0.7202353", "0.71031183", "0.71018416", "0.70801187", "0.7077303", "0.70432234", "0.7021891", "0.6997206", "0.699...
0.7017662
19
Used for trainiing only Save params on disk
def preprocess(path_train_X="", path_train_y="", path_pipeline_export="", cols_group=None, n_sample=5000, preprocess_pars={}, path_features_store=None): ##### column names for feature generation ##################################################### log(cols_group) coly = cols_group...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_save_parameters(self):\n obj_points = self.get_object_points()\n cam_pos = self.get_camera_position()\n distortion = self.get_distortion_coeeficients()\n\n d = {\n 'object positions': obj_points,\n 'camera positions': cam_pos,\n 'distortion coe...
[ "0.7320969", "0.7138416", "0.70646757", "0.7031888", "0.70187485", "0.6993781", "0.68250567", "0.6748856", "0.6748856", "0.6715416", "0.66888726", "0.66842914", "0.66687477", "0.66675746", "0.6647949", "0.66365165", "0.66297126", "0.661736", "0.65698665", "0.65528774", "0.650...
0.0
-1
At Inference time, load model, params and preprocess data. Not saving the data, only output final dataframe
def preprocess_inference(df, path_pipeline="data/pipeline/pipe_01/", preprocess_pars={}, cols_group=None): from util_feature import load, load_function_uri, load_dataset #### Pipeline Execution #################################################### pipe_default = [ {'uri' : 'source/prepro.py::pd_colnu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n df = prepro_last()\n X, y = train_build(df)\n fit_store(X, y)", "def main():\n data = load_data()\n analyze_features(data['full_features'])\n model = train(data)\n\n with open('model.pickle', 'wb') as f:\n pickle.dump(model, f)\n evaluate(model, data)", "def load_mo...
[ "0.64184946", "0.6337976", "0.6275767", "0.62493265", "0.62413377", "0.6229349", "0.6225312", "0.62025195", "0.6174834", "0.61704147", "0.61677074", "0.61300826", "0.6080634", "0.6062665", "0.60608184", "0.6054831", "0.6052776", "0.60308474", "0.60219646", "0.6020345", "0.599...
0.6648521
0
Only 3 types of thresholding currently implemented
def perform_thresholding(f,M,type): if type == "largest": a = np.sort(np.ravel(abs(f)))[::-1] #sort a 1D copy of F in descending order T = a[M] y = f*(abs(f) > T) elif type == "soft": s = abs(f) - M s = (s + abs(s))/2 y = np.sign(f)*s elif type == "hard": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def global_threshold(img, threshold_method):\n pass", "def apply_thresholding(x):\n return x > threshold_otsu(x)", "def thresh_setup():\n pass", "def threshold(self,thresholdValue):\n # TO DO\n pass", "def getThreshold(self): # real signature unknown; restored from __doc__\n p...
[ "0.7849862", "0.7268157", "0.7268108", "0.72231966", "0.7098394", "0.698424", "0.6918824", "0.6797195", "0.67815495", "0.6730238", "0.6698765", "0.6675851", "0.66437364", "0.66252387", "0.6544369", "0.6448778", "0.64323175", "0.64106774", "0.6361952", "0.63429403", "0.6325623...
0.6608822
14
Helper method to load a LookML file from tests/resources and parse it.
def load(filename): path = Path(__file__).parent / "resources" / filename with path.open() as file: return lkml.load(file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_data_from_file(self, local_lookml_project_path: str) -> dict:\n logger.info(\n \"Parsing data from local LookML file {}\".format(\n self.lookml_file_name_and_path\n )\n )\n with open(\n utils.assemble_path(\n local_lookml_...
[ "0.66835463", "0.6393878", "0.6098357", "0.56062335", "0.5595313", "0.5581819", "0.55224305", "0.5505772", "0.54858464", "0.5482919", "0.54599816", "0.5456783", "0.54460776", "0.54395825", "0.54266834", "0.5425838", "0.54160774", "0.5410144", "0.5384232", "0.53471184", "0.533...
0.63659114
2
Create a pumping rate well
def __init__(self, name="", description="", time_units="s", len_units="m", pump_units="m3/s"): # Set general info self._type = 1 # pumping well id self.parameters = {'full': True, 'rw': 1., 'd': 0., ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(window_type=WindowType.DEFAULT, rate=10):\n pass", "def create_pumper():\n return _Kalamazoo()", "def run_loop_measurement(t=0.5, name='test', loops=4, pump_t=180, total_t=600, jump_x=10):\n\n incident_angles = [0.1, 0.4]\n waxs_arc = [20, 0]\n user = \"TP\"\n\n condition = (\n...
[ "0.6111014", "0.59055704", "0.5620826", "0.5561464", "0.5551125", "0.5525205", "0.547904", "0.5449968", "0.5444173", "0.54401493", "0.5416738", "0.54025877", "0.53928125", "0.538614", "0.536652", "0.5296037", "0.5283478", "0.5277413", "0.52544755", "0.5250356", "0.5236363", ...
0.6467801
0
Add new observation well or piezometer object to the actual pumping well INPUTS x [int, float, list, tuple, ndarray] time vector y [int, float, list, tuple, ndarray] drawodwn vector wtype [int] type of data 0 observation well 1 piezometer name [string] well name that is used as label for plot description [string] well ...
def add_well(self, x=1, y=1, wtype=0, name="New well", description="Added well"): if wtype == 0: new_well = ObservationWell(name, description, time_units=self.time_units, len_units=self.len_units) elif wtype == 1: new_well = Piezometer(name,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_figure(picks, curve, active_well): \n w = p.get_well(active_well) ##selects the correct welly.Well object\n picks_df = pd.read_json(picks)\n picks_selected = picks_df[picks_df['UWI'] == active_well.replace(' ', '-')]\n \n # regenerate figure with the new horizontal line\n fig = helper...
[ "0.5584504", "0.53288746", "0.52431315", "0.5236649", "0.5117322", "0.5074837", "0.5043187", "0.50353146", "0.5032513", "0.4923973", "0.48615775", "0.48594245", "0.48498887", "0.4801942", "0.47999173", "0.4759228", "0.4738073", "0.47359067", "0.47266603", "0.47177938", "0.471...
0.78409934
0
Convert parameters, pumping rate, drawdown and data units given new units INPUTS time_units [string] new time units. If None, actual units are used length_units [string] new length units. If None, actual units are used pump_units [string] new pumping rate units. If None, actual units are used same [bool] if True, pump_...
def convert_units(self, time_units=None, len_units=None, pump_units=None, same=False): in_time = self.time_units # Check new time units if time_units is None: time_units = in_time flag = _units.validate_units(time_units) if flag == -1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_units(self, time_units=None, len_units=None):\n in_time = self.time_units\n # Check new time units\n if time_units is None:\n time_units = in_time\n flag = _units.validate_units(time_units)\n if flag == -1:\n raise ValueError('Bad time units inpu...
[ "0.73620564", "0.6910942", "0.62991405", "0.6231261", "0.5903703", "0.57218415", "0.57206535", "0.5695423", "0.56943077", "0.5688793", "0.56632334", "0.5642992", "0.5642229", "0.560559", "0.5601575", "0.55584586", "0.5550535", "0.5549772", "0.5539942", "0.5536012", "0.5520892...
0.81115675
0
Converts the actual pumping rate units to the equivalent length and time units used in parameters and drawdown
def convert_same_units(self): # Convert pumping rate data pump_units = "%s3/%s" % (self.len_units, self.time_units) flag = _units.validate_units(pump_units) if flag == 2: self.pumprate.convert_units(self.time_units, pump_units) self.pump_units = pump_units
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_units(self,):\n self.UNITS = {'pressure':'Pa',}\n return", "def update_units(self):\n unit_var_value = self.view.vars['unit'].get()\n if unit_var_value == 'm3ph':\n self.minran_u_label.config(text='m³/h')\n self.maxran_u_label.config(text='m³/h')\n ...
[ "0.68502927", "0.6652245", "0.6640804", "0.65066785", "0.64253104", "0.6364545", "0.6226802", "0.6216705", "0.6182806", "0.61223763", "0.5989723", "0.5980712", "0.5951391", "0.5941575", "0.5923968", "0.5891878", "0.58807355", "0.58771986", "0.5800373", "0.5793957", "0.5791693...
0.6932813
0
Removes the well object from the associated wells list given the well name or index
def delete_well(self, key): if type(key) is str: idx = self.get_well_id(key) elif type(key) is int: idx = key else: raise TypeError('key must be a string or an integer.') n = self.well_count() if 0 <= idx <= n - 1: raise ValueError(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_all_wells(self):\n self.wells = []", "def remove(self, index):\n self._checkIndex(index)\n self._updateOwner(index, register=False)\n discard = self._items.pop(index)", "def removePlayer(self, index):\n\n self.eloList.pop(index)\n self.idList.pop(index)", ...
[ "0.65468025", "0.6206192", "0.6196141", "0.6068812", "0.60405266", "0.5954996", "0.5951935", "0.5905774", "0.58772933", "0.5833229", "0.5827092", "0.5823839", "0.5822445", "0.5816786", "0.5801315", "0.57647634", "0.5764105", "0.57499415", "0.5734532", "0.572572", "0.57193094"...
0.71419835
0
Removes all the associated observation wells or piezometers
def delete_all_wells(self): self.wells = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeIrisToOcc(self):\n\t\tshas = self._getShapes()\n\t\tfor sha in shas:\n\t\t\tif sha.a.iris_Occ.exists:\n\t\t\t\tsha.a.iris_Occ.delete()", "def clean():\n filter_phase_data()\n combine_phase_data()\n remove_duplicates_phase_data()", "def clear(self):\n for ob in self.obs:\n o...
[ "0.65370387", "0.6513907", "0.6458628", "0.64248127", "0.6260866", "0.62452203", "0.62053883", "0.62028664", "0.6195377", "0.615413", "0.60914683", "0.6066282", "0.60553503", "0.6043595", "0.6036875", "0.60030484", "0.59885705", "0.59833914", "0.59626335", "0.59259456", "0.59...
0.75973433
0
Returns a list of plot options with the visible data to be plotted including pumping well, observation well or piezometer drawdown
def get_plot_options(self): plot_options = [] # Get pumping rate plot options op = self.pumprate.get_plot_options() if op['visible']: plot_options.append(op) # Get associated data options for i in range(self.well_count()): well_options = self.wells...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_plot_options(self):\n plot_options = []\n # Get drawdown plot options\n op = self.drawdown.get_plot_options()\n if op['visible']:\n plot_options.append(op)\n # Get associated data options\n for i in range(self.data_count()):\n op = self.data[i...
[ "0.7651929", "0.61596566", "0.59600675", "0.59015876", "0.5859506", "0.57540476", "0.5697014", "0.5660056", "0.55900997", "0.55315745", "0.5520085", "0.55183053", "0.55124867", "0.5510683", "0.5503015", "0.55007356", "0.5492204", "0.547329", "0.5446899", "0.5444196", "0.54159...
0.81560767
0
Returns the well id given a well name Only the first well with similar names is returned When well name is not found, 1 is returned
def get_well_id(self, name): idx = -1 if type(name) is str: wells_names = self.wells_list() if name in wells_names: idx = wells_names.index(name) return(idx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getwellid(infile, wellinfo):\r\n m = re.search(\"\\d\", getfilename(infile))\r\n s = re.search(\"\\s\", getfilename(infile))\r\n if m.start() > 3:\r\n wellname = getfilename(infile)[0:m.start()].strip().lower()\r\n else:\r\n wellname = getfilename(infile)[0:s.start()].strip().lower()\...
[ "0.7484223", "0.6575883", "0.62805164", "0.6043915", "0.60195637", "0.5838901", "0.5630826", "0.55032206", "0.549321", "0.54633754", "0.54303014", "0.536089", "0.53045803", "0.5288866", "0.5257819", "0.52421564", "0.5241637", "0.5231975", "0.5201168", "0.5197424", "0.51961", ...
0.7903967
0
Returns well name using the data index as input If well index does not exist then None is returned
def get_well_name(self, idx): name = None if type(idx) is int: n = self.well_count() assert 0 <= idx <= n - 1, "Bad well index" name = self.wells[idx].drawdown.name return(name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_index_from_well(self, well):\n pass", "def index_to_wellname(index, num_wells, direction=\"row\"):\n row, column = index_to_row_column(index, num_wells, direction)\n return coordinates_to_wellname((row, column))", "def get_indexname(self,index):\n if index in self.indexname2index:\n...
[ "0.6899968", "0.66426885", "0.6603633", "0.659633", "0.63491505", "0.60702014", "0.60461676", "0.591587", "0.5881933", "0.579355", "0.57482564", "0.5638517", "0.55967", "0.55727726", "0.55493134", "0.55107397", "0.54778844", "0.5453047", "0.5377641", "0.5374415", "0.53504837"...
0.75987595
0
Check if the well has a constant pumping rate (True) or if pumping rate varies in time (False)
def is_constant_rate(self): n1 = self.pumprate.x.size n2 = self.pumprate.y.size if n1 == n2: if n1 == 1: return(True) else: return(False) else: raise ValueError('Pumping rate is incorrect, check the assigned values!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def have_pump(self, pump):\n if pump > MAX_PUMPS:\n return False\n return bool(self.pump_array[pump])", "def ready_to_measure(self):\n\n constant_tank_ready = self.tanks[CONSTANT_TANK].is_filled\n measuring_tank_ready = (\n self.valves[MEASURING_DRAIN_VALVE].is_c...
[ "0.62926847", "0.62068665", "0.6156856", "0.6154851", "0.6148754", "0.6126147", "0.6086376", "0.60729843", "0.60600513", "0.60233563", "0.6013671", "0.59107727", "0.5866539", "0.5859206", "0.5843414", "0.58411956", "0.57965446", "0.57905734", "0.57867235", "0.577967", "0.5741...
0.6840193
0
Returns a dictionary with all the data contained by the pumping well (including observation wells). It could be used to save data into a .json file
def to_dict(self): out_dict = _deepcopy(self.__dict__) out_dict["pumprate"] = self.pumprate.to_dict() out_wells = [] for i in range(self.well_count()): out_wells.append(self.wells[i].to_dict()) out_dict["wells"] = out_wells return(out_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDictWells(self):\n #Method begins here\n #nx=self.__grid['nx'] #From the geometry in grid\n ny=self.__grid['ny']\n nz=self.__grid['nz']\n minx=self.__grid['ox']\n miny=self.__grid['oy']\n minz=self.__grid['oz']\n rx=self.__grid['dx']\n ry=self...
[ "0.7113749", "0.60998636", "0.5969908", "0.59269804", "0.5899864", "0.5834773", "0.5746034", "0.57153934", "0.5714173", "0.5697139", "0.56901616", "0.56225646", "0.56192833", "0.56154716", "0.55966175", "0.5588612", "0.5565126", "0.55407035", "0.55356914", "0.5494014", "0.548...
0.6850534
1
Returns a dictionary with drawdown data and well parameters needed for analysis models in chen
def to_model(self): out_dict = _deepcopy(self.parameters) out_dict["x"] = self.pumprate.x.copy() out_dict["y"] = self.pumprate.y.copy() out_dict["wtype"] = 1 return(out_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def asDict(self) -> dict:\n return {\n \"predominant_occlusion\": self.predominantOcclusion.value,\n \"estimations\": {\n \"chin\": self.chin,\n \"mouth\": self.mouth,\n \"clear\": self.clear,\n \"correct\": self.correct,\n ...
[ "0.587928", "0.58295727", "0.581102", "0.5742519", "0.5710721", "0.5695244", "0.56393194", "0.56131953", "0.5612707", "0.56123364", "0.56055796", "0.55478233", "0.5530112", "0.5522836", "0.5512796", "0.5482065", "0.54444814", "0.54272425", "0.5426051", "0.54042035", "0.539659...
0.0
-1
Updates the pumping well object using an input dictionary
def update(self, new_data): if type(new_data) is not dict: raise TypeError("Input parameter must be a dict") # Update parameters self._type = new_data.get("_type", self._type) self.time_units = new_data.get("time_units", self.time_units) self.len_units = new_data.get(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_dict(new,old):", "def normal_update(self, game, elfDict):\n self.game = game # update game\n self.my_elves = [elf for elf in elfDict.values() if not elf.elf.already_acted] # update self.my_elves\n self.game = game # update self.game\n self.portals.portals_update(game) #...
[ "0.5895445", "0.5812442", "0.577191", "0.5706581", "0.56495655", "0.5521227", "0.5519335", "0.5515376", "0.55042815", "0.5486805", "0.54773784", "0.53881663", "0.5346425", "0.5302062", "0.528914", "0.5283164", "0.5267203", "0.5243199", "0.5229438", "0.5223958", "0.5216763", ...
0.6680555
0
Verify well parameters and returns warnings according to possible errors
def validate_parameters(self): flag = True warnings = "" # Check radius r = self.parameters.get('rw', 0) if type(r) not in [int, float]: flag = False warnings += "Well radius rw must be a float value\n" else: if r <= 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Check(self, parameters):", "def check_errors(self) -> None:", "def _check_params(self):\n\t\tstrange_param_helper = False\n\t\tfor param in self.params:\n\t\t\n\t\t\t# It could be that the param encapsulates several values (e.g., \"FLUX_RADIUS(10)\")\n\t\t\t# So we have to dissect this\n\t\t\tmatch = re.co...
[ "0.7046296", "0.6972314", "0.69019", "0.6827856", "0.67996854", "0.6766278", "0.67596585", "0.6748443", "0.6729965", "0.6717157", "0.66976315", "0.66686934", "0.6619799", "0.65809375", "0.65628576", "0.64479285", "0.6446445", "0.64453197", "0.642674", "0.6337774", "0.6332849"...
0.7049662
0
Returns the number of observation wells associate to pumping well
def well_count(self): return(len(self.wells))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_wells(self):\n return self.info_wells['well'].nunique()", "def num_injectors(self):\n injectors = self.info_wells.groupby('well_type').get_group('inj')\n return injectors['well'].nunique()", "def num_producers(self):\n producers = self.info_wells.groupby('well_type').get_gr...
[ "0.8019491", "0.7295038", "0.7184108", "0.6849336", "0.6847076", "0.64381284", "0.6317566", "0.6127201", "0.60816175", "0.6061327", "0.6042718", "0.5989033", "0.5961877", "0.59533936", "0.5948019", "0.59341747", "0.5918273", "0.5909013", "0.5906111", "0.5804282", "0.5790544",...
0.7780465
1
Returns a list with the well name given a type of well
def wells_list(self, wtype='all'): list_names = [] for well_data in self.wells: if wtype == 'all': list_names.append(well_data.drawdown.name) elif wtype == well_data._type - 2: list_names.append(well_data.drawdown.name) return(list_names)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_well_name(self, idx):\n name = None\n if type(idx) is int:\n n = self.well_count()\n assert 0 <= idx <= n - 1, \"Bad well index\"\n name = self.wells[idx].drawdown.name\n return(name)", "def get_well_aliases(self):\n return self.info_wells['wel...
[ "0.6303364", "0.62997895", "0.60606045", "0.60131824", "0.60059685", "0.5961164", "0.5938659", "0.58209205", "0.5689827", "0.5598569", "0.55082047", "0.54078776", "0.53718215", "0.5231179", "0.5161112", "0.51495016", "0.51280046", "0.5123762", "0.5105599", "0.50994503", "0.50...
0.76513284
0
Create an observation well object
def __init__(self, name="", description="", time_units="s", len_units="m"): # Set general info self._type = 2 # observation well id self.time_units = time_units self.len_units = len_units self.parameters = {'full': True, # is full penetrating? 'r': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_observation(self):", "def create_observation(self):", "def create_observation(obs):\n\n obs = {\n \"resourceType\": \"Bundle\",\n \"entry\": [\n {\n \"resource\": {\n \"resourceType\": \"Observation\",\n \"text\": \"Res...
[ "0.7262633", "0.7262633", "0.6304292", "0.6092133", "0.5869381", "0.58260345", "0.5790642", "0.5662167", "0.56451553", "0.5643948", "0.56339514", "0.55029154", "0.55016196", "0.54881907", "0.5431089", "0.5425991", "0.53834933", "0.53741235", "0.53203386", "0.5315863", "0.5306...
0.5767391
7
Add new data object to the actual observation well or piezometer INPUTS x [int, float, list, tuple, ndarray] time vector y [int, float, list, tuple, ndarray] data vector dtype [int] type of data 1 drawdown 2 drawdown first derivative 3 drawdown second derivative name [string] data name that is used as label for plot de...
def add_data(self, x=1, y=1, dtype=1, name="New data", description="New data"): assert 1 <= dtype <= 3, "Bad value for data type" new_data = _Data(dtype, name=name, description=description) new_data.set_data(x=x, y=y, xunits=self.time_units, yunits=self.len_units) self.data.append(new_da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addData(self,data,x,y):\n self.nSamples+=1\n if self.nSamples == 1:\n self.indata.append(data)\n (self.ny,self.nx)=data.shape\n self.ny=int(data.shape[0])\n self.x=x\n self.y=y\n self.lx=self.x[-1:][0]\n self.ly=self.y[-...
[ "0.6510986", "0.62951386", "0.61421543", "0.60370123", "0.60024756", "0.5935693", "0.5730617", "0.57196116", "0.5718037", "0.57020605", "0.5682233", "0.56609374", "0.5654391", "0.5629142", "0.5609044", "0.5552659", "0.5545938", "0.5531034", "0.5513014", "0.5501703", "0.548691...
0.7377167
0
Convert parameters, drawdown and data units given new units INPUTS time_units [string] new time units. If None, actual units are used length_units [string] new length units. If None, actual units are used
def convert_units(self, time_units=None, len_units=None): in_time = self.time_units # Check new time units if time_units is None: time_units = in_time flag = _units.validate_units(time_units) if flag == -1: raise ValueError('Bad time units input {}'.format...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_units(self, time_units=None, len_units=None, pump_units=None,\n same=False):\n in_time = self.time_units\n # Check new time units\n if time_units is None:\n time_units = in_time\n flag = _units.validate_units(time_units)\n if flag == -1...
[ "0.7270952", "0.67853004", "0.6321186", "0.62948203", "0.6257909", "0.62499386", "0.6237745", "0.609285", "0.6059407", "0.6052014", "0.60473174", "0.60461247", "0.6036106", "0.60240674", "0.59835577", "0.59373957", "0.58589494", "0.58529156", "0.58520365", "0.584814", "0.5838...
0.82226205
0
Removes the data object from the associated data list given the data name or id
def delete_data(self, key): if type(key) is str: idx = self.get_data_id(key) elif type(key) is int: idx = key else: raise TypeError('key must be a string or a integer.') n = self.data_count() if 0 <= idx <= n - 1: raise ValueError('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeData(self, data: ghidra.program.model.listing.Data) -> None:\n ...", "def delete(self, data):\n self.data.remove(data)", "def remove(self, data_id, idx):\n temp = self.database[data_id]\n del temp[idx]\n self.database[data_id] = temp", "def _remove_link(self, name...
[ "0.7811379", "0.7518123", "0.723232", "0.7106772", "0.6698628", "0.6691075", "0.66770357", "0.6628748", "0.6618853", "0.6594276", "0.6585027", "0.6566789", "0.6539488", "0.65005875", "0.6422972", "0.6422553", "0.64187837", "0.64134914", "0.64002156", "0.6397125", "0.63957363"...
0.63491714
22
Returns a list of plot options with the visible data to be plotted including observation well or piezometer drawdown
def get_plot_options(self): plot_options = [] # Get drawdown plot options op = self.drawdown.get_plot_options() if op['visible']: plot_options.append(op) # Get associated data options for i in range(self.data_count()): op = self.data[i].get_plot_op...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_plot_options(self):\n plot_options = []\n # Get pumping rate plot options\n op = self.pumprate.get_plot_options()\n if op['visible']:\n plot_options.append(op)\n # Get associated data options\n for i in range(self.well_count()):\n well_options...
[ "0.7800204", "0.60322195", "0.59715027", "0.59681576", "0.58703583", "0.58673334", "0.57929796", "0.5701164", "0.55820847", "0.5552981", "0.5541041", "0.5540643", "0.55129695", "0.5459508", "0.54499143", "0.544476", "0.5441358", "0.54261726", "0.5417078", "0.5395974", "0.5373...
0.77666795
1
Returns a list with the data name given a type of data
def data_list(self, dtype='all'): list_names = [] for well_data in self.data: if dtype == 'all': list_names.append(well_data.name) elif dtype == well_data.dtype: list_names.append(well_data.name) return(list_names)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDataTypes(self, name: unicode) -> List[ghidra.program.model.data.DataType]:\n ...", "def get_text_data_list(self):\n return [self.name, str(self.type)]", "def list_of_identifiers(data, type):\n identifiers = []\n for id_data in data:\n if id_data.get('type') == type:\n ...
[ "0.728314", "0.6950621", "0.67950463", "0.64226145", "0.6325345", "0.6290614", "0.6279772", "0.6163454", "0.61411387", "0.6140158", "0.6051041", "0.6050611", "0.603196", "0.5979531", "0.59499097", "0.5932981", "0.5897951", "0.5894344", "0.58363205", "0.5806849", "0.57793367",...
0.7135787
1
Returns the number of data associated to the well or piezometer
def data_count(self): return(len(self.data))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_data(self):\n try:\n ndata = len(self.x)\n logger.info(\"Number of data points: {0}\".format(ndata))\n except AttributeError:\n logger.error(\"Data object has not been defined\")\n ndata = 0\n return ndata", "def get_number_of_measurement...
[ "0.71673447", "0.67605793", "0.6595559", "0.6514471", "0.6508083", "0.6439929", "0.63984495", "0.63630575", "0.6320137", "0.6320137", "0.6320137", "0.6320137", "0.63045174", "0.6284571", "0.62344813", "0.61748326", "0.6155655", "0.61516064", "0.6130794", "0.61301106", "0.6126...
0.65397066
3
Returns the data object giving the data name or index
def get_data(self, key): if type(key) is str: idx = self.get_data_id(key) elif type(key) is int: idx = key else: raise TypeError('key must be a string or a integer.') n = self.data_count() if 0 > idx or idx > n - 1: raise ValueError...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, index):\n\n if self._data_indices is not None:\n index = self._data_indices[index]\n data = self._dataset[index]\n return data", "def __getitem__(self, name):\n if name in self.data: return self.data[name]", "def get_at_index(self, index: int) -> obj...
[ "0.7211367", "0.6997411", "0.69773567", "0.697084", "0.6944017", "0.6932011", "0.6911341", "0.6911341", "0.6850977", "0.68421745", "0.67610013", "0.6677398", "0.6553262", "0.6523296", "0.65120715", "0.64988226", "0.6473112", "0.64687705", "0.64374113", "0.6436611", "0.6431836...
0.6006657
54
Returns the data id in the list of data using the data name Only the first data with similar names is returned When data name is not found, 1 is returned
def get_data_id(self, name): idx = -1 if type(name) is str: data_names = self.data_list() if name in data_names: idx = data_names.index(name) return(idx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _data_id_from_label(self, label):\n for data_item in self.state.data_items:\n if data_item['name'] == label:\n return data_item['id']", "def search(self, name):\n\n name = name.lower().strip()\n exact_names = get_close_matches(name, self.possible_names, n=1)\n ...
[ "0.6605792", "0.6598897", "0.6358529", "0.6218891", "0.6171888", "0.5997316", "0.59925854", "0.5937047", "0.5915923", "0.5889121", "0.58376426", "0.5834831", "0.57998013", "0.57785743", "0.5744238", "0.569555", "0.5694921", "0.56620944", "0.5656047", "0.56512594", "0.56259936...
0.78273237
0
Returns data name using the data index as input If data idx does not exist then None is returned
def get_data_name(self, idx): name = None if type(idx) is int: n = self.data_count() assert 0 <= idx <= n - 1, "Bad data index" name = self.data[idx].name return(name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_indexed_component_data_name(component, index):\n if not component.is_indexed():\n return component.name\n elif index in component._data:\n ans = component._data[index].name\n else:\n for i in range(5):\n try:\n component._data[index] = component._Com...
[ "0.72503287", "0.68155634", "0.65541536", "0.650533", "0.6259094", "0.62368953", "0.60989296", "0.60197777", "0.59163827", "0.5891898", "0.5812209", "0.57695496", "0.57461333", "0.5738705", "0.5722598", "0.57208043", "0.56727195", "0.56393695", "0.5613669", "0.56084156", "0.5...
0.8564489
0
Returns the data type given the data index
def get_data_type(self, idx): return(self.data[idx].dtype)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_type():\n return DataTypeUtil.getDTypeForName(DataTypeUtil.getDtypeFromContext())", "def data_type(self) -> int:\n return self.data[\"args\"][\"dataType\"]", "def datatype(self):\n # datatype is type of first dataarg\n return self[self.dataargs()[0]].typename", "def data_type...
[ "0.72349155", "0.7209514", "0.7037685", "0.69469965", "0.6839629", "0.6827165", "0.6827165", "0.6827165", "0.6680594", "0.6609436", "0.6554991", "0.6540169", "0.6508893", "0.6493248", "0.6450711", "0.6441724", "0.63943344", "0.6353002", "0.63170236", "0.63162494", "0.6316209"...
0.8298103
0
Returns a dictionary with well parameters
def get_parameters(self): return(_deepcopy(self.parameters))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_params(self):\n return {}", "def parameters(self):\n return {\"W\": self.W,\n \"T\": self.T,\n \"P\": self.P,\n \"Wo\": self.Wo,\n \"To\": self.To,\n \"Po\": self.Po}", "def get_params(self):\n return {\"d\": \"...
[ "0.7157849", "0.71448296", "0.70548433", "0.69977343", "0.69741374", "0.6912348", "0.6773086", "0.6764622", "0.67219996", "0.6715262", "0.6695996", "0.66917676", "0.6640885", "0.6640533", "0.6637852", "0.66346395", "0.65994066", "0.65687644", "0.6556268", "0.65546185", "0.652...
0.0
-1
Delete all the associate data
def reset_data(self): self.data = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_all(self):\n raise NotImplementedError()", "def delete_all(self):\n with self.__lock:\n self.__data = dict()\n self.flush()", "def deleteAll(self):\n self.deleteAttributeRange() #Default args = everything", "def clear_data():\n logger.info(\"Delete Str...
[ "0.78988016", "0.77220124", "0.770756", "0.7586882", "0.7411554", "0.73536557", "0.7343204", "0.7230482", "0.71741986", "0.71688086", "0.714042", "0.7107411", "0.71067667", "0.70971084", "0.70971084", "0.70941174", "0.70929646", "0.7079958", "0.70230395", "0.69778144", "0.696...
0.0
-1
Replaces the well drawdown given the index of a drawdown data in data list
def set_as_drawdown(self, idx): dtype = self.get_data_type(idx) if dtype == "Pumping rate": x, y = self.data[idx].get_data() self.drawdown.set_data(x, y) else: raise TypeError('Selected data is not drawdown!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from_drawn(section: str, index: int):\r\n del drawn[section][index]", "def activateChildWellIndex(self,index,value):\n activeIndices=self.activeChildWellIndices()\n if value and index not in activeIndices:\n activeIndices.append(index)\n activeIndices=sorted(acti...
[ "0.5802891", "0.53335387", "0.53131515", "0.52770084", "0.52692586", "0.51205266", "0.50659335", "0.49722874", "0.49578884", "0.4950951", "0.48292145", "0.48174497", "0.48127028", "0.47716764", "0.47540691", "0.47284764", "0.47264978", "0.46799114", "0.4676532", "0.46628883", ...
0.5534069
1
Set well or piezometer parameters
def set_parameters(self, full=None, r=None, l=None, d=None, z=None): original = _deepcopy(self.parameters) # save in case of error if type(full) is bool: self.parameters["full"] = full if type(r) in [int, float]: self.parameters["r"] = float(r) if self._type ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setParameters(self):\n\n # Set the parameters\n self.taux = 24.2\n self.mu = 0.23\n self.G = 33.75\n self.alpha_0 = 0.05\n self.delta = 0.0075\n self.p = 0.50\n self.I0 = 9500.0\n self.kparam = 0.55", "def set_parameters(self,params):\n K3...
[ "0.66596335", "0.652628", "0.6494346", "0.6468288", "0.6423567", "0.640161", "0.63715726", "0.63502043", "0.6313164", "0.6293706", "0.6262655", "0.62223566", "0.61831945", "0.61662924", "0.61540055", "0.613113", "0.6102963", "0.61024153", "0.609081", "0.60681343", "0.60625523...
0.6427534
4
Returns a list of dictionaries containing all the data in the well that can be used to storage the data as json format
def to_dict(self): out_dict = _deepcopy(self.__dict__) out_dict["drawdown"] = self.drawdown.to_dict() out_data = [] for i in range(self.data_count()): out_data.append(self.data[i].to_dict()) out_dict["data"] = out_data return(out_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_datalist_fr_json(self):\n raw_data = json.load(open(self.saved_json_file, 'r'))\n for indivdual_set in raw_data['query']['results']['stats']:\n temp_dict_data = {}\n if type(indivdual_set) == str:\n #for single data\n continue # temp do no...
[ "0.7234665", "0.714661", "0.68842065", "0.68358326", "0.66206723", "0.6602693", "0.6447181", "0.64074695", "0.64045924", "0.63781536", "0.6338094", "0.6336256", "0.63291097", "0.6313858", "0.62933797", "0.62647957", "0.6225904", "0.62003684", "0.6192421", "0.61876845", "0.618...
0.5839698
73
Returns a dictionary with drawdown data and well parameters needed for analysis models in chen
def to_model(self): out_dict = _deepcopy(self.parameters) out_dict["x"] = self.drawdown.x.copy() out_dict["y"] = self.drawdown.y.copy() if self._type == 2: out_dict["wtype"] = 2 elif self._type == 3: out_dict["wtype"] = 3 return(out_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def asDict(self) -> dict:\n return {\n \"predominant_occlusion\": self.predominantOcclusion.value,\n \"estimations\": {\n \"chin\": self.chin,\n \"mouth\": self.mouth,\n \"clear\": self.clear,\n \"correct\": self.correct,\n ...
[ "0.58797055", "0.58303946", "0.5813848", "0.5742892", "0.57119375", "0.5697148", "0.5641197", "0.5615532", "0.5615115", "0.561501", "0.55502295", "0.5531489", "0.55249536", "0.5515042", "0.5483852", "0.54467213", "0.54290205", "0.54283315", "0.54066515", "0.5398945", "0.53961...
0.56081396
10
Updates the well or piezometer object using an input dictionary
def update(self, new_data): if type(new_data) is not dict: raise TypeError("Input parameter must be a dict") # Update parameters self._type = new_data.get("_type", self._type) self.time_units = new_data.get("time_units", self.time_units) self.len_units = new_data.get(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self,d:dict):\n for name,(value,n) in d.items():\n if n==0:\n continue\n self.meters[name].update(value,n)", "def update(self,dict):\n for key in list(dict.keys()):\n print(\"Hey, I'm updating something\")\n self.d[key]=dict[key]...
[ "0.6955226", "0.63827276", "0.63701075", "0.62050605", "0.60651165", "0.601024", "0.5964989", "0.5824813", "0.5740105", "0.5740105", "0.571362", "0.57038397", "0.5703277", "0.5690079", "0.568872", "0.5649773", "0.5644877", "0.5637672", "0.5637672", "0.5636201", "0.56254166", ...
0.61816335
4
Verify well parameters and returns warnings according to possible errors
def validate_parameters(self): flag = True warnings = "" # Check radius r = self.parameters.get('r', 0) if type(r) not in [int, float]: flag = False warnings += "Radius r must be a float value\n" else: if r <= 0: flag =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_parameters(self):\n\n flag = True\n warnings = \"\"\n # Check radius\n r = self.parameters.get('rw', 0)\n if type(r) not in [int, float]:\n flag = False\n warnings += \"Well radius rw must be a float value\\n\"\n else:\n if r <...
[ "0.7049662", "0.7046296", "0.6972314", "0.69019", "0.67996854", "0.6766278", "0.67596585", "0.6748443", "0.6729965", "0.6717157", "0.66976315", "0.66686934", "0.6619799", "0.65809375", "0.65628576", "0.64479285", "0.6446445", "0.64453197", "0.642674", "0.6337774", "0.6332849"...
0.6827856
4
Create a piezometer object (works similar to Observation well)
def __init__(self, name="", description="", time_units="s", len_units="m"): super(Piezometer, self).__init__() # Set general info self._type = 3 # piezometer id self.parameters = {'full': True, # is full penetrating? 'r': 1., # distance until pumping well i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lick_piezo():\n lp_raw = read_npy_file('lickPiezo.raw.npy')\n lp_timestamps = read_npy_file('lickPiezo.timestamps.npy')\n lp_rate = get_rate(lp_timestamps)\n lick_piezo_ts = TimeSeries(\n name='lickPiezo',\n starting_time=lp_timestamps[0, 1],\n rate=lp_rate,\n data=np.ra...
[ "0.5920001", "0.57205135", "0.5660947", "0.5660947", "0.5660947", "0.5660947", "0.5660947", "0.56580734", "0.5646192", "0.5608879", "0.56043893", "0.55835843", "0.55835843", "0.55835843", "0.55835843", "0.55835843", "0.55835843", "0.55835843", "0.55545354", "0.5550657", "0.55...
0.6613623
0
method to validate my input
def validate_empty(self): result = "" if(not re.search("[a-zA-Z0-9]", self.title) or not re.search("^(\s|\S)*(\S)+(\s|\S)*$", self.body)): result = "INCORRECT INPUT, YOU CAN'T SUBMIT EMPTY FIELD OR FIRST CHARACTER SHOULD BE ALPHA NUMERIC" else: result = True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate():", "def validate_input(self, *args):\n return", "def isInputValid(self, input):\r\n pass", "def check_validity(self):", "def __validate():\n # TODO: implement", "def validate(self):", "def validate(self):", "def _validate_input(self):\n self.data.validate()\n ...
[ "0.8256197", "0.8026426", "0.7914555", "0.7372203", "0.7364157", "0.73189014", "0.73189014", "0.71831155", "0.71817976", "0.7078171", "0.7075113", "0.7054536", "0.69421256", "0.69395375", "0.69082284", "0.69082284", "0.69082284", "0.69082284", "0.69082284", "0.69082284", "0.6...
0.0
-1
Connects to postgres db
def connect_to_postgres(): try: conn = psycopg2.connect(database=os.environ['POSTGRES_DATABASE'], user=os.environ['POSTGRES_USER'], password=os.environ['POSTGRES_PASSWORD'], host=os.environ['POSTGRES_HOST']) return conn except psycopg2.Error as err: loggin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect_to_postgres():\n postgres_creds = os.environ.get(\"POSTGRES_CREDS\")\n if not postgres_creds:\n postgres_creds = get_secret(\"POSTGRES_CREDS\")\n print(\"Using {} Postgres database credentials\".format(postgres_creds))\n postgres_url = os.environ.get(\"POSTGRES\")\n if not postgre...
[ "0.8593803", "0.8553654", "0.8398151", "0.83853227", "0.82916325", "0.82193106", "0.8194222", "0.8186864", "0.8180956", "0.81787014", "0.81350166", "0.8125547", "0.8113675", "0.8113675", "0.8113675", "0.8113675", "0.8113675", "0.8113675", "0.8113675", "0.8113675", "0.8113675"...
0.80444777
24