Passed
Push — master ( a8a0e7...5f5103 )
by Yohann
01:28
created

utils.get_int()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
from time import time
2
3
HALF_HOUR: int = 1800
4
SALARIED_ROLE_ID: int = 888527962935296091
5
PDG_ROLE_ID: int = 888527789794422784
6
7
8
def word_capitalize(word: str) -> str:
9
    """Capitalize the first letter of every word within a sentence."""
10
    return ' '.join(map(str.capitalize, word.split()))
11
12
13
def get_int(string):
14
    return int(''.join(ch for ch in string if ch.isdigit()))
15
16
17
def get_last_half_hour():
18
    current_sec = time()
19
    return int(current_sec - (current_sec % HALF_HOUR))
20