| Server IP : 162.144.4.212 / Your IP : 216.73.216.108 Web Server : Apache System : Linux gator2125.hostgator.com 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64 User : cozeellc ( 2980) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/libexec/oracle-cloud-agent/plugins/osms/ |
Upload File : |
a
ٓ�f�( � @ s8 d dl mZ d dl mZ d dl mZ d dl mZ d dlmZ d dlmZmZ d dl m
Z
mZ d dlm
Z
mZ d d lmZmZ zd d
lmZ W n ey� d d
lmZ Y n0 z
efZW n ey� eefZY n0 dZdZd
Zdd� Zdd� ZG dd� de�Z G dd� de!�Z"G dd� de�Z#ddddde fdd�Z$dS )� )�unicode_literals)�division)�print_function)�absolute_import)�wraps)�datetime� timedelta)�isgeneratorfunction�isclass)�AnyStr�Iterable)�ceil�floor)� monotonic�closed�open� half_openc s � fdd�}|S )zOBuild a predicate function that checks if an exception is a subtype from a listc s
t | � �S �N)�
issubclass)�thrown_type�_�� exc_types� �r/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/circuitbreaker.py�
matches_types s z(in_exception_list.<locals>.matches_typesr )r r r r r �in_exception_list s r c C sv t | �rt| t�rt| �}nVz&t| � t| t�r8td��t| � }W n. typ t | �r`t | �rhtd��| }Y n0 |S )az Build a failure predicate_function.
The returned function has the signature (Type[Exception], Exception) -> bool.
Return value True indicates a failure in the underlying function.
:param expected_exception: either an type of Exception, iterable of Exception types, or a predicate function.
If an Exception type or iterable of Exception types, the failure predicate will return True when a thrown
exception type matches one of the provided types.
If a predicate function, it will just be returned as is.
:return: callable (Type[Exception], Exception) -> bool
z9expected_exception cannot be a string. Did you mean name?z1expected_exception does not look like a predicate)
r
r � Exceptionr �iter�
isinstance�STRING_TYPES�
ValueError� TypeError�callable)�expected_exception�failure_predicater r r �build_failure_predicate&