Tells whether the given other_value is considered the same value as the
internally set value of this valueholder.

@param float $other_value number value to compare

@return boolean true if the given value is considered the same value as the internal one
542246
protected function valueEquals($other_value)
    {
        if (!is_float($other_value)) {
            return false;
        }

        return $this->almostEqual($this->getValue(), $other_value, $this->getEpsilon());
        //return (abs($this->getValue() - $other_value) < $this->getEpsilon());
    }
466823
public function equals($other)
    {
        $value = $other instanceof Value ? $other->getValue() : $other;

        return $this->getValue() === $value;
    }
52626
private boolean attributeEquals(Object value, Object otherValue) {
        if (value == null && otherValue == null) {
            return true;
        } else if (value == null || otherValue == null) {
            return false;
        } else {
            if (value.getClass().isArray()) {
                return Arrays.equals((Object[]) value, (Object[]) otherValue);
                  
            } else {
                return value.equals(otherValue);
            }
        }
    }
830562
public function compareTo($other)
    {
        if ($other === null) {
            return false;
        }
        if ($other instanceof IntegerNode) {
            return $this->getDenominator() == 1 && $this->getNumerator() == $other->getValue();
        }
        if (!($other instanceof RationalNode)) {
            return false;
        }

        return $this->getNumerator() == $other->getNumerator() && $this->getDenominator() == $other->getDenominator();
    }
492393
public function equals(RDN $other): bool
    {
        // if attribute count doesn't match
        if (count($this) != count($other)) {
            return false;
        }
        $attribs1 = $this->_attribs;
        $attribs2 = $other->_attribs;
        // if there's multiple attributes, sort using SET OF rules
        if (count($attribs1) > 1) {
            $attribs1 = self::fromASN1($this->toASN1())->_attribs;
            $attribs2 = self::fromASN1($other->toASN1())->_attribs;
        }
        for ($i = count($attribs1) - 1; $i >= 0; --$i) {
            $tv1 = $attribs1[$i];
            $tv2 = $attribs2[$i];
            if (!$tv1->equals($tv2)) {
                return false;
            }
        }
        return true;
    }
98101
def value_right(self, other):
    
    return self if isinstance(other, self.__class__) else self.value
637138
def contains_any(self, other):
        
        return self.value == other.value or self.value & other.value
1146335
public function equal($other, $trim = false)
    {
        $this->isString();

        if (false === $trim) {
            return parent::equal($other);
        }

        return $this->doCheck(function ($value) use ($other) {
            $this->throwExceptionIfFalse(
                trim($value) === trim($other),
                'Value %s is not equal to %s', $value, $other
            );
        });
    }
20648
def equals(self, other):
        
        if self.is_(other):
            return True

        if not isinstance(other, Index):
            return False

        if not isinstance(other, MultiIndex):
            other_vals = com.values_from_object(ensure_index(other))
            return array_equivalent(self._ndarray_values, other_vals)

        if self.nlevels != other.nlevels:
            return False

        if len(self) != len(other):
            return False

        for i in range(self.nlevels):
            self_codes = self.codes[i]
            self_codes = self_codes[self_codes != -1]
            self_values = algos.take_nd(np.asarray(self.levels[i]._values),
                                        self_codes, allow_fill=False)

            other_codes = other.codes[i]
            other_codes = other_codes[other_codes != -1]
            other_values = algos.take_nd(
                np.asarray(other.levels[i]._values),
                other_codes, allow_fill=False)

            # since we use NaT both datetime64 and timedelta64
            # we can have a situation where a level is typed say
            # timedelta64 in self (IOW it has other values than NaT)
            # but types datetime64 in other (where its all NaT)
            # but these are equivalent
            if len(self_values) == 0 and len(other_values) == 0:
                continue

            if not array_equivalent(self_values, other_values):
                return False

        return True
1050357
public boolean sameAs(BlockType other) {
        if (!this.isValid) {
            return !other.isValid && (this.isTop == other.isTop);
        } else {
            if (!other.isValid) {
                return false;
            } else {
                // Both facts are valid
                if (this.depth != other.depth) {
                    return false;
                }

                // Compare bits
                for (int i = 0; i < this.depth; ++i) {
                    if (this.get(i) != other.get(i)) {
                        return false;
                    }
                }

                return true;
            }
        }
    }
164295
protected function valueEquals($other_value)
    {
        if (!$other_value instanceof EntityList) {
            return false;
        }

        $entities = $this->getValue();

        if (count($entities) !== count($other_value)) {
            return false;
        }

        foreach ($entities as $index => $entity) {
            if (!$entity->isEqualTo($other_value->getItem($index))) {
                return false;
            }
        }

        return true;
    }
243298
public function contains(Clause $other_clause)
    {
        if (count($other_clause->possibilities) > count($this->possibilities)) {
            return false;
        }

        foreach ($other_clause->possibilities as $var => $possible_types) {
            if (!isset($this->possibilities[$var]) || count(array_diff($possible_types, $this->possibilities[$var]))) {
                return false;
            }
        }

        return true;
    }
1361640
public function isEqual(EnumSet $other): bool
    {
        return $this->enumeration === $other->enumeration
            && $this->bitset === $other->bitset;
    }
427752
public boolean similar(Object other) {
        if (!(other instanceof JSONArray)) {
            return false;
        }
        int len = this.length();
        if (len != ((JSONArray)other).length()) {
            return false;
        }
        for (int i = 0; i < len; i += 1) {
            Object valueThis = this.get(i);
            Object valueOther = ((JSONArray)other).get(i);
            if (valueThis instanceof JSONObject) {
                if (!((JSONObject)valueThis).similar(valueOther)) {
                    return false;
                }
            } else if (valueThis instanceof JSONArray) {
                if (!((JSONArray)valueThis).similar(valueOther)) {
                    return false;
                }
            } else if (!valueThis.equals(valueOther)) {
                return false;
            }
        }
        return true;
    }
339192
protected function matches($other): bool
    {
        if (is_array($other)) {
            $success = null;
            foreach ($other as $item) {
                $currentSuccess = $this->matchesSection($item);
                $success = ($success === null ? $currentSuccess : $success || $currentSuccess);
            }
            return !empty($success);
        } else {
            return $this->matchesSection($other);
        }
    }
822440
public function isEqual($other)
    {
        return !($other instanceof self) ?
            false :
            ($this->id === $other->id && $this->customerId === $other->customerId);
    }
1371041
private function hasSameColumnLengths(self $other) : bool
    {
        $filter = static function (?int $length) : bool {
            return $length !== null;
        };

        return array_filter($this->options['lengths'] ?? [], $filter)
            === array_filter($other->options['lengths'] ?? [], $filter);
    }