original_docstring: Tries to abbreviate the home dir within the given path
docstring: Tries to abbreviate the home dir within the given path
docstring_tokens: Tries to abbreviate the home dir within the given path
code: def abbreviate_user(path: str):
      """Tries to abbreviate the home dir within the given path"""
      try:
          f = Path(path)
          home = '%USERPROFILE%' if platform.system() == 'Windows' else '~'
          return str(home / f.relative_to(Path.home()))
      except ValueError:
          return path
code_tokens: def abbreviate_user ( path : str ) : try : f = Path ( path ) home = '%USERPROFILE%' if platform . system ( ) == 'Windows' else '~' return str ( home / f . relative_to ( Path . home ( ) ) ) except ValueError : return path
short_docstring: Tries to abbreviate the home dir within the given path
short_docstring_tokens: Tries to abbreviate the home dir within the given path
comment: """Tries to abbreviate the home dir within the given path"""