File: workflow_by_chain_of_responsability_oo.py
from abc import ABC, abstractmethod
#
# Abstract classes
#| class Parent1: | |
| def parent1_method(self): | |
| return "Method from Parent1 class" | |
| class Parent2: | |
| def parent2_method(self): | |
| return "Method from Parent2 class" | |
| class Child: | |
| def __init__(self, parent_class): |
| from typing import Any | |
| class WorkflowSkip(Exception): | |
| ... | |
| class WorkflowProcess: | |
| workflow_steps = () |
| import re | |
| if re.match(r'^/tmp/(?!.*/$).*$', file_path): | |
| os.remove(file_path) |
echo -e "#!/bin/bash
#
echo 'This is my script'" > my-scriptsudo install my-script /usr/local/binAlways I forget how to set Linux swap so there it is
| #!/bin/bash | |
| # Variables to store argument values | |
| ARG1="" | |
| ARG2="" | |
| # Function to display the error message and exit the script | |
| function usage_error { | |
| echo "Usage: $0 --argument_1=\"<text>\" --argument_2=\"<text>\"" | |
| echo "Error: $1" |
| import time | |
| # | |
| # Creating two large sets for testing | |
| # | |
| a = set(range(1, 1000000)) # Set with 1 million elements | |
| b = set(range(500000, 1500000)) # Set that partially overlaps with set 'a' | |
| print() |
| # reference: https://docs.gspread.org/en/latest/user-guide.html | |
| # Install the required libraries | |
| !pip install gspread google-auth | |
| # Import libraries | |
| import gspread | |
| from google.colab import auth | |
| from oauth2client.client import GoogleCredentials | |
| from google.auth import default |