code: def get_config_dir():
      
  
      paths = []
      if 'TMUXP_CONFIGDIR' in os.environ:
          paths.append(os.environ['TMUXP_CONFIGDIR'])
      if 'XDG_CONFIG_HOME' in os.environ:
          paths.append(os.environ['XDG_CONFIG_HOME'])
      else:
          paths.append('~/.config/tmuxp/')
      paths.append('~/.tmuxp')
  
      for path in paths:
          path = os.path.expanduser(path)
          if os.path.isdir(path):
              return path
      # Return last path as default if none of the previous ones matched
      return path
docs: Return tmuxp configuration directory.
  
      ``TMUXP_CONFIGDIR`` environmental variable has precedence if set. We also 
      evaluate XDG default directory from XDG_CONFIG_HOME environmental variable 
      if set or its default. Then the old default ~/.tmuxp is returned for 
      compatibility.
  
      Returns
      -------
      str :
          absolute path to tmuxp config directory