def query_nvidia_smi(gpu_number) -> GPUUsageInfo:
params = ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>",<EOL>"<STR_LIT>", "<STR_LIT>",<EOL>"<STR_LIT>", "<STR_LIT>"]<EOL>try:<EOL><INDENT>output = subprocess.check_output(["<STR_LIT>",<EOL>"<STR_LIT>".format('<STR_LIT:U+002C>'.join(params)),<EOL>"<STR_LIT>"])<EOL><DEDENT>except FileNotFoundError:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>except subprocess.CalledProcessError:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>output = output.decode('<STR_LIT:utf-8>').split("<STR_LIT:\n>")[gpu_number].strip()<EOL>values = output.split("<STR_LIT:U+002CU+0020>")<EOL>values = [None if ("<STR_LIT>" in value.lower()) else int(value) for value in values]<EOL>return GPUUsageInfo(*values)<EOL>
:return:
    all memory fields are in megabytes,
    temperature in degrees celsius,
    fan speed is integer percent from 0 to 100 inclusive,
    usage_gpu and usage_mem are integer percents from 0 to 100 inclusive
    (usage_mem != used_mem, usage_mem is about read/write access load)
    read more in 'nvidia-smi --help-query-gpu'.

    Any field can be None if such information is not supported by nvidia-smi for current GPU

    Returns None if call failed (no nvidia-smi or query format was changed)

    Raises exception with readable comment