Skip to content

Commit

Permalink
moved utility function to discoutils where it belongs
Browse files Browse the repository at this point in the history
  • Loading branch information
mbatchkarov committed Oct 23, 2015
1 parent dac0a5a commit 0010ae1
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions eval/utils/misc.py
Expand Up @@ -111,18 +111,3 @@ def update_dict_according_to_mask(v, mask):
new_indices = {old_index: new_index for new_index, old_index in enumerate(sorted(v.values()))}
# update indices in vocabulary
return {feature: new_indices[index] for feature, index in v.items()}


def force_symlink(existing_file, link_name):
"""
Created a symlink. If `link_name` exists it is deleted first. Take care!
:raise e:
"""
try:
os.symlink(existing_file, link_name)
except OSError as e:
if e.errno == errno.EEXIST:
os.remove(link_name)
os.symlink(existing_file, link_name)
else:
raise e

0 comments on commit 0010ae1

Please sign in to comment.