Alpinewerk Digital e.U. Owner: Alexander Semerad
registered sole proprietorship
Steckhovengasse 18, 1130 Wien - AT
Tel: +43 (0) 681 20289940
E-Mail: [email protected]
VAT-Nr: ATU75303217
FN: 544875m
Commercial Court Vienna
Decorators play a vital role in augmenting the functionality of functions and methods without altering their core logic. Diving into three specific decorators designed to track different aspects of function execution, count, time, and caller details. These decorators are useful tools for debugging, optimization, and monitoring in software development.
counter
The counter
decorator is designed to keep track of how many times a particular function is executed. This is particularly useful for understanding the usage pattern of a function within an application, aiding in both debugging and performance optimization.
from functools import wraps
def counter(func):
@wraps(func)
def wrapper(*args, **kwargs):
wrapper.count += 1
print(f"\n> Counting execution of '{func.__name__}': {wrapper.count}.")
return func(*args, **kwargs)
wrapper.count = 0
return wrapper
stopwatch
The stopwatch decorator measures the execution time of the decorated function. This information is critical for identifying performance bottlenecks and optimizing slow-running functions to improve the overall efficiency of an application.
from functools import wraps
from timeit import default_timer as timer
def stopwatch(func):
@wraps(func)
def wrapper(*args, **kwargs):
start = timer()
result = func(*args, **kwargs)
print(f"\n> Execution of '{func.__name__}' in: {(timer() - start):.4f} sec.")
return result
return wrapper
inspect_caller
The inspect_caller decorator provides insights into the caller's context of a function. It prints the file name, function name, and line number from where the decorated function was called. This decorator is invaluable for tracing the flow of execution and debugging complex applications with multiple layers of function calls.
import inspect
from functools import wraps
def inspect_caller(func):
@wraps(func)
def wrapper(*args, **kwargs):
current_frame = inspect.currentframe()
prev_caller_frame = inspect.getouterframes(current_frame, 2)[1]
filename = prev_caller_frame.filename
line_num = prev_caller_frame.lineno
func_name = prev_caller_frame.function
print(f"\n> Function '{func.__name__}' was called from file '{filename}', from function '{func_name}', at line '{line_num}'")
return func(*args, **kwargs)
return wrapper
Alpinewerk Digital e.U. Owner: Alexander Semerad
registered sole proprietorship
Steckhovengasse 18, 1130 Wien - AT
Tel: +43 (0) 681 20289940
E-Mail: [email protected]
VAT-Nr: ATU75303217
FN: 544875m
Commercial Court Vienna
Welcome to the website www.alpinewerk.com! Please get a picture of how we process your personal data when you visit our website or you are otherwise in a business relationship with us (Art 13, Art 14 GDPR; § 96 Abs 3 TKG – the Austrian Telecommunication Act).
The following data may be processed when you visit our website:
The processing of this data is necessary to manage the security of the operation of the website and to ensure the functionality of the website from a technical point of view. The processing of this data is justified by our legitimate interest in the operation of our website (Art 6 para 1 lit f DSGVO).
For the operation of our website, it may be necessary for us to disclose your data to the following recipients:
Recipients of data | Purpose of data processing | Reasoning for data processing | Location | Third party transfer |
---|---|---|---|---|
Alphabet Inc (Google Analytics) | Statistical evaluations and marketing purposes | Consent (Art 6 Abs 1 lit a GDPR) | USA | Standard contractual clauses (Art 46 Abs 2 lit c DSGVO) |
The above-mentioned data is stored via so-called "cookies". These technical cookies are only used to the extent necessary (§ 96 para 3 TKG). Cookies are text files that are stored on your computer and enable an analysis of the use of the website. They are used to recognise and store temporary data of the homepage visitor. We only use cookies to the extent necessary to communicate with you via the homepage.
These technical cookies are activated as soon as you visit our homepage.
The following cookies are used on our homepage on the basis of our legitimate interest (Art 6 para 1 lit f GDPR):
Name of the cookie | Purpose of the Cookies | Storage duration | Location of recipient |
---|---|---|---|
SESS# | Retains the user's states for all page | Session | USA |
In addition to the "technical cookies" described above, we also use so-called advertising cookies (including "statistical cookies"). These advertising cookies enable us to better understand and evaluate your interests. With the help of the advertising cookies, we can merge your "surfing behaviour" across the boundaries of our website with data from other websites. This is to enable us to better understand the interests of our homepage visitors and to target them more effectively.
We respect that not every visitor to the website wants this. Therefore, we only process your data in the course of advertising cookies if you consent to this (Art 6 para 1 lit a GDPR). You can revoke this consent at any time, whereby the data processing carried out up to the time of revocation remains justified.
These advertising cookies will only be activated once you have consented to them.
Name of the cookie | Purpose of the Cookies | Storage duration | Location of recipient | Purpose of data transfer |
---|---|---|---|---|
_ga (Google Analytics) | Statistical purposes | 2 years | USA | Registers a unique ID that is used to generate statistical data on how the visitor uses the website. |
ga# | Statistical purposes | 2 years | USA | Collects data on how often a user visits a website, as well as data for the first and last visit. |
In the course of our business relationship with customers or suppliers, we process your data on the basis of contractual (processing of the contractual relationship with you, pre-contractual obli-gations, invoicing of services, dispatch of documents, communication for the processing of the contract) and legal obligations (legally required storage within the meaning of § 132 BAO) (Art 6 para 1 lit b and c GDPR) as well as on the basis of our legitimate interests or on the basis of the legitimate interests of third parties (Art 6 para 1 lit f GDPR), namely:
for the purpose of internal administration and management of your business case to the extent necessary (e.g.: Processing your business case, forwarding your business case to various de-partments, filing, archiving purposes, correspondence with you);
for the purpose of direct advertising (e.g.: Mailing, e-mailing, satisfaction surveys, congratulatory letters, statistical evaluations);
We would like to expressly inform you that you can object to the processing of your data for the purpose of direct advertising.
in each case to the extent necessary. The processing of your data serves the purpose of initiating, maintaining and handling our business relations. If you do not provide us with this data, we will not be able to process your business case.
If particularly sensitive data is processed in the course of specific legal disputes, this is done for the purpose of asserting legal claims (Art 9 (2) (f) in conjunction with Art 6 (1) (b) GDPR).
We will only store your data for as long as is necessary for the purposes for which we collected your data. In this context, statutory retention obligations must be taken into account (for example, for reasons of tax law, contracts and other documents from our contractual relationship must generally be retained for a period of seven years (§ 132 BAO)). In justified individual cases, such as for the assertion and defence of legal claims, we may also store your data for up to 30 years after termination of the business relationship.
We store data of interested parties for up to three years from the time of the last contact by the respective person.
In the course of our business relationship, it may be necessary for us to transmit your data to the following recipients:
Recipient | Purposes | Legal justification | Location (country) | Purpose of data transfer |
---|---|---|---|---|
Bank (credit institution) | Payment-services | Contractual obligation (Art 6 Abs 1 lit b | ||
GDPR) | Austria | Within the EAA | ||
Business and tax advisors | Tax advisory | Contractual obligation (Art 6 Abs 1 lit b | ||
GDPR) | Austria | Within the EAA | ||
Attorney at law | Enforcement of claim | Contractual obligation (Art 6 Abs 1 lit b | ||
GDPR) | Austria | Within the EAA |
In the course of a business relationship or the initiation thereof, it is naturally necessary to conduct research on the business partner. This is done exclusively to the extent necessary for this purpose. In this context, data may be retrieved and processed from the following sources:
Source | Publicly available | Data subjects | Purpose/Reasoning |
---|---|---|---|
Internet-Research | Ja | Contact details | Contact for business purposes |
No automated decision-making or profiling takes place in our company.
We would like to inform you that, provided the legal requirements are met, you have the right to request information about your personal data:
If we process your data on the basis of your consent, you have the right to revoke this consent at any time by email. This does not affect the lawfulness of the data processing carried out up to this point (Art 7 (3) DSGVO).
If, contrary to expectations, there is a breach of your right to lawful processing of your data, please contact us by post or e-mail. We will endeavour to deal with your concern promptly. However, you also have the right to lodge a complaint with the supervisory authority for data protection matters responsible for you.
The address of the Austrian data protection authority is:
Austrian Data Protection Authority Barichgasse 40-42, 1030 Vienna
If you have any further questions about the processing of your data, please do not hesitate to contact our data protection coordinator using the contact details below.
Controller pursuant to Art 4 Z 7 GDPR:
Alpinewerk Digital e.U. Alexander Semerad
Steckhovengasse 18, 1130 Wien - AT
[email protected] +4368120289940
FN 544875m
Author: Attorney Dr. Tobias Tretzmüller, LL.M (IT-LAW); https://www.digital-recht.at/