index int64 0 731k | package stringlengths 2 98 ⌀ | name stringlengths 1 76 | docstring stringlengths 0 281k ⌀ | code stringlengths 4 8.19k | signature stringlengths 2 42.8k ⌀ | embed_func_code listlengths 768 768 |
|---|---|---|---|---|---|---|
721,747 | aiopg.connection | _connect | null | @property
def notifies(self) -> ClosableQueue:
"""Return notification queue (an asyncio.Queue -like object)."""
return self._notifies_proxy
| (self) -> aiopg.connection.Connection | [
0.00724869454279542,
0.004179547540843487,
-0.06296414881944656,
-0.015305761247873306,
0.020342538133263588,
0.000019032959244214,
-0.03674093261361122,
0.06456312537193298,
0.055999718606472015,
-0.016584942117333412,
0.03565718233585358,
-0.021586187183856964,
-0.031872935593128204,
0.0... |
721,748 | aiopg.connection | _create_waiter | null | def _create_waiter(self, func_name: str) -> "asyncio.Future[None]":
if self._waiter is not None:
raise RuntimeError(
f"{func_name}() called while another coroutine "
f"is already waiting for incoming data"
)
self._waiter = self._loop.create_future()
return self._waite... | (self, func_name: str) -> _asyncio.Future[None] | [
-0.0046835001558065414,
-0.07434508204460144,
-0.06869441270828247,
0.00023385761596728116,
-0.039702415466308594,
0.023525990545749664,
0.014652961865067482,
0.027717826887965202,
-0.010932014323771,
-0.02280580624938011,
0.037671130150556564,
0.044872965663671494,
0.002225182019174099,
-... |
721,749 | aiopg.connection | _cursor | null | def cursor(
self,
name: Optional[str] = None,
cursor_factory: Any = None,
scrollable: Optional[bool] = None,
withhold: bool = False,
timeout: Optional[float] = None,
isolation_level: Optional[IsolationLevel] = None,
) -> _ContextManager[Cursor]:
"""A coroutine that returns a new cursor o... | (self, name: Optional[str] = None, cursor_factory: Optional[Any] = None, scrollable: Optional[bool] = None, withhold: bool = False, timeout: Optional[float] = None, isolation_level: Optional[aiopg.connection.IsolationLevel] = None) -> aiopg.connection.Cursor | [
-0.01834382489323616,
-0.11806035786867142,
-0.01959902234375477,
-0.03620350360870361,
0.016855519264936447,
0.027130212634801865,
0.008961218409240246,
0.013609934598207474,
-0.04120636358857155,
-0.0844927653670311,
0.005397352389991283,
0.012695432640612125,
-0.026753652840852737,
0.04... |
721,751 | aiopg.connection | _fatal_error | null | def _fatal_error(self, message: str) -> None:
# Should be called from exception handler only.
self._loop.call_exception_handler(
{
"message": message,
"connection": self,
}
)
self.close()
if self._waiter and not self._waiter.done():
self._waiter.set_ex... | (self, message: str) -> NoneType | [
-0.033366139978170395,
-0.034178148955106735,
-0.023603592067956924,
0.0836368054151535,
-0.007432640064507723,
-0.07127214223146439,
0.04643208533525467,
0.08718011528253555,
0.03214813023805618,
-0.05351870134472847,
0.008184670470654964,
0.05853838473558426,
0.03168676048517227,
-0.0392... |
721,754 | aiopg.connection | _ready | null | @staticmethod
def _ready(weak_self: "weakref.ref[Any]") -> None:
self = cast(Connection, weak_self())
if self is None:
return
waiter = self._waiter
try:
state = self._conn.poll()
while self._conn.notifies:
notify = self._conn.notifies.pop(0)
self._notifies... | (weak_self: weakref.ReferenceType[typing.Any]) -> NoneType | [
-0.0027571681421250105,
-0.07261837273836136,
-0.0647740364074707,
0.05347352847456932,
0.005101731978356838,
-0.008737504482269287,
0.041163355112075806,
0.041396357119083405,
-0.0038469291757792234,
-0.09762705117464066,
0.0038954708725214005,
0.038755688816308975,
0.02462034672498703,
0... |
721,755 | aiopg.connection | cancel | null | @property
def raw(self) -> Any:
"""Underlying psycopg connection object, readonly"""
return self._conn
| (self) -> NoneType | [
0.0015023688320070505,
-0.08474379032850266,
-0.009778128936886787,
0.050350576639175415,
0.015804581344127655,
-0.02604106068611145,
0.0021601857151836157,
0.05072404444217682,
0.08386103808879852,
-0.09445401281118393,
-0.009294315241277218,
0.02244216576218605,
-0.0063107977621257305,
0... |
721,756 | aiopg.connection | close | null | def close(self) -> "asyncio.Future[None]":
self._close()
return create_completed_future(self._loop)
| (self) -> _asyncio.Future[None] | [
-0.01282664854079485,
-0.08036983758211136,
-0.020931830629706383,
0.0033378140069544315,
-0.00008258466550614685,
-0.015598323196172714,
-0.024219369515776634,
0.02544345334172249,
-0.005683245602995157,
-0.013980784453451633,
0.016393978148698807,
-0.03808648884296417,
0.02929057367146015,... |
721,758 | aiopg.connection | cursor | A coroutine that returns a new cursor object using the connection.
*cursor_factory* argument can be used to create non-standard
cursors. The argument must be subclass of
`psycopg2.extensions.cursor`.
*name*, *scrollable* and *withhold* parameters are not supported by
psycopg ... | def cursor(
self,
name: Optional[str] = None,
cursor_factory: Any = None,
scrollable: Optional[bool] = None,
withhold: bool = False,
timeout: Optional[float] = None,
isolation_level: Optional[IsolationLevel] = None,
) -> _ContextManager[Cursor]:
"""A coroutine that returns a new cursor o... | (self, name: Optional[str] = None, cursor_factory: Optional[Any] = None, scrollable: Optional[bool] = None, withhold: bool = False, timeout: Optional[float] = None, isolation_level: Optional[aiopg.connection.IsolationLevel] = None) -> aiopg.utils._ContextManager[aiopg.connection.Cursor] | [
-0.01839805208146572,
-0.11806312948465347,
-0.019599484279751778,
-0.03620435297489166,
0.016864880919456482,
0.02713085152208805,
0.009073503315448761,
0.013637152500450611,
-0.041171468794345856,
-0.08449475467205048,
0.005384030286222696,
0.0127046974375844,
-0.02673635073006153,
0.040... |
721,759 | aiopg.connection | get_backend_pid | Returns the PID of the backend server process. | @property
def cursor_factory(self) -> Any:
"""The default cursor factory used by .cursor()."""
return self._conn.cursor_factory
| (self) -> int | [
0.0067530483938753605,
-0.09713120013475418,
0.005854989867657423,
0.0018423408037051558,
0.04543120041489601,
0.008218997158110142,
0.02720589190721512,
0.04712166264653206,
0.04194461926817894,
-0.05416525900363922,
-0.02755807153880596,
0.016763759776949883,
-0.037049319595098495,
0.014... |
721,760 | aiopg.connection | get_parameter_status | Look up a current parameter setting of the server. | @property
def cursor_factory(self) -> Any:
"""The default cursor factory used by .cursor()."""
return self._conn.cursor_factory
| (self, parameter: str) -> Optional[str] | [
0.0067530483938753605,
-0.09713120013475418,
0.005854989867657423,
0.0018423408037051558,
0.04543120041489601,
0.008218997158110142,
0.02720589190721512,
0.04712166264653206,
0.04194461926817894,
-0.05416525900363922,
-0.02755807153880596,
0.016763759776949883,
-0.037049319595098495,
0.014... |
721,761 | aiopg.connection | get_transaction_status | Return the current session transaction status as an integer. | @property
def cursor_factory(self) -> Any:
"""The default cursor factory used by .cursor()."""
return self._conn.cursor_factory
| (self) -> int | [
0.0067530483938753605,
-0.09713120013475418,
0.005854989867657423,
0.0018423408037051558,
0.04543120041489601,
0.008218997158110142,
0.02720589190721512,
0.04712166264653206,
0.04194461926817894,
-0.05416525900363922,
-0.02755807153880596,
0.016763759776949883,
-0.037049319595098495,
0.014... |
721,762 | aiopg.connection | isexecuting | null | def isexecuting(self) -> bool:
return self._conn.isexecuting() # type: ignore
| (self) -> bool | [
0.07114806026220322,
-0.055418048053979874,
-0.0029191274661570787,
0.01865130104124546,
0.041969750076532364,
-0.0022622698452323675,
0.013379153795540333,
-0.03640374541282654,
-0.04549603909254074,
-0.03747545927762985,
0.015064512379467487,
0.036161743104457855,
0.015012655407190323,
-... |
721,763 | aiopg.connection | lobject | null | @property
def status(self) -> int:
"""A read-only integer representing the status of the connection."""
return self._conn.status # type: ignore
| (self, *args: Any, **kwargs: Any) -> NoneType | [
0.00038729325751774013,
-0.051152098923921585,
-0.030043041333556175,
0.009824024513363838,
0.07449465245008469,
-0.03343527019023895,
-0.0001458909537177533,
-0.010336216539144516,
0.03212539851665497,
-0.10250571370124817,
-0.046046964824199677,
0.001662527211010456,
0.007233672775328159,
... |
721,766 | aiopg.connection | set_client_encoding | null | @property
def encoding(self) -> str:
"""Client encoding for SQL operations."""
return self._conn.encoding # type: ignore
| (self, val: str) -> NoneType | [
-0.02549058571457863,
-0.07290782779455185,
0.03144744038581848,
0.03669150918722153,
0.01686926931142807,
-0.03239782154560089,
-0.019856180995702744,
0.025202076882123947,
0.07664147019386292,
-0.08139337599277496,
-0.028273845091462135,
0.001990921562537551,
-0.014764852821826935,
0.024... |
721,767 | aiopg.connection | set_isolation_level | Transaction isolation level.
The only allowed value is ISOLATION_LEVEL_READ_COMMITTED.
| @property
def isolation_level(self) -> int:
"""Transaction isolation level.
The only allowed value is ISOLATION_LEVEL_READ_COMMITTED.
"""
return self._conn.isolation_level # type: ignore
| (self, val: int) -> NoneType | [
-0.01567447930574417,
-0.037159550935029984,
0.03156089410185814,
0.054644323885440826,
0.04793299734592438,
-0.07509620487689972,
-0.02760474383831024,
-0.0020983931608498096,
-0.005201277788728476,
-0.09332275390625,
-0.017749691382050514,
0.0031922953203320503,
-0.019621798768639565,
-0... |
721,768 | aiopg.connection | set_session | null | @property
def dsn(self) -> Optional[str]:
"""DSN connection string.
Read-only attribute representing dsn connection string used
for connectint to PostgreSQL server.
"""
return self._dsn # type: ignore
| (self, *args: Any, **kwargs: Any) -> NoneType | [
0.01604240946471691,
-0.02356318198144436,
0.056086473166942596,
0.004542013164609671,
0.05433258041739464,
-0.036031078547239304,
0.0193023644387722,
0.011648142710328102,
0.07682817429304123,
-0.0735110267996788,
-0.02749037928879261,
0.02594619058072567,
0.02716629020869732,
0.029968706... |
721,775 | aiopg.connection | Cursor | null | class Cursor:
def __init__(
self,
conn: "Connection",
impl: Any,
timeout: float,
echo: bool,
isolation_level: Optional[IsolationLevel] = None,
):
self._conn = conn
self._impl = impl
self._timeout = timeout
self._echo = echo
... | (conn: 'Connection', impl: Any, timeout: float, echo: bool, isolation_level: Optional[aiopg.connection.IsolationLevel] = None) | [
0.01855424791574478,
-0.09489639848470688,
-0.07871251553297043,
0.06126171723008156,
0.016899079084396362,
-0.006022979039698839,
-0.017563190311193466,
0.011974438093602657,
-0.009680699557065964,
-0.12767285108566284,
-0.019218361005187035,
0.01797187514603138,
-0.01988247223198414,
0.0... |
721,776 | aiopg.connection | __aenter__ | null | def __aiter__(self) -> "Cursor":
return self
| (self) -> aiopg.connection.Cursor | [
-0.009537099860608578,
-0.04839134216308594,
-0.03880499675869942,
0.016094882041215897,
-0.006233585998415947,
0.02214379981160164,
0.005572883412241936,
0.0434340201318264,
0.02811885066330433,
-0.023161528632044792,
0.002698211232200265,
-0.021487200632691383,
-0.0017122869612649083,
0.... |
721,780 | aiopg.connection | __init__ | null | def __init__(
self,
conn: "Connection",
impl: Any,
timeout: float,
echo: bool,
isolation_level: Optional[IsolationLevel] = None,
):
self._conn = conn
self._impl = impl
self._timeout = timeout
self._echo = echo
self._transaction = Transaction(
self, isolation_level or ... | (self, conn: aiopg.connection.Connection, impl: Any, timeout: float, echo: bool, isolation_level: Optional[aiopg.connection.IsolationLevel] = None) | [
-0.020777732133865356,
-0.04803164303302765,
0.02606661058962345,
0.010217967443168163,
-0.03088776394724846,
-0.026984069496393204,
-0.04522529989480972,
0.016568217426538467,
-0.05022634565830231,
-0.05306866765022278,
-0.006714535877108574,
0.06397023051977158,
-0.023044394329190254,
0.... |
721,781 | aiopg.connection | __repr__ | null | def __repr__(self) -> str:
return (
f"<"
f"{type(self).__module__}::{type(self).__name__} "
f"name={self.name}, "
f"closed={self.closed}"
f">"
)
| (self) -> str | [
0.03920246288180351,
-0.050851594656705856,
0.03377899155020714,
0.007271986920386553,
0.028216008096933365,
-0.07435911893844604,
0.0019019211176782846,
0.019670987501740456,
-0.00044332744437269866,
-0.055002033710479736,
-0.014849153347313404,
-0.01885136216878891,
-0.008736847899854183,
... |
721,782 | aiopg.connection | begin | null | def begin(self) -> _ContextManager[Transaction]:
return _ContextManager[Transaction](
self._transaction.begin(),
_commit_transaction,
_rollback_transaction,
)
| (self) -> aiopg.utils._ContextManager[aiopg.connection.Transaction] | [
-0.015740152448415756,
0.003273489186540246,
0.04422314837574959,
-0.01669929176568985,
-0.011569611728191376,
-0.019080011174082756,
-0.01073892880231142,
0.011449718847870827,
0.03240519016981125,
-0.03541962429881096,
-0.005634940229356289,
-0.009308784268796444,
-0.008079888299107552,
... |
721,783 | aiopg.connection | begin_nested | null | def begin_nested(self) -> _ContextManager[Transaction]:
if self._transaction.is_begin:
return self._transaction.point()
return _ContextManager[Transaction](
self._transaction.begin(),
_commit_transaction,
_rollback_transaction,
)
| (self) -> aiopg.utils._ContextManager[aiopg.connection.Transaction] | [
-0.007848079316318035,
0.003966925200074911,
0.0366758331656456,
0.02657196670770645,
-0.031152157112956047,
-0.023930208757519722,
-0.0036495712120085955,
0.004768887534737587,
0.03876865282654762,
-0.026880742982029915,
-0.007020385470241308,
-0.037293385714292526,
-0.012445423752069473,
... |
721,784 | aiopg.connection | callproc | Call a stored database procedure with the given name.
The sequence of parameters must contain one entry for each
argument that the procedure expects. The result of the call is
returned as modified copy of the input sequence. Input
parameters are left untouched, output and input/output
... | @withhold.setter
def withhold(self, val: bool) -> None:
# Not supported
self._impl.withhold = val
| (self, procname: str, parameters: Optional[Any] = None, *, timeout: Optional[float] = None) -> NoneType | [
0.033330801874399185,
-0.01571551524102688,
0.0209822915494442,
0.032516613602638245,
-0.02154204435646534,
-0.0059113409370183945,
-0.02445955015718937,
0.03758832439780235,
-0.016309194266796112,
-0.05129381641745567,
-0.045865897089242935,
-0.025460323318839073,
0.01512183714658022,
0.0... |
721,785 | aiopg.connection | close | Close the cursor now. | def close(self) -> None:
"""Close the cursor now."""
if not self.closed:
self._impl.close()
| (self) -> NoneType | [
0.005830870475620031,
-0.0525193065404892,
0.004818969871848822,
0.03626254200935364,
-0.031285978853702545,
-0.031833402812480927,
-0.004677967168390751,
0.07677174359560013,
0.020403899252414703,
-0.03457051143050194,
-0.014390555210411549,
-0.07378581166267395,
0.019756946712732315,
0.0... |
721,786 | aiopg.connection | copy_expert | null | @tzinfo_factory.setter
def tzinfo_factory(self, val: datetime.tzinfo) -> None:
"""The time zone factory used to handle data types such as
`TIMESTAMP WITH TIME ZONE`.
"""
self._impl.tzinfo_factory = val
| (self, *args: Any, **kwargs: Any) -> NoneType | [
0.06720537692308426,
-0.009854982607066631,
0.04379189386963844,
0.020107416436076164,
-0.039600588381290436,
-0.026972481980919838,
-0.040684547275304794,
0.05763041973114014,
-0.02478650026023388,
0.0008688598754815757,
0.013603669591248035,
0.024949094280600548,
-0.000022141390218166634,
... |
721,789 | aiopg.connection | execute | Prepare and execute a database operation (query or command).
Parameters may be provided as sequence or mapping and will be
bound to variables in the operation. Variables are specified
either with positional %s or named %({name})s placeholders.
| @withhold.setter
def withhold(self, val: bool) -> None:
# Not supported
self._impl.withhold = val
| (self, operation: str, parameters: Optional[Any] = None, *, timeout: Optional[float] = None) -> NoneType | [
0.033330801874399185,
-0.01571551524102688,
0.0209822915494442,
0.032516613602638245,
-0.02154204435646534,
-0.0059113409370183945,
-0.02445955015718937,
0.03758832439780235,
-0.016309194266796112,
-0.05129381641745567,
-0.045865897089242935,
-0.025460323318839073,
0.01512183714658022,
0.0... |
721,790 | aiopg.connection | executemany | null | @withhold.setter
def withhold(self, val: bool) -> None:
# Not supported
self._impl.withhold = val
| (self, *args: Any, **kwargs: Any) -> NoneType | [
0.033330801874399185,
-0.01571551524102688,
0.0209822915494442,
0.032516613602638245,
-0.02154204435646534,
-0.0059113409370183945,
-0.02445955015718937,
0.03758832439780235,
-0.016309194266796112,
-0.05129381641745567,
-0.045865897089242935,
-0.025460323318839073,
0.01512183714658022,
0.0... |
721,791 | aiopg.connection | fetchall | Fetch all (remaining) rows of a query result.
Returns them as a list of tuples. An empty list is returned
if there is no more record to fetch.
| def mogrify(self, operation: str, parameters: Any = None) -> bytes:
"""Return a query string after arguments binding.
The byte string returned is exactly the one that would be sent to
the database running the .execute() method or similar.
"""
ret = self._impl.mogrify(operation, parameters)
asser... | (self) -> List[Any] | [
0.027057258412241936,
-0.055960945785045624,
0.013164670206606388,
0.05077674612402916,
0.011069685220718384,
-0.05258766561746597,
-0.04307146370410919,
0.015810031443834305,
0.017265869304537773,
-0.05990235507488251,
0.04335552826523781,
0.029152244329452515,
-0.004494008142501116,
-0.0... |
721,792 | aiopg.connection | fetchmany | Fetch the next set of rows of a query result.
Returns a list of tuples. An empty list is returned when no
more rows are available.
The number of rows to fetch per call is specified by the
parameter. If it is not given, the cursor's .arraysize
determines the number of rows to b... | def mogrify(self, operation: str, parameters: Any = None) -> bytes:
"""Return a query string after arguments binding.
The byte string returned is exactly the one that would be sent to
the database running the .execute() method or similar.
"""
ret = self._impl.mogrify(operation, parameters)
asser... | (self, size: Optional[int] = None) -> List[Any] | [
0.027057258412241936,
-0.055960945785045624,
0.013164670206606388,
0.05077674612402916,
0.011069685220718384,
-0.05258766561746597,
-0.04307146370410919,
0.015810031443834305,
0.017265869304537773,
-0.05990235507488251,
0.04335552826523781,
0.029152244329452515,
-0.004494008142501116,
-0.0... |
721,793 | aiopg.connection | fetchone | Fetch the next row of a query result set.
Returns a single tuple, or None when no more data is
available.
| def mogrify(self, operation: str, parameters: Any = None) -> bytes:
"""Return a query string after arguments binding.
The byte string returned is exactly the one that would be sent to
the database running the .execute() method or similar.
"""
ret = self._impl.mogrify(operation, parameters)
asser... | (self) -> Any | [
0.027057258412241936,
-0.055960945785045624,
0.013164670206606388,
0.05077674612402916,
0.011069685220718384,
-0.05258766561746597,
-0.04307146370410919,
0.015810031443834305,
0.017265869304537773,
-0.05990235507488251,
0.04335552826523781,
0.029152244329452515,
-0.004494008142501116,
-0.0... |
721,794 | aiopg.connection | mogrify | Return a query string after arguments binding.
The byte string returned is exactly the one that would be sent to
the database running the .execute() method or similar.
| def mogrify(self, operation: str, parameters: Any = None) -> bytes:
"""Return a query string after arguments binding.
The byte string returned is exactly the one that would be sent to
the database running the .execute() method or similar.
"""
ret = self._impl.mogrify(operation, parameters)
asser... | (self, operation: str, parameters: Optional[Any] = None) -> bytes | [
0.027057258412241936,
-0.055960945785045624,
0.013164670206606388,
0.05077674612402916,
0.011069685220718384,
-0.05258766561746597,
-0.04307146370410919,
0.015810031443834305,
0.017265869304537773,
-0.05990235507488251,
0.04335552826523781,
0.029152244329452515,
-0.004494008142501116,
-0.0... |
721,796 | aiopg.connection | scroll | Scroll to a new position according to mode.
If mode is relative (default), value is taken as offset
to the current position in the result set, if set to
absolute, value states an absolute target position.
| def mogrify(self, operation: str, parameters: Any = None) -> bytes:
"""Return a query string after arguments binding.
The byte string returned is exactly the one that would be sent to
the database running the .execute() method or similar.
"""
ret = self._impl.mogrify(operation, parameters)
asser... | (self, value: int, mode: str = 'relative') -> NoneType | [
0.027057258412241936,
-0.055960945785045624,
0.013164670206606388,
0.05077674612402916,
0.011069685220718384,
-0.05258766561746597,
-0.04307146370410919,
0.015810031443834305,
0.017265869304537773,
-0.05990235507488251,
0.04335552826523781,
0.029152244329452515,
-0.004494008142501116,
-0.0... |
721,797 | aiopg.connection | setinputsizes | This method is exposed in compliance with the DBAPI.
It currently does nothing but it is safe to call it.
| def mogrify(self, operation: str, parameters: Any = None) -> bytes:
"""Return a query string after arguments binding.
The byte string returned is exactly the one that would be sent to
the database running the .execute() method or similar.
"""
ret = self._impl.mogrify(operation, parameters)
asser... | (self, sizes: int) -> NoneType | [
0.027057258412241936,
-0.055960945785045624,
0.013164670206606388,
0.05077674612402916,
0.011069685220718384,
-0.05258766561746597,
-0.04307146370410919,
0.015810031443834305,
0.017265869304537773,
-0.05990235507488251,
0.04335552826523781,
0.029152244329452515,
-0.004494008142501116,
-0.0... |
721,799 | aiopg.connection | DefaultCompiler | null | class DefaultCompiler(IsolationCompiler):
__slots__ = ()
def __init__(self, readonly: bool, deferrable: bool):
super().__init__(None, readonly, deferrable)
@property
def name(self) -> str:
return "Default"
| (readonly: bool, deferrable: bool) | [
0.06202080845832825,
-0.03259936720132828,
0.0036883587017655373,
-0.031010404229164124,
-0.010208659805357456,
-0.02837921865284443,
-0.02154497057199478,
-0.0011244475608691573,
-0.012686074711382389,
-0.049787502735853195,
0.030549094080924988,
0.05822780355811119,
-0.060141392052173615,
... |
721,800 | aiopg.connection | __init__ | null | def __init__(self, readonly: bool, deferrable: bool):
super().__init__(None, readonly, deferrable)
| (self, readonly: bool, deferrable: bool) | [
-0.001712085329927504,
-0.0038349865935742855,
0.03345819190144539,
0.011214847676455975,
-0.04035312309861183,
-0.010122162289917469,
0.01053721271455288,
0.032492563128471375,
-0.0009894518880173564,
-0.04621465876698494,
0.010427097789943218,
0.09012535959482193,
-0.03020554780960083,
0... |
721,802 | aiopg.connection | begin | null | def begin(self) -> str:
query = "BEGIN"
if self._isolation_level is not None:
query += f" ISOLATION LEVEL {self._isolation_level.upper()}"
if self._readonly:
query += " READ ONLY"
if self._deferrable:
query += " DEFERRABLE"
return query
| (self) -> str | [
-0.005169098265469074,
0.006661615334451199,
0.032756589353084564,
0.013988517224788666,
0.035137616097927094,
-0.040127258747816086,
0.004287156742066145,
-0.030848268419504166,
-0.036275602877140045,
-0.07815361768007278,
-0.029937878251075745,
0.03258151561021805,
-0.03373701125383377,
... |
721,803 | aiopg.connection | commit | null | def commit(self) -> str:
return "COMMIT"
| (self) -> str | [
-0.005908149294555187,
-0.016126858070492744,
-0.0014518784591928124,
0.05632239952683449,
0.003778028767555952,
-0.11056499928236008,
-0.040187157690525055,
0.058804746717214584,
-0.0024634760338813066,
-0.08077685534954071,
0.004356683697551489,
-0.0416296012699604,
-0.005107257515192032,
... |
721,804 | aiopg.connection | release_savepoint | null | def release_savepoint(self, unique_id: str) -> str:
return f"RELEASE SAVEPOINT {unique_id}"
| (self, unique_id: str) -> str | [
-0.017224878072738647,
0.00298919714987278,
-0.052968405187129974,
0.05120955407619476,
0.007284846622496843,
-0.06622741371393204,
-0.016590679064393044,
0.08652182668447495,
0.02502976916730404,
-0.020852504298090935,
-0.07414223253726959,
-0.018501734361052513,
0.020869415253400803,
0.0... |
721,805 | aiopg.connection | rollback | null | def rollback(self) -> str:
return "ROLLBACK"
| (self) -> str | [
-0.023561885580420494,
-0.0032433278393000364,
0.01778477244079113,
0.011965676210820675,
-0.023259595036506653,
-0.10002465546131134,
-0.06029021367430687,
0.06099555641412735,
0.08880630880594254,
-0.054513100534677505,
0.006965282838791609,
-0.036442831158638,
0.006318716332316399,
-0.0... |
721,806 | aiopg.connection | rollback_savepoint | null | def rollback_savepoint(self, unique_id: str) -> str:
return f"ROLLBACK TO SAVEPOINT {unique_id}"
| (self, unique_id: str) -> str | [
-0.06117605045437813,
0.002164247212931514,
0.016414329409599304,
0.06725291907787323,
-0.03849813714623451,
-0.09173013269901276,
-0.04939575865864754,
0.07265080511569977,
0.07020647823810577,
-0.04121405631303787,
-0.05397886782884598,
-0.03199690952897072,
-0.008351447992026806,
-0.023... |
721,807 | aiopg.connection | savepoint | null | def savepoint(self, unique_id: str) -> str:
return f"SAVEPOINT {unique_id}"
| (self, unique_id: str) -> str | [
-0.02772839181125164,
-0.007011632900685072,
-0.008367912843823433,
0.08720378577709198,
0.007497214712202549,
-0.04390328750014305,
-0.030491184443235397,
0.06754609197378159,
-0.006726981606334448,
-0.018452106043696404,
-0.054820504039525986,
-0.027812112122774124,
-0.005818608682602644,
... |
721,808 | aiopg.connection | IsolationCompiler | null | class IsolationCompiler(abc.ABC):
__slots__ = ("_isolation_level", "_readonly", "_deferrable")
def __init__(
self, isolation_level: Optional[str], readonly: bool, deferrable: bool
):
self._isolation_level = isolation_level
self._readonly = readonly
self._deferrable = deferra... | (isolation_level: Optional[str], readonly: bool, deferrable: bool) | [
0.007061841432005167,
-0.043520547449588776,
0.014016753062605858,
0.020013749599456787,
0.008251438848674297,
-0.07153623551130295,
-0.06365904957056046,
-0.01676129177212715,
-0.04348490387201309,
-0.08411833643913269,
0.00604600552469492,
0.05528285726904869,
-0.04152451828122139,
0.018... |
721,809 | aiopg.connection | __init__ | null | def __init__(
self, isolation_level: Optional[str], readonly: bool, deferrable: bool
):
self._isolation_level = isolation_level
self._readonly = readonly
self._deferrable = deferrable
| (self, isolation_level: Optional[str], readonly: bool, deferrable: bool) | [
-0.005097353830933571,
-0.0016151240561157465,
0.03818575292825699,
0.0140221631154418,
0.008840445429086685,
-0.05523613467812538,
-0.021099848672747612,
0.013675827533006668,
-0.018933027982711792,
-0.0464622937142849,
-0.0020724651403725147,
0.08248122781515121,
-0.020371655002236366,
0... |
721,817 | aiopg.connection | IsolationLevel | An enumeration. | class IsolationLevel(enum.Enum):
serializable = SerializableCompiler
repeatable_read = RepeatableReadCompiler
read_committed = ReadCommittedCompiler
default = DefaultCompiler
def __call__(self, readonly: bool, deferrable: bool) -> IsolationCompiler:
return self.value(readonly, deferrable) ... | (value, names=None, *, module=None, qualname=None, type=None, start=1) | [
0.032885629683732986,
-0.04332384839653969,
-0.008867250755429268,
-0.006912265904247761,
0.012943043373525143,
-0.0493982657790184,
-0.02441984973847866,
-0.07006524503231049,
-0.05023611709475517,
-0.06280387192964554,
0.018764358013868332,
0.05941756069660187,
-0.04129904508590698,
0.01... |
721,818 | aiopg.pool | Pool | Connection pool | class Pool:
"""Connection pool"""
def __init__(
self,
dsn: str,
minsize: int,
maxsize: int,
timeout: float,
*,
enable_json: bool,
enable_hstore: bool,
enable_uuid: bool,
echo: bool,
on_connect: Optional[Callable[[Connection... | (dsn: str, minsize: int, maxsize: int, timeout: float, *, enable_json: bool, enable_hstore: bool, enable_uuid: bool, echo: bool, on_connect: Optional[Callable[[aiopg.connection.Connection], Awaitable[NoneType]]], pool_recycle: float, **kwargs: Any) | [
0.006796445231884718,
-0.07742664217948914,
-0.041998669505119324,
0.010576517321169376,
0.01082628034055233,
0.012814781628549099,
-0.01688784547150135,
-0.03790639340877533,
-0.04249819368124008,
-0.14540070295333862,
-0.019644849002361298,
0.02203681319952011,
0.03709946572780609,
0.062... |
721,819 | aiopg.pool | __aenter__ | null | def __exit__(
self,
exc_type: Optional[Type[BaseException]],
exc: Optional[BaseException],
tb: Optional[TracebackType],
) -> None:
# This must exist because __enter__ exists, even though that
# always raises; that's how the with-statement works.
pass # pragma: nocover
| (self) -> aiopg.pool.Pool | [
0.008405182510614395,
-0.016099456697702408,
0.039290651679039,
0.038666438311338425,
-0.05735810846090317,
-0.058779921382665634,
0.006957358215004206,
0.011599931865930557,
-0.011001728475093842,
-0.05808635428547859,
0.013758663088083267,
-0.01780736818909645,
0.020494947209954262,
-0.0... |
721,821 | aiopg.pool | __await__ | null | def __await__(self) -> Generator[Any, Any, _PoolConnectionContextManager]:
# This is not a coroutine. It is meant to enable the idiom:
#
# with (await pool) as conn:
# <block>
#
# as an alternative to:
#
# conn = await pool.acquire()
# try:
# <block>
... | (self) -> Generator[Any, Any, aiopg.pool._PoolConnectionContextManager] | [
0.03157603740692139,
-0.08704745024442673,
-0.004827079828828573,
0.025388840585947037,
0.0003380845009814948,
0.01116540003567934,
0.007809557486325502,
-0.000240437249885872,
0.032447222620248795,
-0.06521447002887726,
-0.02371758595108986,
0.0025624416302889585,
0.012898881919682026,
0.... |
721,822 | aiopg.pool | __del__ | null | def __del__(self) -> None:
try:
self._free
except AttributeError:
return # frame has been cleared, __dict__ is empty
if self._free:
left = 0
while self._free:
conn = self._free.popleft()
conn.close()
left += 1
warnings.warn(
... | (self) -> NoneType | [
-0.01563809998333454,
-0.046432554721832275,
0.010450104251503944,
0.0006004409515298903,
-0.06366410851478577,
-0.011710045859217644,
-0.023790663108229637,
0.047062527388334274,
0.008870544843375683,
-0.05365869030356407,
-0.05191700533032417,
-0.01700921170413494,
0.03924347460269928,
0... |
721,823 | aiopg.pool | __enter__ | null | def __enter__(self) -> "Pool":
raise RuntimeError(
'"await" should be used as context manager expression'
)
| (self) -> aiopg.pool.Pool | [
0.06742129474878311,
-0.062098558992147446,
-0.002932432107627392,
0.04291043430566788,
0.00354848918505013,
0.016921035945415497,
0.015590352937579155,
-0.005425409879535437,
0.024872280657291412,
-0.056742969900369644,
0.01270720548927784,
-0.019680973142385483,
0.029061468318104744,
0.0... |
721,825 | aiopg.pool | __init__ | null | def __init__(
self,
dsn: str,
minsize: int,
maxsize: int,
timeout: float,
*,
enable_json: bool,
enable_hstore: bool,
enable_uuid: bool,
echo: bool,
on_connect: Optional[Callable[[Connection], Awaitable[None]]],
pool_recycle: float,
**kwargs: Any,
):
if minsize < 0... | (self, dsn: str, minsize: int, maxsize: int, timeout: float, *, enable_json: bool, enable_hstore: bool, enable_uuid: bool, echo: bool, on_connect: Optional[Callable[[aiopg.connection.Connection], Awaitable[NoneType]]], pool_recycle: float, **kwargs: Any) | [
-0.012166307307779789,
-0.06715574860572815,
-0.010805042460560799,
-0.04817366227507591,
0.017507381737232208,
0.04749302938580513,
-0.02304697595536709,
-0.019965222105383873,
-0.06590792536735535,
-0.12160635739564896,
-0.01947365514934063,
0.09445668011903763,
0.012355372309684753,
0.0... |
721,826 | aiopg.pool | _acquire | null | @classmethod
async def from_pool_fill(cls, *args: Any, **kwargs: Any) -> "Pool":
"""constructor for filling the free pool with connections,
the number is controlled by the minsize parameter
"""
self = cls(*args, **kwargs)
if self._minsize > 0:
async with self._cond:
await self._f... | (self) -> aiopg.connection.Connection | [
0.027420802041888237,
-0.06752194464206696,
-0.02747408114373684,
-0.006353491917252541,
-0.027527358382940292,
0.021933089941740036,
-0.018221335485577583,
-0.047311536967754364,
-0.009927609004080296,
-0.08176513761281967,
0.0006437849951907992,
0.029338836669921875,
0.022004127502441406,
... |
721,829 | aiopg.pool | acquire | Acquire free connection from the pool. | def acquire(self) -> _ContextManager[Connection]:
"""Acquire free connection from the pool."""
coro = self._acquire()
return _ContextManager[Connection](coro, self.release)
| (self) -> aiopg.utils._ContextManager[aiopg.connection.Connection] | [
-0.00005608716674032621,
-0.07511541247367859,
-0.011295994743704796,
0.012055248022079468,
0.034031398594379425,
0.0019171134335920215,
0.02761993184685707,
-0.024768514558672905,
-0.0012875662650913,
-0.0913802981376648,
0.004416320938616991,
-0.00457660760730505,
0.004078874830156565,
0... |
721,830 | aiopg.pool | clear | Close all free connections in pool. | @property
def timeout(self) -> float:
return self._timeout
| (self) -> NoneType | [
0.03554622083902359,
0.0263217743486166,
-0.01925983466207981,
0.03760736063122749,
0.06416565924882889,
-0.00473048584535718,
-0.03451565280556679,
0.01848268322646618,
0.00691833533346653,
-0.025865620002150536,
0.002126606646925211,
-0.019530147314071655,
-0.0037674938794225454,
0.01425... |
721,831 | aiopg.pool | close | Close pool.
Mark all pool connections to be closed on getting back to pool.
Closed pool doesn't allow to acquire new connections.
| def close(self) -> None:
"""Close pool.
Mark all pool connections to be closed on getting back to pool.
Closed pool doesn't allow to acquire new connections.
"""
if self._closed:
return
self._closing = True
| (self) -> NoneType | [
0.010026227682828903,
-0.043709054589271545,
0.02969883568584919,
0.0356173999607563,
-0.061447083950042725,
-0.030794210731983185,
-0.029804838821291924,
0.020723816007375717,
0.04646516218781471,
-0.060528382658958435,
-0.044592421501874924,
-0.056747566908597946,
0.06384984403848648,
0.... |
721,832 | aiopg.pool | cursor | null | def release(self, conn: Connection) -> "asyncio.Future[None]":
"""Release free connection back to the connection pool."""
future = create_completed_future(self._loop)
if conn in self._terminated:
assert conn.closed, conn
self._terminated.remove(conn)
return future
assert conn in ... | (self, name: Optional[str] = None, cursor_factory: Optional[Any] = None, scrollable: Optional[bool] = None, withhold: bool = False, *, timeout: Optional[float] = None) -> aiopg.pool._PoolCursorContextManager | [
-0.010304760187864304,
-0.035438552498817444,
-0.03283166512846947,
0.014470112510025501,
-0.032397184520959854,
-0.0340595468878746,
-0.02066619135439396,
0.0002944259322248399,
0.009832498617470264,
-0.08115352690219879,
-0.031169302761554718,
0.006559721194207668,
0.021648498252034187,
... |
721,833 | aiopg.pool | release | Release free connection back to the connection pool. | def release(self, conn: Connection) -> "asyncio.Future[None]":
"""Release free connection back to the connection pool."""
future = create_completed_future(self._loop)
if conn in self._terminated:
assert conn.closed, conn
self._terminated.remove(conn)
return future
assert conn in ... | (self, conn: aiopg.connection.Connection) -> _asyncio.Future[None] | [
-0.010304760187864304,
-0.035438552498817444,
-0.03283166512846947,
0.014470112510025501,
-0.032397184520959854,
-0.0340595468878746,
-0.02066619135439396,
0.0002944259322248399,
0.009832498617470264,
-0.08115352690219879,
-0.031169302761554718,
0.006559721194207668,
0.021648498252034187,
... |
721,834 | aiopg.pool | terminate | Terminate pool.
Close pool with instantly closing all acquired connections also.
| def terminate(self) -> None:
"""Terminate pool.
Close pool with instantly closing all acquired connections also.
"""
self.close()
for conn in list(self._used):
conn.close()
self._terminated.add(conn)
self._used.clear()
| (self) -> NoneType | [
0.002806150121614337,
-0.03888364136219025,
-0.0037371108774095774,
0.009827053174376488,
-0.0803854763507843,
-0.01125998143106699,
-0.01972486823797226,
-0.004714509006589651,
0.01958334445953369,
-0.05384977534413338,
-0.05943996459245682,
-0.03923745080828667,
0.022413820028305054,
0.0... |
721,835 | aiopg.pool | wait_closed | Wait for closing all pool's connections. | def terminate(self) -> None:
"""Terminate pool.
Close pool with instantly closing all acquired connections also.
"""
self.close()
for conn in list(self._used):
conn.close()
self._terminated.add(conn)
self._used.clear()
| (self) -> NoneType | [
0.002806150121614337,
-0.03888364136219025,
-0.0037371108774095774,
0.009827053174376488,
-0.0803854763507843,
-0.01125998143106699,
-0.01972486823797226,
-0.004714509006589651,
0.01958334445953369,
-0.05384977534413338,
-0.05943996459245682,
-0.03923745080828667,
0.022413820028305054,
0.0... |
721,836 | aiopg.connection | ReadCommittedCompiler | null | class ReadCommittedCompiler(IsolationCompiler):
__slots__ = ()
def __init__(self, readonly: bool, deferrable: bool):
super().__init__("Read committed", readonly, deferrable)
| (readonly: bool, deferrable: bool) | [
0.00464885588735342,
-0.02877863310277462,
-0.019787438213825226,
-0.007607605773955584,
0.00595155730843544,
-0.012592780403792858,
-0.0071308002807199955,
0.013588964007794857,
-0.02513447403907776,
-0.10442046076059341,
0.05612684786319733,
0.05343630164861679,
-0.030396366491913795,
0.... |
721,837 | aiopg.connection | __init__ | null | def __init__(self, readonly: bool, deferrable: bool):
super().__init__("Read committed", readonly, deferrable)
| (self, readonly: bool, deferrable: bool) | [
-0.036678534001111984,
-0.026133455336093903,
-0.0020621062722057104,
0.018644921481609344,
0.02236371673643589,
-0.03586345538496971,
0.016989292576909065,
0.04282558336853981,
0.028561709448695183,
-0.09828488528728485,
0.023263700306415558,
0.0575309582054615,
-0.01473933644592762,
0.02... |
721,845 | aiopg.connection | RepeatableReadCompiler | null | class RepeatableReadCompiler(IsolationCompiler):
__slots__ = ()
def __init__(self, readonly: bool, deferrable: bool):
super().__init__("Repeatable read", readonly, deferrable)
| (readonly: bool, deferrable: bool) | [
0.020417671650648117,
-0.02111065573990345,
-0.008679200895130634,
-0.01747671514749527,
-0.004504395183175802,
0.01913311704993248,
-0.011468038894236088,
-0.012879359535872936,
-0.017240086570382118,
-0.06936600059270859,
0.05246395245194435,
0.08958084881305695,
-0.03542668744921684,
0.... |
721,846 | aiopg.connection | __init__ | null | def __init__(self, readonly: bool, deferrable: bool):
super().__init__("Repeatable read", readonly, deferrable)
| (self, readonly: bool, deferrable: bool) | [
0.00025158494827337563,
-0.006820277310907841,
0.010291727259755135,
0.00518391840159893,
0.00041886779945343733,
0.011441829614341259,
0.017657456919550896,
0.007695539388805628,
0.020837152376770973,
-0.056422680616378784,
0.023441797122359276,
0.10310331732034683,
-0.010629992000758648,
... |
721,854 | aiopg.connection | SerializableCompiler | null | class SerializableCompiler(IsolationCompiler):
__slots__ = ()
def __init__(self, readonly: bool, deferrable: bool):
super().__init__("Serializable", readonly, deferrable)
| (readonly: bool, deferrable: bool) | [
0.029930541291832924,
-0.002507501281797886,
-0.012984449975192547,
-0.02664036490023136,
-0.00939211342483759,
-0.02229263074696064,
-0.03944855555891991,
0.02311517484486103,
-0.038474928587675095,
-0.05788026005029678,
0.03548691049218178,
0.0734582468867302,
-0.057813115417957306,
0.03... |
721,855 | aiopg.connection | __init__ | null | def __init__(self, readonly: bool, deferrable: bool):
super().__init__("Serializable", readonly, deferrable)
| (self, readonly: bool, deferrable: bool) | [
-0.004812533035874367,
0.01863412745296955,
-0.00697282562032342,
-0.003479996230453253,
-0.004179417621344328,
-0.021269258111715317,
-0.017444897443056107,
0.055851049721241,
-0.00654504494741559,
-0.051504798233509064,
0.010010069236159325,
0.08897838741540909,
-0.05229191482067108,
0.0... |
721,863 | aiopg.connection | Transaction | null | class Transaction:
__slots__ = ("_cursor", "_is_begin", "_isolation", "_unique_id")
def __init__(
self,
cursor: "Cursor",
isolation_level: Callable[[bool, bool], IsolationCompiler],
readonly: bool = False,
deferrable: bool = False,
):
self._cursor = cursor
... | (cursor: 'Cursor', isolation_level: Callable[[bool, bool], aiopg.connection.IsolationCompiler], readonly: bool = False, deferrable: bool = False) | [
0.008909703232347965,
-0.047407735139131546,
0.0004649117181543261,
0.0866989716887474,
0.008974266238510609,
-0.05663102865219116,
-0.047407735139131546,
0.014047077856957912,
-0.015338338911533356,
-0.0965125560760498,
0.004328031092882156,
0.0017604964086785913,
0.004323419649153948,
0.... |
721,864 | aiopg.connection | __aenter__ | null | def __del__(self) -> None:
if self._is_begin:
warnings.warn(
f"You have not closed transaction {self!r}", ResourceWarning
)
if self._unique_id is not None:
warnings.warn(
f"You have not closed savepoint {self!r}", ResourceWarning
)
| (self) -> aiopg.connection.Transaction | [
-0.03501059487462044,
-0.010475968942046165,
0.03176349774003029,
0.028842926025390625,
-0.017124352976679802,
-0.061313893646001816,
-0.028208019211888313,
0.0605882853269577,
0.03027600236237049,
-0.03947308659553528,
-0.04135966673493385,
-0.033214714378118515,
0.04067033901810646,
-0.0... |
721,867 | aiopg.connection | __init__ | null | def __init__(
self,
cursor: "Cursor",
isolation_level: Callable[[bool, bool], IsolationCompiler],
readonly: bool = False,
deferrable: bool = False,
):
self._cursor = cursor
self._is_begin = False
self._unique_id: Optional[str] = None
self._isolation = isolation_level(readonly, deferr... | (self, cursor: aiopg.connection.Cursor, isolation_level: Callable[[bool, bool], aiopg.connection.IsolationCompiler], readonly: bool = False, deferrable: bool = False) | [
-0.01631247252225876,
-0.020399553701281548,
-0.0012099910527467728,
0.041731249541044235,
-0.003564992221072316,
-0.014573669992387295,
-0.004322357010096312,
0.02115243673324585,
-0.03309101611375809,
-0.07220509648323059,
-0.013892490416765213,
0.0407274030148983,
-0.02269405499100685,
... |
721,868 | aiopg.connection | __repr__ | null | def __repr__(self) -> str:
return (
f"<{self.__class__.__name__} "
f"transaction={self._isolation} id={id(self):#x}>"
)
| (self) -> str | [
0.0040588160045444965,
-0.03616352751851082,
0.070445716381073,
0.032766662538051605,
0.04267853498458862,
-0.07239673286676407,
-0.009310889057815075,
0.0002679656899999827,
0.015564600937068462,
-0.07149089872837067,
-0.028185253962874413,
0.007216156460344791,
-0.028725266456604004,
0.0... |
721,869 | aiopg.connection | _check_commit_rollback | null | def _check_commit_rollback(self) -> None:
if not self._is_begin:
raise psycopg2.ProgrammingError(
"You are trying to commit " "the transaction does not open"
)
| (self) -> NoneType | [
0.004803394433110952,
-0.02309528924524784,
0.029812950640916824,
0.0834479033946991,
-0.02676430158317089,
-0.05097624659538269,
-0.012079385109245777,
0.04870748519897461,
0.016980266198515892,
-0.06356078386306763,
0.015243245288729668,
-0.02224450185894966,
0.029937023296952248,
-0.043... |
721,870 | aiopg.connection | _check_release_rollback | null | def _check_release_rollback(self) -> None:
self._check_commit_rollback()
if self._unique_id is None:
raise psycopg2.ProgrammingError("You do not start savepoint")
| (self) -> NoneType | [
-0.015146284364163876,
0.02193964459002018,
-0.026292329654097557,
0.06608326733112335,
-0.02278551086783409,
-0.061818692833185196,
0.00029186776373535395,
0.05773033946752548,
0.04102449119091034,
-0.026909105479717255,
-0.013974407687783241,
0.01036185584962368,
0.06590704619884491,
-0.... |
721,871 | aiopg.connection | begin | null | @property
def is_begin(self) -> bool:
return self._is_begin
| (self) -> aiopg.connection.Transaction | [
0.026320552453398705,
0.04053432121872902,
-0.03071845881640911,
0.02026716060936451,
0.007729781325906515,
-0.0035534417256712914,
0.004740709438920021,
0.030651571229100227,
0.023009581491351128,
-0.07090161740779877,
0.01567694917321205,
-0.0289459191262722,
0.011672011576592922,
0.0208... |
721,873 | aiopg.connection | point | null | def point(self) -> _ContextManager["Transaction"]:
return _ContextManager[Transaction](
self.savepoint(),
_release_savepoint,
_rollback_savepoint,
)
| (self) -> aiopg.utils._ContextManager['Transaction'] | [
-0.0032077429350465536,
-0.01317131519317627,
0.037539951503276825,
0.05486346408724785,
0.0051221782341599464,
-0.061500173062086105,
-0.03039272502064705,
0.03464702516794205,
0.028639953583478928,
-0.018276477232575417,
-0.0270233191549778,
-0.05231088399887085,
0.0030609695240855217,
0... |
721,878 | aiopg | VersionInfo | VersionInfo(major, minor, micro, releaselevel, serial) | from aiopg import VersionInfo
| (major, minor, micro, releaselevel, serial) | [
0.03521490842103958,
-0.04053336754441261,
-0.06929898262023926,
0.03441978991031647,
0.022722715511918068,
-0.05240713432431221,
-0.006904277950525284,
0.02834155224263668,
0.027016354724764824,
0.01749260351061821,
-0.0028050008695572615,
-0.021750904619693756,
-0.01742192730307579,
0.03... |
721,884 | aiopg | _parse_version | null | def _parse_version(ver: str) -> VersionInfo:
RE = (
r"^"
r"(?P<major>\d+)\.(?P<minor>\d+)\.(?P<micro>\d+)"
r"((?P<releaselevel>[a-z]+)(?P<serial>\d+)?)?"
r"$"
)
match = re.match(RE, ver)
if not match:
raise ImportError(f"Invalid package version {ver}")
try:
... | (ver: str) -> aiopg.VersionInfo | [
0.08475042134523392,
0.05834268406033516,
-0.03392184525728226,
0.013203870505094528,
-0.005391730926930904,
-0.0685662031173706,
0.057620175182819366,
0.019887087866663933,
-0.028195952996611595,
0.005378183908760548,
0.0009838554542511702,
0.03706476464867592,
-0.04237521067261696,
-0.01... |
721,885 | aiopg.connection | connect | A factory for connecting to PostgreSQL.
The coroutine accepts all parameters that psycopg2.connect() does
plus optional keyword-only `timeout` parameters.
Returns instantiated Connection object.
| def connect(
dsn: Optional[str] = None,
*,
timeout: float = TIMEOUT,
enable_json: bool = True,
enable_hstore: bool = True,
enable_uuid: bool = True,
echo: bool = False,
**kwargs: Any,
) -> _ContextManager["Connection"]:
"""A factory for connecting to PostgreSQL.
The coroutine ac... | (dsn: Optional[str] = None, *, timeout: float = 60.0, enable_json: bool = True, enable_hstore: bool = True, enable_uuid: bool = True, echo: bool = False, **kwargs: Any) -> aiopg.utils._ContextManager['Connection'] | [
-0.029472921043634415,
-0.08238479495048523,
0.04497050493955612,
-0.04808836430311203,
0.026373405009508133,
0.025456387549638748,
-0.014974885620176792,
0.01698315143585205,
0.012902427464723587,
-0.0930221900343895,
-0.004280176013708115,
0.036405570805072784,
0.006364096887409687,
0.09... |
721,887 | aiopg.pool | create_pool | null | def create_pool(
dsn: Optional[str] = None,
*,
minsize: int = 1,
maxsize: int = 10,
timeout: float = TIMEOUT,
pool_recycle: float = -1.0,
enable_json: bool = True,
enable_hstore: bool = True,
enable_uuid: bool = True,
echo: bool = False,
on_connect: Optional[Callable[[Connect... | (dsn: Optional[str] = None, *, minsize: int = 1, maxsize: int = 10, timeout: float = 60.0, pool_recycle: float = -1.0, enable_json: bool = True, enable_hstore: bool = True, enable_uuid: bool = True, echo: bool = False, on_connect: Optional[Callable[[aiopg.connection.Connection], Awaitable[NoneType]]] = None, **kwargs: ... | [
-0.000712901703082025,
-0.04730473458766937,
0.03421928361058235,
-0.06862106919288635,
-0.013632962480187416,
0.08344029635190964,
-0.03872710093855858,
-0.03978561982512474,
-0.012483194470405579,
-0.10942870378494263,
-0.01921754889190197,
0.0578899011015892,
-0.02741192653775215,
0.035... |
721,888 | aiopg.utils | get_running_loop | null | def get_running_loop() -> asyncio.AbstractEventLoop:
return __get_running_loop()
| () -> asyncio.events.AbstractEventLoop | [
0.024807726964354515,
-0.06557217985391617,
-0.08227688074111938,
-0.00041739491280168295,
-0.011335332877933979,
0.06115558743476868,
0.00000507830463902792,
0.02178022265434265,
0.0053693680092692375,
0.009768153540790081,
-0.024861153215169907,
-0.03000791184604168,
-0.02819140814244747,
... |
721,896 | apprise.apprise | Apprise |
Our Notification Manager
| class Apprise:
"""
Our Notification Manager
"""
def __init__(self, servers=None, asset=None, location=None, debug=False):
"""
Loads a set of server urls while applying the Asset() module to each
if specified.
If no asset is provided, then the default asset is used.
... | (servers=None, asset=None, location=None, debug=False) | [
0.01822463795542717,
-0.04973217099905014,
-0.06962504237890244,
0.01064939983189106,
0.04301727935671806,
-0.011226460337638855,
0.020176153630018234,
0.05296371132135391,
-0.02700645662844181,
0.018182668834924698,
0.006059140898287296,
0.040813952684402466,
-0.0135871646925807,
-0.02560... |
721,897 | apprise.apprise | __bool__ |
Allows the Apprise object to be wrapped in an 'if statement'.
True is returned if at least one service has been loaded.
| def __bool__(self):
"""
Allows the Apprise object to be wrapped in an 'if statement'.
True is returned if at least one service has been loaded.
"""
return len(self) > 0
| (self) | [
0.009080179035663605,
-0.06186804547905922,
-0.023371592164039612,
0.0034324834123253822,
0.04323393478989601,
0.0009540768223814666,
0.023125944659113884,
-0.007057975046336651,
-0.002463053446263075,
0.017984896898269653,
0.013887849636375904,
0.01287894044071436,
0.016247818246483803,
-... |
721,898 | apprise.apprise | __getitem__ |
Returns the indexed server entry of a loaded notification server
| def __getitem__(self, index):
"""
Returns the indexed server entry of a loaded notification server
"""
# Tracking variables
prev_offset = -1
offset = prev_offset
for idx, s in enumerate(self.servers):
if isinstance(s, (ConfigBase, AppriseConfig)):
# Get our list of server... | (self, index) | [
0.02727690525352955,
-0.025087574496865273,
-0.08972666412591934,
0.0009595144656486809,
0.032229818403720856,
0.00489010289311409,
0.004161073826253414,
0.01714676432311535,
0.04181262478232384,
-0.021247273311018944,
-0.04669375345110893,
0.012202826328575611,
-0.011942618526518345,
-0.0... |
721,899 | apprise.apprise | __getstate__ |
Pickle Support dumps()
| def __getstate__(self):
"""
Pickle Support dumps()
"""
attributes = {
'asset': self.asset,
# Prepare our URL list as we need to extract the associated tags
# and asset details associated with it
'urls': [{
'url': server.url(privacy=False),
'tag': s... | (self) | [
0.016343438997864723,
-0.04103127494454384,
-0.06604579091072083,
-0.0170341394841671,
0.019414251670241356,
-0.012077904306352139,
-0.029401389881968498,
-0.007546356879174709,
0.020534304901957512,
-0.036420390009880066,
-0.01738882251083851,
0.05368787422776222,
-0.0396125391125679,
0.0... |
721,900 | apprise.apprise | __init__ |
Loads a set of server urls while applying the Asset() module to each
if specified.
If no asset is provided, then the default asset is used.
Optionally specify a global ContentLocation for a more strict means
of handling Attachments.
| def __init__(self, servers=None, asset=None, location=None, debug=False):
"""
Loads a set of server urls while applying the Asset() module to each
if specified.
If no asset is provided, then the default asset is used.
Optionally specify a global ContentLocation for a more strict means
of handlin... | (self, servers=None, asset=None, location=None, debug=False) | [
0.007840437814593315,
-0.055861957371234894,
-0.06634073704481125,
0.04661378264427185,
0.017573395743966103,
-0.033599212765693665,
0.009695666842162609,
0.055116135627031326,
-0.017797142267227173,
0.052132852375507355,
0.008185380138456821,
0.04415257275104523,
-0.027390258386731148,
-0... |
721,901 | apprise.apprise | __iter__ |
Returns an iterator to each of our servers loaded. This includes those
found inside configuration.
| def __iter__(self):
"""
Returns an iterator to each of our servers loaded. This includes those
found inside configuration.
"""
return chain(*[[s] if not isinstance(s, (ConfigBase, AppriseConfig))
else iter(s.servers()) for s in self.servers])
| (self) | [
0.023640640079975128,
-0.05031166225671768,
-0.04425089806318283,
-0.016457172110676765,
-0.03946800157427788,
0.007133266422897577,
0.016320256516337395,
-0.0013748537749052048,
0.05388970673084259,
0.0407823845744133,
0.0019111038418486714,
0.01016821339726448,
-0.03216587379574776,
0.04... |
721,902 | apprise.apprise | __len__ |
Returns the number of servers loaded; this includes those found within
loaded configuration. This funtion nnever actually counts the
Config entry themselves (if they exist), only what they contain.
| def __len__(self):
"""
Returns the number of servers loaded; this includes those found within
loaded configuration. This funtion nnever actually counts the
Config entry themselves (if they exist), only what they contain.
"""
return sum([1 if not isinstance(s, (ConfigBase, AppriseConfig))
... | (self) | [
-0.0019137264462187886,
-0.05870101600885391,
-0.012128087691962719,
0.02389867790043354,
0.023130059242248535,
0.045294877141714096,
0.007641499862074852,
-0.0569850318133831,
0.043829139322042465,
-0.007440407760441303,
-0.020109210163354874,
0.010590850375592709,
0.0053401123732328415,
... |
721,903 | apprise.apprise | __setstate__ |
Pickle Support loads()
| def __setstate__(self, state):
"""
Pickle Support loads()
"""
self.servers = list()
self.asset = state['asset']
self.locale = state['locale']
self.location = state['location']
for entry in state['urls']:
self.add(entry['url'], asset=entry['asset'], tag=entry['tag'])
| (self, state) | [
-0.014937060885131359,
-0.04143829643726349,
-0.09429251402616501,
0.005819152574986219,
-0.014612744562327862,
0.024370018392801285,
-0.047257449477910995,
0.011406650766730309,
0.016086066141724586,
-0.030633946880698204,
-0.048702970147132874,
0.07524127513170242,
-0.03128257766366005,
... |
721,904 | apprise.apprise | _create_notify_calls |
Creates notifications for all the plugins loaded.
Returns a list of (server, notify() kwargs) tuples for plugins with
parallelism disabled and another list for plugins with parallelism
enabled.
| def _create_notify_calls(self, *args, **kwargs):
"""
Creates notifications for all the plugins loaded.
Returns a list of (server, notify() kwargs) tuples for plugins with
parallelism disabled and another list for plugins with parallelism
enabled.
"""
all_calls = list(self._create_notify_gen(... | (self, *args, **kwargs) | [
0.006817711982876062,
-0.03129705414175987,
-0.04387671872973442,
-0.003560957033187151,
-0.006182465702295303,
0.0343569740653038,
-0.0175542663782835,
0.018055304884910583,
-0.012543873861432076,
-0.019576316699385643,
0.041443098336458206,
0.027807675302028656,
-0.022242560982704163,
-0... |
721,905 | apprise.apprise | _create_notify_gen |
Internal generator function for _create_notify_calls().
| def _create_notify_gen(self, body, title='',
notify_type=common.NotifyType.INFO,
body_format=None, tag=common.MATCH_ALL_TAG,
match_always=True, attach=None,
interpret_escapes=None):
"""
Internal generator function for _c... | (self, body, title='', notify_type='info', body_format=None, tag='all', match_always=True, attach=None, interpret_escapes=None) | [
0.022864600643515587,
-0.048419155180454254,
0.005269497632980347,
-0.0267188623547554,
-0.0001333841501036659,
-0.037599120289087296,
-0.006157784257084131,
0.043280139565467834,
0.0149754099547863,
0.015407007187604904,
0.06271203607320786,
0.06010238453745842,
0.009309445507824421,
0.00... |
721,906 | apprise.apprise | _notify_parallel_asyncio |
Process a list of async_notify() calls in parallel and asynchronously.
| @staticmethod
async def _notify_parallel_asyncio(*servers_kwargs):
"""
Process a list of async_notify() calls in parallel and asynchronously.
"""
n_calls = len(servers_kwargs)
# 0-length case
if n_calls == 0:
return True
# (Unlike with the thread pool, we don't optimize for the singl... | (*servers_kwargs) | [
0.013645010069012642,
-0.024124082177877426,
-0.05606118217110634,
0.040212973952293396,
0.028104647994041443,
0.003408938180655241,
0.020810028538107872,
0.0007509847055189312,
-0.02951173111796379,
-0.02860453352332115,
0.03349229693412781,
0.0016084264498203993,
0.01120112743228674,
-0.... |
721,907 | apprise.apprise | _notify_parallel_threadpool |
Process a list of notify() calls in parallel and synchronously.
| @staticmethod
def _notify_parallel_threadpool(*servers_kwargs):
"""
Process a list of notify() calls in parallel and synchronously.
"""
n_calls = len(servers_kwargs)
# 0-length case
if n_calls == 0:
return True
# There's no need to use a thread pool for just a single notification
... | (*servers_kwargs) | [
0.035105571150779724,
-0.04250499978661537,
-0.024683313444256783,
0.05837946757674217,
0.005962198134511709,
-0.010338803753256798,
0.004946862813085318,
-0.018878748640418053,
-0.009161200374364853,
-0.026407994329929352,
0.016291730105876923,
-0.005716477520763874,
-0.0036046726163476706,... |
721,908 | apprise.apprise | _notify_sequential |
Process a list of notify() calls sequentially and synchronously.
| @staticmethod
def _notify_sequential(*servers_kwargs):
"""
Process a list of notify() calls sequentially and synchronously.
"""
success = True
for (server, kwargs) in servers_kwargs:
try:
# Send notification
result = server.notify(**kwargs)
success = succe... | (*servers_kwargs) | [
0.026399461552500725,
-0.009709506295621395,
-0.05079390108585358,
0.04904878884553909,
0.010860538110136986,
-0.03232170268893242,
-0.005216771271079779,
0.024710044264793396,
0.019251927733421326,
-0.005411704070866108,
0.02535982057452202,
0.04474170506000519,
0.022519372403621674,
-0.0... |
721,909 | apprise.apprise | add |
Adds one or more server URLs into our list.
You can override the global asset if you wish by including it with the
server(s) that you add.
The tag allows you to associate 1 or more tag values to the server(s)
being added. tagging a service allows you to exclusively access them... | def add(self, servers, asset=None, tag=None):
"""
Adds one or more server URLs into our list.
You can override the global asset if you wish by including it with the
server(s) that you add.
The tag allows you to associate 1 or more tag values to the server(s)
being added. tagging a service allows... | (self, servers, asset=None, tag=None) | [
-0.006243919022381306,
-0.024994300678372383,
-0.05460751801729202,
0.005363903474062681,
0.017441999167203903,
0.0034292663913220167,
0.00908883661031723,
0.05397427827119827,
-0.020896874368190765,
0.015635406598448753,
-0.0026540146209299564,
0.05147857218980789,
-0.020096013322472572,
... |
721,910 | apprise.apprise | async_notify |
Send a notification to all the plugins previously loaded, for
asynchronous callers.
The arguments are identical to those of Apprise.notify().
| def notify(self, body, title='', notify_type=common.NotifyType.INFO,
body_format=None, tag=common.MATCH_ALL_TAG, match_always=True,
attach=None, interpret_escapes=None):
"""
Send a notification to all the plugins previously loaded.
If the body_format specified is NotifyFormat.MARKDOWN,... | (self, *args, **kwargs) | [
0.027370985597372055,
-0.029223846271634102,
-0.00739310123026371,
-0.049715396016836166,
0.0608692541718483,
-0.039809007197618484,
-0.007466481998562813,
-0.019757742062211037,
-0.028361624106764793,
0.026949046179652214,
0.050485894083976746,
-0.028783563524484634,
0.008232392370700836,
... |
721,911 | apprise.apprise | clear |
Empties our server list
| def clear(self):
"""
Empties our server list
"""
self.servers[:] = []
| (self) | [
-0.0075956969521939754,
0.042785339057445526,
-0.05303996428847313,
-0.019573859870433807,
-0.054009996354579926,
0.001790661714039743,
-0.048951972275972366,
0.030625294893980026,
0.05723188817501068,
0.01946992799639702,
-0.04919448122382164,
-0.017807016149163246,
-0.02057853527367115,
... |
721,912 | apprise.apprise | details |
Returns the details associated with the Apprise object
| def details(self, lang=None, show_requirements=False, show_disabled=False):
"""
Returns the details associated with the Apprise object
"""
# general object returned
response = {
# Defines the current version of Apprise
'version': __version__,
# Lists all of the currently supp... | (self, lang=None, show_requirements=False, show_disabled=False) | [
0.012227781116962433,
-0.05767076462507248,
-0.008223910816013813,
-0.01973738707602024,
0.06861091405153275,
0.009337663650512695,
0.021974291652441025,
-0.02257581055164337,
-0.013599999248981476,
0.046542637050151825,
-0.0028337249532341957,
-0.007612992078065872,
0.008440082892775536,
... |
721,913 | apprise.apprise | find |
Returns a list of all servers matching against the tag specified.
| def find(self, tag=common.MATCH_ALL_TAG, match_always=True):
"""
Returns a list of all servers matching against the tag specified.
"""
# Build our tag setup
# - top level entries are treated as an 'or'
# - second level (or more) entries are treated as 'and'
#
# examples:
# ... | (self, tag='all', match_always=True) | [
0.07988855242729187,
-0.05428420007228851,
-0.046576954424381256,
-0.009393204003572464,
0.005822119303047657,
0.022843828424811363,
0.039684899151325226,
-0.05146808922290802,
0.019546017050743103,
0.01271880604326725,
0.013737793080508709,
0.029865572229027748,
-0.022028638049960136,
-0.... |
721,914 | apprise.apprise | instantiate |
Returns the instance of a instantiated plugin based on the provided
Server URL. If the url fails to be parsed, then None is returned.
The specified url can be either a string (the URL itself) or a
dictionary containing all of the components needed to istantiate
the notificatio... | @staticmethod
def instantiate(url, asset=None, tag=None, suppress_exceptions=True):
"""
Returns the instance of a instantiated plugin based on the provided
Server URL. If the url fails to be parsed, then None is returned.
The specified url can be either a string (the URL itself) or a
dictionary con... | (url, asset=None, tag=None, suppress_exceptions=True) | [
0.007175321690738201,
-0.05522119253873825,
-0.05409010872244835,
-0.01306807342916727,
0.04386994615197182,
0.004069886635988951,
0.0506160594522953,
0.04831349477171898,
-0.03409413993358612,
0.015138363465666771,
0.026580501347780228,
0.07077361643314362,
-0.011563326232135296,
-0.02946... |
721,915 | apprise.apprise | notify |
Send a notification to all the plugins previously loaded.
If the body_format specified is NotifyFormat.MARKDOWN, it will
be converted to HTML if the Notification type expects this.
if the tag is specified (either a string or a set/list/tuple
of strings), then only the notifica... | def notify(self, body, title='', notify_type=common.NotifyType.INFO,
body_format=None, tag=common.MATCH_ALL_TAG, match_always=True,
attach=None, interpret_escapes=None):
"""
Send a notification to all the plugins previously loaded.
If the body_format specified is NotifyFormat.MARKDOWN,... | (self, body, title='', notify_type='info', body_format=None, tag='all', match_always=True, attach=None, interpret_escapes=None) | [
0.02727976255118847,
-0.02926107682287693,
-0.007402410265058279,
-0.04971631243824959,
0.06083368510007858,
-0.03973635658621788,
-0.007462033070623875,
-0.01977645233273506,
-0.028453873470425606,
0.026967888697981834,
0.05048682168126106,
-0.028784092515707016,
0.00820502545684576,
-0.0... |
721,916 | apprise.apprise | pop |
Removes an indexed Notification Service from the stack and returns it.
The thing is we can never pop AppriseConfig() entries, only what was
loaded within them. So pop needs to carefully iterate over our list
and only track actual entries.
| def pop(self, index):
"""
Removes an indexed Notification Service from the stack and returns it.
The thing is we can never pop AppriseConfig() entries, only what was
loaded within them. So pop needs to carefully iterate over our list
and only track actual entries.
"""
# Tracking variables
... | (self, index) | [
0.010608085431158543,
-0.0036007664166390896,
-0.08386459201574326,
-0.04646841436624527,
-0.007683718577027321,
-0.013769080862402916,
-0.026377344503998756,
0.02419857867062092,
0.07179209589958191,
-0.019144559279084206,
-0.033770859241485596,
-0.023323500528931618,
-0.04761137440800667,
... |
721,917 | apprise.apprise | urls |
Returns all of the loaded URLs defined in this apprise object.
| def urls(self, privacy=False):
"""
Returns all of the loaded URLs defined in this apprise object.
"""
return [x.url(privacy=privacy) for x in self.servers]
| (self, privacy=False) | [
-0.03298930078744888,
-0.02110332064330578,
-0.060500867664813995,
-0.00542506342753768,
0.00025882621412165463,
0.0502476766705513,
0.020330820232629776,
-0.062256552278995514,
0.05245983600616455,
0.08996124565601349,
-0.02217428758740425,
0.010937911458313465,
0.024316223338246346,
0.00... |
721,918 | apprise.asset | AppriseAsset |
Provides a supplimentary class that can be used to provide extra
information and details that can be used by Apprise such as providing
an alternate location to where images/icons can be found and the
URL masks.
Any variable that starts with an underscore (_) can only be initialized
by this cla... | class AppriseAsset:
"""
Provides a supplimentary class that can be used to provide extra
information and details that can be used by Apprise such as providing
an alternate location to where images/icons can be found and the
URL masks.
Any variable that starts with an underscore (_) can only be ... | (plugin_paths=None, **kwargs) | [
0.017263004556298256,
-0.13594751060009003,
-0.07621169090270996,
0.026784073561429977,
0.042289506644010544,
-0.05369753763079643,
-0.02138197235763073,
0.02540389634668827,
-0.008739328011870384,
-0.014653605408966541,
0.025533288717269897,
0.04185820370912552,
0.019829271361231804,
0.01... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.