Set the data from a string.
341979
def _setbytes_safe(self, data, length=None, offset=0):
        """"""
        data = bytearray(data)
        if length is None:
            # Use to the end of the data
            length = len(data)*8 - offset
            self._datastore = ByteStore(data, length, offset)
        else:
            if length + offset > len(data) * 8:
                msg = "Not enough data present. Need {0} bits, have {1}."
                raise CreationError(msg, length + offset, len(data) * 8)
            if length == 0:
                self._datastore = ByteStore(bytearray(0))
            else:
                self._datastore = ByteStore(data, length, offset)
1019975
def _fromstring(value):
    '''
    '''

    if not value:
        return None
    std_value = value.strip().lower()
    if std_value == 'true':
        return 'true'
    elif std_value == 'false':
        return 'false'
#     try:
#         return int(std_value)
#     except ValueError:
#         pass
#     try:
#         return float(std_value)
#     except ValueError:
#         pass
    return value
137654
def p_string_literal(self, p):
        """"""
        p[0] = self.asttypes.String(p[1])
        p[0].setpos(p)
496382
public void set(String string) {
        try {
            ByteBuffer bb = encode(string, true);
            bytes = bb.array();
            length = bb.limit();
        } catch (CharacterCodingException e) {
            throw new RuntimeException("Should not have happened " + e.toString());
        }
    }
1005293
def FromString(s, **kwargs):
    """"""
    
    f = StringIO.StringIO(s)
    return FromFile(f, **kwargs)
1170884
def set_data(self, data):
        
        for name in self._fields:
            setattr(self, name, data.get(name))
        return self
1139055
def insertData(self, offset: int, string: str) -> None:
        """"""
        self._insert_data(offset, string)
130524
def from_string(s):
        """"""

        if not len(s):
            raise ValueError("Invalid parameter string.")

        params = parse_qs(u(s), keep_blank_values=False)
        if not len(params):
            raise ValueError("Invalid parameter string.")

        try:
            key = params['oauth_token'][0]
        except Exception:
            raise ValueError("'oauth_token' not found in OAuth request.")

        try:
            secret = params['oauth_token_secret'][0]
        except Exception:
            raise ValueError("'oauth_token_secret' not found in " 
                "OAuth request.")

        token = Token(key, secret)
        try:
            token.callback_confirmed = params['oauth_callback_confirmed'][0]
        except KeyError:
            pass  # 1.0, no callback confirmed.
        return token
1342736
def from_string(cls, string):
        """"""
        if string is None:
            string = ''

        if not isinstance(string, six.string_types):
            raise TypeError('string has to be a string type, got: {}'.format(type(string)))

        dictionary = {}
        tokens = [token.strip() for token in shlex.split(string)]

        def list_tuples(some_iterable):
            items, nexts = itertools.tee(some_iterable, 2)
            nexts = itertools.chain(itertools.islice(nexts, 1, None), [None])
            return list(zip(items, nexts))

        for token_current, token_next in list_tuples(tokens):

            # If current token starts with a dash, it is a value so we skip it
            if not token_current.startswith('-'):
                continue

            # If the next token is None or starts with a dash, the current token must be a flag, so the value is True
            if not token_next or token_next.startswith('-'):
                dictionary[token_current.lstrip('-')] = True

            # Otherwise the current token is an option with the next token being its value
            else:
                dictionary[token_current.lstrip('-')] = token_next

        return cls.from_dictionary(dictionary)
221149
def from_string(cls, id, format, raw_content, compressed=False,
                    encoded=False):
        """"""
        content = cls(id, format, compressed, encoded)
        content._raw_content = raw_content
        return content
1356360
def write_string(self, string):
        """"""
        self.write_uint16(len(string))
        self.write_bytes(string, len(string))
1165644
def _add_from_str(self, s):
        """"""

        if sys.version_info[0] < 3 and isinstance(s, str):
            s = s.decode('utf-8')

        for line in s.split("\n"):
            self._parse_line(line)
784686
def set_string_value(self, index, s):
        
        return self.__set_string_value(index, javabridge.get_env().new_string(s))
121087
def from_string(cls, s):
        """"""
        stream = cStringIO(s)
        stream.seek(0)
        return cls(**yaml.safe_load(stream))
806568
private final void setto(String s) {
        int l = s.length(); 
        int o = j+1;
        for (int i = 0; i < l; i++)
            sb.setCharAt(o+i, s.charAt(i));
        k = j+l;
    }
693167
@NonNull
    public Parameters setString(@NonNull String name, String value) {
        return setValue(name, value);
    }
1231071
def set(self, tclass, tnum, tlvt=0, tdata=''):
        """"""
        if not isinstance(tdata, str):
            raise TypeError("tag data must be str")

        self.tagClass = tclass
        self.tagNumber = tnum
        self.tagLVT = tlvt
        self.tagData = tdata