add_from_string(buffer, length=-1)

        {{ all }}
551672
def add_from_string(self, buffer, length=-1):
        

        return Gtk.Builder.add_from_string(self, buffer, length)
261459
def alloc_buffer(self, length):
        

        buf = Buffer(sum(len(v) for v in six.iterkeys(self.data)) + sum(v.length for v in self.buffers), length)
        self.buffers.append(buf)
        return buf
521984
def get_string_from_data(self, offset, data):
        """"""
        
        # OC Patch
        b = None
        
        try:
            b = data[offset]
        except IndexError:
            return ''
        
        s = ''
        while ord(b):
            s += b
            offset += 1
            try:
                b = data[offset]
            except IndexError:
                break
        
        return s
49115
def _encode_buffer(string, f):
	""""""
	if isinstance(string, str):
		string = string.encode()
	f.write(str(len(string)).encode())
	f.write(_TYPE_SEP)
	f.write(string)
648210
def fromstring(s):
  
  ps = PatchSet( StringIO(s) )
  if ps.errors == 0:
    return ps
  return False
679388
public String _append(String str) {
	if (offset + size + 1 > arr.length) enlargeCapacity(size + 1);
	arr[offset + size] = str;
	size++;
	return str;
    }
752379
def puts(string)
      util = output
      util.write(prefix)
      util.puts(string)
      self
    end
1187078
def wrap(string, length, indent):
    
    newline = "\n" + " " * indent
    return newline.join((string[i : i + length] for i in range(0, len(string), length)))
1007540
def add_inputs_from_inputstring(self, input_string):
        
        raw_params = input_string.split('\n')
        param_attributes = (self._parse_param_line(rp) for rp in raw_params if len(rp.strip(' \t')) > 0)
        for param, attributes in param_attributes:
            self.add_input(param, attributes)
681696
def from_string(cls, string):
        
        cls.TYPE.setParseAction(cls.make)
        try:
            return cls.TYPE.parseString(string, parseAll=True)[0]
        except ParseException:
            log.error("Failed to parse '{0}'".format(string))
            raise
117596
function add(str, {split, last, only}={}) {
        if (only !== 'path') regex += str;
        if (filepath && only !== 'regex') {
            path.regex += (str === '\\/' ? SEP : str);
            if (split) {
                if (last) segment += str;
                if (segment !== '') {
                    if (!flags.includes('g')) segment = `^${segment}$`; // change it 'includes'
                    path.segments.push(new RegExp(segment, flags));
                }
                segment = '';
            } else {
                segment += str;
            }
        }
    }
1299126
def accumulate_str(self, buf):
        ''''''
        accum = self.crc
        import array
        bytes = array.array('B')
        bytes.fromstring(buf)
        self.accumulate(bytes)
811737
function stringify(start, end) {
  var values = []
  var positions = []
  var offsets = []

  add(start)
  add(end)

  if (positions.length !== 0) {
    values.push(positions.join('-'))
  }

  if (offsets.length !== 0) {
    values.push(offsets.join('-'))
  }

  return values.join(', ')

  // Add a position.
  function add(position) {
    var tuple = compile(position)

    if (tuple) {
      positions.push(tuple[0])

      if (tuple[1]) {
        offsets.push(tuple[1])
      }
    }
  }
}
15489
function appendBuffer(buffer1, buffer2) {
  var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);
  tmp.set(new Uint8Array(buffer1), 0);
  tmp.set(new Uint8Array(buffer2), buffer1.byteLength);
  return tmp.buffer;
}
930481
def PushBack(self, string='', **unused_kwargs):
    
    self.buffer = string + self.buffer
    self.processed_buffer = self.processed_buffer[:-len(string)]
616906
def add_str(window, line_num, str):
    
    try:
        window.addstr(line_num, 0, str)
    except curses.error:
        pass
903886
function stringToBuffer(data) {
    return (typeof Buffer.from === 'function' && Buffer.from !== Uint8Array.from) ?
        Buffer.from(data) : new Buffer(data);
}