Implement divison for timedelta instances.

    :param first: First timedelta instance.
    :param second: Second timedelta instance.
553490
def timedelta_div(first: datetime.timedelta,
                  second: datetime.timedelta) -> Optional[float]:
    
    first_seconds = timedelta_seconds(first)
    second_seconds = timedelta_seconds(second)

    if not second_seconds:
        return None

    return first_seconds / second_seconds
1242666
def add_seconds(self, datetimestr, n):
        
        a_datetime = self.parse_datetime(datetimestr)
        return a_datetime + timedelta(seconds=n)
856124
def delta(d1, d2, opt='d'):
    
    delta = 0

    if opt == 'm':
        while True:
            mdays = monthrange(d1.year, d1.month)[1]
            d1 += timedelta(days=mdays)
            if d1 <= d2:
                delta += 1
            else:
                break
    else:
        delta = (d2 - d1).days

    return delta
696998
@Beta
    public static <T> Predicate<T> nand(Predicate<? super T> first, Predicate<? super T> second) {
        return com.google.common.base.Predicates.not(com.google.common.base.Predicates.and(first, second));
    }
415164
public double calculateScore(int first, int second) {
        //Score is -log P(out|in)
        double prob = calculateProb(first, second);
        return -FastMath.log(prob);
    }
243992
def div(a,b):
    
    res, fail = divmod(a,b)
    if fail:
        raise ValueError("%r does not divide %r" % (b,a))
    else:
        return res
1288241
public static <S extends Solution<?>> double distanceBetweenObjectives(S firstSolution, S secondSolution) {

    double diff;
    double distance = 0.0;

    //euclidean distance
    for (int nObj = 0; nObj < firstSolution.getNumberOfObjectives(); nObj++) {
      diff = firstSolution.getObjective(nObj) - secondSolution.getObjective(nObj);
      distance += Math.pow(diff, 2.0);
    }

    return Math.sqrt(distance);
  }
794762
public double getCount(F first, S second) {
        Counter<S> counter = maps.get(first);
        if (counter == null)
            return 0.0;

        return counter.getCount(second);
    }
1069963
def _seconds_or_timedelta(duration):
    
    if isinstance(duration, int):
        dt_timedelta = timedelta(seconds=duration)
    elif isinstance(duration, timedelta):
        dt_timedelta = duration
    else:
        raise TypeError(
            'Expects argument as `datetime.timedelta` object '
            'or seconds in `int` format'
        )

    return dt_timedelta
778602
def timedelta_seconds(value: datetime.timedelta) -> int:
    
    return SECONDS_PER_DAY * value.days + value.seconds
1002414
def second(self):
        ''''''
        self.magnification = 1
        self._update(self.baseNumber, self.magnification)
        return self
634450
public static String subtractSeq(String first, String second, String delimiter) {
    if (isEmpty(first)) { return ""; }
    if (isEmpty(second)) {
      StringBuilder builder = new StringBuilder();
      if (!first.startsWith(delimiter)) builder.append(delimiter).append(first);
      if (!first.endsWith(delimiter)) builder.append(first).append(delimiter);
      return builder.toString();
    }
    List<String> firstSeq = Arrays.asList(split(first, delimiter));
    List<String> secondSeq = Arrays.asList(split(second, delimiter));
    Collection<String> rs = CollectUtils.subtract(firstSeq, secondSeq);
    StringBuilder buf = new StringBuilder();
    for (final String ele : rs)
      buf.append(delimiter).append(ele);
    if (buf.length() > 0) buf.append(delimiter);
    return buf.toString();
  }
1223061
def merge(cls, first, second):
        
        merged = AttributeList([], None)

        assert (isinstance(first, AttributeList))
        assert (isinstance(second, AttributeList))
        merged._contents = first._contents[:]
        merged._contents += second._contents[:]

        return merged
173947
public void elemDivide(VTensor other) {
        checkEqualSize(this, other);
        for (int c = 0; c < this.size(); c++) {
            divideValue(c, other.getValue(c));
        }
    }
847875
def otherwise(first, second)
      first = first.to_s
      first.empty? ? second : first
    end
1043693
public FloatPoint Divide(FloatPoint point1, FloatPoint point2) {
        FloatPoint result = new FloatPoint(point1);
        result.Divide(point2);
        return result;
    }
734420
public double distance(Instance first, Instance second) {
    return Math.sqrt(distance(first, second, Double.POSITIVE_INFINITY));
  }