Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._vendor.tenacity._utils Namespace Reference

Functions

str find_ordinal (int pos_num)
 
str to_ordinal (int pos_num)
 
str get_callback_name (typing.Callable[..., typing.Any] cb)
 
float to_seconds (time_unit_type time_unit)
 

Variables

int MAX_WAIT = sys.maxsize / 2
 
 time_unit_type = typing.Union[int, float, timedelta]
 

Function Documentation

◆ find_ordinal()

str find_ordinal ( int  pos_num)

Definition at line 27 of file _utils.py.

27def find_ordinal(pos_num: int) -> str:
28 # See: https://en.wikipedia.org/wiki/English_numerals#Ordinal_numbers
29 if pos_num == 0:
30 return "th"
31 elif pos_num == 1:
32 return "st"
33 elif pos_num == 2:
34 return "nd"
35 elif pos_num == 3:
36 return "rd"
37 elif 4 <= pos_num <= 20:
38 return "th"
39 else:
40 return find_ordinal(pos_num % 10)
41
42

References pip._vendor.tenacity._utils.find_ordinal().

Referenced by pip._vendor.tenacity._utils.find_ordinal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_callback_name()

str get_callback_name ( typing.Callable[..., typing.Any]  cb)
Get a callback fully-qualified name.

If no name can be produced ``repr(cb)`` is called and returned.

Definition at line 47 of file _utils.py.

47def get_callback_name(cb: typing.Callable[..., typing.Any]) -> str:
48 """Get a callback fully-qualified name.
49
50 If no name can be produced ``repr(cb)`` is called and returned.
51 """
52 segments = []
53 try:
55 except AttributeError:
56 try:
58 except AttributeError:
59 pass
60 if not segments:
61 return repr(cb)
62 else:
63 try:
64 # When running under sphinx it appears this can be none?
67 except AttributeError:
68 pass
69 return ".".join(segments)
70
71
for i

References i.

◆ to_ordinal()

str to_ordinal ( int  pos_num)

Definition at line 43 of file _utils.py.

43def to_ordinal(pos_num: int) -> str:
44 return f"{pos_num}{find_ordinal(pos_num)}"
45
46

◆ to_seconds()

float to_seconds ( time_unit_type  time_unit)

Definition at line 75 of file _utils.py.

75def to_seconds(time_unit: time_unit_type) -> float:
76 return float(time_unit.total_seconds() if isinstance(time_unit, timedelta) else time_unit)

References i.

Variable Documentation

◆ MAX_WAIT

int MAX_WAIT = sys.maxsize / 2

Definition at line 24 of file _utils.py.

◆ time_unit_type

time_unit_type = typing.Union[int, float, timedelta]

Definition at line 72 of file _utils.py.