-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc.py
More file actions
43 lines (32 loc) · 742 Bytes
/
func.py
File metadata and controls
43 lines (32 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
Converted from Idris2 func.idr
Original Idris2 code:
private helperFunction: Int -> Int
helperFunction x = x + 1
public apiFunction : Int -> Int
apiFunction x = helperFunction x * 2
"""
def _helper_function(x: int) -> int:
"""
Private helper function.
Adds 1 to the input value.
Args:
x: An integer value
Returns:
x + 1
"""
return x + 1
def api_function(x: int) -> int:
"""
Public API function.
Applies helper function and multiplies result by 2.
Args:
x: An integer value
Returns:
(x + 1) * 2
"""
return _helper_function(x) * 2
if __name__ == "__main__":
# Example usage
result = api_function(5)
print(result)