<jupyter_start><jupyter_text>Get VMs (Not templates) not running<jupyter_code>usage = dataraw[['VM', 'Template', 'Guest state', 'Provisioned MB', 'In Use MB', 'Disks']]
usagefilter1 = usage[usage['Guest state'] == "notRunning"]
usagefilter2 = usagefilter1[usagefilter1['Template'] == False].copy()
usagetotal = usagefilter2.copy()
usagefilter2['Provisioned MB'] = usagefilter2['Provisioned MB'].map(human_size)
usagefilter2['In Use MB'] = usagefilter2['In Use MB'].map(human_size)
usagefilter2<jupyter_output><empty_output><jupyter_text>Total space used by Not Running VMs<jupyter_code>usagetotal[['Provisioned MB', 'In Use MB']].sum().apply(human_size)
display(Markdown("#### Total VMs not running: {}".format(usagetotal['VM'].count())))
usagetotal[['VM', 'Disks']]<jupyter_output><empty_output><jupyter_text>Get VM by OS<jupyter_code>vmos = dataraw[['VM', 'OS according to the configuration file']]
vmos[['VM', 'OS according to the configuration file']].groupby('OS according to the configuration file').count()
vmlinux = vmos[['VM', 'OS according to the configuration file']]
vmlinux = vmlinux[vmlinux['OS according to the configuration file'].fillna("Unknown").str.contains('Linux')].VM.count()
vmwindows = vmos[['VM', 'OS according to the configuration file']]
vmwindows = vmwindows[vmwindows['OS according to the configuration file'].fillna("Unknown").str.contains('Microsoft')].VM.count()
vmtotal = vmos[['VM', 'OS according to the configuration file']].VM.count()

for ostype in zip([vmlinux, vmwindows, vmtotal], ['VM linux', 'VM Windows', 'VM Total']):
    display(Markdown("#### {}: {}".format(ostype[1], ostype[0])))
vms = pd.DataFrame([vmlinux, vmwindows], ['VM linux', 'VM Windows'])
vms.columns = ['VMs']
vms.plot.pie(figsize=(7, 7), y=0, legend=False)
vmosgroups = dataraw[['VM', 'OS according to the configuration file']]
vmosgroups.groupby('OS according to the configuration file').count().plot.pie(figsize=(12, 12),y=0)
plt.legend(loc="best", bbox_to_anchor=(0.0, 0.45))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1822684497275879, 'fraction_numerical': 0.012382367508667657, 'mean_word_length': 8.308755760368664, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '321241', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 700, 'n_tokens_neox': 680, 'n_words': 160, 'path': 'vms.ipynb', 'repo_name': 'aldenso/jupyter-vmware-analysis', 'size': '2019'}