code: def __user_location(__pkg: str, type_) -> str:
      
      if ALLOW_DARWIN and sys.platform == 'darwin':
          user_dir = '~/Library/{}'.format(__LOCATIONS[type_][0])
      else:
          user_dir = getenv('XDG_{}_HOME'.format(type_.upper()),
                             path.sep.join([getenv('HOME', ''),
                                            __LOCATIONS[type_][1]]))
      return path.expanduser(path.sep.join([user_dir, __pkg]))
docs: Utility function to look up XDG basedir locations
  
      Args:
          __pkg: Package name
          __type: Location type