This is the output of my `nvidia-smi` command, I want to parse its output and kill all the python processes that runs on GPU. I already know how to kill all python processes with the following script I wrote.

```
kall () {
    pgrep $1 | xargs kill -9
}

```

And now I want to kill all the processes (get the PID number) that using the GPU so I want to parse the nvidia-smi output.

```
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.27                 Driver Version: 367.27                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1070    Off  | 0000:01:00.0      On |                  N/A |
|  0%   46C    P2    40W / 166W |   4902MiB /  8112MiB |      1%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0       917    G   /usr/lib/xorg/Xorg                             209MiB |
|    0      1683    G   compiz                                         159MiB |
|    0      3780    G   ...UI2016Q2,UsePasswordSeparatedSigninFlow<P   130MiB |
|    0     25962    C   python                                        2199MiB |
|    0     26103    C   python                                        2201MiB |
+-----------------------------------------------------------------------------+

```