code: def general_eq(a, b, attributes):
      
      try:
          for attr in attributes:
              _a, _b = getattr(a, attr), getattr(b, attr)
              if attr in ['phi', 'alpha']:
                  if not utils.eq(_a, _b):
                      return False
              elif attr in ['mechanism', 'purview']:
                  if _a is None or _b is None:
                      if _a != _b:
                          return False
                  elif not set(_a) == set(_b):
                      return False
              else:
                  if not numpy_aware_eq(_a, _b):
                      return False
          return True
      except AttributeError:
          return False
docs: Return whether two objects are equal up to the given attributes.
  
      If an attribute is called ``'phi'``, it is compared up to |PRECISION|.
      If an attribute is called ``'mechanism'`` or ``'purview'``, it is
      compared using set equality.  All other attributes are compared with
      :func:`numpy_aware_eq`.