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
Executes the prepared statement pipeline.
def _execute_prepared_pipeline(self, msg_type, msg, statement): # For old servers without prepared statement support if not self._prepared_stmt_supported: # Crud::<Operation> self.protocol.send_msg_without_ps(msg_type, msg, statement) return if statement.deal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(self):\n if self.sql is None:\n self.sql = self.construct_query()\n # Only SQL strings can be split, not (e.g.) SQLAlchemy statements.\n if self.multiple_statements and isinstance(self.sql, str):\n statements = self._split_sql()\n else:\n sta...
[ "0.70832497", "0.6924596", "0.6796455", "0.67755574", "0.67714244", "0.6683341", "0.6624205", "0.66034377", "0.6593222", "0.6552192", "0.64773214", "0.64732516", "0.64438355", "0.63944197", "0.6392974", "0.63772726", "0.63595045", "0.63264805", "0.62783676", "0.62783676", "0....
0.7378705
0
Execute a SQL statement.
def send_sql(self, statement): sql = statement.sql if self.protocol is None: raise OperationalError("MySQLx Connection not available") if not isinstance(sql, str): raise ProgrammingError("The SQL statement is not a valid string") msg_type, msg = self.protocol.buil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(self, sql, *args, **kwgs):\n curr = self.conn.cursor()\n curr.execute(sql, *args, **kwgs)\n self.conn.commit()\n curr.close()", "def execute(self, sql):\n return self.db.execute(sql)", "def execute(self, sql):\n\n res = self.cur.execute(sql)\n self.c...
[ "0.80913717", "0.7996879", "0.7953266", "0.7799667", "0.77607554", "0.7701537", "0.7694793", "0.76723194", "0.7666365", "0.7663556", "0.75981164", "0.7598033", "0.7582277", "0.75515825", "0.7514116", "0.7508846", "0.7474857", "0.746607", "0.74504364", "0.74478", "0.74393445",...
0.7065757
40
Send an insert statement.
def send_insert(self, statement): if self.protocol is None: raise OperationalError("MySQLx Connection not available") msg_type, msg = self.protocol.build_insert(statement) self.protocol.send_msg(msg_type, msg) ids = None if isinstance(statement, AddStatement): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_statement() -> str:\n pass", "def send_insert(self, query):\n # TODO: Add exception handling from bad queries\n\n # More regex to make sure our table names don't have colons\n insert_pattern = r\"INSERT INTO ([\\w_:]+)\"\n match = re.search(insert_pattern, query, re....
[ "0.7384397", "0.69468737", "0.68763345", "0.6809553", "0.6746126", "0.66473293", "0.65237105", "0.65009034", "0.6473686", "0.6462763", "0.6447793", "0.6376111", "0.632397", "0.6143063", "0.6130192", "0.61221296", "0.61190283", "0.61083734", "0.60887593", "0.60645217", "0.6062...
0.76300764
0
Send an find statement.
def send_find(self, statement): msg_type, msg = self.protocol.build_find(statement) self._execute_prepared_pipeline(msg_type, msg, statement) return DocResult(self) if statement.is_doc_based() else RowResult(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def command_find(args):\n _perform_environment_check()\n\n filter_dict = _get_find_filter_dict(args)\n _find_verify_arguments(filter_dict)\n\n session = setup_session()\n expanded_queries = _expand_query_list(\n session, args[\"queries\"], True, args[\"verbose\"])\n query_results = retriev...
[ "0.6444074", "0.6254063", "0.61229104", "0.59837246", "0.5848489", "0.5848489", "0.5728122", "0.5681463", "0.5674269", "0.55781", "0.55584466", "0.55389637", "0.55220276", "0.5503203", "0.5482566", "0.5453439", "0.5439397", "0.54308236", "0.5427496", "0.53980815", "0.5381286"...
0.78340423
0
Send an delete statement.
def send_delete(self, statement): msg_type, msg = self.protocol.build_delete(statement) self._execute_prepared_pipeline(msg_type, msg, statement) return Result(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self):\n self.method = \"DELETE\"\n self.send()", "async def delete(self, delete: TPayload) -> None:", "async def send_delete(self, timeout, message, *args, **kwargs):\n msg = await self.send(message, *args, **kwargs)\n await self.delay(timeout, self.delete_message, msg)"...
[ "0.7385034", "0.73660344", "0.71574575", "0.70037", "0.7000284", "0.6950718", "0.6941215", "0.69066143", "0.673866", "0.67378473", "0.6722369", "0.6716552", "0.6706473", "0.6699444", "0.66581553", "0.6646974", "0.66316766", "0.66136587", "0.66136587", "0.6557389", "0.65246904...
0.80671525
0
Send an delete statement.
def send_update(self, statement): msg_type, msg = self.protocol.build_update(statement) self._execute_prepared_pipeline(msg_type, msg, statement) return Result(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_delete(self, statement):\n msg_type, msg = self.protocol.build_delete(statement)\n self._execute_prepared_pipeline(msg_type, msg, statement)\n return Result(self)", "def delete(self):\n self.method = \"DELETE\"\n self.send()", "async def delete(self, delete: TPayload...
[ "0.80671525", "0.7385034", "0.73660344", "0.71574575", "0.70037", "0.7000284", "0.6950718", "0.6941215", "0.69066143", "0.673866", "0.67378473", "0.6722369", "0.6716552", "0.6706473", "0.6699444", "0.66581553", "0.6646974", "0.66316766", "0.66136587", "0.66136587", "0.6557389...
0.0
-1
Execute a non query command.
def execute_nonquery(self, namespace, cmd, raise_on_fail, fields=None): try: msg_type, msg = self.protocol.build_execute_statement( namespace, cmd, fields ) self.protocol.send_msg(msg_type, msg) return Result(self) except OperationalError: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _execute_command(self):\n try:\n self.dw.execute_sql_command(self.query)\n except Exception as e:\n raise e", "def execute_command(self):\n raise Exception(\"Not implemented\")", "def execute():\n pass", "def execute_command(self, command):\n raise...
[ "0.7001297", "0.6783529", "0.67653435", "0.67629516", "0.6759797", "0.6638806", "0.6563317", "0.6484494", "0.6454391", "0.64470786", "0.643935", "0.6354869", "0.63405234", "0.6338001", "0.63165015", "0.6301107", "0.628283", "0.6262336", "0.6207604", "0.62047315", "0.6106944",...
0.75498843
0
Execute a SQL scalar.
def execute_sql_scalar(self, sql): msg_type, msg = self.protocol.build_execute_statement("sql", sql) self.protocol.send_msg(msg_type, msg) result = RowResult(self) result.fetch_all() if result.count == 0: raise InterfaceError("No data found") return result[0][...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scalar(\n self,\n statement: Executable,\n params: Optional[_CoreSingleExecuteParams] = None,\n *,\n execution_options: OrmExecuteOptionsParameter = util.EMPTY_DICT,\n bind_arguments: Optional[_BindArguments] = None,\n **kw: Any,\n ) -> Any:\n\n return...
[ "0.7701918", "0.71551996", "0.7100363", "0.6940922", "0.6882699", "0.6826517", "0.6695476", "0.6527107", "0.64857984", "0.64295435", "0.6383758", "0.6353387", "0.6353387", "0.6297698", "0.62929964", "0.62206954", "0.6217163", "0.6205181", "0.61824566", "0.61709344", "0.616329...
0.8164014
0
Returns the row result.
def get_row_result(self, cmd, fields): msg_type, msg = self.protocol.build_execute_statement("mysqlx", cmd, fields) self.protocol.send_msg(msg_type, msg) return RowResult(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def row(self):\n\t\treturn self.__row", "def GetRow(self, *args):\n return _table.Table_GetRow(self, *args)", "def row(self):\n return self[\"row\"]", "async def fetchrow(self, query, *args):\n return await self.conn.fetchrow(query, *args)", "def get(self, question, rows):\n con...
[ "0.74685645", "0.73545074", "0.7256448", "0.7067526", "0.69482213", "0.69145906", "0.69093925", "0.6632243", "0.66001034", "0.65924114", "0.6545835", "0.6512619", "0.6488524", "0.648791", "0.64498204", "0.6423435", "0.64162236", "0.63929546", "0.6330284", "0.6315243", "0.6300...
0.7327626
2
Returns the next statement ID.
def get_next_statement_id(self): self._stmt_counter += 1 return self._stmt_counter
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next_id(self):\n con = self.c._connect()\n last_id = self.c.get_last_id(con.cursor())\n con.close()\n return last_id + 1", "def _GetNextId(self):\r\n ret = self.next_id\r\n self.next_id += 1\r\n return str(self.next_id)", "def next_id(self):\n next_id = self....
[ "0.7208179", "0.7177133", "0.71536875", "0.7083505", "0.69675034", "0.68555605", "0.66787165", "0.6669282", "0.66617703", "0.66554725", "0.6654138", "0.66450495", "0.6561741", "0.6561741", "0.6507544", "0.6493001", "0.64676034", "0.64601374", "0.641892", "0.6389219", "0.63501...
0.87267596
0
Check if connection is open.
def is_open(self): return self.stream.is_open()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_open(self):\n\t\treturn self.conn.open", "def is_open(self) -> bool:\n return self._connection is not None", "def connection_open(self):\n return self.conn_status == self.CONN_OPEN", "def is_open(self):\n return self.connection.isOpen()", "def is_open(self):\n return self...
[ "0.8654838", "0.86042035", "0.86011446", "0.8508045", "0.8285075", "0.82302254", "0.8161917", "0.81535035", "0.81473255", "0.8084304", "0.78512996", "0.77833134", "0.776559", "0.7737575", "0.7721025", "0.7687225", "0.7648195", "0.7561605", "0.7556905", "0.7545668", "0.7534977...
0.7602707
17
Set the disconnection message from the server.
def set_server_disconnected(self, reason): self._server_disconnected = True self._server_disconnected_reason = reason
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disconnect(self, message, **kwargs):\n pass", "def disconnect(self, message, **kwargs):\n pass", "def on_disconnect(self, raw_msg, server, port, **kwargs):", "def on_disconnect_message(self, message):\n log.warning(\"Received disconnect message: %s\", message)", "def disconnect(sel...
[ "0.68638045", "0.68638045", "0.6823694", "0.6618729", "0.6473516", "0.64338416", "0.62882143", "0.6279782", "0.6179876", "0.61749744", "0.6167695", "0.61551136", "0.61484003", "0.6045428", "0.6002268", "0.59675527", "0.59421736", "0.5928037", "0.58582866", "0.58468086", "0.58...
0.6655169
3
Verify if the session has been disconnect from the server.
def is_server_disconnected(self): return self._server_disconnected
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def the_current_device_is_disconnected():\n assert web_app.disconnect_from_device()", "def disconnect(self):\n\n try:\n\n if (not self._is_connected):\n self._mh.demsg('htk_on_warning', self._mh._trn.msg(\n 'htk_email_not_connected'), self._mh.fromhere())\n...
[ "0.7145031", "0.71031016", "0.6996738", "0.6955181", "0.68829244", "0.68382865", "0.6805459", "0.6763558", "0.67475975", "0.65670174", "0.6533137", "0.6518449", "0.6506981", "0.648855", "0.64253366", "0.6399528", "0.6389389", "0.6377379", "0.6375204", "0.6342823", "0.62868726...
0.7003153
2
Get the disconnection message sent by the server.
def get_disconnected_reason(self): return self._server_disconnected_reason
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disconnect(self):\n\n if not self.sascfg.reconnect:\n return \"Disconnecting and then reconnecting to this workspaceserver has been disabled. Did not disconnect\"\n\n pgm = b'\\n'+b'tom says EOL=DISCONNECT \\n'\n self.stdin[0].send(pgm)\n\n while True:\n ...
[ "0.7116792", "0.6579427", "0.6540664", "0.6371147", "0.6267578", "0.62578523", "0.6254394", "0.6201919", "0.61806864", "0.61534166", "0.61381096", "0.6127999", "0.611137", "0.6108084", "0.6046112", "0.5982081", "0.5954857", "0.59370977", "0.59243006", "0.58993757", "0.5895715...
0.68035406
1
Close a sucessfully authenticated session.
def close_session(self): if not self.is_open(): return try: # Fetch any active result self.fetch_active_result() # Deallocate all prepared statements if self._prepared_stmt_supported: for stmt_id in self._prepared_stmt_ids: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_session(self):\n if self.sma_sid is None:\n return\n yield from self._fetch_json(URL_LOGOUT, {})\n self.sma_sid = None", "def terminate_session():\n token = oidc.user_loggedin and oidc.get_access_token()\n if token and oidc.validate_token(token):\n # Direct ...
[ "0.7321204", "0.7281403", "0.7239736", "0.72332984", "0.7224548", "0.7203067", "0.71985906", "0.7167103", "0.7161366", "0.7139684", "0.7103199", "0.70937157", "0.7082139", "0.706835", "0.7061959", "0.7012305", "0.7012305", "0.7012305", "0.7012305", "0.7012305", "0.7012305", ...
0.67202854
35
Reset a sucessfully authenticated session.
def reset_session(self): if not self.is_open(): return if self._active_result is not None: self._active_result.fetch_all() try: self.keep_open = self.protocol.send_reset(self.keep_open) except (InterfaceError, OperationalError) as err: _LOG...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset():\n if app.config['SESSION_KEY'] in session:\n session.pop(app.config['SESSION_KEY'])\n return redirect(url_for('home'))", "def reset_flask_session_on_login():\n session.clear()\n session.permanent = True", "def relogin(self):\n spotify.Error.maybe_raise(lib.sp_session_relo...
[ "0.7480814", "0.6960703", "0.68716395", "0.6633303", "0.6603879", "0.6529527", "0.64746696", "0.6469612", "0.6411634", "0.6361558", "0.6336899", "0.6296393", "0.6277908", "0.618854", "0.618854", "0.6179551", "0.61739373", "0.6171018", "0.6112825", "0.60756004", "0.60566664", ...
0.72207
1
Announce to the server that the client wants to close the connection. Discards any session state of the server.
def close_connection(self): if not self.is_open(): return if self._active_result is not None: self._active_result.fetch_all() self.protocol.send_connection_close() self.protocol.read_ok() self.stream.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\r\n try:\r\n self.server_connection.send(b\"Close Client Connection\")\r\n\r\n # Avoid an error when shutting down the server.\r\n except ConnectionAbortedError:\r\n pass\r\n\r\n # The connection is closed.\r\n self.is_connected = False", ...
[ "0.7333029", "0.7107399", "0.7106812", "0.6964972", "0.69557995", "0.6927663", "0.6906798", "0.68644345", "0.6861224", "0.68433136", "0.6811934", "0.6802279", "0.6788052", "0.67816615", "0.67729366", "0.6764916", "0.67384773", "0.67384773", "0.6725847", "0.6722761", "0.672145...
0.0
-1
Closes the connection. This method closes the socket.
def close_connection(self): super().close_session()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self) -> None:\n self._socket.close()", "def close(self):\n self.socket.close()", "def close(self):\n self.socket.close()", "def close(self):\n self.socket.close()", "def close(self):\n self.socket.close()", "def close(self):\n self.socket.close()", "...
[ "0.8179949", "0.8071804", "0.8071804", "0.8071804", "0.8071804", "0.8071804", "0.8071804", "0.79675394", "0.79121006", "0.7899818", "0.7899818", "0.7828968", "0.77170676", "0.7714015", "0.7701385", "0.76992553", "0.76978284", "0.7671865", "0.7653264", "0.76029766", "0.7513653...
0.0
-1
Do not close, but add connection back to pool. The close_session() method does not close the connection with the MySQL server. The connection is added back to the pool so it can be reused. When the pool is configured to reset the session, the session state will be cleared by reauthenticating the user once the connectio...
def close_session(self): self.pool.add_connection(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_db_session(self, session):\r\n session.close()", "def recycle(self, session):\n pool = self.session_pool\n for s in list(pool): # freezing the pool into a list for iteration allows pool mutation inside the loop\n if not s.healthy:\n pool.remove(s)\n ...
[ "0.6510951", "0.63316697", "0.61100155", "0.61048955", "0.6004304", "0.59648746", "0.5942895", "0.5915236", "0.5910982", "0.5891946", "0.58184874", "0.58020455", "0.57593113", "0.5719936", "0.57130855", "0.56957394", "0.5664843", "0.5656271", "0.5656271", "0.56377137", "0.563...
0.8022143
0
Reset the connection. Resets the connection by reauthenticate.
def reset(self): self.reconnect()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reset_connection(self):\n\n self.__userid = 0\n self.__token = 0\n self.__conn.close()\n\n self.__conn = httplib.HTTPConnection(\"www.slimtimer.com\")\n self._logon()", "def reconect(self):\n self.connection.reset_connection()\n return self.connection", ...
[ "0.7405834", "0.7173897", "0.7081212", "0.6790866", "0.6768989", "0.66587275", "0.6614098", "0.6464352", "0.64231384", "0.6328056", "0.6328056", "0.6328056", "0.6328056", "0.63127524", "0.6265836", "0.618074", "0.6164294", "0.6147996", "0.6144305", "0.6122264", "0.6121173", ...
0.73772067
1
r"""Set the name of the pool. This method checks the validity and sets the name of the pool.
def _set_pool_name(self, pool_name): if _CNX_POOL_NAME_REGEX.search(pool_name): raise AttributeError(f"Pool name '{pool_name}' contains illegal characters") if len(pool_name) > _CNX_POOL_MAX_NAME_SIZE: raise AttributeError(f"Pool name '{pool_name}' is too long") self.name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n\t\tself.name_ = name", "def set_name(self, name):\n self.name = name # overwrite the existing name with the input name", "def set_name(self, name):\n self.name = name # overwrite the existing name with the input name", "def set_name(self, _name):\n self.name...
[ "0.6738657", "0.6685082", "0.6685082", "0.6633863", "0.6587753", "0.6581045", "0.65677935", "0.65675783", "0.6564265", "0.6564265", "0.6564265", "0.6564265", "0.6564265", "0.65593666", "0.65580016", "0.65530765", "0.65530765", "0.6527032", "0.65236634", "0.65236634", "0.64855...
0.8624035
0
Returns the number of open connections that can return to this pool.
def open_connections(self): return len(self._connections_openned)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _created_connections(self):\n return len(self._available_connections) + len(self._in_use_connections)", "def getconnectioncount(self):\n return self.proxy.getconnectioncount()", "def size(self):\r\n return sum(pool.size() for pool in self.host_to_pool.values())", "def pool_size(self)...
[ "0.8044701", "0.7799287", "0.7330027", "0.73162156", "0.719832", "0.71733403", "0.71316063", "0.70556307", "0.70315176", "0.7030046", "0.6980931", "0.6876273", "0.6845227", "0.680742", "0.670429", "0.66962683", "0.66733575", "0.66601783", "0.66520566", "0.66254", "0.6611033",...
0.85150576
0
Removes a connection from this pool.
def remove_connection(self, cnx=None): self._connections_openned.remove(cnx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_connection_in_use(self, connection):\n try:\n self._in_use_connections.remove(connection)\n connection.disconnect()\n except Exception as err:\n self.class_logger.warning(\"Error occurred while removing connection: %s\" % (err, ))", "def removeConnection(sel...
[ "0.73158354", "0.7269082", "0.69396466", "0.6919552", "0.6912065", "0.6884179", "0.6790434", "0.66967654", "0.6660787", "0.6624521", "0.6611776", "0.65944844", "0.6536934", "0.6517376", "0.6482876", "0.64035654", "0.63714844", "0.6320985", "0.6307719", "0.62835497", "0.624697...
0.7323535
0
Removes all the connections from the pool.
def remove_connections(self): while self.qsize() > 0: try: cnx = self.get(block=True, timeout=self.queue_timeout) except queue.Empty: pass else: try: cnx.close_connection() except (RuntimeErro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def cleanup(self):\n for _ in range(self.pool_size):\n conn = self.pool.get()\n conn.close()", "async def cleanup(self) -> None:\n for _ in range(self.pool_size):\n conn = await self.acquire()\n conn.close()", "def killconnections(self):\n ...
[ "0.8181471", "0.7893379", "0.7696204", "0.7340544", "0.7276089", "0.72524273", "0.72303146", "0.70528334", "0.7047193", "0.70285887", "0.6972324", "0.6960549", "0.6782169", "0.6779119", "0.6759972", "0.6741183", "0.6699203", "0.6663057", "0.6649225", "0.6644067", "0.6637375",...
0.72982776
4
Adds a connection to this pool. This method instantiates a Connection using the configuration passed when initializing the ConnectionPool instance or using the set_config() method. If cnx is a Connection instance, it will be added to the queue.
def add_connection(self, cnx=None): if not self.cnx_config: raise PoolError("Connection configuration not available") if self.full(): raise PoolError("Failed adding connection; queue is full") if not cnx: cnx = PooledConnection(self) # mysqlx_wai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _threadsafe_add_connection(self, con):\n self._connections.append(con)", "def add_connection(self, connection):\n self.connections.append(connection)", "def add_connection(self, connection):\n self.connections[connection.id] = connection", "def make_connection(self):\n if self...
[ "0.64743185", "0.62594146", "0.6200402", "0.5844291", "0.5764441", "0.5724644", "0.5622598", "0.55206937", "0.5484835", "0.54817796", "0.5468249", "0.54592377", "0.5424593", "0.54111004", "0.5401769", "0.5301684", "0.5267528", "0.5172469", "0.5143603", "0.5113358", "0.5112914...
0.834149
0
Tracks connection in order of close it when client.close() is invoke.
def track_connection(self, connection): self._connections_openned.append(connection)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def closeConnecetion(self):\n client.close()", "def on_client_connect(self, client):\r\n\t\tself.connection_logger.info('Received client connection from %s:%u' % (client.address, client.port))\r\n\t\tif (self.db_connection is False):\r\n\t\t\tclient.send('A critical database error has occurred. Please reconne...
[ "0.69222784", "0.6313277", "0.6270897", "0.62509227", "0.6222245", "0.6216457", "0.621327", "0.619363", "0.6184841", "0.6184293", "0.612349", "0.6079811", "0.6074323", "0.60069704", "0.60047525", "0.59902686", "0.59815025", "0.59683317", "0.59566724", "0.5953389", "0.59407806...
0.60166204
13
Returns if this pool is available for pool connections from it.
def available(self): return self._available
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_pool ( self ):\n return self._poolstack", "def check_pool(self):\n if self.conn.queue_len() < MAX_PROXIES:\n return True\n return False", "def _pool_exists(self, client_id, pool_name):\n pools = self.__pools.get(client_id, [])\n for pool in pools:\n ...
[ "0.8025057", "0.78168243", "0.7066027", "0.70420533", "0.7030652", "0.69436884", "0.68467337", "0.68299955", "0.6809528", "0.68000984", "0.6764606", "0.6764606", "0.6764606", "0.6764606", "0.6764606", "0.6753598", "0.6747319", "0.6747319", "0.6747173", "0.67459613", "0.669855...
0.63559717
60
Sets this pool unavailable for a period of time (in seconds).
def set_unavailable(self, time_out=-1): if self._available: _LOGGER.warning( "ConnectionPool.set_unavailable pool: %s time_out: %s", self, time_out, ) self._available = False self._timeout_stamp = datetime.now() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_pool_unavailable(pool, err):\n penalty = None\n try:\n err_no = err.errno\n penalty = _TIMEOUT_PENALTIES_BY_ERR_NO[err_no]\n except (AttributeError, KeyError):\n pass\n if not penalty:\n err_msg = err.msg\n for key, value in...
[ "0.6928558", "0.6741965", "0.6512105", "0.6314378", "0.6283715", "0.5775192", "0.56474566", "0.55812824", "0.5574952", "0.5572716", "0.5553683", "0.55163765", "0.55151737", "0.5471133", "0.5459293", "0.54034746", "0.5378221", "0.5371841", "0.5370946", "0.53631514", "0.5357788...
0.774368
0
Sets this pool available for pool connections from it.
def set_available(self): self._available = True self._timeout_stamp = datetime.now()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def server_pool(self, server_pool):\n\n self._server_pool = server_pool", "def update_connection_pool(maxsize=1):\n get_pool().connection_pool_kw.update(maxsize=maxsize)", "def set_ports_pool(self, being: int, end: int):\n self.ports_pool = (being, end)\n return self", "def _set_reque...
[ "0.63594", "0.6337544", "0.62497574", "0.6113219", "0.60415995", "0.6025964", "0.59795284", "0.59198624", "0.5902554", "0.58520097", "0.5814299", "0.5807708", "0.576925", "0.5747972", "0.57310736", "0.57114184", "0.5710329", "0.5709292", "0.56997466", "0.56492513", "0.5594173...
0.53289413
41
Returns the penalized time (timeout) and the time at the penalty.
def get_timeout_stamp(self): return (self._timeout, self._timeout_stamp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_timeout(self):\n return self.total_estimated_words() / self.minimum_wpm * 60", "def penalty(self):\n return 0", "def get_timeout(self) -> int:", "def important_time(self):\n\t\twork_s = self.work_time().seconds\n\t\tbreak_s = self.break_time().seconds\n\t\tif self.status():\n\t\t\...
[ "0.6799334", "0.6621371", "0.62221557", "0.6209635", "0.6064928", "0.6054378", "0.5982811", "0.5898739", "0.5895677", "0.5894431", "0.58753026", "0.5869499", "0.58569187", "0.58546793", "0.5846774", "0.5839353", "0.58375275", "0.58320856", "0.5826349", "0.58144355", "0.580583...
0.0
-1
Verifies if a pool exists with the given name.
def _pool_exists(self, client_id, pool_name): pools = self.__pools.get(client_id, []) for pool in pools: if pool.name == pool_name: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_pool_exist(pool_name: str) -> bool:\n if not pool_name:\n return False\n return os.path.exists(constant.work_dir + \"/pool/\" + pool_name)", "def _floating_ip_pool_exists(self, context, name):\n pools = [pool.get('name') for pool in\n self.get_floating_ip_pools(conte...
[ "0.8228599", "0.74547726", "0.6876268", "0.6849546", "0.6354214", "0.6221264", "0.6199039", "0.61017257", "0.6075915", "0.6072237", "0.6043367", "0.6029448", "0.59958076", "0.5952388", "0.59245205", "0.5858584", "0.57955545", "0.57142246", "0.57142246", "0.5710723", "0.570179...
0.779611
1
Retrieves a list of pools that shares the given settings.
def _get_pools(self, settings): available_pools = [] pool_names = [] connections_settings = self._get_connections_settings(settings) # Generate the names of the pools this settings can connect to for router_name, _ in connections_settings: pool_names.append(router_na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPools(self):\n data = self.connect('get','pools',None)\n return data", "def pools(self) -> List[CachingPool]:\n return self._pool_fetcher.pools", "def get_pools():\n pools = ch_core.hookenv.action_get('pools')\n if pools:\n return [p.strip() for p in pools.split(',')]\n...
[ "0.64371336", "0.6221961", "0.6218955", "0.61430126", "0.6115297", "0.6105824", "0.60802984", "0.6063483", "0.59884423", "0.5928385", "0.5899938", "0.5893801", "0.58063644", "0.5693193", "0.5659797", "0.56546915", "0.5629152", "0.55909127", "0.5525719", "0.5514052", "0.548285...
0.78941125
0
Generates a list of separated connection settings for each host. Gets a list of connection settings for each host or router found in the given settings.
def _get_connections_settings(settings): pool_settings = settings.copy() routers = pool_settings.get("routers", []) connections_settings = [] if "routers" in pool_settings: pool_settings.pop("routers") if "host" in pool_settings and "port" in pool_settings: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_pools(self, settings):\n available_pools = []\n pool_names = []\n connections_settings = self._get_connections_settings(settings)\n\n # Generate the names of the pools this settings can connect to\n for router_name, _ in connections_settings:\n pool_names.appe...
[ "0.6441771", "0.59143704", "0.549022", "0.5409772", "0.5368586", "0.53313816", "0.5314408", "0.5314408", "0.5308428", "0.5303599", "0.52979267", "0.5296564", "0.5277395", "0.5248984", "0.52361083", "0.516034", "0.5144902", "0.512325", "0.50972766", "0.5079645", "0.5056473", ...
0.7740059
0
Creates a `ConnectionPool` instance to hold the connections. Creates a `ConnectionPool` instance to hold the connections only if no other pool exists with the same configuration.
def create_pool(self, cnx_settings): connections_settings = self._get_connections_settings(cnx_settings) # Subscribe client if it does not exists if cnx_settings.get("client_id", "No id") not in self.__pools: self.__pools[cnx_settings.get("client_id", "No id")] = [] # Creat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_pool(self) -> pool.SimpleConnectionPool:\n\n return pool.SimpleConnectionPool(\n minconn=1, maxconn=self.pool_size, **self._kwargs\n )", "def make_connection(self):\n if self._created_connections() >= self.max_connections:\n raise ConnPoolException(\"Too many c...
[ "0.75595397", "0.73116374", "0.7268992", "0.71307266", "0.6933179", "0.6854876", "0.6727898", "0.6601544", "0.6593131", "0.6423678", "0.6390654", "0.6333992", "0.63116014", "0.6211054", "0.6180269", "0.6154187", "0.6125197", "0.61084527", "0.60987025", "0.609623", "0.60843295...
0.7385907
1
Get a random router from the group with the given priority.
def _get_random_pool(pool_list): if not pool_list: return None if len(pool_list) == 1: return pool_list[0] last = len(pool_list) - 1 index = random.randint(0, last) return pool_list[index]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_random_connection_params(self, priority):\n router_list = self._get_available_routers(priority)\n if not router_list:\n return None\n if len(router_list) == 1:\n return router_list[0]\n\n last = len(router_list) - 1\n index = random.randint(0, last)...
[ "0.7469789", "0.6443754", "0.57199085", "0.5464766", "0.54480845", "0.5380465", "0.5349423", "0.5275978", "0.5257964", "0.5209318", "0.5207216", "0.518145", "0.5172855", "0.51230246", "0.5080085", "0.5078181", "0.50336725", "0.5022846", "0.50095725", "0.49857655", "0.49270934...
0.50956744
14
Get a connection from the pool. This method returns an `PooledConnection` instance which has a reference to the pool that created it, and can be used as a normal Connection. When the MySQL connection is not connected, a reconnect is attempted.
def get_connection(self, settings): def set_mysqlx_wait_timeout(cnx): ver = cnx.sql(_SELECT_VERSION_QUERY).execute().fetch_all()[0][0] # mysqlx_wait_timeout is only available on MySQL 8 if tuple(int(n) for n in ver.split("-")[0].split(".")) > ( 8, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_connection():\n # 根据配置文件创建连接池\n if not Mysql.__mysql_pool:\n Mysql.__mysql_pool = PooledDB(\n creator=MySQLdb,\n use_unicode=False,\n cursorclass=DictCursor,\n db=sqlconf.MysqlConfig['db'],\n host=sqlconf....
[ "0.7691217", "0.7562302", "0.7353971", "0.6971416", "0.69436675", "0.67937344", "0.672637", "0.66222537", "0.6572692", "0.6564261", "0.65144676", "0.650674", "0.6502689", "0.6485766", "0.6481321", "0.63870996", "0.63638073", "0.6354744", "0.6317922", "0.63092965", "0.6301825"...
0.6944896
4
Closes the connections in the pools
def close_pool(self, cnx_settings): pools = self._get_pools(cnx_settings) for pool in pools: pool.close() # Remove the pool if cnx_settings.get("client_id", None) is not None: client_pools = self.__pools.get(cnx_settings.get("client_id")) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n PoolsManager().close_pool(self.settings)\n for session in self.sessions:\n session.close_connections()", "async def cleanup(self):\n for _ in range(self.pool_size):\n conn = self.pool.get()\n conn.close()", "async def close_connections(se...
[ "0.8231265", "0.7499418", "0.7387195", "0.73317623", "0.7289334", "0.72526157", "0.72519416", "0.72513884", "0.7220146", "0.7214504", "0.7156073", "0.71482754", "0.70928895", "0.70746666", "0.7031293", "0.7031066", "0.6994858", "0.69891924", "0.6965076", "0.6906142", "0.68550...
0.75684214
1
Sets a pool as unavailable. The time a pool is set unavailable depends on the given error message or the error number.
def set_pool_unavailable(pool, err): penalty = None try: err_no = err.errno penalty = _TIMEOUT_PENALTIES_BY_ERR_NO[err_no] except (AttributeError, KeyError): pass if not penalty: err_msg = err.msg for key, value in _TIMEOUT_PENA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_unavailable(self, time_out=-1):\n if self._available:\n _LOGGER.warning(\n \"ConnectionPool.set_unavailable pool: %s time_out: %s\",\n self,\n time_out,\n )\n self._available = False\n self._timeout_stamp = date...
[ "0.67663455", "0.6144874", "0.59132653", "0.58282214", "0.5166597", "0.50937444", "0.5027872", "0.5018812", "0.5001439", "0.49609485", "0.49187532", "0.48645824", "0.48108545", "0.48038194", "0.48004118", "0.47767752", "0.4757744", "0.47423255", "0.47006467", "0.46958756", "0...
0.8235165
0
Setup default and user defined connectionattributes.
def _init_attributes(self): if os.name == "nt": if "64" in platform.architecture()[0]: platform_arch = "x86_64" elif "32" in platform.architecture()[0]: platform_arch = "i386" else: platform_arch = platform.architecture() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __setup_conn__(self, **kwargs):\n self.ext_conn = setup_conn(**kwargs)", "def setup_class(cls):\n cls.connection_config = ConnectionConfig(\n name=\"connection_name\",\n author=\"author\",\n version=\"0.1.0\",\n connections={cls.old_connection_id},\n ...
[ "0.65551555", "0.6265929", "0.6141386", "0.6136928", "0.6075293", "0.6021759", "0.58700883", "0.5774287", "0.57723933", "0.5768105", "0.56981736", "0.5661012", "0.5657088", "0.5634599", "0.5629403", "0.56282943", "0.56181884", "0.55838466", "0.55712587", "0.5533862", "0.55328...
0.7018126
0
Returns `True` if the session is open.
def is_open(self): return self._connection.stream.is_open()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_open(self):\n\t\treturn self._session is not None", "def is_open(self):\n return self._session is not None", "def is_open(self) -> bool:\n return self._connection is not None", "def is_open(self):\n return self.connection.isOpen()", "def is_open(self):\n\t\treturn self.conn.open...
[ "0.9024887", "0.8961831", "0.81315815", "0.81257755", "0.80546355", "0.79255587", "0.7924642", "0.7774636", "0.7760799", "0.7753529", "0.77159536", "0.7703194", "0.7651213", "0.76434505", "0.76299965", "0.76201487", "0.75707895", "0.74527735", "0.73980796", "0.7376171", "0.73...
0.8011751
5
Returns the underlying connection.
def get_connection(self): return self._connection
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_connection(self):\n return self.connection", "def get_connection(self):\n return self.connection", "def connection(self):\n return self.get_connection()", "def get_connection(self):\n if self.conn is None or self.conn.closed != 0:\n self._connect()\n logg...
[ "0.8500861", "0.8500861", "0.83815616", "0.83661926", "0.8338797", "0.8206327", "0.81601465", "0.81601465", "0.81601465", "0.8104311", "0.8070838", "0.79749274", "0.7973642", "0.79457104", "0.7937752", "0.793084", "0.78242356", "0.77912843", "0.7752608", "0.77429104", "0.7714...
0.85670614
1
Returns the list of schemas in the current session.
def get_schemas(self): result = self.sql("SHOW DATABASES").execute() return [row[0] for row in result.fetch_all()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schemas(self):\n return self.get_schemas()", "def schemas(self):\n if not self._schemas:\n self._schemas = get_schema(self.attributes.workspace.namespace, self.attributes.workspace.name)\n return self._schemas", "def schemas(self):\n return model.Schemas(self)", "de...
[ "0.7940168", "0.7674091", "0.76055425", "0.76007926", "0.74846065", "0.7372321", "0.6949388", "0.6884964", "0.68326396", "0.68226933", "0.6800426", "0.6788221", "0.6720207", "0.6689522", "0.6683078", "0.6618202", "0.66057914", "0.65894604", "0.6363446", "0.63566357", "0.62927...
0.76975685
1
Retrieves a Schema object from the current session by it's name.
def get_schema(self, name): return Schema(self, name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_schema(name):\n global SCHEMA\n\n loaded_schema = SCHEMA.get(name)\n if not loaded_schema:\n filename = \"{}/{}.json\".format(_get_directory(), name)\n if os.path.exists(filename):\n SCHEMA[name] = json.load(open(filename, 'r'))\n\n return SCHEMA.get(name)", "def sch...
[ "0.7099188", "0.6785333", "0.65350753", "0.6392307", "0.6346262", "0.6317523", "0.63076603", "0.6277886", "0.61222565", "0.610875", "0.60736275", "0.60679245", "0.60511553", "0.602065", "0.59344053", "0.59279686", "0.5887502", "0.5860551", "0.58236897", "0.5783029", "0.576627...
0.7382961
0
Retrieves a Schema object from the current session by the schema name configured in the connection settings.
def get_default_schema(self): schema = self._connection.settings.get("schema") if schema: res = ( self.sql(_SELECT_SCHEMA_NAME_QUERY.format(escape(schema))) .execute() .fetch_all() ) try: if res[0][0] == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_schema(self, name):\n return Schema(self, name)", "def _get_schema(name):\n global SCHEMA\n\n loaded_schema = SCHEMA.get(name)\n if not loaded_schema:\n filename = \"{}/{}.json\".format(_get_directory(), name)\n if os.path.exists(filename):\n SCHEMA[name] = json.l...
[ "0.70808744", "0.67868173", "0.6623514", "0.64542896", "0.636475", "0.6305224", "0.62445873", "0.62143964", "0.6148457", "0.6105485", "0.6078263", "0.6065644", "0.60614574", "0.60455126", "0.6030014", "0.5985881", "0.5914493", "0.58715165", "0.579491", "0.5776796", "0.576949"...
0.6435839
4
Drops the schema with the specified name.
def drop_schema(self, name): self._connection.execute_nonquery( "sql", _DROP_DATABASE_QUERY.format(quote_identifier(name)), True )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drop_schema(self):\n connRepo = self.connect(self.cxRepo)\n sql = f\"\"\"drop schema if exists {self.schemaRepo} cascade\"\"\"\n with connRepo:\n with connRepo.cursor() as curs:\n curs.execute(sql)", "def drop(name):\n\t\treturn \"DROP DATABASE {0};\".format(nam...
[ "0.7630842", "0.7411391", "0.73312235", "0.72176456", "0.71065515", "0.69249046", "0.67872876", "0.67010725", "0.66641957", "0.6568357", "0.6504149", "0.6495129", "0.63986737", "0.6311625", "0.6287318", "0.6284021", "0.62831044", "0.6239468", "0.62374985", "0.6194844", "0.618...
0.88189185
0
Creates a schema on the database and returns the corresponding object.
def create_schema(self, name): self._connection.execute_nonquery( "sql", _CREATE_DATABASE_QUERY.format(quote_identifier(name)), True ) return Schema(self, name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self):\n c = self.cursor()\n byte_schema = pkgutil.get_data(__package__, 'schema.sql')\n c.executescript(byte_schema.decode('utf-8'))\n self.commit()", "def create_schema(schema): \n\n query = \"CREATE SCHEMA IF NOT EXISTS {}\".format(schema)\n qdb.execute(query)", ...
[ "0.713566", "0.7131881", "0.6989725", "0.6950006", "0.6838461", "0.6758156", "0.67543703", "0.67307276", "0.65807515", "0.656584", "0.6518259", "0.6468557", "0.6438678", "0.64039695", "0.6398292", "0.63878834", "0.637881", "0.63674325", "0.63658404", "0.63474345", "0.6346392"...
0.72758913
0
Starts a transaction context on the server.
def start_transaction(self): self._connection.execute_nonquery("sql", "START TRANSACTION", True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_transaction(self) -> None:\n pass", "def startTransaction(self) -> int:\n ...", "def start_transaction(self):\n raise Unsupported()", "def start_transaction(self,):\n\n if self.tx is not None:\n raise OverlappedTransaction(str(self.tx.xid))\n\n modlogge...
[ "0.72270775", "0.6699702", "0.65571505", "0.6494713", "0.64826524", "0.63875", "0.63773715", "0.6354355", "0.62198335", "0.6208404", "0.61653686", "0.6124205", "0.6092639", "0.6025046", "0.60045147", "0.60032946", "0.5961846", "0.5943527", "0.59046614", "0.5899277", "0.589711...
0.6424953
5
Commits all the operations executed after a call to startTransaction().
def commit(self): self._connection.execute_nonquery("sql", "COMMIT", True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commit_transaction(self) -> None:\n pass", "def commit(self):\n self.execute_sql(sql.commit)\n self.under_transaction = False", "def commit(self):\n if self.transaction:\n self.conn.commit()\n self.transaction = False", "def commit(self, transaction):\n ...
[ "0.8051533", "0.789841", "0.77758884", "0.7731627", "0.7716815", "0.768815", "0.752487", "0.7514012", "0.7429174", "0.74165803", "0.73289615", "0.7317591", "0.73079133", "0.7263914", "0.7263914", "0.7263914", "0.7263914", "0.7263914", "0.7226164", "0.72199595", "0.7191094", ...
0.75208503
7
Discards all the operations executed after a call to startTransaction().
def rollback(self): self._connection.execute_nonquery("sql", "ROLLBACK", True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disable_transactions(self):\n self.rollback()\n yield", "def abort_transaction(self) -> None:\n pass", "def tearDown(self):\n\t\tTransaction.transaction_list = []", "def clean_for_commit(self):", "def abort(self, transaction):\n raise NotImplementedError", "def cleanup(sel...
[ "0.6822115", "0.6721113", "0.63137096", "0.624253", "0.6171296", "0.6119577", "0.61067444", "0.60298455", "0.6029664", "0.60241884", "0.5966891", "0.59225225", "0.59157103", "0.5901638", "0.589327", "0.58346015", "0.58310616", "0.58202505", "0.58133054", "0.5804906", "0.57882...
0.56098586
55
Creates a transaction savepoint. If a name is not provided, one will be generated using the uuid.uuid1() function.
def set_savepoint(self, name=None): if name is None: name = f"{uuid.uuid1()}" elif not isinstance(name, str) or len(name.strip()) == 0: raise ProgrammingError("Invalid SAVEPOINT name") self._connection.execute_nonquery( "sql", f"SAVEPOINT {quote_identifier(nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_wallet(self, walletName):\n return", "def save_transaction(**kwargs):\n if not 'user_id' in kwargs:\n raise AttributeError(\"Cannot create a transaction without user_id\")\n\n\n return History.create(\n user_id=kwargs['user_id'],\n from_curr=kwargs['cu...
[ "0.65303457", "0.61587226", "0.59878576", "0.5905397", "0.5792132", "0.57136196", "0.5660708", "0.55327386", "0.54938084", "0.548573", "0.54418075", "0.54328376", "0.5341623", "0.53411496", "0.53411496", "0.53342783", "0.53303015", "0.5328881", "0.5287005", "0.5276058", "0.52...
0.6933689
0
Rollback to a transaction savepoint with the given name.
def rollback_to(self, name): if not isinstance(name, str) or len(name.strip()) == 0: raise ProgrammingError("Invalid SAVEPOINT name") self._connection.execute_nonquery( "sql", f"ROLLBACK TO SAVEPOINT {quote_identifier(name)}", True, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def savepoint_rollback(self, id):\n self.execute(\"ROLLBACK TO SAVEPOINT {}\".format(id))", "def release_savepoint(self, name):\n if not isinstance(name, str) or len(name.strip()) == 0:\n raise ProgrammingError(\"Invalid SAVEPOINT name\")\n self._connection.execute_nonquery(\n ...
[ "0.75790715", "0.6660333", "0.6392549", "0.6234782", "0.62145495", "0.6171088", "0.61522824", "0.6101417", "0.6064307", "0.6056632", "0.60493654", "0.60462016", "0.59910023", "0.59887075", "0.59846413", "0.59639025", "0.58136445", "0.5793797", "0.57077324", "0.5703036", "0.56...
0.85947764
0
Release a transaction savepoint with the given name.
def release_savepoint(self, name): if not isinstance(name, str) or len(name.strip()) == 0: raise ProgrammingError("Invalid SAVEPOINT name") self._connection.execute_nonquery( "sql", f"RELEASE SAVEPOINT {quote_identifier(name)}", True, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rollback_to(self, name):\n if not isinstance(name, str) or len(name.strip()) == 0:\n raise ProgrammingError(\"Invalid SAVEPOINT name\")\n self._connection.execute_nonquery(\n \"sql\",\n f\"ROLLBACK TO SAVEPOINT {quote_identifier(name)}\",\n True,\n ...
[ "0.6826982", "0.65725434", "0.6022051", "0.5866084", "0.5803091", "0.5377269", "0.52517676", "0.5245904", "0.5132967", "0.49802732", "0.49693072", "0.49311382", "0.48374695", "0.48211297", "0.4773615", "0.4773615", "0.4773615", "0.47389153", "0.47362256", "0.47286457", "0.472...
0.8287476
0
Closes all underliying connections as pooled connections
def close_connections(self): self._connection.close_connection()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n PoolsManager().close_pool(self.settings)\n for session in self.sessions:\n session.close_connections()", "def n_close(conns):\n\n\tfor conn in conns:\n\t\tconn.close()", "def killconnections(self):\n for conn in self._connections:\n try:conn.close()...
[ "0.7893946", "0.7627752", "0.7483146", "0.74009717", "0.73747396", "0.73512363", "0.7335036", "0.7294042", "0.72800267", "0.72594935", "0.72508353", "0.72462237", "0.7233647", "0.7189396", "0.7155282", "0.7151442", "0.71505964", "0.6991779", "0.69650173", "0.6921953", "0.6914...
0.73708725
5
Set the size of the pool. This method sets the size of the pool but it will not resize the pool.
def _set_pool_size(self, pool_size): if ( isinstance(pool_size, bool) or not isinstance(pool_size, int) or not pool_size > 0 ): raise AttributeError( "Pool max_size value must be an integer greater than 0, the " f"given valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_pool_size(self, pool_size):\n self._aspp.set_pool_size(pool_size)", "def set_pool_size(self, pool_size):\n self._semantic_decoder.set_pool_size(pool_size)\n if self._instance_decoder is not None:\n self._instance_decoder.set_pool_size(pool_size)", "def pool_size(self, pool_size: ConfigNod...
[ "0.8340374", "0.82194114", "0.81067353", "0.6883167", "0.6848949", "0.667367", "0.6625689", "0.6585363", "0.64515054", "0.6378429", "0.6368305", "0.6336948", "0.6316415", "0.6298938", "0.6257138", "0.6232536", "0.6202294", "0.619024", "0.61799705", "0.61607885", "0.6149098", ...
0.7577263
3
Set the max idle time. This method sets the max idle time.
def _set_max_idle_time(self, max_idle_time): if ( isinstance(max_idle_time, bool) or not isinstance(max_idle_time, int) or not max_idle_time > -1 ): raise AttributeError( "Connection max_idle_time value must be an integer greater or " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maximum_idle_time(self, maximum_idle_time):\n if (self.local_vars_configuration.client_side_validation and\n maximum_idle_time is not None and maximum_idle_time > 2147483647): # noqa: E501\n raise ValueError(\"Invalid value for `maximum_idle_time`, must be a value less than or...
[ "0.7250238", "0.68779844", "0.686107", "0.6692613", "0.66525775", "0.6395718", "0.6354745", "0.6289671", "0.6289671", "0.6282277", "0.62430394", "0.6237619", "0.61759275", "0.6161843", "0.6161843", "0.6144219", "0.6110566", "0.6076418", "0.6045437", "0.5964966", "0.5964966", ...
0.8394763
0
Set if the pool is enabled. This method sets if the pool is enabled.
def _set_pool_enabled(self, enabled): if not isinstance(enabled, bool): raise AttributeError("The enabled value should be True or False.") self.pooling_enabled = enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setEnabled(self, enable: bool) -> None:\n self.enabled = ...", "def set_enabled(self, enabled=True):\n self._enabled = enabled", "def enabled(self, enabled):\n \n self._enabled = enabled", "def enabled(self, enabled):\n\n self._enabled = enabled", "def enabled(self, e...
[ "0.6399708", "0.6362323", "0.629909", "0.62372655", "0.62372655", "0.6163484", "0.61200476", "0.61200476", "0.6109915", "0.6096295", "0.6096295", "0.60143596", "0.596099", "0.59420854", "0.5857917", "0.5758405", "0.57415175", "0.56308055", "0.562213", "0.562213", "0.562213", ...
0.84562
0
Set the queue timeout. This method sets the queue timeout.
def _set_queue_timeout(self, queue_timeout): if ( isinstance(queue_timeout, bool) or not isinstance(queue_timeout, int) or not queue_timeout > -1 ): raise AttributeError( "Connection queue_timeout value must be an integer greater or " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_timeout(self, timeout: float) -> None:\n self._timeout = timeout", "def set_timeout(self, timeout):\n pass", "def set_timeout(self, timeout):\n self.timeout = timeout", "def set_timeout(self, timeout):\n if self.interface is not None:\n self.interface.timeout = time...
[ "0.7421812", "0.7354362", "0.72003436", "0.71162975", "0.70625746", "0.70500946", "0.70189744", "0.6955598", "0.6946011", "0.6945228", "0.691051", "0.69039935", "0.6892539", "0.6864599", "0.68465585", "0.6709919", "0.6695983", "0.66703004", "0.6661025", "0.664645", "0.6402911...
0.8419401
0
Creates a Session instance using the provided connection data.
def get_session(self): session = Session(self.settings) self.sessions.append(session) return session
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_session(*args, **kwargs):\n settings = _get_connection_settings(*args, **kwargs)\n return Session(settings)", "def create_session(self, **params):\n raise NotImplementedError('Should be implemented by a sub-class.')", "def create_session(self, transport):\n session = self.SESSION_CL...
[ "0.7035977", "0.66529363", "0.6487199", "0.6373291", "0.63426346", "0.6335163", "0.6329022", "0.63015455", "0.627489", "0.6243606", "0.62059706", "0.6134959", "0.61318696", "0.61073995", "0.60964423", "0.6075273", "0.60751593", "0.6062976", "0.60453093", "0.6037572", "0.60368...
0.0
-1
Closes the sessions opened by this client.
def close(self): PoolsManager().close_pool(self.settings) for session in self.sessions: session.close_connections()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def close_session(self):\n await self._client_session.close()", "def close(self):\n\t\tself._client.close_session()", "async def close(self):\n try:\n self.logger.debug(\"Closing session\")\n if self.key in self._ALL_SESSIONS:\n del self._ALL_SESSIONS[se...
[ "0.8111592", "0.8103941", "0.7726971", "0.7700497", "0.7689983", "0.7650477", "0.76026857", "0.76026857", "0.76026857", "0.76026857", "0.76026857", "0.76026857", "0.7557631", "0.7541065", "0.7507988", "0.7507988", "0.7507988", "0.7449348", "0.74443275", "0.74263626", "0.74213...
0.6882067
41
Parses a list of host, port pairs.
def _parse_address_list(path): path = path.replace(" ", "") array = ( not ("," not in path and path.count(":") > 1 and path.count("[") == 1) and path.startswith("[") and path.endswith("]") ) routers = [] address_list = _SPLIT_RE.split(path[1:-1] if array else path) prior...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _bindlist(input_str):\n try:\n ip_port = input_str.split(':')\n if len(ip_port) == 1:\n _ip = ip_port[0]\n _port = None\n else:\n (_ip, _port) = ip_port\n if not _ip and not _port:\n raise AssertionError\n elif not _port:\n ...
[ "0.6726437", "0.65127623", "0.6345882", "0.63328236", "0.6295879", "0.6239828", "0.622072", "0.61888844", "0.59617835", "0.5920507", "0.5892255", "0.5880821", "0.5864347", "0.581431", "0.57831335", "0.57789314", "0.57166445", "0.5698755", "0.56800437", "0.56699437", "0.564403...
0.5352533
38
Parses the connection string and returns a dictionary with the connection settings.
def _parse_connection_uri(uri): settings = {"schema": ""} match = _URI_SCHEME_RE.match(uri) scheme, uri = match.groups() if match else ("mysqlx", uri) if scheme not in ("mysqlx", "mysqlx+srv"): raise InterfaceError(f"Scheme '{scheme}' is not valid") if scheme == "mysqlx+srv": sett...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_connection(conn_obj):\n return dict(\n user=conn_obj.login,\n password=conn_obj.password,\n host=conn_obj.host,\n dbname=conn_obj.schema,\n port=conn_obj.port,\n )", "def _parse_connection_string(self, connection_string):\n self.host = '127.0.0.1'\n ...
[ "0.7423632", "0.72170484", "0.6868679", "0.6839244", "0.6672292", "0.66432637", "0.66335213", "0.6556787", "0.6484814", "0.6334378", "0.6287846", "0.62291914", "0.6167282", "0.6160439", "0.61421984", "0.6119564", "0.6102136", "0.6073667", "0.60458183", "0.6037311", "0.5985968...
0.6688263
4
Validates the settings to be passed to a Session object the port values are converted to int if specified or set to 33060 otherwise. The priority values for each router is converted to int if specified.
def _validate_settings(settings): invalid_opts = set(settings.keys()).difference(_SESS_OPTS) if invalid_opts: invalid_opts_list = "', '".join(invalid_opts) raise InterfaceError(f"Invalid option(s): '{invalid_opts_list}'") if "routers" in settings: for router in settings["routers"]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validatePortConfig(self):\n if config.BindHTTPPorts:\n if config.HTTPPort == 0:\n raise UsageError(\n \"HTTPPort required if BindHTTPPorts is not empty\"\n )\n elif config.HTTPPort != 0:\n config.BindHTTPPorts = [config.HTTPP...
[ "0.60197586", "0.5657626", "0.5495007", "0.53471047", "0.5289687", "0.5281556", "0.5281556", "0.5234276", "0.52294874", "0.51977766", "0.5155232", "0.5141573", "0.5139727", "0.51385075", "0.50844365", "0.5050152", "0.5013974", "0.50133044", "0.50025", "0.49238983", "0.4921965...
0.5876934
1
Parses the connection string and returns a dictionary with the connection settings.
def _get_connection_settings(*args, **kwargs): settings = {} if args: if isinstance(args[0], str): settings = _parse_connection_uri(args[0]) elif isinstance(args[0], dict): for key, val in args[0].items(): settings[key.replace("_", "-")] = val elif kwa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_connection(conn_obj):\n return dict(\n user=conn_obj.login,\n password=conn_obj.password,\n host=conn_obj.host,\n dbname=conn_obj.schema,\n port=conn_obj.port,\n )", "def _parse_connection_string(self, connection_string):\n self.host = '127.0.0.1'\n ...
[ "0.74229205", "0.72186244", "0.6869094", "0.6837826", "0.66878664", "0.6670509", "0.6633563", "0.65562594", "0.6484141", "0.6333064", "0.6287541", "0.6228948", "0.6167878", "0.6159585", "0.6144889", "0.6119889", "0.610257", "0.6074882", "0.6045002", "0.6037794", "0.5987517", ...
0.6642413
6
Creates a Session instance using the provided connection data.
def get_session(*args, **kwargs): settings = _get_connection_settings(*args, **kwargs) return Session(settings)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_session(self, **params):\n raise NotImplementedError('Should be implemented by a sub-class.')", "def create_session(self, transport):\n session = self.SESSION_CLS(self, transport, 0)\n self.session = session\n return session", "def create_session(self, loop):\n ses...
[ "0.66529363", "0.6487199", "0.6373291", "0.63426346", "0.6335163", "0.6329022", "0.63015455", "0.627489", "0.6243606", "0.62059706", "0.6134959", "0.61318696", "0.61073995", "0.60964423", "0.6075273", "0.60751593", "0.6062976", "0.60453093", "0.6037572", "0.6036886", "0.60237...
0.7035977
0
Creates a Client instance with the provided connection data and settings.
def get_client(connection_string, options_string): if not isinstance(connection_string, (str, dict)): raise InterfaceError("connection_data must be a string or dict") settings_dict = _get_connection_settings(connection_string) if not isinstance(options_string, (str, dict)): raise Interface...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_client(self, context):\n return Client(self.settings['client_routing'], context=context)", "def client():\n return Client(**common_data.AUTH_ARGS)", "def __new__(cls, host=None, user=None, client=None):\n cls.__check_parameters(host=host, user=user)\n if client is None:\n ...
[ "0.6803137", "0.66673803", "0.660334", "0.6538909", "0.65329057", "0.6514638", "0.64394593", "0.6403487", "0.6348896", "0.63131326", "0.6292219", "0.62882036", "0.6281073", "0.62706137", "0.6176079", "0.6161133", "0.6158063", "0.61103475", "0.60675514", "0.60673904", "0.60539...
0.6515957
5
Create frequent candidate 1itemset C1 by scaning data set.
def create_C1(data_set): C1 = set() for t in data_set: for item in t: item_set = frozenset([item]) C1.add(item_set) return C1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_C1(data_set):\r\n C1 = set()\r\n for t in data_set:\r\n for item in t:\r\n item_set = frozenset([item])\r\n C1.add(item_set)\r\n return C1", "def fit(self, filePath):\n # Initialize some variables to hold the tmp result\n transListSet = self.getTran...
[ "0.68666804", "0.62472063", "0.6199198", "0.57517475", "0.5700819", "0.5536886", "0.5462085", "0.54602176", "0.54483926", "0.5408374", "0.53961325", "0.5344222", "0.53286785", "0.5307133", "0.53000116", "0.5285556", "0.5277256", "0.5261426", "0.5240939", "0.5231014", "0.52222...
0.68868816
0
Judge whether a frequent candidate kitemset satisfy Apriori property.
def is_apriori(Ck_item, Lksub1): for item in Ck_item: sub_Ck = Ck_item - frozenset([item]) if sub_Ck not in Lksub1: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_apriori(Ck_item, Lksub1):\r\n for item in Ck_item:\r\n sub_Ck = Ck_item - frozenset([item])\r\n if sub_Ck not in Lksub1:\r\n return False\r\n return True", "def runApriori(data_iter, minSupport, minConfidence):\n itemSet, transactionList = getItemSetTransactionList(da...
[ "0.66666365", "0.6057518", "0.5988564", "0.59796983", "0.59633344", "0.58799654", "0.57969064", "0.57616246", "0.5732276", "0.57254297", "0.5724408", "0.57123095", "0.5711876", "0.57087386", "0.5667456", "0.56315696", "0.5604504", "0.56003827", "0.5575922", "0.55722725", "0.5...
0.6695725
0
Create Ck, a set which contains all all frequent candidate kitemsets by Lk1's own connection operation.
def create_Ck(Lksub1, k): Ck = set() len_Lksub1 = len(Lksub1) Lksub = list(Lksub1) for i in range(len_Lksub1): for j in range(1, len_Lksub1): l1 = list(Lksub[i]) l2 = list(Lksub[j]) l1.sort() l2.sort() if l1[0:k-2] == l2[0:k-2]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_Ck(Lksub1, k):\r\n Ck = set()\r\n len_Lksub1 = len(Lksub1)\r\n list_Lksub1 = list(Lksub1)\r\n for i in range(len_Lksub1):\r\n for j in range(1, len_Lksub1):\r\n l1 = list(list_Lksub1[i])\r\n l2 = list(list_Lksub1[j])\r\n l1.sort()\r\n l2.sor...
[ "0.70719284", "0.6693435", "0.6450291", "0.62909186", "0.62846655", "0.6244212", "0.6235127", "0.61993384", "0.6139224", "0.61078626", "0.60946053", "0.5995736", "0.59837943", "0.59188837", "0.5881509", "0.5826247", "0.5768663", "0.5767914", "0.57656425", "0.5685713", "0.5681...
0.7029299
1
Generate Lk by executing a delete policy from Ck.
def generate_Lk_by_Ck(fptree, data_set, Ck,dim, min_support, support_data): Lk = set() item_count = {} t_num = float(len(data_set)) if dim == 1: for t in data_set: for item in Ck: if item.issubset(t): if item not in item_count: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_cluster_policy(self):\n pass", "def _generate_delete_sql(self, delete_keys):\n for key in delete_keys:\n app_label, sql_name = key\n old_node = self.from_sql_graph.nodes[key]\n operation = DeleteSQL(sql_name, old_node.reverse_sql, reverse_sql=old_nod...
[ "0.62599146", "0.6109377", "0.6078322", "0.5997867", "0.59099156", "0.5897554", "0.5890714", "0.5758802", "0.5754749", "0.57538366", "0.57267064", "0.57177985", "0.57177985", "0.56723726", "0.5671771", "0.56254566", "0.5622132", "0.56212693", "0.56137097", "0.5596535", "0.558...
0.0
-1
Generate all frequent itemsets.
def generate_L(data_set, k, min_support): fptree = FPtree.fptree(data_set, min_support) print("pre:",datetime.datetime.now()) fptree.getPretable() print("pre:",datetime.datetime.now()) fptree.getRootTree() support_data = {} # L1,L2,support_L1 = adjacencyMatrix(data_set,min_support,support_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ar_gen(frequentItemSets):\n# print frequentItemSets\n for fItemSet in frequentItemSets:\n if fItemSet:\n itemSets = fItemSet.keys()\n for itemSet in itemSets:\n subsets = subset_gen(itemSet)\n# print itemSet\n# print subsets\n ...
[ "0.7149492", "0.7107362", "0.6580471", "0.62998974", "0.61712855", "0.61018574", "0.61018157", "0.6101683", "0.60413694", "0.6024013", "0.601213", "0.5948399", "0.5887703", "0.5863527", "0.5858014", "0.58262306", "0.5824583", "0.57880974", "0.5702862", "0.5640018", "0.5610952...
0.0
-1
Generate big rules from frequent itemsets.
def generate_big_rules(L, support_data, min_conf): big_rule_list = [] sub_set_list = [] for i in range(0, len(L)): for freq_set in L[i]: for sub_set in sub_set_list: if sub_set.issubset(freq_set): conf = support_data[freq_set] / support_data[freq_set -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def association_rules(mtv, itemsets, use_observed_frequency=False):\n\n # Since we iterate several itemsets,\n # we may visit the same subsets X,Y several times\n # so we track visited nodes to avoid dublicates\n association_rules_set = set()\n\n cache = {}\n\n # List of all possible rules\n #...
[ "0.6845131", "0.6784021", "0.67544943", "0.66333693", "0.63862514", "0.6151236", "0.6040765", "0.5902854", "0.5762428", "0.57535684", "0.56697106", "0.5570257", "0.55588543", "0.54784805", "0.54638857", "0.5444638", "0.5305987", "0.5304137", "0.52909386", "0.5254678", "0.5252...
0.65898126
4
Separator for split operation
def separator(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_separator(self):\r\n \r\n return self._separator", "def sep(self):\n return self.sep_index", "def sep_token(self):\r\n if self._sep_token is None:\r\n logger.error(\"Using sep_token, but it is not set yet.\")\r\n return self._sep_token", "def __split_for_...
[ "0.72160506", "0.71307766", "0.69760233", "0.69715023", "0.6950039", "0.68944466", "0.68936884", "0.6867587", "0.68510765", "0.68073255", "0.6776286", "0.67086405", "0.6669383", "0.6662774", "0.6639649", "0.6636426", "0.6620719", "0.66103375", "0.65886676", "0.65592295", "0.6...
0.72390425
0
If True and the string has no separator ArgumentTypeError will be raised.
def require_separator(self): return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_empty(self):\n self.assertRaises(ParseException, self.flag.parseString, '')", "def test_typeerror_in_case_of_string(self):\n eq_(None,grepit(\"\",\"\",\"\"))", "def issafe(arg):\n return arg.find(';') == -1 and arg.find('|') == -1", "def test_split_string_empty_string(self):\n ...
[ "0.65985346", "0.65559155", "0.6451978", "0.637236", "0.6309041", "0.6308219", "0.6281972", "0.62771165", "0.61227524", "0.6116337", "0.60712427", "0.60600024", "0.605896", "0.60303366", "0.6019376", "0.60184014", "0.60005873", "0.599811", "0.5997462", "0.5921817", "0.5917819...
0.64502275
3
Create a function which attempts to cast input to any of provided types. The order of provided `types` is meaningful if two types accept given input value, the first one on list will be used. Types should be able to accept a string (if correct) as input value for their constructors.
def one_of(*types): def one_of_types(string): exceptions = [] for type_constructor in types: try: return type_constructor(string) except (ArgumentTypeError, TypeError, ValueError) as e: exceptions.append(f'{type_constructor.__name__}: {e}') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_as(val, *types):\n for typ in types:\n try:\n return typ(val)\n except ValueError:\n pass\n return quote(val)", "def parameter_converter(\n possible_types: list,\n default_return: t.Any,\n cache_handler: t.Optional[t.Callable],\n):\n for type_ in po...
[ "0.6481975", "0.6214616", "0.6106705", "0.59639883", "0.5830974", "0.5764432", "0.5697015", "0.56758696", "0.5581147", "0.55767035", "0.55717325", "0.5514725", "0.5415872", "0.5408412", "0.5407065", "0.53984433", "0.5390378", "0.5338023", "0.52545696", "0.525337", "0.5241277"...
0.66086835
0
Broadcast transaction to peers.
def transaction(): data = jsonpickle.decode(request.get_data()) address = data["address"] amount = int(data["amount"]) keyname = data["keyname"] pkplus, pkminus = wallet.keys(keyname) my_balance = p2p.query("/balance", address=pkplus)["balance"] if my_balance < amount: abort(404, d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def broadcast(self, tx):\n\n for neighbor_id in self.adjacencies:\n self.sendMsg(neighbor_id, Message(self.id, Type.BLOCK, tx))", "def broadcast(self, libioncoin_client):\n libioncoin_client.broadcast(self.to_raw_tx())", "def test_broadcast(self):\n if _debug: TestSimple._debug(...
[ "0.690034", "0.64716506", "0.60505223", "0.60371846", "0.592087", "0.5902992", "0.58723474", "0.5788281", "0.5759853", "0.5715606", "0.56850755", "0.56780195", "0.5665879", "0.56646085", "0.56460977", "0.5641858", "0.55699545", "0.55330455", "0.5532313", "0.5525835", "0.55208...
0.49770993
70
Ask peers for balance.
def balance(): address = request.args.get("address") balance = p2p.query("/balance", address=address)["balance"] payload = jsonpickle.encode({"balance": balance}) return payload, 200, {"Content-Type": "application/json"}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_balance(self, args):\n if not self._check_args(args):\n return\n else:\n self.wallet.update_balances()\n balance = self.wallet.addresses.get(args, -1)['balance']\n if balance == -1:\n print(\"Address not found.\")\n else:\n ...
[ "0.7045392", "0.6870766", "0.67591757", "0.65269065", "0.65252906", "0.6455046", "0.64055455", "0.64016366", "0.6400501", "0.6396769", "0.63745165", "0.63566196", "0.6321036", "0.62963474", "0.6282827", "0.6260704", "0.6228892", "0.61761636", "0.61489916", "0.6128721", "0.611...
0.61723906
18
rendering the screen for the GAME OVER TEXT and displaying on the screen
def game_over_text(): over_text = over_font.render("GAME OVER", True, (255, 255, 255)) screen.blit(over_text, (200, 250))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def displayGameOver():\n screen.fill(pygame.Color('black'), (0, 0, SCREEN_SIZE[0], SCREEN_SIZE[1]))\n goText, rect1 = GAME_FONT.render('Game Over', WHITE)\n paText, rect2 = GAME_FONT.render('Press [Enter] to play again', WHITE)\n width1 = goText.get_width()\n height1 = goText.get_height()\n width2 = paText.g...
[ "0.8063501", "0.7958444", "0.78897667", "0.7875936", "0.78596604", "0.77770543", "0.7751221", "0.7696494", "0.7675551", "0.76128083", "0.75853896", "0.75559884", "0.7494957", "0.7444925", "0.74221295", "0.73675346", "0.7348137", "0.7345269", "0.7285808", "0.72778124", "0.7268...
0.8097579
0
Rendering the screen for score and displaying on the screen
def show_score(x, y): score = font.render("Score: " + str(score_value), True, (255, 255, 255)) screen.blit(score, (x, y))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_score(self):\n self.screen.blit(self.score_image, self.score_rect)\n self.screen.blit(self.high_score_text_image, self.high_score_text_rect)\n self.screen.blit(self.high_score_image, self.high_score_rect)\n self.screen.blit(self.wave_image, self.wave_rect)\n self.spacesh...
[ "0.7835424", "0.77375114", "0.767805", "0.76489127", "0.7614477", "0.7541374", "0.7507311", "0.7505519", "0.7503657", "0.74990106", "0.74506015", "0.74234974", "0.7391287", "0.7387557", "0.7376754", "0.7358002", "0.7352656", "0.7303999", "0.72760856", "0.72675276", "0.7263325...
0.75511247
5
Player appearance in the window
def player(x, y): screen.blit(space_invader, (x, y))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_ui(self):\n self.parent.title(\"Roku Player Controller\")\n self.style.theme_use(\"default\")", "def on_show(self): \n arcade.set_background_color(arcade.color.BLACK)", "def on_show(self):\n arcade.set_background_color(arcade.csscolor.DARK_SLATE_BLUE)\n\n # Reset t...
[ "0.67846155", "0.6700756", "0.6498458", "0.63983566", "0.6332676", "0.62745005", "0.62358516", "0.61630243", "0.6152633", "0.614766", "0.61021256", "0.60742384", "0.6072768", "0.6069617", "0.6026441", "0.59867764", "0.59836704", "0.59836227", "0.5964049", "0.59620327", "0.595...
0.0
-1
monster appearance in the window
def monster(x, y, i): screen.blit(monsterImg[i], (x, y))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_window_pane():\n houseturtle.begin_fill()\n for y in range(4):\n houseturtle.pendown()\n houseturtle.forward(35)\n houseturtle.left(90)\n houseturtle.penup()\n houseturtle.end_fill()", "def on_show(self): \n arcade.set_background_...
[ "0.6764813", "0.6683032", "0.66821134", "0.66276044", "0.66041344", "0.65275645", "0.64524066", "0.64199007", "0.64128226", "0.6305767", "0.62841296", "0.62841296", "0.62556934", "0.62409246", "0.620511", "0.620511", "0.62000906", "0.619125", "0.6163793", "0.615416", "0.61509...
0.0
-1
Gets a default filename, based on the directory this file is in
def _get_filename(): dirname = os.path.dirname(__file__) return os.path.join(dirname, 'occulttraining.txt')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_filename() -> str:\n return datetime.datetime.now().strftime(\"%Y-%m-%d_%H-%M-%S\")", "def get_default_file_path(file_name: str) -> str:\n return join(SOURCE_PATH, 'data', file_name)", "def defaultFile(self):\n filename = _odb.getCurrentFrame().filename\n if filename == '<st...
[ "0.7812229", "0.76417834", "0.75525266", "0.7160122", "0.70971155", "0.7094572", "0.7072985", "0.7046131", "0.7007417", "0.6987495", "0.68563485", "0.67204887", "0.67204887", "0.67117774", "0.668968", "0.6678318", "0.6662843", "0.665359", "0.6624531", "0.6610902", "0.6609342"...
0.67671204
11
Loads the occult file.
def occult_raw_data(path=None): if not path: path = _get_filename() word_to_id = _build_vocab(path) all_data = _file_to_char_ids(path, word_to_id) # it's just one massive sequence! # now we need to slice it up # into train, test and valid num_chars = len(all_data) all_data = np.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(self):\r\n self.read(self.filename)", "def load(self, path):\n pass", "def load(self, path):\n pass", "def load_file(self):\n offset = self.meta.segmentid * DATASIZE\n filename = self.meta.filename.encode('UTF-8')\n snc.snc_load_file_to_context(c_char_p(file...
[ "0.69216144", "0.66639304", "0.66639304", "0.66470397", "0.664104", "0.6593018", "0.6544086", "0.65324783", "0.652482", "0.652482", "0.652482", "0.652482", "0.65195227", "0.65143156", "0.6492408", "0.6480668", "0.6451464", "0.6413778", "0.63856083", "0.63391167", "0.63371396"...
0.0
-1
Get a task's parent id from a JSON task dictionary
def get_parent_id(task_dict: dict) -> int | None: return task_dict['parent']['id'] \ if task_dict['parent'] and 'id' in task_dict['parent'] else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_task_by_id(self, id):\n task_table = Table('task', self.metadata, autoload=True)\n try:\n parent_task = self.session.query(task_table).filter(task_table.c.id==id).one()\n task = parent_task._asdict()\n return task\n except Exception as e:\n l...
[ "0.67251194", "0.65341544", "0.6511568", "0.6479204", "0.64372146", "0.6387878", "0.6379795", "0.6379795", "0.62652236", "0.6212493", "0.6132431", "0.6123978", "0.5951328", "0.5945004", "0.5915101", "0.5915101", "0.59042", "0.59042", "0.59042", "0.59042", "0.59029186", "0.5...
0.8564628
0
This function prepares a frequency table for every label in respective column. PARAMETERS ==========
def make_frequency_table(x, y, X, Y): freq = dict() for i in range(len(X)): freq[X[i]] = [0, 0] # merging the two to get a matrix M = np.array([[x[i], y[i]] for i in range(len(x))]) for i in range(len(M)): if M[i][1] == Y[0]: freq[M[i][0]][0] += 1 else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def freq_table(a):\n Detail_freq = a.loc[:, (a.dtypes == object) | (a.dtypes == long) ].columns.get_values().tolist()\n print(Detail_freq)\n for freq in Detail_freq:\n df1 = pd.DataFrame(a[freq].value_counts(dropna=False).astype(float).map('{:20,.0f}'.format).sort_index()).rename(columns={freq:...
[ "0.6683564", "0.6354427", "0.6292186", "0.623926", "0.6035211", "0.6035211", "0.60304123", "0.59121996", "0.5863353", "0.5838982", "0.5829605", "0.5827677", "0.582724", "0.57706845", "0.5759255", "0.57409495", "0.57018375", "0.5699908", "0.5659271", "0.56559473", "0.5653805",...
0.56352055
22
This function prepares a likelihood table for each item we divide frequency by column sum. PARAMETERS ==========
def make_likelihood_table(x, y): Y = np.unique(y) X = np.unique(x) likelihood = [[0 for i in range(len(Y))] for j in range(len(X))] freq = make_frequency_table(x, y, X, Y) for j in range(len(Y)): Sum = (y == Y[j]).sum() for i in range(len(X)): likelihood[i][j] = freq[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_build_idf_table(self):\r\n doc_per_word_table = dict() # in how many documents does a word occur\r\n \r\n for doc in self.documents:\r\n # converting list to set will delete any duplicate words\r\n doc = self.preprocess_document(doc)\r\n doc_words = set...
[ "0.55772585", "0.5530857", "0.5517678", "0.5446453", "0.54261065", "0.5381132", "0.53512454", "0.53395104", "0.531855", "0.5299571", "0.52794135", "0.5240511", "0.5205731", "0.51926017", "0.51895463", "0.5173857", "0.5085575", "0.5071231", "0.50538707", "0.50485694", "0.50425...
0.53115124
9
ensures 'selfupdate check' does not download anything.
def test_check_no_download(self): output = self.run_command("selfupdate --check", exitcode=0) contains_latest_version = ("Already at latest version" in output) contains_new_version = ("New version available" in output) assert (contains_latest_version or contains_new_version) self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def needs_update(self) -> bool:\n return False", "def dummy_update( self ):\r\n pass", "def check_updates(self):\n try:\n if not common.latest_version(version):\n self.update_notify()\n except:\n self.neterror()", "def run(self):\n USER....
[ "0.66283035", "0.6478493", "0.6332788", "0.6326459", "0.62626725", "0.6182095", "0.61624914", "0.611767", "0.6111686", "0.60227585", "0.6000878", "0.59463876", "0.59266293", "0.59234554", "0.58967555", "0.5894234", "0.588228", "0.5823291", "0.58189195", "0.58148617", "0.58021...
0.6917813
0
test that selfupdate uses the correct default repo and branch
def test_default_repo_branch(self): # network may be unavailable, but we are not interested anyway, # so we ignore the exitcode output = self.run_command("selfupdate --check", exitcode=None) self.assertIn("Target: ywangd:master", output) self.assertNotIn("Target: ywangd:dev", out...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_default_repo(self):\n # network may be unavailable, but we are not interested anyway,\n # so we ignore the exitcode\n output = self.run_command(\"selfupdate --check dev\", exitcode=None)\n self.assertIn(\"Target: ywangd:dev\", output)\n self.assertNotIn(\"Target: ywangd:...
[ "0.803227", "0.72238606", "0.6964844", "0.6536882", "0.6459807", "0.64591706", "0.64538366", "0.6417182", "0.6341737", "0.6337273", "0.6321295", "0.6302465", "0.6289103", "0.6223448", "0.62056243", "0.62040347", "0.618718", "0.6172022", "0.6157208", "0.6133951", "0.602443", ...
0.8427602
0
test that selfupdate uses the correct default repo
def test_default_repo(self): # network may be unavailable, but we are not interested anyway, # so we ignore the exitcode output = self.run_command("selfupdate --check dev", exitcode=None) self.assertIn("Target: ywangd:dev", output) self.assertNotIn("Target: ywangd:master", output...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_default_repo_branch(self):\n # network may be unavailable, but we are not interested anyway,\n # so we ignore the exitcode\n output = self.run_command(\"selfupdate --check\", exitcode=None)\n self.assertIn(\"Target: ywangd:master\", output)\n self.assertNotIn(\"Target: y...
[ "0.7640011", "0.7398748", "0.7280295", "0.7017325", "0.65783685", "0.6536711", "0.6522651", "0.6477542", "0.6472085", "0.6460582", "0.64320356", "0.6405418", "0.63857055", "0.63639194", "0.6355184", "0.6300703", "0.62530875", "0.62479275", "0.6238622", "0.62385267", "0.623796...
0.82788765
0
test that selfupdate uses the correct default repo
def test_SELFUPDATE_TARGET(self): # network may be unavailable, but we are not interested anyway, # so we ignore the exitcode output = self.run_command("SELFUPDATE_TARGET=ywangd:dev selfupdate --check", exitcode=None) self.assertIn("Target: ywangd:dev", output) self.assertNotIn("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_default_repo(self):\n # network may be unavailable, but we are not interested anyway,\n # so we ignore the exitcode\n output = self.run_command(\"selfupdate --check dev\", exitcode=None)\n self.assertIn(\"Target: ywangd:dev\", output)\n self.assertNotIn(\"Target: ywangd:...
[ "0.82780904", "0.76390237", "0.73980623", "0.72801113", "0.7016247", "0.6578536", "0.65360075", "0.6523192", "0.64764225", "0.6470717", "0.6459951", "0.64306885", "0.640529", "0.6384877", "0.6362823", "0.63535076", "0.62526286", "0.6247714", "0.62378883", "0.6237631", "0.6237...
0.6301355
16
test that selfupdate uses the correct default repo
def test_target_repo(self): # network may be unavailable, but we are not interested anyway, # so we ignore the exitcode output = self.run_command("selfupdate --check bennr01:dev", exitcode=None) self.assertIn("Target: bennr01:dev", output) self.assertNotIn("Target: ywangd:master"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_default_repo(self):\n # network may be unavailable, but we are not interested anyway,\n # so we ignore the exitcode\n output = self.run_command(\"selfupdate --check dev\", exitcode=None)\n self.assertIn(\"Target: ywangd:dev\", output)\n self.assertNotIn(\"Target: ywangd:...
[ "0.82788765", "0.7640011", "0.7398748", "0.7017325", "0.65783685", "0.6536711", "0.6522651", "0.6477542", "0.6472085", "0.6460582", "0.64320356", "0.6405418", "0.63857055", "0.63639194", "0.6355184", "0.6300703", "0.62530875", "0.62479275", "0.6238622", "0.62385267", "0.62379...
0.7280295
3
test the version check on an outdated branch.
def test_version_check_outdated(self): output = self.run_command("selfupdate --check bennr01:selfupdate_test_outdated", exitcode=0) self.assertIn("Target: bennr01:selfupdate_test_outdated", output) self.assertNotIn("Target: ywangd:master", output) self.assertIn("Already at latest version...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_version_check_update_available(self):\n output = self.run_command(\"selfupdate --check bennr01:selfupdate_test_future\", exitcode=0)\n self.assertIn(\"Target: bennr01:selfupdate_test_future\", output)\n self.assertNotIn(\"Target: ywangd:master\", output)\n self.assertNotIn(\"Al...
[ "0.76776046", "0.7427171", "0.6923874", "0.6835676", "0.68241715", "0.67480385", "0.66892505", "0.66880554", "0.6635462", "0.66249126", "0.66240865", "0.66131085", "0.6598753", "0.6585061", "0.6582532", "0.65403354", "0.65228", "0.6500237", "0.64956987", "0.64749783", "0.6471...
0.7763817
0
test the version check on an outdated branch.
def test_version_check_update_available(self): output = self.run_command("selfupdate --check bennr01:selfupdate_test_future", exitcode=0) self.assertIn("Target: bennr01:selfupdate_test_future", output) self.assertNotIn("Target: ywangd:master", output) self.assertNotIn("Already at latest ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_version_check_outdated(self):\n output = self.run_command(\"selfupdate --check bennr01:selfupdate_test_outdated\", exitcode=0)\n self.assertIn(\"Target: bennr01:selfupdate_test_outdated\", output)\n self.assertNotIn(\"Target: ywangd:master\", output)\n self.assertIn(\"Already a...
[ "0.7763817", "0.7427171", "0.6923874", "0.6835676", "0.68241715", "0.67480385", "0.66892505", "0.66880554", "0.6635462", "0.66249126", "0.66240865", "0.66131085", "0.6598753", "0.6585061", "0.6582532", "0.65403354", "0.65228", "0.6500237", "0.64956987", "0.64749783", "0.64719...
0.76776046
1
test the version check on an nonexistend branch.
def test_version_check_does_not_exist(self): output = self.run_command("selfupdate --check selfupdate_test_does_not_exist", exitcode=0) self.assertIn("Target: ywangd:selfupdate_test_does_not_exist", output) self.assertNotIn("Target: ywangd:master", output) self.assertNotIn("Already at la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_version_missing(self):\r\n self.assertIsNone(self._version_test(self.no_version))", "def test_default_repo_branch(self):\n # network may be unavailable, but we are not interested anyway,\n # so we ignore the exitcode\n output = self.run_command(\"selfupdate --check\", exitcod...
[ "0.73072684", "0.69348514", "0.6934578", "0.6737858", "0.66638994", "0.66529757", "0.6570365", "0.6517341", "0.65064025", "0.64400685", "0.6373914", "0.6364468", "0.6341854", "0.63392055", "0.6328755", "0.6303596", "0.6291833", "0.62678796", "0.62600833", "0.62577677", "0.623...
0.74615693
0
Return whether `other` is equal to `self`.
def equals(self, other: Schema) -> bool: if not isinstance(other, Schema): raise TypeError( f"invalid equality comparison between Schema and {type(other)}" ) return self.__cached_equals__(other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return self is other", "def __eq__(self, other):\n return self is other", "def __eq__(self, other):\n if other != None:\n return self == other\n else:\n return False", "def __eq__(self, other):\n if other != None:\n ...
[ "0.86491597", "0.86491597", "0.854738", "0.854738", "0.8474165", "0.84631306", "0.8452681", "0.8449483", "0.84473795", "0.84290755", "0.84290755", "0.84053004", "0.83532363", "0.8346449", "0.83375067", "0.83325887", "0.8330618", "0.8330618", "0.8329669", "0.8322861", "0.83128...
0.0
-1
Construct a `Schema` from an iterable of pairs.
def from_tuples( cls, values: Iterable[tuple[str, str | dt.DataType]], ) -> Schema: pairs = list(values) if len(pairs) == 0: return cls({}) names, types = zip(*pairs) # validate unique field names name_locs = {v: i for i, v in enumerate(names)} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_tuples(\n cls,\n values: Iterable[tuple[str, str | dt.DataType]],\n ) -> Schema:\n return cls(dict(values))", "def from_dicts(cls, dicts: typing.Dict[str, typing.Any]) -> 'StarSchema':\n # TODO: Still needs cleaning up a bit\n # TODO: Override for default_on_clause\...
[ "0.7464028", "0.5775714", "0.5559106", "0.54880965", "0.53594357", "0.53316325", "0.5222471", "0.51282495", "0.511169", "0.50875187", "0.50622284", "0.50596225", "0.49821848", "0.4974939", "0.49419346", "0.4924182", "0.48580188", "0.48482725", "0.48464513", "0.48421666", "0.4...
0.72733176
1
Return the equivalent ibis schema.
def from_numpy(cls, numpy_schema): from ibis.formats.numpy import NumpySchema return NumpySchema.to_ibis(numpy_schema)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_pyarrow(self):\n from ibis.backends.pyarrow.datatypes import ibis_to_pyarrow_schema\n\n return ibis_to_pyarrow_schema(self)", "def schema(self):\n raise NotImplementedError", "def schema(self):\n return self.table_info.schema", "def schema(self) -> 'outputs.TableSchemaRespo...
[ "0.6428137", "0.6340339", "0.6276669", "0.6241714", "0.6179093", "0.61776984", "0.61594194", "0.6154931", "0.6087268", "0.60489434", "0.60014504", "0.59783155", "0.5967729", "0.595297", "0.5952103", "0.592919", "0.58376867", "0.5833378", "0.5831866", "0.5819864", "0.5785424",...
0.48739564
96
Return the equivalent ibis schema.
def from_pandas(cls, pandas_schema): from ibis.formats.pandas import PandasSchema return PandasSchema.to_ibis(pandas_schema)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_pyarrow(self):\n from ibis.backends.pyarrow.datatypes import ibis_to_pyarrow_schema\n\n return ibis_to_pyarrow_schema(self)", "def schema(self):\n raise NotImplementedError", "def schema(self):\n return self.table_info.schema", "def schema(self) -> 'outputs.TableSchemaRespo...
[ "0.6427271", "0.63406706", "0.6275977", "0.6240763", "0.61794907", "0.61781657", "0.6159442", "0.6155131", "0.60875916", "0.6047986", "0.60015774", "0.59768224", "0.5967992", "0.5952669", "0.5952139", "0.59291506", "0.5837816", "0.5834211", "0.5831802", "0.5818156", "0.578501...
0.5717147
24
Return the equivalent ibis schema.
def from_pyarrow(cls, pyarrow_schema): from ibis.formats.pyarrow import PyArrowSchema return PyArrowSchema.to_ibis(pyarrow_schema)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_pyarrow(self):\n from ibis.backends.pyarrow.datatypes import ibis_to_pyarrow_schema\n\n return ibis_to_pyarrow_schema(self)", "def schema(self):\n raise NotImplementedError", "def schema(self):\n return self.table_info.schema", "def schema(self) -> 'outputs.TableSchemaRespo...
[ "0.6428137", "0.6340339", "0.6276669", "0.6241714", "0.6179093", "0.61776984", "0.61594194", "0.6154931", "0.6087268", "0.60489434", "0.60014504", "0.59783155", "0.5967729", "0.595297", "0.5952103", "0.592919", "0.58376867", "0.5833378", "0.5831866", "0.5819864", "0.5785424",...
0.5501006
45
Return the equivalent ibis schema.
def from_dask(cls, dask_schema): return cls.from_pandas(dask_schema)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_pyarrow(self):\n from ibis.backends.pyarrow.datatypes import ibis_to_pyarrow_schema\n\n return ibis_to_pyarrow_schema(self)", "def schema(self):\n raise NotImplementedError", "def schema(self):\n return self.table_info.schema", "def schema(self) -> 'outputs.TableSchemaRespo...
[ "0.6428137", "0.6340339", "0.6276669", "0.6241714", "0.6179093", "0.61776984", "0.61594194", "0.6154931", "0.6087268", "0.60489434", "0.60014504", "0.59783155", "0.5967729", "0.595297", "0.5952103", "0.592919", "0.58376867", "0.5833378", "0.5831866", "0.5819864", "0.5785424",...
0.0
-1
Return the equivalent numpy dtypes.
def to_numpy(self): from ibis.formats.numpy import NumpySchema return NumpySchema.from_ibis(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def np_dtype(dali_dtype):\n return numpy.dtype(dali_dtype)", "def dtypes(self):\n return self.to_pandas().dtypes", "def dtype(a):\n return a.dtype", "def dtype():\n return RaggedDtype()", "def dtype_specs(self):\r\n #TODO: add more type correspondances for e.g. int32, int64, float32,...
[ "0.74521077", "0.73910326", "0.7246645", "0.7202697", "0.7181751", "0.7170812", "0.70260847", "0.7023042", "0.6929397", "0.6851205", "0.6838065", "0.6829665", "0.6825781", "0.67346334", "0.6725484", "0.67131513", "0.66560495", "0.6647795", "0.6616137", "0.6589966", "0.6531429...
0.0
-1