Substract a Sequence from the current instance.

This method MUST retain the state of the current instance, and return
an instance that contains substracted intervals.
420855
public function substract(Sequence $sequence): self
    {
        if ($this->isEmpty()) {
            return $this;
        }

        $new = $sequence->reduce([$this, 'substractOne'], $this);
        if ($new->intervals === $this->intervals) {
            return $this;
        }

        return $new;
    }
843157
def subtract_and_get(self, delta):
        '''
        
        '''
        with self._lock.exclusive:
            self._value -= delta
            return self._value
1257710
def trimLeft(self, amount):
    
    if amount == 0:
      return
    self.sequenceData = self.sequenceData[amount:]
    self.sequenceQual = self.sequenceQual[amount:]
1173826
private ArrayList<Range<T>> subtractContained(Range<T> contained)
    {
        ArrayList<Range<T>> difference = new ArrayList<Range<T>>(2);

        if (!left.equals(contained.left))
            difference.add(new Range<T>(left, contained.left, partitioner));
        if (!right.equals(contained.right))
            difference.add(new Range<T>(contained.right, right, partitioner));
        return difference;
    }
808347
def subtract_afromb(*inputs, **kwargs):
    

    try:
        value_a = inputs[0].pop()
        value_b = inputs[1].pop()

        return [IOTileReading(0, 0, value_b.value - value_a.value)]
    except StreamEmptyError:
        return []
30427
def intervalsubtract(left, right, lstart='start', lstop='stop', rstart='start',
                     rstop='stop', lkey=None, rkey=None, include_stop=False):
    

    assert (lkey is None) == (rkey is None), \
        'facet key field must be provided for both or neither table'
    return IntervalSubtractView(left, right, lstart=lstart, lstop=lstop,
                                rstart=rstart, rstop=rstop, lkey=lkey,
                                rkey=rkey, include_stop=include_stop)
519183
def previous(time, base)
      current = time
      until match?(current, base) && current < time
        pot_prev = align(potential_previous(current, base), base)
        pot_prev -= min_step if pot_prev == current

        current = pot_prev
      end

      current
    end
712121
def get_last_sequence(self, cur=None):
        
        sql = 'SELECT sequence FROM {} ORDER BY sequence DESC LIMIT 1;'.format(self.subdomain_table)
        cursor = None
        if cur is None:
            cursor = self.conn.cursor()
        else:
            cursor = cur

        db_query_execute(cursor, sql, ())
        last_seq = None
        try:
            last_seq = cursor.fetchone()[0]
        except:
            last_seq = 0
        
        return int(last_seq)
897590
public static Interval oneToBy(int count, int step)
    {
        if (count < 1)
        {
            throw new IllegalArgumentException("Only positive ranges allowed using oneToBy");
        }
        return Interval.fromToBy(1, count, step);
    }
747467
def protract(self, x):
		
		for i in xrange(len(self)):
			self[i] = self[i].protract(x)
		return self.coalesce()
227765
def _insert_from_ordered_sequence(self, seq):
        
        if len(seq) == 0:
            return
        mid, greater, lesser = self._bisect(seq)
        self.insert(mid)
        self._insert_from_ordered_sequence(greater)
        self._insert_from_ordered_sequence(lesser)
1235821
def extract_specific_interval(self, interval_start, interval_end):
        

        interval_start = int(interval_start)
        interval_end = int(interval_end)

        if interval_start >= interval_end:
            raise ValueError("Requested interval's start point is past the requested end point.")

        elif interval_start > self.time_series.size:
            if self.repeat:
                interval_end = interval_end - interval_start
                interval_start = 0
            else:
                raise ValueError("Requested interval's start point is past the end of the time series.")

        if interval_end < self.time_series.size:
            interval = self.time_series[interval_start:interval_end]

        else:
            requested_interval_size = interval_end - interval_start
            remaining_signal = self.time_series[interval_start:self.time_series.size]

            if self.repeat:
                if requested_interval_size < self.time_series.size:
                    self._next_interval_start = requested_interval_size-remaining_signal.size
                    interval = np.hstack((remaining_signal, self.time_series[0:self._next_interval_start]))

                else:
                    repeated_signal = np.repeat(self.time_series, np.floor(requested_interval_size/self.time_series.size))
                    self._next_interval_start = requested_interval_size % self.time_series.size

                    interval = (np.hstack((remaining_signal, repeated_signal)))[0:requested_interval_size]

            else:
                self.warning("Returning last interval of the time series.")
                self._next_interval_start = self.time_series.size + 1

                samples_per_interval = self.interval_length*self.sample_rate
                interval = np.hstack((remaining_signal, np.zeros(samples_per_interval-remaining_signal.size)))

        return interval
602618
public void subtract(Object o) {
    Integer count = (Integer) cset.get(o);  
    if ( count != null ) { 
      int c = count.intValue()-1;
      if (c == 0) {
        cset.remove(o);
      }
      else {
        cset.put(o, new Integer(c)); 
      }
    }
  }
1087548
def p(self, sequence, subsequence=True):
        """"""
        if sequence[0] != self.startstate:
            if isinstance(sequence, tuple):
                sequence = (self.startstate,) + sequence
            else:
                sequence = (self.startstate,) + tuple(sequence)
        if self.endstate:
            if sequence[-1] != self.endstate:
                if isinstance(sequence, tuple):
                    sequence = sequence + (self.endstate,)
                else:
                    sequence = tuple(sequence) + (self.endstate,)

        prevnode = None
        prob = 1
        for node in sequence:
            if prevnode:
                try:
                    prob *= self.edges_out[prevnode][node]
                except:
                    return 0
        return prob
382324
def is_subsequence(short_seq, long_seq):
  """"""
  if not short_seq:
    return True
  pos = 0
  for x in long_seq:
    if pos == len(short_seq):
      return True
    if short_seq[pos] == x:
      pos += 1
  if pos == len(short_seq):
    return True
  return False
1277218
public static int subtractExact(int a, int b) {
        long result = (long) a - b;
        checkNoOverflow(result == (int) result);
        return (int) result;
    }
362237
def seq():
    
    current_frame     = inspect.currentframe().f_back
    trace_string      = ""
    while current_frame.f_back:
      trace_string = trace_string + current_frame.f_back.f_code.co_name
      current_frame = current_frame.f_back
    return counter.get_from_trace(trace_string)