returns 0, 1 or -1
971889
function(month, year1, year2) {
    var leap1 = isLeap(year1 - 1);
    var leap2 = isLeap(year2 - 1);

    if(month < 5 + leap1) return 0;
    return leap2 - leap1;
  }
1010738
def compar(self, x, y):
        '''
        

        '''

        indX=0
        indY=0

        a= int(x[0].split('-')[1])

        b= int(y[0].split('-')[1])


        if a>b:
            return 1
        if a==b:
            return 0
        if a<b:
            return -1
1272407
def lx(mt, x):
        
    if x < len(mt.lx):
        return mt.lx[x]
    else:
        return 0
1361541
function(array, obj)
	{
		if (array != null && obj != null)
		{
			for (var i = 0; i < array.length; i++)
			{
				if (array[i] == obj)
				{
					return i;
				}
			}
		}
		
		return -1;
	}
773774
def zero(self):
        """"""
        tmp = self.element()
        self.lincomb(0, tmp, 0, tmp, tmp)
        return tmp
371837
function compareNumericWithNaNs(x, y) {
    if (!isNaN(x) && !isNaN(y))
      return x - y;
    if (isNaN(x))
      return 1;
    if (isNaN(y))
      return -1;
    return 0;
  }
1033182
def j0_1(a=1):
    """

    def lhs(x):
        return x*np.exp(-a*x**2)

    def rhs(b):
        return np.exp(-b**2/(4*a))/(2*a)

    return Ghosh('j0', lhs, rhs)
26987
def count_sign(values, min_value):
    
    positive_count = 0
    negative_count = 0
    for value in values:
        if value > min_value:
            positive_count += 1
        elif value < -min_value:
            negative_count += 1
    return positive_count, negative_count
298979
def check_alpha(a):
    

    a = check_1d(a, "alpha")
    if any(map(lambda d: d <= 0, a)):
        raise Exception('Alpha cannot be 0 or negative')

    return a
88416
function(x) {
    if (x >= 2) { return -100; }
    if (x <= 0) { return 100; }

    var xx = (x < 1) ? x : 2 - x;
    var t = Math.sqrt(-2 * Math.log(xx / 2));

    var r = -0.70711 * ((2.30753 + t * 0.27061) /
            (1 + t * (0.99229 + t * 0.04481)) - t);

    for (var j = 0; j < 2; j++) {
      var err = erfc(r) - xx;
      r += err / (1.12837916709551257 * Math.exp(-(r * r)) - r * err);
    }

    return (x < 1) ? r : -r;
  }
1087140
private int findValue(String s) {

        for (int i = 0; i < values.size(); i++) {
            if (s.equals(values.elementAt(i))) {
                return i;
            }    // end of if (s.equals(values.elementAt(i)))
        }        // end of for (int i=0; i<values.size(); i++)

        return -1;
    }
116238
def int_0_inf(cls, string):
        '''
        '''
        if string == 'inf':
            return 0

        try:
            value = int(string)
        except ValueError as error:
            raise argparse.ArgumentTypeError(error)

        if value < 0:
            raise argparse.ArgumentTypeError(_('Value must not be negative.'))
        else:
            return value
1159759
function ( a, b) {
        if (typeof reverse === 'boolean' && reverse === true) {
            if (a[colindex] < b[colindex]) {
                return 1;
            }
            else if (a[colindex] > b[colindex]) {
                return -1;
            }
            else {
                return 0;
            }
        }
        else {
            if (a[colindex] < b[colindex]) {
                return -1;
            }
            else if (a[colindex] > b[colindex]) {
                return 1;
            }
            else {
                return 0;
            }
        }
    }
1016003
def _is_zero(x):
    
    if x is None:
        return True
    if isinstance(x, numbers.Number):
        return x == 0.0
    if isinstance(x, np.ndarray):
        return np.all(x == 0)
    return False
1315500
def srp1(*args, **kargs):
    """"""
    ans, _ = srp(*args, **kargs)
    if len(ans) > 0:
        return ans[0][1]
    else:
        return None
1022840
function indexOf(arr, value, start) {
  start = start || 0;
  if (arr == null) {
    return -1;
  }
  var len = arr.length;
  var i = start < 0 ? len + start : start;
  while (i < len) {
    if (arr[i] === value) {
      return i;
    }
    i++;
  }
  return -1;
}
932902
function(a, el, sType, fn) {
                for (var i=0, l=a.length; i<l; i=i+1) {
                    var li = a[i];
                    if ( li                 && 
                         li[this.FN] == fn  && 
                         li[this.EL] == el  && 
                         li[this.TYPE] == sType ) {
                        return i;
                    }
                }

                return -1;
            }