original_docstring: Brings back shapes to a previously flattened array of weights.
          Returns weights dictionary where weights for L0 are under the 0 key and so on.
  
          >>> arr = np.array([0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5])
          >>> shapes = [(3, 2), (3, 2)]
          >>> MLTools.roll(arr, shapes)
          {0: array([[0, 1],
                 [2, 3],
                 [4, 5]]), 1: array([[0, 1],
                 [2, 3],
                 [4, 5]])}
          
docstring: Brings back shapes to a previously flattened array of weights.
  Returns weights dictionary where weights for L0 are under the 0 key and so on.
  
  
docstring_tokens: Brings back shapes to a previously flattened array of weights . Returns weights dictionary where weights for L0 are under the 0 key and so on .
code: def roll(arr, shapes):
          """Brings back shapes to a previously flattened array of weights.
          Returns weights dictionary where weights for L0 are under the 0 key and so on.
  
          >>> arr = np.array([0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5])
          >>> shapes = [(3, 2), (3, 2)]
          >>> MLTools.roll(arr, shapes)
          {0: array([[0, 1],
                 [2, 3],
                 [4, 5]]), 1: array([[0, 1],
                 [2, 3],
                 [4, 5]])}
          """
          thetas = {}
          start_idx = 0
          for idx, shape in enumerate(shapes):
  
              dim1, dim2 = shape
              end_idx = start_idx + (dim1 * dim2)
              thetas[idx] = arr[start_idx:end_idx].reshape(dim1, dim2)
              start_idx = end_idx
  
          return thetas
code_tokens: def roll ( arr , shapes ) : thetas = { } start_idx = 0 for idx , shape in enumerate ( shapes ) : dim1 , dim2 = shape end_idx = start_idx + ( dim1 * dim2 ) thetas [ idx ] = arr [ start_idx : end_idx ] . reshape ( dim1 , dim2 ) start_idx = end_idx return thetas
short_docstring: Brings back shapes to a previously flattened array of weights.
short_docstring_tokens: Brings back shapes to a previously flattened array of weights .
comment: """Brings back shapes to a previously flattened array of weights.
          Returns weights dictionary where weights for L0 are under the 0 key and so on.
  
          >>> arr = np.array([0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5])
          >>> shapes = [(3, 2), (3, 2)]
          >>> MLTools.roll(arr, shapes)
          {0: array([[0, 1],
                 [2, 3],
                 [4, 5]]), 1: array([[0, 1],
                 [2, 3],
                 [4, 5]])}
          """