code: def make_reber_classification(
      n_samples,
      invalid_size=0.5,
      lenrange=(3, 14),
      return_indices=False,
  ):
      """
      Generate random dataset for Reber grammar classification.
      Invalid words contains the same letters as at Reber grammar, but
      they are build without grammar rules.
  
      Parameters
      ----------
      n_samples : int
          Number of samples in dataset.
  
      invalid_size : float
          Proportion of invalid words in dataset, defaults to ``0.5``.
          Value must be between ``0`` and ``1``.
  
      lenrange : tuple
          Length of each word will be bounded by the two numbers
          specified in this range. Defaults to ``(3, 14)``.
  
      return_indices : bool
          If ``True``, each word will be converted to array where each
          letter converted to the index. Defaults to ``False``.
  
      Returns
      -------
      tuple
          Return two lists. First contains words and second - labels for them.
  
      Examples
      --------
      >>> from neupy.datasets import make_reber_classification
      >>>
      >>> data, labels = make_reber_classification(10, invalid_size=0.5)
      >>> data
      array(['SXSXVSXXVX', 'VVPS', 'VVPSXTTS', 'VVS', 'VXVS', 'VVS',
             'PPTTTXPSPTV', 'VTTSXVPTXVXT', 'VSSXSTX', 'TTXVS'],
            dtype='<U12')
      >>> labels
      array([0, 1, 0, 1, 1, 1, 0, 0, 0, 1])
      >>>
      >>> data, labels = make_reber_classification(
      ...     4, invalid_size=0.5, return_indices=True)
      >>> data
      array([array([1, 3, 1, 4]),
             array([0, 3, 0, 3, 0, 4, 3, 0, 4, 4]),
             array([1, 3, 1, 2, 3, 1, 2, 4]),
             array([0, 3, 0, 0, 3, 0, 4, 2, 4, 1, 0, 4, 0])], dtype=object)
      """
      if n_samples < 2:
          raise ValueError("There are must be at least 2 samples")
  
      if not 0 < invalid_size < 1:
          raise ValueError(
              "`invalid_size` argument value must be between "
              "zero and one, got {}".format(invalid_size)
          )
  
      n_valid_words = int(math.ceil(n_samples * invalid_size))
      n_invalid_words = n_samples - n_valid_words
  
      valid_words = make_reber(n_valid_words)
      valid_labels = [1] * n_valid_words
  
      invalid_words = []
      invalid_labels = [0] * n_valid_words
  
      for i in range(n_invalid_words):
          word_length = randint(*lenrange)
          word = [choice(avaliable_letters) for _ in range(word_length)]
          invalid_words.append("".join(word))
  
      samples = np.array(valid_words + invalid_words)
      labels = np.array(valid_labels + invalid_labels)
  
      indices = np.arange(len(samples))
      np.random.shuffle(indices)
  
      samples, labels = samples[indices], labels[indices]
  
      if return_indices:
          samples = convert_letters_to_indices(samples)
  
      return samples, labels
  
imports: import math
  from random import choice, randint
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: make_reber_classification(n_samples, invalid_size, lenrange, return_indices) and returns: samples,  labels