truncate this fastqSequence in-place so it is only <size> nucleotides
      long

      :param size: the number of nucleotides to truncate to.
10658
def truncate(self, size):
    
    if size > len(self):
      raise NGSReadError("Trying to truncate NGS read to size " + str(size) +
                         ", but read is only " + str(len(self)) +
                         " nucleotides long")
    if size < 0:
      raise NGSReadError("Trying to truncate NGS read to size less than 0")

    self.trimRight(len(self) - size)
658561
function truncateSamples(samples) {
  /** @type {number} */   
  let len = samples.length;
  for (let i=0; i<len; i++) {
    if (samples[i] > 1) {
      samples[i] = 1;
    } else if (samples[i] < -1) {
      samples[i] = -1;
    }
  }
}
614170
public static String truncate(String str, int count)
    {
        if(count < 0 || str.length() <= count)
            return str;

        int pos = count;
        for(int i = count; i >= 0 && !Character.isWhitespace(str.charAt(i)); i--, pos--);
        return str.substring(0, pos)+"...";
    }
1249591
public Promise<Void> truncate(long size) {
		return sanitize(ofBlockingRunnable(executor, () -> {
			try {
				channel.truncate(size);
			} catch (IOException e) {
				throw new UncheckedException(e);
			}
		}));
	}
444564
def parse_size(size):
        
        if size.startswith('x'):
            return None, int(size.replace('x', ''))
        if 'x' in size:
            return int(size.split('x')[0]), int(size.split('x')[1])
        return int(size), None
997993
def resize(self, size):
        
        count = max(int(size), 0) - len(self)

        if count == 0:
            pass
        elif -count == len(self):
            self._value = bytes()
        elif count > 0:
            self._value += b'\x00' * count
        else:
            self._value = self._value[:count]
        size = len(self)
        self._bit_size = size * 8
        self._align_to_byte_size = size
1327612
def trunc(text, length):
    
    if length < 1:
        raise ValueError("length should be 1 or larger")

    # Remove whitespace first so no unneccesary truncation is done.
    text = text.strip()
    text_length = wcswidth(text)

    if text_length <= length:
        return text

    # We cannot just remove n characters from the end since we don't know how
    # wide these characters are and how it will affect text length.
    # Use wcwidth to determine how many characters need to be truncated.
    chars_to_truncate = 0
    trunc_length = 0
    for char in reversed(text):
        chars_to_truncate += 1
        trunc_length += wcwidth(char)
        if text_length - trunc_length <= length:
            break

    # Additional char to make room for elipsis
    n = chars_to_truncate + 1
    return text[:-n].strip() + '…'
204427
def calculate_size(name, sequence):
    
    data_size = 0
    data_size += calculate_size_str(name)
    data_size += LONG_SIZE_IN_BYTES
    return data_size
962691
def truncate(str, len = 80)
      if str and str.length > len and (add = str[len..-1].index(' '))
        str = str[0, len + add] + '&#8230;'
      end
      str
    end
491163
public static CharSequence truncate(CharSequence s, int len) {
    if (s.length() == len) return (s);
    if (s.length() > len) return (s.subSequence(0, len));
    StringBuilder result = new StringBuilder(s);
    while (result.length() < len)
      result.append(' ');
    return (result);
  }
1037248
def _truncate(value, arg):
        
        length = int(arg)
        if value is None:
            value = ""
        if len(value) > length:
            return value[:length] + "..."
        else:
            return value
926959
private static int sizeToInt(String size) {
		int position = size.indexOf('p');
		if (position < 0) {
			return Integer.parseInt(size);
		}
		return Integer.parseInt(size.substring(0, position));
	}
337528
public function truncate(int $size): bool
    {
        $this->size = $size;
        foreach (array_filter(array_keys($this->content),
                              function($pos) use ($size)
                              {
                                  return $pos >= $size;
                              }
                ) as $removePos) {
            unset($this->content[$removePos]);
        }

        return true;
    }
1349316
public static StringBuilder size(long size) {
        final StringBuilder buf = new StringBuilder(16);
        appendSize(buf, size);
        return buf;
    }
1022725
def truncate(string, width):
    
    if len(string) > width:
        return string[:width-3] + '...'
    else:
        return string.ljust(width)
156462
def _run_seq(self, size):
        

        # Write the sequence to the sequence generator (hw driver)
        self['SEQ'].write(size)  # write pattern to memory

        self['SEQ'].set_size(size)  # set size
        self['SEQ'].set_repeat(1)  # set repeat
        self['SEQ'].start()  # start

        while not self['SEQ'].get_done():
            time.sleep(0.01)
1343106
public int truncate(long upToSequenceNumber) {
        int count = 0;
        synchronized (this.lock) {
            // We truncate by finding the new head and simply pointing our head reference to it, as well as disconnecting
            // its predecessor node from it. We also need to mark every truncated node as such - this will instruct ongoing
            // reads to stop serving truncated data.
            while (this.head != null && this.head.item.getSequenceNumber() <= upToSequenceNumber) {
                this.head = trim(this.head);
                count++;
            }

            if (this.head == null) {
                this.tail = null;
            }
        }

        return count;
    }