def _assign_value_by_type(self, pbuf_obj, value, _bool=True, _float=True,<EOL>_integer=True, _string=True, error_prefix='<STR_LIT>'):
<EOL>if isinstance(value, bool) and _bool is True:<EOL><INDENT>pbuf_obj.value.boolValue = value<EOL><DEDENT>elif isinstance(value, six.integer_types) andnot isinstance(value, bool) and _integer is True:<EOL><INDENT>if value < INTEGER_MIN or value > INTEGER_MAX:<EOL><INDENT>raise ValueError(<EOL>('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>.format(error_prefix, str(value),<EOL>str(INTEGER_MIN), str(INTEGER_MAX)))<EOL><DEDENT>pbuf_obj.value.intValue = value<EOL><DEDENT>elif isinstance(value, float) and _float is True:<EOL><INDENT>pbuf_obj.value.doubleValue = value<EOL><DEDENT>elif isinstance(value, six.string_types) and _string is True:<EOL><INDENT>pbuf_obj.value.strValue = value<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>.format(error_prefix, str(value), str(type(value))))<EOL><DEDENT>
Assigns the supplied value to the appropriate protobuf value type