From d0c2bf5567072752c61a7d1e4061764453ca6415 Mon Sep 17 00:00:00 2001 From: Alihan <147850914+Alihanesentas@users.noreply.github.com> Date: Sun, 5 Apr 2026 23:51:33 +0300 Subject: [PATCH 1/7] Add student ID and full name to info_alihan_esentas.py --- Week01/info_alihan_esentas.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Week01/info_alihan_esentas.py diff --git a/Week01/info_alihan_esentas.py b/Week01/info_alihan_esentas.py new file mode 100644 index 00000000..ccfac61c --- /dev/null +++ b/Week01/info_alihan_esentas.py @@ -0,0 +1,2 @@ +student_id = "220316034" +full_name = "Alihan_esentas" From 15ddc9178e4b4d66d9dbf70df087334fab9614a4 Mon Sep 17 00:00:00 2001 From: Alihan <147850914+Alihanesentas@users.noreply.github.com> Date: Sun, 5 Apr 2026 23:53:51 +0300 Subject: [PATCH 2/7] Add variables of different types in types_alihan_esentas.py --- Week02/types_alihan_esentas.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Week02/types_alihan_esentas.py diff --git a/Week02/types_alihan_esentas.py b/Week02/types_alihan_esentas.py new file mode 100644 index 00000000..c70e146c --- /dev/null +++ b/Week02/types_alihan_esentas.py @@ -0,0 +1,4 @@ +my_int = 13 +my_float = 21.3 +my_bool = False +my_complex = 11j From ca742f53637dbf6fb828de8f6dee88245a62e617 Mon Sep 17 00:00:00 2001 From: Alihan <147850914+Alihanesentas@users.noreply.github.com> Date: Sun, 5 Apr 2026 23:58:18 +0300 Subject: [PATCH 3/7] Add function to calculate pyramid height --- Week03/pyramid_alihan_esentas.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Week03/pyramid_alihan_esentas.py diff --git a/Week03/pyramid_alihan_esentas.py b/Week03/pyramid_alihan_esentas.py new file mode 100644 index 00000000..236c1067 --- /dev/null +++ b/Week03/pyramid_alihan_esentas.py @@ -0,0 +1,7 @@ +def calculate_pyramid_height(blockNumber): + height = 0 + + while blockNumber > height: + height += 1 + blockNumber -= height + return height From a99ec0abd9b71bfd2bee32488ab6da7c82d8d8cd Mon Sep 17 00:00:00 2001 From: Alihan <147850914+Alihanesentas@users.noreply.github.com> Date: Mon, 6 Apr 2026 00:00:15 +0300 Subject: [PATCH 4/7] Add performance decorator for function metrics Implement a performance decorator to measure execution time and memory usage. --- decorators_alihan_esentas.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 decorators_alihan_esentas.py diff --git a/decorators_alihan_esentas.py b/decorators_alihan_esentas.py new file mode 100644 index 00000000..3daa62a1 --- /dev/null +++ b/decorators_alihan_esentas.py @@ -0,0 +1,20 @@ +import tracemalloc +import time + +def performance(func): + performance.counter = 0 + performance.total_time = 0.0 + performance.total_mem = 0.0 + + def wrapper(*args, **kwargs): + tracemalloc.start() + start_time = time.time() + result = func(*args, **kwargs) + end_time = time.time() + current, peak = tracemalloc.get_traced_memory() + tracemalloc.stop() + performance.counter += 1 + performance.total_time += (end_time - start_time) + performance.total_mem += peak + return result + return wrapper From 0f1ab401ab1bcf7e1aee2b1e19c90e529116cb23 Mon Sep 17 00:00:00 2001 From: Alihan <147850914+Alihanesentas@users.noreply.github.com> Date: Mon, 6 Apr 2026 00:01:02 +0300 Subject: [PATCH 5/7] Add performance decorator for function metrics Implemented a performance decorator to track execution time and memory usage. --- Week04/decorators_alihan_esentas.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Week04/decorators_alihan_esentas.py diff --git a/Week04/decorators_alihan_esentas.py b/Week04/decorators_alihan_esentas.py new file mode 100644 index 00000000..3daa62a1 --- /dev/null +++ b/Week04/decorators_alihan_esentas.py @@ -0,0 +1,20 @@ +import tracemalloc +import time + +def performance(func): + performance.counter = 0 + performance.total_time = 0.0 + performance.total_mem = 0.0 + + def wrapper(*args, **kwargs): + tracemalloc.start() + start_time = time.time() + result = func(*args, **kwargs) + end_time = time.time() + current, peak = tracemalloc.get_traced_memory() + tracemalloc.stop() + performance.counter += 1 + performance.total_time += (end_time - start_time) + performance.total_mem += peak + return result + return wrapper From 217ac7b09aec247cd72525ef898f8802c4d948fd Mon Sep 17 00:00:00 2001 From: Alihan <147850914+Alihanesentas@users.noreply.github.com> Date: Mon, 6 Apr 2026 00:04:28 +0300 Subject: [PATCH 6/7] Delete decorators_alihan_esentas.py i was added wrong field and i deleted file, I didn't want to go back to the previous commit. --- decorators_alihan_esentas.py | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 decorators_alihan_esentas.py diff --git a/decorators_alihan_esentas.py b/decorators_alihan_esentas.py deleted file mode 100644 index 3daa62a1..00000000 --- a/decorators_alihan_esentas.py +++ /dev/null @@ -1,20 +0,0 @@ -import tracemalloc -import time - -def performance(func): - performance.counter = 0 - performance.total_time = 0.0 - performance.total_mem = 0.0 - - def wrapper(*args, **kwargs): - tracemalloc.start() - start_time = time.time() - result = func(*args, **kwargs) - end_time = time.time() - current, peak = tracemalloc.get_traced_memory() - tracemalloc.stop() - performance.counter += 1 - performance.total_time += (end_time - start_time) - performance.total_mem += peak - return result - return wrapper From 0fb55804d649148731eac81405b9887c7b166fd7 Mon Sep 17 00:00:00 2001 From: Alihan <147850914+Alihanesentas@users.noreply.github.com> Date: Mon, 6 Apr 2026 00:05:40 +0300 Subject: [PATCH 7/7] Add awaitme decorator for coroutine functions --- Week05/awaitme_alihan_esentas.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Week05/awaitme_alihan_esentas.py diff --git a/Week05/awaitme_alihan_esentas.py b/Week05/awaitme_alihan_esentas.py new file mode 100644 index 00000000..0c828f4f --- /dev/null +++ b/Week05/awaitme_alihan_esentas.py @@ -0,0 +1,17 @@ +import asyncio + +def awaitme(fn): + if asyncio.iscoroutinefunction(fn): + return fn + + async def wrapper(*args, **kwargs): + return fn(*args, **kwargs) + + try: + wrapper.__name__ = fn.__name__ + wrapper.__doc__ = fn.__doc__ + wrapper.__annotations__ = fn.__annotations__ + except (AttributeError, TypeError): + pass + + return wrapper