def decode_string(x, f):
    colon = x.index(':', f)
    try:
        n = int(x[f:colon])
    except (OverflowError, __HOLE__):
        n = long(x[f:colon])
    if x[f] == '0' and colon != f+1:
        raise ValueError
    colon += 1
    return (x[colon:colon+n], colon+n)
dataset/ETHPy150Open Cclleemm/FriendlyTorrent/src/tornado/BitTornado/bencode.py/decode_string