compare the word to another
 currently checks for same class, though really identity of the characters
 in right order would suffice
517941
def compare( other )
      return false if other.class != self.class
      return false if other.length != self.length
      len = self.length - 1
      while(len >= 0)
        return false if self.get_char(len) != other.get_char(len)
        len = len - 1
      end
      return true
    end
758293
def identical(self, other):
        
        try:
            return (utils.dict_equiv(self.attrs, other.attrs) and
                    self.equals(other))
        except (TypeError, AttributeError):
            return False
159234
public int compareTo(OffsetCharSequence other) {
        int len1 = length();
        int len2 = other.length();
        int lim = Math.min(len1, len2);

        for (int i = 0; i  < lim; i++) {
            char c1 = charAt(i);
            char c2 = other.charAt(i);
            if (c1 != c2) {
                return c1 - c2;
            }
        }
        return len1 - len2;
    }
178999
public int compare(Class o1, Class o2) {
    String        s1;
    String        s2;
    int           i;
    int           result;
    int           v1;
    int           v2;

    result = 0;   // they're equal

    // get lower case string
    s1 = o1.getName().toLowerCase();
    s2 = o2.getName().toLowerCase();

    // same length
    s1 = fillUp(s1, s2.length());
    s2 = fillUp(s2, s1.length());

    for (i = 0; i < s1.length(); i++) {
      // same char?
      if (s1.charAt(i) == s2.charAt(i)) {
        result = 0;
      }
      else {
        v1 = charGroup(s1.charAt(i));
        v2 = charGroup(s2.charAt(i));

        // different type (special, number, letter)?
        if (v1 != v2) {
          if (v1 < v2)
            result = -1;
          else
            result = 1;
        }
        else {
          if (s1.charAt(i) < s2.charAt(i))
            result = -1;
          else
            result = 1;
        }

        break;
      }
    }

    return result;
  }
396678
def is_signature_equal(cls, sig_a, sig_b):
        """"""
        if len(sig_a) != len(sig_b):
            return False

        invalid_chars = 0
        for char_a, char_b in zip(sig_a, sig_b):
            if char_a != char_b:
                invalid_chars += 1
        return invalid_chars == 0
201450
def star_sep_check(self, original, loc, tokens):
        """"""
        return self.check_py("3", "keyword-only argument separator (add 'match' to front to produce universal code)", original, loc, tokens)
659968
public boolean contentEqualsIgnoreCase(CharSequence string) {
        if (string == null || string.length() != length()) {
            return false;
        }

        if (string.getClass() == AsciiString.class) {
            AsciiString rhs = (AsciiString) string;
            for (int i = arrayOffset(), j = rhs.arrayOffset(); i < length(); ++i, ++j) {
                if (!equalsIgnoreCase(value[i], rhs.value[j])) {
                    return false;
                }
            }
            return true;
        }

        for (int i = arrayOffset(), j = 0; i < length(); ++i, ++j) {
            if (!equalsIgnoreCase(b2c(value[i]), string.charAt(j))) {
                return false;
            }
        }
        return true;
    }
553587
function processToEqual( textContent ) {
      // using [\s\S] to match newline as well
      var matcher = /^(Expected )([\s\S]*?) ((?:not )?to (?:equal|be) )([\s\S]*?)\.$/;
      var matches = textContent.match( matcher );
      return matches && {
         prefix: matches[ 1 ],
         left: matches[ 2 ],
         relationText: matches[ 3 ],
         right: matches[ 4 ]
      };
   }
105278
def identical(self, other):
        
        return (self.equals(other) and
                all((getattr(self, c, None) == getattr(other, c, None)
                     for c in self._comparables)) and
                type(self) == type(other))
280916
def equals(self, other):
        """"""
        if isinstance(other, SSAEvent):
            return self.as_dict() == other.as_dict()
        else:
            raise TypeError("Cannot compare to non-SSAEvent object")
284758
public boolean precedesOrEqualsForAllOffsetTypesInBoth(final OffsetGroup other) {
    return charOffset().precedesOrEquals(other.charOffset())
        && edtOffset().precedesOrEquals(other.edtOffset())
        && (!byteOffset().isPresent() || !other.byteOffset().isPresent()
                || byteOffset().get().precedesOrEquals(other.byteOffset().get()))
        && (!asrTime().isPresent() || !other.asrTime().isPresent()
                || asrTime().get().precedesOrEquals(other.asrTime().get()));
  }
1343785
private static boolean matches(StringBuilder word, String val) {
        int len = word.length();
        if (len != val.length()) return false;

        // Start at index 1, assuming that the first characters have already
        // been checked to match.
        for (int index = 1; index < len; index++) {
            char cw = word.charAt(index);
            char cv = val.charAt(index);

            if (cw != cv) {
                return false;
            }
        }

        return true;
    }
912213
def does_match_definition(given, main, secondary):
    """"""
    assert isinstance(secondary, tuple)
    assert len(secondary) == 2  # general solution could be provided
    types = decompose_type(given)

    if isinstance(types[0], main):
        return True

    if len(types) >= 2:
        cond1 = isinstance(types[0], main)
        cond2 = isinstance(types[1], secondary)
        cond3 = isinstance(types[1], main)
        cond4 = isinstance(types[0], secondary)
        if (cond1 and cond2) or (cond3 and cond4):
            return True

        if len(types) >= 3:
            classes = set([tp.__class__ for tp in types[:3]])
            desired = set([main] + list(secondary))
            diff = classes.symmetric_difference(desired)
            if not diff:
                return True
            if len(diff) == 2:
                items = list(diff)
                return (
                    issubclass(
                        items[0], items[1]) or issubclass(items[1], items[0]))
            return False
    else:
        return False
1305368
def _compare_title(self, other):
        """"""

        # If title is omitted, assume a match
        if not self.title or not other.title:
            return True

        titles = set(self.title_list + other.title_list)

        return not (titles & MALE_TITLES and titles & FEMALE_TITLES)
1011402
def identifiers_comparaison(other, release)
      [identifiers(release).length, other.identifiers(release).length].max.times do |i|
        if identifiers(release)[i].class == other.identifiers(release)[i].class
          ans = identifiers(release)[i] <=> other.identifiers(release)[i]
          return ans if ans != 0
        elsif identifiers(release)[i] && other.identifiers(release)[i]
          return identifiers(release)[i].class.to_s <=> other.identifiers(release)[i].class.to_s
        elsif identifiers(release)[i] || other.identifiers(release)[i]
          return other.identifiers(release)[i].class.to_s <=> identifiers(release)[i].class.to_s
        end
      end
      0
    end
1075017
function correct(str, out, sep) {
    return out.split('').reduce(function(accu, x, i) {
        var o = str.charAt(accu.length);
        var p = str.charAt(accu.length-1);
        return (
            // Matches input
            similar(o, x) ?
            accu + o :
            // Does not match input
            ( (x != sep || p != accu[accu.length-1])?
                // If not a "sep" or a "sep" and previous chars differ
                accu + x :
                // Bad sep
                accu
            )
        );
    }, '');
}
640848
def match_classes(self, el, classes):
        """"""

        current_classes = self.get_classes(el)
        found = True
        for c in classes:
            if c not in current_classes:
                found = False
                break
        return found