class_docstr: On Unix/Linux, we follow the
  `XDG Basedir Spec <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html>`_. The spec allows
  overriding directories with environment variables. The examples show are the default values, alongside the name of
  the environment variable that overrides them. Makes use of the
  `appname <platformdirs.api.PlatformDirsABC.appname>`,
  `version <platformdirs.api.PlatformDirsABC.version>`,
  `multipath <platformdirs.api.PlatformDirsABC.multipath>`,
  `opinion <platformdirs.api.PlatformDirsABC.opinion>`.
docstr: :return: state directory tied to the user, e.g. ``~/.local/state/$appname/$version`` or
   ``$XDG_STATE_HOME/$appname/$version``
docstr_tok: [":","return",":","state","directory","tied","to","the","user",",","e.g",".","``","~\/.local\/state\/","$","appname\/","$","version","``","or","``","$","XDG_STATE_HOME\/","$","appname\/","$","version","``"]
code: def user_state_dir(self) -> str:
      """
      :return: state directory tied to the user, e.g. ``~/.local/state/$appname/$version`` or
       ``$XDG_STATE_HOME/$appname/$version``
      """
      path = os.environ.get("XDG_STATE_HOME", "")
      if not path.strip():
          path = os.path.expanduser("~/.local/state")
      return self._append_app_name_and_version(path)
  
imports: from __future__ import annotations
  import os
  import sys
  from configparser import ConfigParser
  from pathlib import Path
  from .api import PlatformDirsABC
label_desc: Use image node_id 7 for calling the Unix obj's underlying member method code with example usage: obj.user_state_dir() and returns: self