PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` 3 pe]'@sPddlZddlmZddlmZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZddlmZmZdd lmZdd lmZmZmZmZmZmZmZdd lmZdd lmZdd l m!Z!ddl"m#Z#ddlm$Z$ddl%Z%ddl&Z&dZ'yddl(m)Z)Wne*k rYnXedZ+Gdddej,Z-e-Z.Gddde/Z0ddZ1e1d\Z2Z3e1d\Z4Z5e1d\Z6Z7e1d\Z8Z9e1d\Z:Z;e1d\ZZ?e1d\Z@ZAe1d \ZBZCe1d!\ZDZEe1d"\ZFZGe1d#\ZHZIe1d$\ZJZKe$d%d\ZLZMd\ZNZOd\ZPZQGd*d+d+eRZSGd,d-d-eRZTGd.d/d/eTZUGd0d1d1eTZVGd2d3d3eVZWGd4d5d5eVZXGd6d7d7eVZYGd8d9d9eVZZGd:d;d;eVZ[Gdd?d?e\Z]Gd@dAdAe[Z^GdBdCdCe[Z_GdDdEdEe[Z`GdFdGdGeZadHdIZbdJdKZcdLdMZddNdOZedPdQZfdRdSZgdTdUZherDeaZinejZidZkdVZledWZmedXedYfZndZd[Zoejd\dVdVZpepjqe.d]Zre!epjsZtejjuZudZvdevdVZwd^d_Zxd`daZydbdcZzdddeZ{dfdgZ|dhdiZ}ejj~jqe.d]Zejjjqe.d]ZdjdkZdldmZdndoZdpdqZdrdsZdtduZdvdwZdxdyZdzd{Zd|d}Zd~dZddZernddZnddZddZddZedZedZddZe2dZedZddZddZGdddZereje_edZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZee2dZee2dZee2dZee2dZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZeeeeedeeddgdZGddde/ZGddde/ZdddddZddddddddddddddddddddddddddddddd؜ZddڄZdd܄ZddބZddZddZddZdS)N) timedelta)warn)pack)md5)Decimal)deque defaultdict)countislice)map)bPY2 integer_typesnext text_typeu binary_type)UUID)deepcopy)timegm) LooseVersion)StructzMathieu Fenniak)loadsc@s$eZdZddZddZddZdS)UTCcCstS)N)ZERO)selfdtr-/usr/lib/fm-agent/dependencies/pg8000/core.py utcoffset>sz UTC.utcoffsetcCsdS)Nrr)rrrrrtznameAsz UTC.tznamecCstS)N)r)rrrrrdstDszUTC.dstN)__name__ __module__ __qualname__rr r!rrrrr<src@steZdZdZdddZddZddZd d Zed d eZ ed d eZ edd eZ ddZ ddZ ddZdS)Intervala An Interval represents a measurement of time. In PostgreSQL, an interval is defined in the measure of months, days, and microseconds; as such, the pg8000 interval type represents the same information. Note that values of the :attr:`microseconds`, :attr:`days` and :attr:`months` properties are independently measured and cannot be converted to each other. A month may be 28, 29, 30, or 31 days, and a day may occasionally be lengthened slightly by a leap second. .. attribute:: microseconds Measure of microseconds in the interval. The microseconds value is constrained to fit into a signed 64-bit integer. Any attempt to set a value too large or too small will result in an OverflowError being raised. .. attribute:: days Measure of days in the interval. The days value is constrained to fit into a signed 32-bit integer. Any attempt to set a value too large or too small will result in an OverflowError being raised. .. attribute:: months Measure of months in the interval. The months value is constrained to fit into a signed 32-bit integer. Any attempt to set a value too large or too small will result in an OverflowError being raised. rcCs||_||_||_dS)N) microsecondsdaysmonths)rr&r'r(rrr__init__mszInterval.__init__cCs@t|tstdn(t|ko&tkns6tdn||_dS)Nz$microseconds must be an integer typez6microseconds must be representable as a 64-bit integer) isinstancer TypeErrormin_int8max_int8 OverflowError _microseconds)rvaluerrr_setMicrosecondsrs   zInterval._setMicrosecondscCs@t|tstdn(t|ko&tkns6tdn||_dS)Nzdays must be an integer typez.days must be representable as a 32-bit integer)r*rr+min_int4max_int4r._days)rr0rrr_setDays{s   zInterval._setDayscCs@t|tstdn(t|ko&tkns6tdn||_dS)Nzmonths must be an integer typez0months must be representable as a 32-bit integer)r*rr+r2r3r._months)rr0rrr _setMonthss   zInterval._setMonthscCs|jS)N)r/)rrrrszInterval.cCs|jS)N)r4)rrrrr8scCs|jS)N)r6)rrrrr8scCsd|j|j|jfS)Nz,)r(r'r&)rrrr__repr__szInterval.__repr__cCs6|dk o4t|to4|j|jko4|j|jko4|j|jkS)N)r*r%r(r'r&)rotherrrr__eq__szInterval.__eq__cCs |j| S)N)r;)rr:rrr__neq__szInterval.__neq__N)rrr)r"r#r$__doc__r)r1r5r7propertyr&r'r(r9r;r<rrrrr%Js!    r%cCstd|}|j|jfS)N!)rr unpack_from)fmtZstrucrrr pack_funcss rBihqdfZiiiiiZqiiZdiiZihihihZciZbhZccccz!i?c@seZdZdZdS)WarningzGeneric exception raised for important database warnings like data truncations. This exception is not currently used by pg8000. This exception is part of the `DBAPI 2.0 specification `_. N)r"r#r$r=rrrrrMsrMc@seZdZdZdS)ErrorzGeneric exception that is the base exception of all other error exceptions. This exception is part of the `DBAPI 2.0 specification `_. N)r"r#r$r=rrrrrNsrNc@seZdZdZdS)InterfaceErroraiGeneric exception raised for errors that are related to the database interface rather than the database itself. For example, if the interface attempts to use an SSL connection but the server refuses, an InterfaceError will be raised. This exception is part of the `DBAPI 2.0 specification `_. N)r"r#r$r=rrrrrOsrOc@seZdZdZdS) DatabaseErrorzGeneric exception raised for errors that are related to the database. This exception is currently never raised by pg8000. This exception is part of the `DBAPI 2.0 specification `_. N)r"r#r$r=rrrrrPsrPc@seZdZdZdS) DataErrorzGeneric exception raised for errors that are due to problems with the processed data. This exception is not currently raised by pg8000. This exception is part of the `DBAPI 2.0 specification `_. N)r"r#r$r=rrrrrQsrQc@seZdZdZdS)OperationalErrora= Generic exception raised for errors that are related to the database's operation and not necessarily under the control of the programmer. This exception is currently never raised by pg8000. This exception is part of the `DBAPI 2.0 specification `_. N)r"r#r$r=rrrrrRsrRc@seZdZdZdS)IntegrityErrora Generic exception raised when the relational integrity of the database is affected. This exception is not currently raised by pg8000. This exception is part of the `DBAPI 2.0 specification `_. N)r"r#r$r=rrrrrSsrSc@seZdZdZdS) InternalErroraNGeneric exception raised when the database encounters an internal error. This is currently only raised when unexpected state occurs in the pg8000 interface itself, and is typically the result of a interface bug. This exception is part of the `DBAPI 2.0 specification `_. N)r"r#r$r=rrrrrTsrTc@seZdZdZdS)ProgrammingErrora&Generic exception raised for programming errors. For example, this exception is raised if more parameter fields are in a query string than there are available parameters. This exception is part of the `DBAPI 2.0 specification `_. N)r"r#r$r=rrrrrUsrUc@seZdZdZdS)NotSupportedErrorzGeneric exception raised in case a method or database API was used which is not supported by the database. This exception is part of the `DBAPI 2.0 specification `_. N)r"r#r$r=rrrrrVsrVc@seZdZdZdS)ArrayContentNotSupportedErrorz Raised when attempting to transmit an array where the base type is not supported for binary data transfer by the interface. N)r"r#r$r=rrrrrW$srWc@seZdZdZdS)ArrayContentNotHomogenousErrorzl Raised when attempting to transmit an array that doesn't contain only a single type of object. N)r"r#r$r=rrrrrX,srXc@seZdZdZdS)ArrayContentEmptyErrorzRaised when attempting to transmit an empty array. The type oid of an empty array cannot be determined, and so sending them is not permitted. N)r"r#r$r=rrrrrY4srYc@seZdZdZdS)!ArrayDimensionsNotConsistentErrorzf Raised when attempting to transmit an array that has inconsistent multi-dimension sizes. N)r"r#r$r=rrrrrZ;srZc@seZdZdZdS)ByteazBytea is a str-derived class that is mapped to a PostgreSQL byte array. This class is only used in Python 2, the built-in ``bytes`` type is used in Python 3. N)r"r#r$r=rrrrr[Csr[cCstj|||S)zConstuct an object holding a date value. This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`datetime.date` )datetimedate)yearmonthdayrrrDateKsracCstj|||S)zConstruct an object holding a time value. This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`datetime.time` )r\time)hourminutesecondrrrTimeVsrfcCstj||||||S)zConstruct an object holding a timestamp value. This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`datetime.datetime` )r\)r^r_r`rcrdrerrr TimestampasrgcCsttj|ddS)aConstruct an object holding a date value from the given ticks value (number of seconds since the epoch). This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`datetime.date` N)rarb localtime)ticksrrr DateFromTicksls rkcCsttj|ddS)aConstruct an objet holding a time value from the given ticks value (number of seconds since the epoch). This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`datetime.time` rh)rfrbri)rjrrr TimeFromTicksxs rmcCsttj|ddS)a Construct an object holding a timestamp value from the given ticks value (number of seconds since the epoch). This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`datetime.datetime` Nrl)rgrbri)rjrrrTimestampFromTickss rncCstr t|S|SdS)zConstruct an object holding binary data. This function is part of the `DBAPI 2.0 specification `_. :rtype: :class:`pg8000.types.Bytea` for Python 2, otherwise :class:`bytes` N)r r[)r0rrrBinarysro ZALTERZCREATEc sd}d}d}d}d}d}d}gg} tddtd} |} d} xt|D]v\} }| dt|krr|| d}nd}| |kr|d kr| j|| d kr|} n|} q|d kr| j||} q|d kr|d kr| jt| n|dkr|dkr| jdn|dkr"|dkr"|} jdn|dkrP|dkrP|dkrP|} jdnp|d$kr|dkrd}|r~d}| j|n6|dkrd}n&|dkr|} | jt| ntdn | j|n| |kr^|d kr| j||rd}n|d krd}n|} nV|d%krP|dkrP|r.d}| j|n |dkr>d}ntd|dn | j|n`| |kr|d kr|} | j|nV|d&kr|dkr|rd}| j|n |dkrd}ntd|dn | j|n| |krd|d kr | dkr | j||} nV|d'krV|dkrV|r4d}| j|n |dkrDd}ntd|dn | j|nZ| |kr|dkrd(|7<|dks|j r|dkr|} y2jd)dd*}| jdt |dd+=Wn,t k r | jdt tYnXn|dkr| dkr|dkr|} y2jd,dd-}| jdt |dd.=Wn,t k r| jdt tYnXn|d krnd/|7<n|dkr|} |} qJW|d0krd!d"}n fd#d"}dj | |fS)1NrrprIrhFcSs dt|S)N$)str)xrrrr8sz$convert_paramstyle..'E"qmark?numeric:rsnamedpyformat%(formatTsz*Only %s and %% are supported in the query.z'%z:' not supported in a quoted string within the query string\z;' not supported in a quoted string within the query string._)z()cSs|S)Nr)valsrrr make_argsHsz%convert_paramstyle..make_argscstfddDS)Nc3s|]}|VqdS)Nr).0p)rrr Lsz8convert_paramstyle..make_args..)tuple)r) placeholders)rrrKs)rr)rr)rr)rrrrrrrrr)r{ryr) r r enumeratelenappendrrOisalnumindexrt ValueErrorjoin)stylequeryZOUTSIDEZ INSIDE_SQZ INSIDE_QIZ INSIDE_ESZ INSIDE_PNZin_quote_escapeZin_param_escapeZ output_queryZ param_idxstateprev_crCcZnext_cZpidxrr)rrconvert_paramstyles                                    ri)tzinfocCsht||d}ytt|dStk rb}z*|tkr>tjjS|tkrNtjjS|WYdd}~XnXdS)Nr)r&) q_unpackEPOCHrr.INFINITY_MICROSECONDSr\maxMINUS_INFINITY_MICROSECONDSmin)dataoffsetlengthmicroserrrtimestamp_recv_integer[srcCsttt||dS)Nr)utcfromtimestamp EPOCH_SECONDSd_unpack)rrrrrrtimestamp_recv_floatisrcCsJ|tjjkrt}n0|tjjkr$t}ntt|jtd|j }t |S)Ng.A) r\rrrrintr timetupler microsecondq_pack)vrrrrtimestamp_send_integerns  rcCstt|j|jdtS)Ng.A)d_packrrrr)rrrrtimestamp_send_floatzsrcCst|jtjddS)N)r)r astimezoneutcreplace)rrrrtimestamptz_send_integer~srcCst|jtjddS)N)r)rrrr)rrrrtimestamptz_send_floatsrcCs`t||d}ytt|dStk rZ}z"|tkr:tS|tkrFtS|WYdd}~XnXdS)Nr)r&)rEPOCH_TZrr.rDATETIME_MAX_TZrDATETIME_MIN_TZ)rrrrrrrrtimestamptz_recv_integersrcCst|||jtdS)N)r)rrr)rrrrrrtimestamptz_recv_floatsrcCsd|j}y|t|jd7}Wntk r0YnXy |j}Wntk rTd}YnXt||j|S)Ng.Ar)r&rsecondsAttributeErrorr(qii_packr')rr&r(rrrinterval_send_integers  rcCsd|jdd}y||j7}Wntk r0YnXy |j}Wntk rTd}YnXt||j|S)Ng@@r)r&rrr(dii_packr')rrr(rrrinterval_send_floats  rcCsDt||\}}}|dkr4t|d\}}tj|||St|||SdS)Nrg.A) qii_unpackdivmodr\rr%)rrrr&r'r(rrrrrinterval_recv_integers rcCsPt||\}}}|dkr4t|d\}}tj|||Stt|dd||SdS)Nrg.Ai) dii_unpackrr\rr%r)rrrrr'r(Zsecsr&rrrinterval_recv_floats rcCst||dS)Nr)r)rrrrrr int8_recvsrcCst||dS)Nr)h_unpack)rrrrrr int2_recvsrcCst||dS)Nr)i_unpack)rrrrrr int4_recvsrcCst||dS)Nr)f_unpack)rrrrrr float4_recvsrcCst||dS)Nr)r)rrrrrr float8_recvsrcCs|S)Nr)rrrr bytea_sendsrcCst||||S)N)r[)rrrrrr bytea_recvsrcCs||||S)Nr)rrrrrrrscCs|jS)N)bytes)rrrr uuid_sendsrcCst||||dS)N)r)r)rrrrrr uuid_recvsrcCs |rtStS)N)TRUEFALSE)rrrr bool_sendsrcCstS)N)NULL)rrrr null_sendsrcCst||||S)N)r)rrrrrrint_in src@seZdZdZddZeddZeddZedd Zd d Z d!d dZ ddZ ddZ d"ddZ ddZddZddZddZd#ddZdd Zd S)$Cursora<A cursor object is returned by the :meth:`~Connection.cursor` method of a connection. It has the following attributes and methods: .. attribute:: arraysize This read/write attribute specifies the number of rows to fetch at a time with :meth:`fetchmany`. It defaults to 1. .. attribute:: connection This read-only attribute contains a reference to the connection object (an instance of :class:`Connection`) on which the cursor was created. This attribute is part of a DBAPI 2.0 extension. Accessing this attribute will generate the following warning: ``DB-API extension cursor.connection used``. .. attribute:: rowcount This read-only attribute contains the number of rows that the last ``execute()`` or ``executemany()`` method produced (for query statements like ``SELECT``) or affected (for modification statements like ``UPDATE``). The value is -1 if: - No ``execute()`` or ``executemany()`` method has been performed yet on the cursor. - There was no rowcount associated with the last ``execute()``. - At least one of the statements executed as part of an ``executemany()`` had no row count associated with it. - Using a ``SELECT`` query statement on PostgreSQL server older than version 9. - Using a ``COPY`` query statement on PostgreSQL server version 8.1 or older. This attribute is part of the `DBAPI 2.0 specification `_. .. attribute:: description This read-only attribute is a sequence of 7-item sequences. Each value contains information describing one result column. The 7 items returned for each column are (name, type_code, display_size, internal_size, precision, scale, null_ok). Only the first two values are provided by the current implementation. This attribute is part of the `DBAPI 2.0 specification `_. cCs0||_d|_d|_d|_t|_d|_d|_dS)NrpFr)_c arraysizeps _row_countr _cached_rows portal_nameportal_suspended)r connectionrrrr)DszCursor.__init__cCstddd|jS)Nz'DB-API extension cursor.connection usedrh) stacklevel)rr)rrrrrMs zCursor.connectioncCs|jS)N)r)rrrrrowcountRszCursor.rowcountcCs|jS)N)_getDescription)rrrrr8VszCursor.c Cs^|jdkrdS|jd}t|dkr(dSg}x,|D]$}|j|d|ddddddfq2W|S)Nrow_descrnametype_oid)rrr)rrcolumnscolrrrrXs     zCursor._getDescriptionNcCsyR|jj@||_|jj r6|jj r6|jj|dd|jj|||WdQRXWnPtk r}z4|jdkrxtdn|jjdkrtdn|WYdd}~XnXdS)aeExecutes a database operation. Parameters may be provided as a sequence, or as a mapping, depending upon the value of :data:`pg8000.paramstyle`. This method is part of the `DBAPI 2.0 specification `_. :param operation: The SQL statement to execute. :param args: If :data:`paramstyle` is ``qmark``, ``numeric``, or ``format``, this argument should be an array of parameters to bind into the statement. If :data:`paramstyle` is ``named``, the argument should be a dict mapping of parameters. If the :data:`paramstyle` is ``pyformat``, the argument value may be either an array or a mapping. :param stream: This is a pg8000 extension for use with the PostgreSQL `COPY `_ command. For a COPY FROM the parameter must be a readable file-like object, and for COPY TO it must be writable. .. versionadded:: 1.9.11 zbegin transactionNz Cursor closedzconnection is closed) r_lockstreamin_transaction autocommitexecuterrO_sock)r operationargsrrrrrris     zCursor.executecCsDg}x$|D]}|j|||j|jq Wd|kr6dnt||_dS)a1Prepare a database operation, and then execute it against all parameter sequences or mappings provided. This method is part of the `DBAPI 2.0 specification `_. :param operation: The SQL statement to execute :param parameter_sets: A sequence of parameters to execute the statement with. The values in the sequence should be sequences or mappings of parameters, the same as the args argument of the :meth:`execute` method. rpNrr)rrrsum)rrZ param_setsZ rowcountsZ parametersrrr executemanys   zCursor.executemanyc CsVyt|Stk rdStk r6tdYntk rPtdYnXdS)a Fetch the next row of a query result set. This method is part of the `DBAPI 2.0 specification `_. :returns: A row as a sequence of field values, or ``None`` if no more rows are available. Nz#attempting to use unexecuted cursor)r StopIterationr+rUr)rrrrfetchones  zCursor.fetchonec Cs>ytt||dkr|jn|Stk r8tdYnXdS)aFetches the next set of rows of a query result. This method is part of the `DBAPI 2.0 specification `_. :param size: The number of rows to fetch when called. If not provided, the :attr:`arraysize` attribute value is used instead. :returns: A sequence, each entry of which is a sequence of field values making up a row. If no more rows are available, an empty sequence will be returned. Nz#attempting to use unexecuted cursor)rr rr+rU)rnumrrr fetchmanys zCursor.fetchmanyc Cs*yt|Stk r$tdYnXdS)a$Fetches all remaining rows of a query result. This method is part of the `DBAPI 2.0 specification `_. :returns: A sequence, each entry of which is a sequence of field values making up a row. z#attempting to use unexecuted cursorN)rr+rU)rrrrfetchalls zCursor.fetchallcCs d|_dS)zCloses the cursor. This method is part of the `DBAPI 2.0 specification `_. N)r)rrrrclosesz Cursor.closecCs|S)zoA cursor object is iterable to retrieve the rows from a query. This is a DBAPI 2.0 extension. r)rrrr__iter__szCursor.__iter__cCsdS)zThis method is part of the `DBAPI 2.0 specification `_, however, it is not implemented by pg8000. Nr)rZsizesrrr setinputsizesszCursor.setinputsizescCsdS)zThis method is part of the `DBAPI 2.0 specification `_, however, it is not implemented by pg8000. Nr)rsizecolumnrrr setoutputsizeszCursor.setoutputsizecCs|jjy |jjStk r|jrj|jj||jjt|jj |jj ||jsj|jj |y |jjStk r|j dkrt dn"t|j ddkrt dntYnXYnXWdQRXdS)NzA query hasn't been issued.rrz no result set)rrrpopleft IndexErrorr send_EXECUTE_writeSYNC_MSG_flushhandle_messages close_portalrrUrr)rrrr__next__s&           zCursor.__next__)NN)N)N)r"r#r$r=r)r>rr descriptionrrrrrrrrrrr rrrrrs 3    *  rNRSKZTrwDC123rntArGHIBPrXrrMWFLz[] 'uz{}rhc@s4eZdZddZddZddZddZd d Zd S) MulticastDelegatecCs g|_dS)N) delegates)rrrrr)YszMulticastDelegate.__init__cCs|j||S)N)add)rdelegaterrr__iadd__\s zMulticastDelegate.__iadd__cCs|jj|dS)N)r(r)rr*rrrr)`szMulticastDelegate.addcCs|jj||S)N)r(remove)rr*rrr__isub__cs zMulticastDelegate.__isub__cOsx|jD]}|||qWdS)N)r()rrkwargsrFrrr__call__gs zMulticastDelegate.__call__N)r"r#r$r)r+r)r-r/rrrrr'Xs r'c@seZdZdZeddZeddZeddZeddZeddZ eddZ ed dZ ed dZ ed dZ d ZeeZd dZddZddZddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Z d-d.Z!d/d0Z"d1d2Z#d3d4Z$d5d6Z%d7d8Z&d9d:Z'd;d<Z(d=d>Z)d?d@Z*dAdBZ+dCdDZ,dEdFZ-dGdHZ.dIdJZ/dKdLZ0dMdNZ1dOdPZ2dQdRZ3dSdTZ4dUdVZ5dWdXZ6dYdZZ7dbd\d]Z8dcd^d_Z9d`daZ:d[S)d Connectiona2 A connection object is returned by the :func:`pg8000.connect` function. It represents a single physical connection to a PostgreSQL database. .. attribute:: Connection.notifies A list of server-side notifications received by this database connection (via the LISTEN/NOTIFY PostgreSQL commands). Each list element is a two-element tuple containing the PostgreSQL backend PID that issued the notify, and the notification name. PostgreSQL will only send notifications to a client between transactions. The contents of this property are generally only populated after a commit or rollback of the current transaction. This list can be modified by a client application to clean out notifications as they are handled. However, inspecting or modifying this collection should only be done while holding the :attr:`notifies_lock` lock in order to guarantee thread-safety. This attribute is not part of the DBAPI standard; it is a pg8000 extension. .. versionadded:: 1.07 .. attribute:: Connection.notifies_lock A :class:`threading.Lock` object that should be held to read or modify the contents of the :attr:`notifies` list. This attribute is not part of the DBAPI standard; it is a pg8000 extension. .. versionadded:: 1.07 .. attribute:: Connection.autocommit Following the DB-API specification, autocommit is off by default. It can be turned on by setting this boolean pg8000-specific autocommit property to True. .. versionadded:: 1.9 .. exception:: Connection.Error Connection.Warning Connection.InterfaceError Connection.DatabaseError Connection.InternalError Connection.OperationalError Connection.ProgrammingError Connection.IntegrityError Connection.DataError Connection.NotSupportedError All of the standard database exception types are accessible via connection instances. This is a DBAPI 2.0 extension. Accessing any of these attributes will generate the warning ``DB-API extension connection.DatabaseError used``. cCs |jtS)N) _getErrorrM)rrrrr8szConnection.cCs |jtS)N)r1rN)rrrrr8scCs |jtS)N)r1rO)rrrrr8scCs |jtS)N)r1rP)rrrrr8scCs |jtS)N)r1rR)rrrrr8scCs |jtS)N)r1rS)rrrrr8scCs |jtS)N)r1rT)rrrrr8scCs |jtS)N)r1rU)rrrrr8scCs |jtS)N)r1rV)rrrrr8sdcCstd|jdd|S)Nz#DB-API extension connection.%s usedrh)r)rr")rerrorrrrr1szConnection._getErrorc #Gs d_tdtdtdtdtdtdtdf_tj_|dkrPtd t|trh|j d_ n|_ t|tr|j d_ n|_ d _ d_ td d _d _d _yR|dkr|dk rtjtjtj_n8|dk r ttdstdtjtjtj_ntdt r0|dk r0jj||dkrV|dk rVjj||fn|dk rljj||rjvyPd dl} jjtddjjd} | tdkr| j j_ntdWnt!k rtdYnXWdQRXjj"dd_#Wn:tj$k r@} zjj%td| WYdd} ~ XnXj#j&_'j#j(_)j#j*_+d_,t-_.t-_/t-_0j/j17_/fdd} fdd} fdd}fd d!}t2t3t4t5t6d"t6d#d$t7ifd%d&}fd'd(}fd)d*}tr2fd+d,d-d.}fd/d0}n fd1d,d2d.}fd3d0}fd4d5}fd6d7}fd8d9}fd:d;}tfdftft<|ft8t?ft8t@ft8ft<ft8|ft8|ft8|ft8|ft8|ft8|ft8|ft8|ft8|ft8|ft8ft8ft<|ft<|ft8tAft8tBft8tCft<|ft8|ft<|ft8ft8tDft<|fd=&_EtFddTt8tGftHd>t8tIftJd?t<|ftKd@t8tLftMjNdAt<|ftMjOdBt<| fdCdCt8tPfdDdDt8tQftMjRdEt8tSftTdEt8tSft7dFt<|ftUdGt8tVfi _WtMjMjXtYjZt[jZi_\trfdHt8t]fjWt^<d?t<| fjWt<d?t.rAF_UNIXz9attempt to connect to unix socket on unsupported platformz)one of host or unix_sock must be providedi/rprzServer refuses SSLzESSL required but ssl module not available in this python installationrwb)modezcommunication errorcs |jjS)N)encode_client_encoding)r)rrrtext_out6sz%Connection.__init__..text_outcs|jjjS)N) isoformatr@rA)r)rrrtime_out9sz%Connection.__init__..time_outcsD|tjjkrdjjS|tjjkr0djjS|jjjSdS)NZinfinityz -infinity)r\r]rr@rArrC)r)rrrdate_out<s     z%Connection.__init__..date_outcst|jjS)N)rtr@rA)r)rrr unknown_outDsz(Connection.__init__..unknown_outz{}z[]rcsg}d}xz||||jjjjtdtdD]H}|d krX|d krX|jdn|d krr|dkrr|jd |j||}q8Wtd j|S)NrNone[],rz Decimal('rz')r~)rHrIrJr)rHrJ)rIrJ)rHrIrJr) decoderA translaterrextendrevalr)ridxrarrrr)glblsr trans_tabrrarray_inJs   z%Connection.__init__..array_inc s||}t||\}}}|d7}j|d}g}x,t|D] } |jt||d|d7}q.array_recvcs,td||||jjjdddS)NrHrqrJrI)rNrKrAr)rrOr)rrr vector_inysz&Connection.__init__..vector_incst||||jS)N)unicoderA)rrr)rrr text_recv~sz&Connection.__init__..text_recvcSs ||dkS)Nrr)rFolrrr bool_recvsz&Connection.__init__..bool_recvcstt||||jS)N)rrbrA)rrr)rrrjson_insz$Connection.__init__..json_incst||||jS)N)rtrA)rrr)rrrrcscSs ||dkS)Nrpr)rrrrrrrfscstt||||jS)N)rrtrA)rrr)rrrrgscspt|||d}t||d|d}t||d||jj}tj||t|t|t|dS)NrIrhrli@B)rrrKrAr\rb)rrrrcrdZsec)rrrtime_ins z$Connection.__init__..time_incsv|||djj}|dkr(tjjS|dkr8tjjStjt|t||d|dt||d|dSdS)NrrZinfiz-infrhr= )rKrAr\r]rrr)rrrZyear_str)rrrdate_insz$Connection.__init__..date_incst||||jjS)N)rrKrA)rrr)rrr numeric_insz'Connection.__init__..numeric_incst|jjS)N)rtr@rA)rF)rrr numeric_outsz(Connection.__init__..numeric_outcstfS)N)FC_TEXTr)rcrrr8s)&riiii=iiiiiiiiiiiii:i;iZiiiiiii irpiii:i;iZiiii rq) ip_address IPv4Address IPv6Address ip_network IPv4Network IPv6Networkcst|jjS)N)rtr@rA)r)rrrinet_outsz%Connection.__init__..inet_outcs6||||jj}d|kr*|dS|SdS)N/F)rKrA)rrrZinet_str)r{r~rrrinet_ins  z$Connection.__init__..inet_inieizuserz databaserrrhr)rAr _commands_with_count threadingLockrrOr*rr@userpasswordr_xidr_cachesstatement_number portal_numbersocketAF_INET SOCK_STREAM_usockhasattrr<rUr settimeoutconnectsslsendallii_packrecv wrap_socket ImportErrormakefilerr3rflushr read_readwriter_backend_key_datar'NoticeReceivedZParameterStatusReceivedNotificationReceivedhandle_PARAMETER_STATUSr;r[r ordrr FC_BINARYrrrrorrrrrrrrrVtyperboolrrfloatrr\r]rbrrrrr%rrpy_typesinspect_datetimerZ array_inspectr inspect_funcsrr[rtlongr ipaddressr{r|r}r~rrNOTICE_RESPONSEhandle_NOTICE_RESPONSEAUTHENTICATION_REQUESThandle_AUTHENTICATION_REQUESTPARAMETER_STATUSBACKEND_KEY_DATAhandle_BACKEND_KEY_DATAREADY_FOR_QUERYhandle_READY_FOR_QUERYROW_DESCRIPTIONhandle_ROW_DESCRIPTIONERROR_RESPONSEhandle_ERROR_RESPONSEEMPTY_QUERY_RESPONSEhandle_EMPTY_QUERY_RESPONSEDATA_ROWhandle_DATA_ROWCOMMAND_COMPLETEhandle_COMMAND_COMPLETEPARSE_COMPLETEhandle_PARSE_COMPLETE BIND_COMPLETEhandle_BIND_COMPLETECLOSE_COMPLETEhandle_CLOSE_COMPLETEPORTAL_SUSPENDEDhandle_PORTAL_SUSPENDEDNO_DATAhandle_NO_DATAPARAMETER_DESCRIPTIONhandle_PARAMETER_DESCRIPTIONNOTIFICATION_RESPONSEhandle_NOTIFICATION_RESPONSE COPY_DONEhandle_COPY_DONE COPY_DATAhandle_COPY_DATACOPY_IN_RESPONSEhandle_COPY_IN_RESPONSECOPY_OUT_RESPONSEhandle_COPY_OUT_RESPONSE message_types bytearrayi_pack NULL_BYTErMrrcursor_cursor ci_unpack Exception_closernotifies notifies_lock)#rrhost unix_sockportdatabaserrtimeoutZ sslmoduleresprrBrDrErFrSr`rarfrgrirlrmrnr|r}rrrrprotocolvalcodedata_lenr)rQr{r~rrcrRrr)s                                                       zConnection.__init__csXtfdd|jtD}t|}|tdkr.Z28000z"md5 password authentication failedcss|]\}}|VqdS)Nr)rkrrrrrUs)rsplitrr; RESPONSE_CODErOr3rU)rrr responsesZmsg_dictr)rrrMs   z Connection.handle_ERROR_RESPONSEcCstd|_dS)Nzquery was empty)rUr3)rrrrrrrWsz&Connection.handle_EMPTY_QUERY_RESPONSEcCsdS)Nr)rrrrrrrZsz Connection.handle_CLOSE_COMPLETEcCsdS)Nr)rrrrrrr]sz Connection.handle_PARSE_COMPLETEcCsdS)Nr)rrrrrrrbszConnection.handle_BIND_COMPLETEcCs d|_dS)NT)r)rrrrrrresz"Connection.handle_PORTAL_SUSPENDEDcCsdS)Nr)rrrrrrrhsz'Connection.handle_PARAMETER_DESCRIPTIONcCs d|_dS)NT)Z _copy_done)rrrrrrrpszConnection.handle_COPY_DONEcCs"t|\}}|jdkrtddS)Nz7An output stream is required for the COPY OUT response.) bh_unpackrrO)rrr is_binarynum_colsrrrrss  z#Connection.handle_COPY_OUT_RESPONSEcCs|jj|dS)N)rr)rrrrrrr~szConnection.handle_COPY_DATAcCst|\}}|jjst|jdkr,tdtrvx|jjd}|sDP|jt t t |d|j||j q2WnTt d}xJ|jj|}|dkrP|jt t |d|j|d||j qW|jt|jt|j dS)Nz5An input stream is required for the COPY IN response.i rrr)rrlockedAssertionErrorrrOr rrrrrr rreadinto COPY_DONE_MSGr )rrrrrZbffr bytes_readrrrrs0        z"Connection.handle_COPY_IN_RESPONSEc Cs|j|t|d}d}|jt||}||||jd}||d7}|jt||}|j|jj||fWdQRXdS)Nrrrasciirp)rrfindrrKrrr)rrrZ backend_pidrOnull conditionrrrrs   z'Connection.handle_NOTIFICATION_RESPONSEcCst|S)zCreates a :class:`Cursor` object bound to this connection. This function is part of the `DBAPI 2.0 specification `_. )r)rrrrrszConnection.cursorc Cs&|j|j|jddWdQRXdS)zCommits the current database transaction. This function is part of the `DBAPI 2.0 specification `_. commitN)rrr)rrrrrszConnection.commitc Cs&|j|j|jddWdQRXdS)zRolls back the current database transaction. This function is part of the `DBAPI 2.0 specification `_. rollbackN)rrr)rrrrrszConnection.rollbackcCszy |jt|j|jjWndtk r>tdYnJtk rXtdYn0tj k r}zt t |WYdd}~XnXWd|j jd|_XdS)Nzconnection is closed) r TERMINATE_MSGr rrrrOrrr3rRrtr)rrrrrrs   " zConnection._closec Cs|j|jWdQRXdS)zCloses the database connection. This function is part of the `DBAPI 2.0 specification `_. N)rr)rrrrrszConnection.closecCs|jjstt|d}|dkr$n|dkrZ|jdkr>td|jt|jt|j n|dkrt dj t |d}|jdkrtdt dt t |j|jjjd |jjd }|jt|t|j n4|dkrtdt|dntdt|ddS)NrrhzGserver requesting password authentication, but no password was providedrhr~rrzKserver requesting MD5 password authentication, but no password was providedrrrIrlrjr= zAuthentication method z not supported by pg8000.z not recognized by pg8000.)rIrrrlrjr=r)rrrrrrO _send_messagePASSWORDrr r r cccc_unpackrr hexdigestr@rt)rrrZ auth_codeZsaltpwdrrrrs6         z(Connection.handle_AUTHENTICATION_REQUESTcCs|tk|_dS)N)IDLEr)rrrrrrr'sz!Connection.handle_READY_FOR_QUERYcCs ||_dS)N)r)rrrrrrr+sz"Connection.handle_BACKEND_KEY_DATAcCs"|jdkr|jdS|jdSdS)NiZi)rr)rr0rrrr.s  zConnection.inspect_datetimecCsg}x|D]}t|}y|j|j|Wq tk ry|j|j||Wn6tk r}ztdt|dWYdd}~XnXYq Xq Wt|S)Nztype znot mapped to pg type)rrrKeyErrorrrVrtr)rr_paramsr0typrrrr make_params4s .zConnection.make_paramsc Cst|d}d}xt|D]v}|||jt|}|t|d7}ttdt||}||d <|d 7}|jd j ||j |d\|d <|d<qWdS)NrrIrp table_oidcolumn_attrnumr type_size type_modifierrrrZ pg8000_fcfunc)r r rr r r) rrWrrrr;r[ ihihih_unpackrrrV)rrrr rOrCrfieldrrrrBs z!Connection.handle_ROW_DESCRIPTIONc"s|dkr f}tj}j|}y|d|\}}Wn2tk rbt||\}}||f|d|<YnX||}j|} || f} y|d| } | |_Wn"tk rdtj} jd7_| j dt } gt dd| Dd} | |_t d d| D}t | }|j |j jt |j tt| x0| D](\}}}|j t|dkrVd n|q8Wjt|jtt| jty jWnntk r}z jdkrtd n|WYdd}~Xn2tjk r}ztt|WYdd}~XnXj|t fd d| d D}t dd| d D| d<| tt| t ddt|f|tt| | d<tt|t ddt|f|| d<| |d| <YnX|j!j"d|_#dtj$|_%j$d7_$|j%j dt |_&|j&t'j(|_)t |j&| d}xPt*|| dD]>\}}|dkrBt+}n||}|j tt||j |q*W|j | djt,|j-|jtjj||j.rƈj/rtdn j0|dS)N statementrZpg8000_statement_rprcss|]}|dVqdS)rINr)rrurrrrksz%Connection.execute..)r param_funcscss|]}|dVqdS)rpNr)rrurrrrosizconnection is closedc3s |]}j|ddVqdS)rrN)rV)rrG)rrrrsrcss|]}|dVqdS)rNr)rrGrrrrs input_funcsr?rDZbind_1Zbind_2Zpg8000_portal_rzWith autocommit on, it's not possible to retrieve more rows than the pg8000 cache size, as the portal is closed when the transaction is closed.rr)1pg8000 paramstylerrrr rrtrr@rrrrMrAh_packrrrPARSEDESCRIBE STATEMENTrr r rrrOrr3rRr rrclearrrrportal_name_binr0_row_cache_size_bin execute_msgr[rBINDrrrr )rrrrrcacherrrrkeyrZstatement_nameZstatement_name_binZ param_fcsroidfc send_funcrZ output_fcretvalr0r)rrrRs     "      (         zConnection.executecCsy8|j||jtt|d|j||jtWnVtk rt}z t|dkr`tdn|WYdd}~Xntk rtdYnXdS)Nrrzwrite to closed filezconnection is closed)rrr FLUSH_MSGrrtrOr)rrrrrrrrs    zConnection._send_messagecCsd|_|jt|jdS)NF)rrEXECUTEr)rrrrrrszConnection.send_EXECUTEcCsdS)Nr)rmsgrrrrrszConnection.handle_NO_DATAcCs~|ddjt}|d}||jkrPt|d}|jdkrB||_n|j|7_|tkrzx |jD]}|j|djq`WdS)Nrprrrrr)r BINARY_SPACErrr DDL_COMMANDSrr)rrrr_command row_countrrrrrs    z"Connection.handle_COMMAND_COMPLETEcCspd}g}xV|jdD]H}t||d}|d7}|dkrB|jdq|j||||||7}qW|jj|dS)NrIrrrrrpr)rrrr)rrrZdata_idxrowrvlenrrrrs  zConnection.handle_DATA_ROWc Cstd}|_y>x8|tkrDt|jd\}}|j||j|d|qWWn|jYnX|jdk rp|jdS)Nrhrr)r3rrrrr)rrrrrrrr s  " zConnection.handle_messagescCs2|jtt|j|jt|j|j|dS)N)rCLOSEPORTALrrr r r )rrrrrr .s zConnection.close_portalcCs&tdd|jtD}|j|dS)Ncss&|]}|dd|ddfVqdS)rrpNr)rrrrrr:sz4Connection.handle_NOTICE_RESPONSE..)r;rrr)rrrrrrrr9sz!Connection.handle_NOTICE_RESPONSEcCs|jt}|d|||dd}}|tdkrT|jdj}tj|||_n|tdkrJ|tdkrdtt f|j d<tt f|j d<dtt f|j d<ttf|j d<dttf|j t<dttf|j tj<ttf|j d<nldttf|j d<ttf|j d<dttf|j d<ttf|j d<dttf|j t<dttf|j tj<ttf|j d<n|td krt|jd|_|jtd krtd td td tdtdf|_n:|jtdkrtd td td tdtdtdf|_dS)NrpZclient_encodingrZinteger_datetimesoniZiiZserver_versionz8.2.0r5r6r7r8r9z9.0.0r:r)rrr rKlowerpg_to_py_encodingsgetrArrrrrVrrrr%r\rrrrrrrrrZ_server_versionr)rrrposr!r0encodingrrrr=s:   z"Connection.handle_PARAMETER_STATUSc st|}|dkrtdt|ttr td\}}}xtt|D]h}|dkrRqDt|kodtknrlqDd}t|kot knrqDd}t |kot knrqDd}qDW|rd}dt t }n>|rd}dt t}n$|rd}d t t}ntd ny4|j|fd \}d kr4d t }t}WnRtk rhtdtdYn*tk rtdtdYnX|t krfdd} nfdd} ||| fS)Nzarray has no valuesTFirtirvirsz'numeric not supported as array contentsrirwzoid z not supported as array contentsztype csx8t|D],\}}}t|tdfs tdtq Wt|t|}t|}tt t ||}x|D]}|j t |dqlWxFt |D]:}|dkr|td7}q|}|tt |7}||7}qW|S)Nz#not all array elements are of type rpr) walk_arrayr*rrXrtarray_check_dimensionsarray_has_nullarray_dim_lengthsriii_packrrMr array_flattenr)rParCrZhas_nullr^rZ inner_data)r"r$rrr send_arrays"  z,Connection.array_inspect..send_arraycsx8t|D],\}}}t|tdfs tdtq Wt|t|}x:t|D].\}}}|dkrpd||<qT|jd||<qTWtt|j t j dS)Nz#not all array elements are of type rr) r7r*rrXrtr8rrKrrL arr_transr@)rPr=rCrar)r$rrrr>s )TTT)array_find_first_elementrYr issubclassrr<min_int2max_int2r2r3r,r-rrrrrWr pg_array_typesrrtrV) rr0Z first_elementZint2_okZint4_okZint8_okrZ array_oidr#r>r)r"r$rrrjs\     zConnection.array_inspectcCs |||fS)a)Create a Transaction IDs (only global_transaction_id is used in pg) format_id and branch_qualifier are not used in postgres global_transaction_id may be any string identifier supported by postgres returns a tuple (format_id, global_transaction_id, branch_qualifier)r)rZ format_idZglobal_transaction_idZbranch_qualifierrrrxidszConnection.xidcCs ||_|jr|j|jdddS)a.Begins a TPC transaction with the given transaction ID xid. This method should be called outside of a transaction (i.e. nothing may have executed since the last .commit() or .rollback()). Furthermore, it is an error to call .commit() or .rollback() within the TPC transaction. A ProgrammingError is raised, if the application calls .commit() or .rollback() during an active TPC transaction. This function is part of the `DBAPI 2.0 specification `_. zbegin transactionN)rrrr)rrFrrr tpc_begins zConnection.tpc_begincCs$d|jdf}|j|j|ddS)aPerforms the first phase of a transaction started with .tpc_begin(). A ProgrammingError is be raised if this method is called outside of a TPC transaction. After calling .tpc_prepare(), no statements can be executed until .tpc_commit() or .tpc_rollback() have been called. This function is part of the `DBAPI 2.0 specification `_. zPREPARE TRANSACTION '%s';rpN)rrr)rrErrr tpc_prepares zConnection.tpc_prepareNc Csr|dkr|j}|dkrtdz@|j}d|_||jkrT|j|jd|dfdn|jWd||_Xd|_dS)a%When called with no arguments, .tpc_commit() commits a TPC transaction previously prepared with .tpc_prepare(). If .tpc_commit() is called prior to .tpc_prepare(), a single phase commit is performed. A transaction manager may choose to do this if only a single resource is participating in the global transaction. When called with a transaction ID xid, the database commits the given transaction. If an invalid transaction ID is provided, a ProgrammingError will be raised. This form should be called outside of a transaction, and is intended for use in recovery. On return, the TPC transaction is ended. This function is part of the `DBAPI 2.0 specification `_. Nz.Cannot tpc_commit() without a TPC transaction!TzCOMMIT PREPARED '%s';rp)rrUr tpc_recoverrrr)rrFprevious_autocommit_moderrr tpc_commits  zConnection.tpc_commitc Csr|dkr|j}|dkrtdz@|j}d|_||jkrT|j|jd|dfdn|jWd||_Xd|_dS)aDWhen called with no arguments, .tpc_rollback() rolls back a TPC transaction. It may be called before or after .tpc_prepare(). When called with a transaction ID xid, it rolls back the given transaction. If an invalid transaction ID is provided, a ProgrammingError is raised. This form should be called outside of a transaction, and is intended for use in recovery. On return, the TPC transaction is ended. This function is part of the `DBAPI 2.0 specification `_. Nz9Cannot tpc_rollback() without a TPC prepared transaction!TzROLLBACK PREPARED '%s';rp)rrUrrIrrr)rrFrJrrr tpc_rollback s  zConnection.tpc_rollbackc s>z0j}d_j}|jdfdd|DS|_XdS)zReturns a list of pending transaction IDs suitable for use with .tpc_commit(xid) or .tpc_rollback(xid). This function is part of the `DBAPI 2.0 specification `_. Tz!select gid FROM pg_prepared_xactscsg|]}jd|ddqS)rr~)rF)rr-)rrr I sz*Connection.tpc_recover..N)rrr)rrJZcursr)rrrI= s zConnection.tpc_recover)N)N);r"r#r$r=r>rMrNrOrPrRrSrTrUrVZ_row_cache_sizerrr1r)rrrrrrrrrrrrrrrrrrrrrr rrrrrrrr r rrrrFrGrHrKrLrIrrrrr0lsv<            #    9   -a ' $r0iiii)rprwiigb2312Zis8859_5Zis8859_6Zis8859_7Zis8859_8koi8_rz iso8859-1 iso8859_2 iso8859_3 iso8859_4 iso8859_9 iso8859_10 iso8859_13 iso8859_14 iso8859_15rZcp886Zcp874cp1250cp1251cp1252cp1253cp1254cp1255cp1256cp1257cp1258zutf-8)Z mule_internalZeuc_tweuc_cn iso_8859_5 iso_8859_6 iso_8859_7 iso_8859_8Zkoi8latin1latin2latin3latin4latin5latin6latin7latin8latin9Z sql_asciiZwin866Zwin874Zwin1250Zwin1251Zwin1252Zwin1253Zwin1254Zwin1255Zwin1256Zwin1257Zwin1258rbccsVxPt|D]D\}}t|trBx0t|D]\}}}|||fVq&Wq |||fVq WdS)N)rr*rZr7)rPrCrr=i2v2rrrr7 s  r7cCs"xt|D]}|dk r |Sq WdS)N)r<)rPrrrrrA srAccs<x6|D].}t|tr.xt|D] }|VqWq|VqWdS)N)r*rZr<)rPrrprrrr< s    r<cCs|d}t|trht|}t|}x0|D](}t|}t||ksH||kr(tdq(W|g}|j||Sx|D]}t|trntdqnWgSdS)Nrzarray dimensions not consistent)r*rZrr8rZrM)rPv0Zreq_lenZreq_inner_lengthsrZ inner_lengthsr%rrrr8 s"       r8cCs"xt|D]}|dkr dSq WdS)NTF)r<)rPrrrrr9 sr9cCs:|d}t|tr,t|g}|jt|n t|gS|S)Nr)r*rZrrMr:)rPrqr%rrrr: s    r:i)rrrsl)rtrul)rvrwllrr)r\rwarningsrrrstructrhashlibrZdecimalr collectionsrr itertoolsr r Z six.movesr sixr r rrrrruuidrcopyrcalendarrZdistutils.versionrrrbr __author__jsonrrrrrrobjectr%rBrrrrrrrrZf_packrr;rUrrXrrrrZ ihihih_packrZci_packrZbh_packrZ cccc_packrrCrDr2r3r,r-rrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[rarfrgrkrmrnroBINARYrrorr)r*rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrr'ZFLUSHZSYNCrrZ TERMINATEr/r&r rrrr0ZRESPONSE_SEVERITYrZ RESPONSE_MSGZRESPONSE_DETAILZ RESPONSE_HINTZRESPONSE_POSITIONZRESPONSE__POSITIONZRESPONSE__QUERYZRESPONSE_WHEREZ RESPONSE_FILEZ RESPONSE_LINEZRESPONSE_ROUTINErZIDLE_IN_TRANSACTIONZIDLE_IN_FAILED_TRANSACTIONr;r[rrZr?r'r0rEr3r7rAr<r8r9r:rrrrs      $      T                              )            *l