def createvaluesdict(self):
cpus_offline = <NUM_LIT:0><EOL>if self.file == '<STR_LIT>':<EOL><INDENT>with open('<STR_LIT>') as f:<EOL><INDENT>line = f.readline()<EOL>cpus_online = [int(cpu) for cpu in line.split('<STR_LIT:U+002C>') if cpu.find('<STR_LIT:->') < <NUM_LIT:0>]<EOL>cpus_online_range = [cpu_range for cpu_range in line.split('<STR_LIT:U+002C>') if cpu_range.find('<STR_LIT:->') > <NUM_LIT:0>]<EOL><DEDENT>for cpu_range in cpus_online_range:<EOL><INDENT>cpus_online += [cpu for cpu in range(int(cpu_range.split('<STR_LIT:->')[<NUM_LIT:0>]), int(cpu_range.split('<STR_LIT:->')[<NUM_LIT:1>]) + <NUM_LIT:1>)]<EOL><DEDENT>mhz_values = [<NUM_LIT:0.0> for cpu in range(max(cpus_online) + <NUM_LIT:1>)]<EOL>ghz_values = [<NUM_LIT:0.0> for cpu in range(max(cpus_online) + <NUM_LIT:1>)]<EOL>for cpu in cpus_online:<EOL><INDENT>with open('<STR_LIT>'.format(cpu)) as f:<EOL><INDENT>line = f.readline()<EOL>mhz_values[cpu] = float(line.rstrip()) / <NUM_LIT><EOL>ghz_values[cpu] = float(line.rstrip()) / <NUM_LIT><EOL><DEDENT><DEDENT>cpus_offline = mhz_values.count(<NUM_LIT:0.0>)<EOL><DEDENT>else:<EOL><INDENT>with open(self.file) as f:<EOL><INDENT>mhz_values = [float(line.split('<STR_LIT::>')[<NUM_LIT:1>]) for line in f if line.startswith('<STR_LIT>')]<EOL>ghz_values = [value / <NUM_LIT> for value in mhz_values]<EOL><DEDENT><DEDENT>mhz = {"<STR_LIT>".format(key): "<STR_LIT>".format(value) for key, value in enumerate(mhz_values)}<EOL>ghz = {"<STR_LIT>".format(key): "<STR_LIT>".format(value) for key, value in enumerate(ghz_values)}<EOL>cdict = mhz.copy()<EOL>cdict.update(ghz)<EOL>cdict['<STR_LIT>'] = "<STR_LIT>".format(sum(mhz_values) / (len(mhz_values) - cpus_offline))<EOL>cdict['<STR_LIT>'] = "<STR_LIT>".format(sum(ghz_values) / (len(ghz_values) - cpus_offline), <NUM_LIT:2>)<EOL>return cdict<EOL>
function processes the /proc/cpuinfo file, use file=/sys to use kernel >=4.13 location
:return: dictionary used as the full-text output for the module