code: def normalize_path(path, filetype=FILE):
      
      if not path:
          raise ValueError('"{0}" is not a valid path.'.format(path))
      if not os.path.exists(path):
          raise ValueError('"{0}" does not exist.'.format(path))
      if filetype == FILE and not os.path.isfile(path):
          raise ValueError('"{0}" is not a file.'.format(path))
      elif filetype == DIR and not os.path.isdir(path):
          raise ValueError('"{0}" is not a dir.'.format(path))
  
      return os.path.abspath(path)
docs: Takes a path and a filetype, verifies existence and type, and
      returns absolute path.