Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff81c9c

Browse files
committed
PEP8 changes
1 parent 45add05 commit ff81c9c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/pylab_examples/system_monitor.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
#!/usr/bin/env python
2-
# -*- noplot -*-
31
import time
42
import matplotlib.pyplot as plt
53
import numpy as np
64

5+
76
def get_memory():
87
"Simulate a function that returns system memory"
98
return 100*(0.5 + 0.5*np.sin(0.5*np.pi*time.time()))
109

10+
1111
def get_cpu():
1212
"Simulate a function that returns cpu usage"
1313
return 100*(0.5 + 0.5*np.sin(0.2*np.pi*(time.time() - 0.25)))
1414

15+
1516
def get_net():
1617
"Simulate a function that returns network bandwidth"
1718
return 100*(0.5 + 0.5*np.sin(0.7*np.pi*(time.time() - 0.1)))
1819

20+
1921
def get_stats():
2022
return get_memory(), get_cpu(), get_net()
2123

24+
2225
# turn interactive mode on for dynamic updates. If you aren't in
2326
# interactive mode, you'll need to use a GUI event handler/timer.
2427
plt.ion()

0 commit comments

Comments
 (0)