-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1edb1a
commit cd4dacc
Showing
2 changed files
with
93 additions
and
7 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
93 changes: 93 additions & 0 deletions
93
src/github_actions_testing/utils.py.2c8b3efc845ec47128c76a504a75dcf2.tmp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import platform | ||
import sys | ||
import time | ||
|
||
|
||
def add(a, b): | ||
'''Adds two numbers. | ||
Args: | ||
a: The value of the left-hand side. | ||
b: The value of the right-hand side. | ||
Returns | ||
The resulting value. | ||
''' | ||
return a + b | ||
|
||
|
||
def sub(a, b): | ||
'''Subtracts two numbers. | ||
Args: | ||
a: The value of the left-hand side. | ||
b: The value of the right-hand side. | ||
Returns | ||
The resulting value. | ||
''' | ||
return a - b | ||
|
||
|
||
def mul(a, b): | ||
'''Multiplies two numbers. | ||
Args: | ||
a: The value of the left-hand side. | ||
b: The value of the right-hand side. | ||
Returns | ||
The resulting value. | ||
''' | ||
return a * b | ||
|
||
|
||
def div(a, b): | ||
'''Divides two numbers. | ||
Args: | ||
a: The value of the left-hand side. | ||
b: The value of the right-hand side. | ||
Returns | ||
The resulting value. | ||
''' | ||
return a / b | ||
|
||
|
||
def muladd(a, b, c): | ||
'''Performs the fused multiply-add operation.''' | ||
return a * b + c | ||
|
||
|
||
def print_greet(): | ||
'''Displays greeting.''' | ||
print('Hello, world!') | ||
|
||
|
||
def print_mascot(): | ||
'''Displays mascot.''' | ||
runner_os = platform.system() | ||
if runner_os == 'Linux': | ||
print('Tux') | ||
elif runner_os == 'Darwin': | ||
print('Dogcow') | ||
else: | ||
print('Unknown') | ||
|
||
|
||
def is_py38_or_higher(): | ||
'''Check if python 3.8 or higher.''' | ||
if sys.version_info < (3, 8): | ||
return False | ||
else: | ||
return True | ||
|
||
|
||
def print_python_version(): | ||
'''Displays python version.''' | ||
# print(f"{sys.version=}") # Syntax for Python 3.8 or higher. | ||
# print(f"sys.version={sys.version}") | ||
print(sys.version) | ||
|
||
|
||
def print_with_delay(text): | ||
delay = len(text) / 100 + 1.0 | ||
time.sleep(delay) | ||
print(text) | ||
|
||
|
||
if __name__ == '__main__': | ||
print_greet() |