Analog to digital conversion using Python
You see this because you're sampling too close to Nyquist rate, but do not worry, although it seems to be aliased however, your sampling system works well and the signal is not aliased. To be more sure, just take a look at sampled signal in frequency domain:
As you see, only 9th bin is active, all others are zero, so no aliasing is occurred in sampling.The code (MATLAB) for FFT calculation is:

Fs = 20;                    % Sampling frequency
T = 1/Fs;                     % Sample time
L = length(sampling_signal);  % Length of signal
t = (0:L-1)*T;                % Time vector
y = sampling_signal;     % Sinusoids plus quantization noise
NFFT = 2^nextpow2(L); 
Y = fft(y,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1);
plot(f,2*abs(Y(1:NFFT/2+1))) 
title('Single-Sided Amplitude Spectrum of y(t)')
xlabel('Frequency (Hz)')
ylabel('|Y(f)|')


Note! I've changed time_of_view to 10 secs, to avoid FFT leakage (the side lobes you see around 9th bin).

It is O.K to increase signal rate this close to Nyquist rate, as far as you're not intended to return the signal back to the analog domain,
 because then your DAC requires a very sharp Low-pass filter in output and its realization is too hard (if not impossible). This paper intuitively expalins sampling problems, Sampling: What Nyquist Didn't Say, and What to Do About It