Add an internal value  to a string
974909
def addfield(self, pkt, s, val):
        """"""
        tmp_len = self.length_of(pkt)
        if tmp_len == 0:
            return s
        internal = self.i2m(pkt, val)[-tmp_len:]
        return s + struct.pack("!%ds" % tmp_len, internal)
936015
def indent(self, value):
        """"""
        # Explicit indent setting
        if isinstance(value, str):
            if value.isspace() or len(value) == 0:
                self._indent = value
            else:
                raise ValueError('String indentation can only contain '
                                 'whitespace.')

        # Set indent width
        elif isinstance(value, int):
            if value >= 0:
                self._indent = value * ' '
            else:
                raise ValueError('Indentation spacing must be nonnegative.')

        else:
            raise TypeError('Indentation must be specified by string or space '
                            'width.')
933231
def add(cls, name, value):
        """"""
        attr = cls(value)
        attr._name = name
        setattr(cls, name, attr)
441366
private String addAndEncode(String originalValue, String newType,
      String newValue, boolean encode) {
    if (newValue == null) {
      return originalValue;
    } else {
      String finalNewValue;
      if (encode) {
        if (newType == null) {
          finalNewValue = new String(
              enc.encode(newValue.getBytes(StandardCharsets.UTF_8)),
              StandardCharsets.UTF_8);
        } else {
          finalNewValue = new String(
              enc.encode(newType.getBytes(StandardCharsets.UTF_8)),
              StandardCharsets.UTF_8)
              + ":"
              + new String(
                  enc.encode(newValue.getBytes(StandardCharsets.UTF_8)),
                  StandardCharsets.UTF_8);
        }
      } else {
        finalNewValue = newValue;
      }
      if (originalValue == null || originalValue.isEmpty()) {
        return finalNewValue;
      } else {
        return originalValue + (encode ? " " : "") + finalNewValue;
      }
    }
  }
616906
def add_str(window, line_num, str):
    
    try:
        window.addstr(line_num, 0, str)
    except curses.error:
        pass
292289
public void put(String key, Character value) {
		if (this.compiledStatement != null) {
			if (value == null) {
				this.compiledStatement.bindNull(compiledStatementBindIndex++);
			} else {
				compiledStatement.bindLong(compiledStatementBindIndex++, Character.getNumericValue(value));
			}
		} else if (values != null) {
			values.put(key, Character.getNumericValue(value));
			return;
		}

		names.add(key);
		// values.put(key, value);
		args.add(value);
		valueType.add(ParamType.CHARACTER);
	}
583270
def addCodedValue(self, name, code):
        
        i = {"name" : name, "code" : code}
        if i not in self._codedValues:
            self._codedValues.append(i)
1089848
public void putShortString(String value)
    {
        checkAvailable(value.length() + 1);
        Wire.putShortString(needle, value);
    }
518864
def to_internal_value(self, data):
        
        if html.is_html_input(data):
            data = html.parse_html_dict(data)
        if not isinstance(data, dict):
            self.fail('not_a_dict', input_type=type(data).__name__)
        return {
            six.text_type(key): self.child.run_validation(value)
            for key, value in data.items()
        }
52015
function append(key, value, req) {
  var val = this.getKey(key, req)
    , str = typeof val === 'string';
  // doesn't exist becomes the empty string
  if(val === undefined) val = new Buffer('');
  if(!(val instanceof Buffer)) val = new Buffer('' + val);
  if(!(value instanceof Buffer)) value = new Buffer('' + value);
  // coerce numbers to strings
  //val = (val + '') + value;
  //val = val.concat()
  val = Buffer.concat([val, value], val.length + value.length);
  if(str) val = val.toString();
  this.setKey(key, val, undefined, undefined, undefined, req);
  return str ? Buffer.byteLength(val) : val.length;
}
1071550
def _expand(self, str, local_vars={}):
        """"""
        return ninja_syntax.expand(str, self.vars, local_vars)
127435
def _expand1(instring, noerror):
    """"""

    # first expand names in parentheses
    # note this works on nested names too, expanding from the
    # inside out (just like IRAF)
    mm = __re_var_paren.search(instring)
    while mm is not None:
        # remove embedded dollar signs from name
        varname = mm.group('varname').replace('$','')
        if defvar(varname):
            varname = envget(varname)
        elif noerror:
            varname = ""
        else:
            raise ValueError("Undefined variable `%s' in string `%s'" %
                             (varname, instring))

        instring = instring[:mm.start()] + varname + instring[mm.end():]
        mm = __re_var_paren.search(instring)
    # now expand variable name at start of string
    mm = __re_var_match.match(instring)
    if mm is None:
        return instring
    varname = mm.group('varname')
    if varname in ['', ' ', None]:
        mm = __re_var_match2.match(instring)
        varname = mm.group('varname')

    if defvar(varname):
        # recursively expand string after substitution
        return _expand1(envget(varname) + instring[mm.end():], noerror)
    elif noerror:
        return _expand1(varname + instring[mm.end():], noerror)
    else:
        raise ValueError("Undefined variable `%s' in string `%s'" %
                         (varname, instring))
442228
def add_from_string(self, strdata):
        """"""
        if self.tree is None:
            self.tree = tree = ET.ElementTree(ET.fromstring(strdata))
            self.root = tree.getroot()
            self.objects = {}
        else:
            # TODO: append to current tree
            pass
927399
public static void internAll(String[] strings) {
        for (int i = 0; i < strings.length; i++) {
            strings[i] = strings[i].intern();
        }
    }
1107304
private void internalWriteNameValuePair(String name, String value) throws IOException
   {
      writeComma();
      writeNewLineIndent();
      writeName(name);

      if (m_pretty)
      {
         m_writer.write(' ');
      }

      m_writer.write(value);
   }
889302
public void putString(String value)
    {
        if (value.length() > Byte.MAX_VALUE * 2 + 1) {
            putLongString(value);
        }
        else {
            putShortString(value);
        }
    }
679388
public String _append(String str) {
	if (offset + size + 1 > arr.length) enlargeCapacity(size + 1);
	arr[offset + size] = str;
	size++;
	return str;
    }