This repository was archived by the owner on Mar 14, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStandards.py
More file actions
172 lines (127 loc) · 4.85 KB
/
Standards.py
File metadata and controls
172 lines (127 loc) · 4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Python
Python_data_type_integer = int
Python_data_type_float = float
Python_data_type_string = str
Python_data_type_boolean = bool
Python_data_type_list = list
Python_data_type_tag_list = dict
import importlib.util
def Python_load_immutables(immutable_data):
spec = importlib.util.spec_from_file_location(
"immutables",
os.path.join(os.path.dirname(__file__), ".immutables.py")
)
immutables = importlib.util.module_from_spec(spec)
spec.loader.exec_module(immutables)
immutable_data = getattr(immutables, immutable_data)
return immutable_data
def Python_print(any_value):
print(any_value)
def Python_integer(any_value):
return int(any_value)
def Python_float(any_value):
return float(any_value)
def Python_string(any_value):
return str(any_value)
def Python_boolean(any_value):
return bool(any_value)
def Python_list(any_value):
return list(any_value)
def Python_tag_list(any_value):
return dict(any_value)
def Python_fstring(string_value):
loop = 0
temporary_hold_of_single_quotes = ""
was_single_quotes_found = False
was_f_string_divider_found = False
text_for_output = ""
while loop < len(string_value):
if temporary_hold_of_single_quotes == "''''''":
was_f_string_divider_found = True
if was_f_string_divider_found == False:
if was_single_quotes_found == False:
if string_value[loop:loop + 1] != "'":
text_for_output += string_value[loop:loop + 1]
elif string_value[loop:loop + 1] == "'":
was_single_quotes_found = True
temporary_hold_of_single_quotes += (
string_value[loop:loop + 1]
)
elif was_single_quotes_found == True:
if string_value[loop:loop + 1] != "'":
text_for_output += temporary_hold_of_single_quotes
text_for_output += string_value[loop:loop + 1]
temporary_hold_of_single_quotes = ""
was_single_quotes_found = False
elif string_value[loop:loop + 1] == "'":
temporary_hold_of_single_quotes += (
string_values[loop:loop + 1]
)
elif was_f_string_divider_found == True:
text_for_output = text_for_output[:-1]
was_double_quotes_found = False
was_f_string_divider_found = False
temporary_hold_of_single_quotes = ""
loop += 1
return text_for_output[1:-1]
def Python_read_file(FILE_PATH):
open_file = open(FILE_PATH, "r").read()
open(FILE_PATH).close()
return open_file
def Python_read_binary_of_file(FILE_PATH):
open_file = open(FILE_PATH, "rb").read()
open(FILE_PATH).close()
return open_file
def Python_write_file(FILE_PATH, STRING_VALUE):
open(FILE_PATH, "a").write(STRING_VALUE)
open(FILE_PATH).close()
def Python_write_binary_of_file(FILE_PATH, STRING_VALUE):
open(FILE_PATH, "ab").write(STRING_VALUE)
open(FILE_PATH).close()
def Python_overwrite_file(FILE_PATH, STRING_VALUE):
open(FILE_PATH, "w").write(STRING_VALUE)
open(FILE_PATH).close()
def Python_overwrite_binary_of_file(FILE_PATH, STRING_VALUE):
open(FILE_PATH, "wb").write(STRING_VALUE)
open(FILE_PATH).close()
def Python_type(ANY_VALUE):
return type(ANY_VALUE)
def Python_length(ANY_VALUE):
return len(ANY_VALUE)
import os
def OS_exit_Main():
os.sys.exit()
def OS_environment(ANY_TAG, ANY_VALUE):
os.environ[ANY_TAG] = ANY_VALUE
def OS_initialize_directory(directory_path):
os.makedirs(directory_path)
def OS_return_boolean_filesystem(filesystem_path):
return os.path.exists(filesystem_path)
def OS_return_boolean_file(file_path):
return os.path.isfile(file_path)
def OS_return_boolean_directory(directory_path):
return os.path.isdir(directory_path)
def OS_return_list_of_directory_files(directory_path):
return os.listdir(directory_path)
def OS_delete_file(file_path):
os.remove(file_path)
def OS_return_path_of_home_user():
return os.path.expanduser("~")
def OS_return_absolute_path(relative_path_of_filesystem):
return os.path.abspath(relative_path_of_filesystem)
def OS_return_resolution_path_of_symbolic_link(relative_path_of_symbolic_link):
return os.path.realpath(relative_path_of_symbolic_link)
def OS_return_function_parameters():
return os.sys.argv
import subprocess
def SubProcess_Initialize(functions):
subprocess.run(functions, shell=True)
def SubProcess_Parallel_Initialize(functions):
subprocess.Popen(functions, shell=True)
import signal
def Signal_signal(signal_type, function):
signal.signal(signal_type, function)
def Signal_return_signal_for_interruption():
return signal.SIGINT
def Signal_return_signal_for_termination():
return signal.SIGTERM