def absolute_symlink(source_path, target_path):
 if (not os.path.isabs(source_path)):
  raise ValueError(u'Path for source : {} must be absolute'.format(source_path))
 if (not os.path.isabs(target_path)):
  raise ValueError(u'Path for link : {} must be absolute'.format(target_path))
 if (source_path == target_path):
  raise ValueError(u'Path for link is identical to source : {}'.format(source_path))
 try:
  if os.path.lexists(target_path):
   if (os.path.islink(target_path) or os.path.isfile(target_path)):
    os.unlink(target_path)
   else:
    shutil.rmtree(target_path)
  safe_mkdir_for(target_path)
  os.symlink(source_path, target_path)
 except OSError as e:
  if (not ((e.errno == errno.EEXIST) or (e.errno == errno.ENOENT))):
   raise

def absolute_symlink ( source_path , target_path ) : if ( not os . path . isabs ( source_path ) ) : raise ValueError ( u'Path for source : {} must be absolute' . format ( source_path ) ) if ( not os . path . isabs ( target_path ) ) : raise ValueError ( u'Path for link : {} must be absolute' . format ( target_path ) ) if ( source_path == target_path ) : raise ValueError ( u'Path for link is identical to source : {}' . format ( source_path ) ) try : if os . path . lexists ( target_path ) : if ( os . path . islink ( target_path ) or os . path . isfile ( target_path ) ) : os . unlink ( target_path ) else : shutil . rmtree ( target_path ) safe_mkdir_for ( target_path ) os . symlink ( source_path , target_path ) except OSError as e : if ( not ( ( e . errno == errno . EEXIST ) or ( e . errno == errno . ENOENT ) ) ) : raise
create a symlink at target pointing to source using the absolute path .