Compares the given time zone representations. Returns a negative number if a is less than b, a positive number if a is greater than b, or zero if a and b are equal.
178986
function compareTimeZones(a, b) {
    if (typeof a !== 'string' || typeof b !== 'string') {
      return NaN;
    }

    return normalizeIso8601TimeZone(a) - normalizeIso8601TimeZone(b);
  }
716819
function compareDates(a, b) {
    var aTimestamp = convertToTimestamp(a);
    var bTimestamp = convertToTimestamp(b);

    if (isNaN(aTimestamp) || isNaN(bTimestamp)) {
      return NaN;
    } else {
      return aTimestamp - bTimestamp;
    }
  }
74838
def less_than(self, less_than):
        

        if hasattr(less_than, 'strftime'):
            less_than = datetime_as_utc(less_than).strftime('%Y-%m-%d %H:%M:%S')
        elif isinstance(less_than, six.string_types):
            raise QueryTypeError('Expected value of type `int` or instance of `datetime`, not %s' % type(less_than))

        return self._add_condition('<', less_than, types=[int, str])
54764
public final int compareTo(final Dur arg0) {
        int result;
        if (isNegative() != arg0.isNegative()) {
            // return Boolean.valueOf(isNegative()).compareTo(Boolean.valueOf(arg0.isNegative()));
            // for pre-java 1.5 compatibility..
            if (isNegative()) {
                return Integer.MIN_VALUE;
            }
            else {
                return Integer.MAX_VALUE;
            }
        }
        else if (getWeeks() != arg0.getWeeks()) {
            result = getWeeks() - arg0.getWeeks();
        }
        else if (getDays() != arg0.getDays()) {
            result = getDays() - arg0.getDays();
        }
        else if (getHours() != arg0.getHours()) {
            result = getHours() - arg0.getHours();
        }
        else if (getMinutes() != arg0.getMinutes()) {
            result = getMinutes() - arg0.getMinutes();
        }
        else {
            result = getSeconds() - arg0.getSeconds();
        }
        // invert sense of all tests if both durations are negative
        if (isNegative()) {
            return -result;
        }
        else {
            return result;
        }
    }
976462
def is_older_than(before, seconds):
    """"""
    if isinstance(before, six.string_types):
        before = parse_strtime(before).replace(tzinfo=None)
    else:
        before = before.replace(tzinfo=None)

    return utcnow() - before > datetime.timedelta(seconds=seconds)
842982
public static function compareInstancesByStartTime($a, $b) {
		$start_a = $a->getStartTimestamp();
		$start_b = $b->getStartTimestamp();
		if ($start_a == $start_b) {
			return 0;
		}
		return ($start_a < $start_b) ? -1 : 1;
	}
327628
function normalizeIso8601TimeZone(value) {
    if (value === 'Z') {
      return 0;
    }

    var regex = /^([+-])(\d\d):?(\d\d)$/;
    var matches = regex.exec(value);
    if (matches === null) {
      return NaN;
    } else {
      var multiplicationFactor = (matches[1] === '+') ? 1 : -1;
      var hour = parseInt(matches[2], 10);
      var minute = parseInt(matches[3], 10);

      return multiplicationFactor * ((hour * 60) + minute);
    }
  }
245692
def sub_match?(time, accessor, values)

      return true if values.nil?

      value = time.send(accessor)

      if accessor == :day

        values.each do |v|
          return true if v == 'L' && (time + DAY_S).day == 1
          return true if v.to_i < 0 && (time + (1 - v) * DAY_S).day == 1
        end
      end

      if accessor == :hour

        return true if value == 0 && values.include?(24)
      end

      if accessor == :monthdays

        return true if (values & value).any?
      end

      values.include?(value)
    end
784901
protected static function compareZone(DateTime $a, DateTime $b) {
        if (false === DateTimeZoneHelper::equals($a->getTimezone(), $b->getTimezone())) {
            throw new IllegalArgumentException("The two date/times does not have the same time zone");
        }
    }
353075
@Override
  public GallicWeight times(GallicWeight a, GallicWeight b) {
    if (isZero(a) || isZero(b)) {
      return zero;
    }
    IntArrayList newOutputLabels = new IntArrayList();
    newOutputLabels.addAll(a.getLabels());
    newOutputLabels.addAll(b.getLabels());
    double newWeight = this.weightSemiring.times(a.getWeight(), b.getWeight());
    return GallicWeight.create(newOutputLabels, newWeight);
  }
1015539
function compare(a, b) {
  invariant(typeof a === typeof b, '"a" and "b" must be of the same type');

  if (a > b) {
    return 1;
  } else if (a < b) {
    return -1;
  } else {
    return 0;
  }
}
1345663
function compare(a, b) {
    if (Type.isString(a)) {
        return a === b;
    } else if (Type.isNumber(a)) {
        if (isNaN(a) || isNaN(b)) {
            return isNaN(a) === isNaN(b);
        }
        return a === b;
    } else if (Type.isBoolean(a)) {
        return a === b;
    } else if (Type.isDate(a) && Type.isDate(b)) {
        return a.getTime() === b.getTime();
    } else if (Type.isRegExp(a) && Type.isRegExp(b)) {
        return a.source === b.source;
    } else if (Type.isArray(a) && Type.isArray(b)) {
        // check references first
        if (a === b) {
            return true;
        }
        return a.every(function (item, index) {
            try {
                return compare(item, b[index]);
            } catch (e) {
                throw e;
            }
        });
    } else if (Type.isObject(a) && Type.isObject(b)) {
        var equal = [];
        // check references first
        if (a === b) {
            return true;
        }

        try {
            for (var key in a) {
                equal.push(compare(a[key], b[key]));
            }
        } catch (e) {
            throw e;
        }
        return equal.every(function (item) {
            return item === true;
        });
        /// compare undefined and nulls and nans
    } else if (a === b) {
        return true;
    }

    return false;
}
354578
private boolean lessThanOrEqual(
         byte[] a,
         byte[] b)
    {
         if (a.length <= b.length)
         {
             for (int i = 0; i != a.length; i++)
             {
                 int    l = a[i] & 0xff;
                 int    r = b[i] & 0xff;

                 if (r > l)
                 {
                     return true;
                 }
                 else if (l > r)
                 {
                     return false;
                 }
             }

             return true;
         }
         else
         {
             for (int i = 0; i != b.length; i++)
             {
                 int    l = a[i] & 0xff;
                 int    r = b[i] & 0xff;

                 if (r > l)
                 {
                     return true;
                 }
                 else if (l > r)
                 {
                     return false;
                 }
             }

             return false;
         }
    }
825312
@Override
    public int compareTo(PlainTime time) {

        int delta = this.hour - time.hour;

        if (delta == 0) {
            delta = this.minute - time.minute;
            if (delta == 0) {
                delta = this.second - time.second;
                if (delta == 0) {
                    delta = this.nano - time.nano;
                }
            }
        }

        return ((delta < 0) ? -1 : ((delta == 0) ? 0 : 1));

    }
409614
def compare(a, b):
    
    s=0
    for i in range(len(a)):
        s=s+abs(a[i]-b[i])
    return s
738958
@Override
  public int compareTo(VersionInfo other) {
    if (this.timestamp == other.timestamp) {
      return 0;
    }
    if (this.timestamp < other.timestamp) {
      return 1;
    }
    return -1;
  }
53750
function compare (a, b) {
    if (a.timeStamp > b.timeStamp) {
      return -1;
    }
    if (a.timeStamp < b.timeStamp) {
      return 1;
    }

    return 0;
  }