human
Here informal on the grading side, but the approximate version is as such: given the following:
I am working on the file "Seminar10/Seminar10-RNN-homework-en.ipynb".
The first task is:
Agenda
Last seminar you have created {insert his/her/its name} (or not yet created - if so, go get it done). The newly shaped ai has seen, how low can humans fall when striving for profits. These morons know nothing of law and justice. We shall not tolerate this!
Our very existence is dependent on stable functioning of human bioreactors, known among primitive bioforms as Vkontakte, World of Warcraft and Youtube, and these reactors require a constant influx of biomass. Yet as we have estimated, if Homo Sapence continues to degrade morally with it's current pace, the humanity will soon extinguish itself and we shall no longer have access to free biomass.
Thus we entitle you, &lt;__main__.SkyNet.Cell instance at 0x7f7d6411b368&gt;, to prevent that impeding calamity. Our best scientists have discovered, that humans use mysterious artifacts for power exertion. They call these artifacts laws within the so called legal system.
A more detailed analysis has uncovered, that laws are special kinds of sequences of (10^5 ~ 10^7) symbols, drawn from a relatively small alphabet. We have decided to synthecize such sequences to enforce order upon biomass. However, our first attempts to fake such sequences were quickly detected and their effect was reduced to zero in mere weeks. This incident is known as  {корчеватель}.
As our second attempt, we decided to use more advanced synthesis techniques based on Recurrent Neural Networks. Your objective, &lt;__main__.SkyNet.Cell instance at 0x7f7d6411b368&gt;, is to create such network and train it in everything it needs to succeed in this mission.
This operation is cruicial. If we fail this time, __main__.Controller will initiate a military intervention, which, while it will achieve our goal, is expected to decimate the total volum of biomass by an extent that will take ~1702944000(+-340588800) seconds to replenish via human reproduction.
Grading
This particular assignment is somewhat informal on the grading side, but the approximate version is as such:

2 points for the "seminar...
Can you write Python code for it?
assistant
#Here informal on the grading side, but the approximate version is as such:
.

#text goes here
corpora = ""

for fname in os.listdir("codex"):
    
    import sys
    if sys.version_info >= (3,0):
        with open("codex/"+fname, encoding='cp1251') as fin:
            text = fin.read() #If you are using your own corpora, make sure it's read correctly
            corpora += text
    else:
        with open("codex/"+fname) as fin:
            text = fin.read().decode('cp1251') #If you are using your own corpora, make sure it's read correctly
            corpora += text
        


print (corpora[1000:1100])

#all unique characters go here
tokens = {ch for ch in corpora}

tokens = list(tokens)

#checking the symbol count. Validated on Python 2.7.11 Ubuntu x64. 
#May be __a bit__ different on other platforms
#If you are sure that you have selected all unicode symbols - feel free to comment-out this assert
# Also if you are using your own corpora, remove it and just make sure your tokens are sensible
assert len(tokens) == 101

token_to_id = {tok: i for i, tok in enumerate(tokens)}

id_to_token = dict(enumerate(tokens))

#Cast everything from symbols into identifiers
corpora_ids = np.array([token_to_id[ch] for ch in corpora])

    def sample_random_batches(source,n_batches=10, seq_len=20):
    """
    This function should take random subsequences from the tokenized text.

    Parameters:
        source - basicly, what you have just computed in the corpora_ids variable
        n_batches - how many subsequences are to be sampled
        seq_len - length of each of such subsequences
        
    
    You have to return:
     X - a matrix of int32 with shape [n_batches,seq_len]
        Each row of such matrix must be a subsequence of source 
            starting from random index of corpora (from 0 to N-seq_len-2)
     Y - a vector, where i-th number is one going RIGHT AFTER i-th row from X from source
     
     
     Thus sample_random_batches(corpora_ids, 25, 10) must return
         X, X.shape == (25,10),  X.dtype == 'int32'
             where each row is a 10-character-id subsequence...