code: def symlink(target, linkname):
      
      target = os.path.abspath(target)
      linkname = os.path.abspath(linkname)
      if not os.path.exists(target):
          raise ValueError("target {} not found".format(target))
  
      link_dir = os.path.dirname(linkname)
      if not os.path.exists(link_dir):
          os.makedirs(link_dir)
  
      run(['ln', '-s', '-f', target, linkname])
      return linkname
docs: Create a symlink to `target` called `linkname`.
  
      Converts `target` and `linkname` to absolute paths; creates
      `dirname(linkname)` if needed.