INNER CODE UNIT · Python
clear_directory
DmitryRyumin/ICCV-2023-25-Papers · code/markdown_to_json_parser.py:62
def clear_directory(directory):
path = Path(directory)
for item in path.iterdir():
try:
if item.is_file():
item.unlink()
elif item.is_dir():
shutil.rmtree(item)
except Exception as e:
print(f"Error while deleting {item}: {e}")
def get_github_repository():
github_token = Config.GITHUB_TOKEN
if not github_token:
print("GitHub token not available. Exiting.")
return None, None