create utils module
This commit is contained in:
2
src/utils/__init__.py
Normal file
2
src/utils/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from .pickles import load_pickle, dump_pickle
|
||||
from .blob import create_blob
|
||||
9
src/utils/blob.py
Normal file
9
src/utils/blob.py
Normal file
@@ -0,0 +1,9 @@
|
||||
def create_blob(file):
|
||||
"""
|
||||
Creates a blob from a file.
|
||||
"""
|
||||
with open(file, "rb") as f:
|
||||
blob = f.read()
|
||||
return blob
|
||||
|
||||
|
||||
6
src/utils/pickles.py
Normal file
6
src/utils/pickles.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import pickle
|
||||
|
||||
def load_pickle(data):
|
||||
return pickle.loads(data)
|
||||
def dump_pickle(data):
|
||||
return pickle.dumps(data)
|
||||
4
src/utils/temp.py
Normal file
4
src/utils/temp.py
Normal file
@@ -0,0 +1,4 @@
|
||||
template = "{{sap{}_prof}} ({{sap_{}_name}})"
|
||||
result = "\n".join(template.format(i, i) for i in range(1, 201))
|
||||
|
||||
print(result)
|
||||
Reference in New Issue
Block a user