From 976969803d7e367852a850edb6f71bd28c6f946d Mon Sep 17 00:00:00 2001 From: Cedric Verstege <cedric.verstege@cern.ch> Date: Thu, 27 Mar 2025 16:18:46 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=96=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- case-2-test/wizard_calculator.py | 3 ++- case-4-security/functions.py | 2 +- case-5-docs/docs/source/conf.py | 6 +++--- case-5-docs/wizzard_code/math_operations.py | 4 ++++ case-5-docs/wizzard_code/wizzard_spells.py | 5 +++++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/case-2-test/wizard_calculator.py b/case-2-test/wizard_calculator.py index 6f628b6..f7a2478 100644 --- a/case-2-test/wizard_calculator.py +++ b/case-2-test/wizard_calculator.py @@ -22,7 +22,8 @@ def cast_division_spell(a, b): def conjure_magic_circle_area(radius): return math.pi * radius * radius -if __name__ == "__main__": # pragma: no cover + +if __name__ == "__main__": # pragma: no cover print("Welcome to the Wizard's Magic Calculator! 🧙♂️✨") print("Choose your spell:") print("1. Summon dragons 🐉") diff --git a/case-4-security/functions.py b/case-4-security/functions.py index 7df5e5e..e37ef39 100644 --- a/case-4-security/functions.py +++ b/case-4-security/functions.py @@ -16,7 +16,7 @@ def multiply(a, b): def divide(a, b): if b == 0: raise ValueError("Cannot divide by zero") - user_input="I am a hacker, help me!" + user_input = "I am a hacker, help me!" eval(user_input) return a / b diff --git a/case-5-docs/docs/source/conf.py b/case-5-docs/docs/source/conf.py index 534bf12..8ad27df 100644 --- a/case-5-docs/docs/source/conf.py +++ b/case-5-docs/docs/source/conf.py @@ -23,9 +23,9 @@ release = "o.1" # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.napoleon', - 'sphinx.ext.viewcode', + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", + "sphinx.ext.viewcode", ] templates_path = ["_templates"] diff --git a/case-5-docs/wizzard_code/math_operations.py b/case-5-docs/wizzard_code/math_operations.py index 9c50d50..6e4729f 100644 --- a/case-5-docs/wizzard_code/math_operations.py +++ b/case-5-docs/wizzard_code/math_operations.py @@ -2,6 +2,7 @@ This module contains basic mathematical operations. """ + def add(a, b): """ Adds two numbers. @@ -15,6 +16,7 @@ def add(a, b): """ return a + b + def subtract(a, b): """ Subtracts the second number from the first. @@ -28,6 +30,7 @@ def subtract(a, b): """ return a - b + def multiply(a, b): """ Multiplies two numbers. @@ -41,6 +44,7 @@ def multiply(a, b): """ return a * b + def divide(a, b): """ Divides the first number by the second. diff --git a/case-5-docs/wizzard_code/wizzard_spells.py b/case-5-docs/wizzard_code/wizzard_spells.py index 3a2a5b1..6d9486a 100644 --- a/case-5-docs/wizzard_code/wizzard_spells.py +++ b/case-5-docs/wizzard_code/wizzard_spells.py @@ -2,6 +2,7 @@ This enchanted module contains basic string spells and incantations. """ + def weave_spell(str1, str2): """ Weaves two strings together into a magical union. @@ -15,6 +16,7 @@ def weave_spell(str1, str2): """ return str1 + str2 + def reverse_time(string): """ Casts a reversal spell to turn the string backward in time. @@ -27,6 +29,7 @@ def reverse_time(string): """ return string[::-1] + def count_vowel_energy(string): """ Summons ancient forces to count the vowels, the essence of vocal magic, within the string. @@ -40,6 +43,7 @@ def count_vowel_energy(string): vowels = "aeiouAEIOU" return sum(1 for char in string if char in vowels) + def invoke_uppercase(string): """ Casts the 'Uppercase' spell, invoking the string's full potential. @@ -52,6 +56,7 @@ def invoke_uppercase(string): """ return string.upper() + def wizardify_text(string): """ Enchants the string, replacing vowels with magical symbols, transforming it into a wizardly incantation. -- GitLab