@staticmethod<EOL><INDENT>def get_uniform(probabilities):<DEDENT>
<EOL>res_idx = None<EOL>random_num = np.random.rand()<EOL>for _idx in range(len(probabilities)):<EOL><INDENT>if random_num < probabilities[_idx]:<EOL><INDENT>res_idx = _idx<EOL>break<EOL><DEDENT><DEDENT>if res_idx is None:<EOL><INDENT>print('<STR_LIT>', probabilities)<EOL>raise AttributeError("<STR_LIT>")<EOL><DEDENT>return res_idx<EOL>
!
        @brief Returns index in probabilities.

        @param[in] probabilities (list): List with segments in increasing sequence with val in [0, 1],
                   for example, [0 0.1 0.2 0.3 1.0].