Allow reuse of get_absolute_path, is_none_or_empty methods

- Move them to utils.helper.py for reuse
- Import those modules where required
- Delete duplicate methods defined in org_to_jsonl.py, asymmetric.py
This commit is contained in:
Debanjum Singh Solanky
2021-08-16 16:33:43 -07:00
parent 9703afb814
commit 649e5d1327
4 changed files with 11 additions and 13 deletions

9
utils/helpers.py Normal file
View File

@@ -0,0 +1,9 @@
import pathlib
def is_none_or_empty(item):
return item == None or (hasattr(item, '__iter__') and len(item) == 0)
def get_absolute_path(filepath):
return str(pathlib.Path(filepath).expanduser().absolute())