Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
_common.cpython-313.pyc73 linesDownload Raw Back to __pycache__
1�

2��j���r	�SrSSKrSSKrSSKJrJrJrJrJr SSK	r	SSK3Jr SSKJ
r
 SSKJr \R"\5r\R$R&\	R(R*\R$R,\	R(R.\R$R0\	R(R2\R$R4\	R(R6\R$R8\	R(R:0r0\R>R@\	R>RB_\R>RD\	R>RF_\R>RH\	R>RJ_\R>RL\	R>RN_\R>RP\	R>RR_\R>RT\	R>RV_\R>RX\	R>RZ_\R>R\\	R>R^_\R>R`\	R>Rb_\R>Rd\	R>Rf_\R>Rh\	R>Rj_\R>Rl\	R>Rn_\R>Rp\	R>Rr_\R>Rt\	R>Rv_\R>Rx\	R>Rz_\R>R|\	R>R~_\R>R�\	R>R�_rB\BR�5VVs0sHupX_M	 snnrDSrESrFS	\S4\G4SjrHS\S5\I4S
jrJS\S\\\
S4S\IS6\4SjrKS\S\\S7\G4SjrLS\GS\\
S8\4SjrMS\IS\IS9\I4SjrNS\S\O4S\PS\\/S44SjrQS$S\S\O4S\/\O4S\\PS\\/S4S10\O411S jjrRS!\IS"\SS12\S4S#jrTgs snnf)%zShared implementation.�N)�Any�AnyStr�Callable�Optional�Union)�cygrpc)�DeserializingFunction)�SerializingFunctiong�������?zjFailed to bind to address %s; set GRPC_VERBOSITY=debug environment variable to see detailed error message.�s�returnc�R�[U[5(aU$URS5$)N�utf8)�13isinstance�bytes�encode)rs �RD:\code\apps\devtools\python\user_packages\Python313\site-packages\grpc/_common.pyrrCs#���!�U������8�8�F����bc�T�[U[5(aURSS5$U$)Nzutf-8�replace)rr�decode)rs rrrIs%���!�U����x�x���+�+��Hr�message�transformer�exception_messagec�h�UcU$U"U5$![a [RU5 gf=f)N)�	Exception�_LOGGER�	exception)rrrs   r�14_transformrOs@��15������7�#�#�������+�,���s��1�1�16serializerc��[XS5$)NzException serializing message!�r)rr s  r�	serializer#]s���g�+K�L�Lr�serialized_message�deserializerc��[XS5$)Nz Exception deserializing message!r")r$r%s  r�deserializer'as����*L��r�group�methodc�$�SRX5$)Nz/{}/{})�format)r(r)s  r�fully_qualified_methodr,is���?�?�5�)�)r�wait_fn.�timeout�spin_cbc�&�U"US9 UbU"5 gg)N)r.�)r-r.r/s   r�17_wait_oncer2ms��18�G�����	�r�wait_complete_fnc�8�Uc,U"5(d[U[U5 U"5(dMg[R"5U-nU"5(dG[U[R"5-19[5nUS:ag[XU5 U"5(dMGg)aBlocks waiting for an event without blocking the thread indefinitely.20 21See https://github.com/grpc/grpc/issues/19464 for full context. CPython's22`threading.Event.wait` and `threading.Condition.wait` methods, if invoked23without a timeout kwarg, may block the calling thread indefinitely. If the24call is made from the main thread, this means that signal handlers may not25run for an arbitrarily long period of time.26 27This wrapper calls the supplied wait function with an arbitrary short28timeout to ensure that no signal handler has to wait longer than29MAXIMUM_WAIT_TIMEOUT before executing.30 31Args:32  wait_fn: A callable acceptable a single float-valued kwarg named33    `timeout`. This function is expected to be one of `threading.Event.wait`34    or `threading.Condition.wait`.35  wait_complete_fn: A callable taking no arguments and returning a bool.36    When this function returns true, it indicates that waiting should cease.37  timeout: An optional float-valued number of seconds after which the wait38    should cease.39  spin_cb: An optional Callable taking no arguments and returning nothing.40    This callback will be called on each iteration of the spin. This may be41    used for, e.g. work related to forking.42 43Returns:44  True if a timeout was supplied and it was reached. False otherwise.45rTF)r2�MAXIMUM_WAIT_TIMEOUT�time�min)r-r3r.r/�end�	remainings      r�waitr:ws���B��"�$�$��w� 4�g�>�#�$�$��
�i�i�k�G�#��"�$�$��C�$�)�)�+�-�/C�D�I��1�}���w�7�3�	#�$�$�46r�address�portc�6�US:Xa[[U-5eU$)aOValidates if the port binding succeed.47 48If the port returned by Core is 0, the binding is failed. However, in that49case, the Core API doesn't return a detailed failing reason. The best we50can do is raising an exception to prevent further confusion.51 52Args:53    address: The address string to be bound.54    port: An int returned by core55r)�RuntimeError�"_ERROR_MESSAGE_PORT_BINDING_FAILED)r;r<s  r�validate_port_binding_resultr@�s#���q�y��=��G�H�H��Kr)NN)U�__doc__�loggingr6�typingrrrrr�grpc�grpc._cythonr�grpc._typingr	r56�	getLogger�__name__r�ConnectivityState�idle�ChannelConnectivity�IDLE�57connecting�58CONNECTING�ready�READY�transient_failure�TRANSIENT_FAILURE�shutdown�SHUTDOWN�1CYGRPC_CONNECTIVITY_STATE_TO_CHANNEL_CONNECTIVITY�59StatusCode�ok�OK�	cancelled�	CANCELLED�unknown�UNKNOWN�invalid_argument�INVALID_ARGUMENT�deadline_exceeded�DEADLINE_EXCEEDED�	not_found�	NOT_FOUND�already_exists�ALREADY_EXISTS�permission_denied�PERMISSION_DENIED�unauthenticated�UNAUTHENTICATED�resource_exhausted�RESOURCE_EXHAUSTED�failed_precondition�FAILED_PRECONDITION�aborted�ABORTED�out_of_range�OUT_OF_RANGE�
unimplemented�
UNIMPLEMENTED�internal�INTERNAL�unavailable�UNAVAILABLE�	data_loss�	DATA_LOSS�!CYGRPC_STATUS_CODE_TO_STATUS_CODE�items�!STATUS_CODE_TO_CYGRPC_STATUS_CODEr5r?rr�strrrr#r'r,�bool�floatr2r:�intr@)�cygrpc_code�	grpc_codes00r�<module>r�s������9�9���.�,�60�61�62�H�63%�����!�!�4�#;�#;�#@�#@�64���'�'��)A�)A�)L�)L�65���"�"�D�$<�$<�$B�$B�66���.�.��0H�0H�0Z�0Z�67���%�%�t�'?�'?�'H�'H�5�1�%�68�����$�/�/�,�,�%�69��������!:�!:�%������t���6�6�%����&�&����(H�(H�	%�70���'�'����)J�)J�%���������!:�!:�
%����$�$�d�o�o�&D�&D�%����'�'����)J�)J�%����%�%�t���'F�'F�%����(�(�$�/�/�*L�*L�%����)�)�4�?�?�+N�+N�%������t���6�6�%����"�"�D�O�O�$@�$@�%����#�#�T�_�_�%B�%B�%��������� 8� 8�%� ���!�!�4�?�?�#>�#>�!%�"��������!:�!:�#%�!�*#D�"I�"I�"K�%�"K�����"K�%�!�71��O�#��f����
�f�
��
��
���*�,A�4�G�H����	�	�M�s�M��1D�(E�M�%�M����-5�6K�-L����*�#�*�s�*�s�*��
�c�4�i�
 ��
���h�r�4�x�(�
)�� $�,0�	+�
�c�4�i�
 �+��r�4�x�(�+��e�_�+��h�r�4�x�(�
)�	+�7273�+�\�#��S��S���_%s�R3
codekingpro/portable-devtools · Team Ai