Compares the magnetic orderings of one structure with another.
        :param other: Structure
        :return (bool):
509650
def matches_ordering(self, other):
        

        a = CollinearMagneticStructureAnalyzer(
            self.structure, overwrite_magmom_mode="normalize"
        ).get_structure_with_spin()

        # sign of spins doesn't matter, so we're comparing both
        # positive and negative versions of the structure
        # this code is possibly redundant, but is included out of
        # an abundance of caution
        b_positive = CollinearMagneticStructureAnalyzer(
            other, overwrite_magmom_mode="normalize", make_primitive=False
        )

        b_negative = b_positive.structure.copy()
        b_negative.add_site_property(
            "magmom", np.multiply(-1, b_negative.site_properties["magmom"])
        )

        b_negative = CollinearMagneticStructureAnalyzer(
            b_negative, overwrite_magmom_mode="normalize", make_primitive=False
        )

        b_positive = b_positive.get_structure_with_spin()
        b_negative = b_negative.get_structure_with_spin()

        if a.matches(b_positive) or a.matches(
            b_negative
        ):  # sometimes returns None (bug?)
            return True
        else:
            return False
438522
public boolean isEquivalent(CrystalTransform other) {
		Matrix4d mul = new Matrix4d();
		mul.mul(this.matTransform,other.matTransform);

		if (mul.epsilonEquals(IDENTITY, 0.0001)) {
			return true;
		}
		return false;
	}
904368
def __compare_helper(self, other, condition, notimpl_target):
        
        if not isinstance(other, self.__class__):
            return NotImplemented

        cmp_res = self.__cmp__(other)
        if cmp_res is NotImplemented:
            return notimpl_target

        return condition(cmp_res)
956479
def equality(self, other):
        
        # Compare specified attributes for equality
        cname = self.__class__.__name__
        for aname in self.attributes:
            try:
                attr1 = getattr(self, aname)
                attr2 = getattr(other, aname)
            except AttributeError as error:
                logging.debug("%s.%s: %s", cname, aname, error)
                return False
            self.log(attr1, attr2, '==', cname=cname, aname=aname)
            eql = (attr1 == attr2)
            self.log(attr1, attr2, '==', cname=cname, aname=aname, result=eql)
            if not eql:
                return False

        return True
1310815
def equals(self, other):
        ''' 

        '''

        # NOTE: don't try to use this to implement __eq__. Because then
        # you will be tempted to implement __hash__, which would interfere
        # with mutability of models. However, not implementing __hash__
        # will make bokeh unusable in Python 3, where proper implementation
        # of __hash__ is required when implementing __eq__.
        if not isinstance(other, self.__class__):
            return False
        else:
            return self.properties_with_values() == other.properties_with_values()
508860
def diff(self, other):
        
        diff = {}
        for k in self.__class__.defaults:
            left = getattr(self, k)
            right = getattr(other, k)
            if left != right:
                diff[k] = (left, right)
        return diff
756723
public boolean eq(IntIntSortedVector other) {
        // This is slow, but correct.
        IntIntSortedVector v1 = IntIntSortedVector.getWithNoZeroValues(this);
        IntIntSortedVector v2 = IntIntSortedVector.getWithNoZeroValues(other);
                
        if (v2.size() != v1.size()) {
            return false;
        }

        for (IntIntEntry ve : v1) {
            if (!Primitives.equals(ve.get(), v2.get(ve.index()))) {
                return false;
            }
        }
        for (IntIntEntry ve : v2) {
            if (!Primitives.equals(ve.get(), v1.get(ve.index()))) {
                return false;
            }
        }
        return true;
    }
1216806
def contains(self, other):
        
        return (self.left <= other.left and
                self.right >= other.right and
                self.top >= other.top and
                self.bottom <= other.bottom)
400089
def sge(self, other):
        
        self._check_match(other)
        return self.to_sint() >= other.to_sint()
549340
def is_domain_equal(self, other):
        
        domain = self.get_domain()
        other_domain = other.get_domain()
        # if they share the same instance of memory for the domain
        if domain == other_domain:
            return True
        else:
            return False
1045631
def slt(self, other):
        
        self._check_match(other)
        return self.to_sint() < other.to_sint()
1264261
def sle(self, other):
        
        self._check_match(other)
        return self.to_sint() <= other.to_sint()
766696
def equals(self, other):
        
        if self.is_dtype_equal(other):
            if self.categories.equals(other.categories):
                # fastpath to avoid re-coding
                other_codes = other._codes
            else:
                other_codes = _recode_for_categories(other.codes,
                                                     other.categories,
                                                     self.categories)
            return np.array_equal(self._codes, other_codes)
        return False
186919
private int compareToLFU( CacheEntry other ) {

        int cmp = compareReadCount( other );
        if ( cmp != 0 ) {
            return cmp;
        }

        cmp = compareTime( other );
        if ( cmp != 0 ) {
            return cmp;
        }

        return compareOrder( other );
    }
614557
def is_equal(self, other):
        
        other = self.coerce(other)
        return len(self.get_values().symmetric_difference(other.get_values())) == 0
503687
def align_to_other(self, other, mapping, self_root_pair, other_root_pair = None):
        '''
        
        '''
        if other_root_pair == None:
            other_root_pair = self_root_pair

        assert( len(self_root_pair) == len(other_root_pair) )

        unmoved_atom_names = []
        new_coords = [ None for x in xrange( len(self_root_pair) ) ]
        for atom in self.names:
            if atom in self_root_pair:
                i = self_root_pair.index(atom)
                assert( new_coords[i] == None )
                new_coords[i] = self.get_coords_for_name(atom)

            if atom in mapping:
                other_atom = mapping[atom]
                self.set_coords_for_name( atom, other.get_coords_for_name(other_atom) )
            else:
                unmoved_atom_names.append(atom)

        # Move unmoved coordinates after all other atoms have been moved (so that
        # references will have been moved already)
        if None in new_coords:
            print new_coords
            assert( None not in new_coords )
        ref_coords = [other.get_coords_for_name(x) for x in other_root_pair]

        # Calculate translation and rotation matrices
        U, new_centroid, ref_centroid = calc_rotation_translation_matrices( ref_coords, new_coords )
        for atom in unmoved_atom_names:
            original_coord = self.get_coords_for_name(atom)
            self.set_coords_for_name( atom, rotate_and_translate_coord(original_coord, U, new_centroid, ref_centroid) )
        self.chain = other.chain
758293
def identical(self, other):
        
        try:
            return (utils.dict_equiv(self.attrs, other.attrs) and
                    self.equals(other))
        except (TypeError, AttributeError):
            return False