code: def n_elements(self):
          
          if self.is_array:
              return functools.reduce(operator.mul, self.array_dimensions)
          else:
              return 1
docs: Total number of array elements.
          If array is multidimensional, array is flattened.
          Returns 1 if not an array.