[docs]defshow_versions(output:bool=True)->str:"""Prints out system and dependency information for debugging"""importimportlibimportlocaleimportstructdeps_info=[]try:(sysname,_,release,_,machine,processor)=platform.uname()deps_info.extend([("python",sys.version),("python-bits",struct.calcsize("P")*8),("OS",f"{sysname}"),("OS-release",f"{release}"),("machine",f"{machine}"),("processor",f"{processor}"),("byteorder",f"{sys.byteorder}"),("LC_ALL",f'{os.environ.get("LC_ALL","None")}'),("LANG",f'{os.environ.get("LANG","None")}'),("LOCALE",f"{locale.getlocale()}"),])# pylint: disable=broad-exceptexceptException:passtry:deps_info.append(('cmdstan_folder',cmdstan_path()))deps_info.append(('cmdstan',str(cmdstan_version())))# pylint: disable=broad-exceptexceptException:deps_info.append(('cmdstan','NOT FOUND'))deps=['cmdstanpy','pandas','xarray','tqdm','numpy']formoduleindeps:try:ifmoduleinsys.modules:mod=sys.modules[module]else:mod=importlib.import_module(module)# pylint: disable=broad-exceptexceptException:deps_info.append((module,None))else:try:ver=mod.__version__# type: ignoredeps_info.append((module,ver))# pylint: disable=broad-exceptexceptException:deps_info.append((module,"installed"))out='INSTALLED VERSIONS\n---------------------\n'fork,infoindeps_info:out+=f'{k}: {info}\n'ifoutput:print(out)return" "else:returnout