code: def equiv(self, other):
          
          # Optimization for equality
          if self == other:
              return True
          elif (not isinstance(other, Weighting) or
                self.exponent != other.exponent):
              return False
          elif isinstance(other, MatrixWeighting):
              return other.equiv(self)
          elif isinstance(other, ConstWeighting):
              return np.array_equiv(self.array, other.const)
          else:
              return np.array_equal(self.array, other.array)
docs: Return True if other is an equivalent weighting.
  
          Returns
          -------
          equivalent : bool
              ``True`` if ``other`` is a `Weighting` instance with the same
              `Weighting.impl`, which yields the same result as this
              weighting for any input, ``False`` otherwise. This is checked
              by entry-wise comparison of arrays/constants.