def xstr(s, encoding="utf-8"):
        if isinstance(s, str):
            return s
        else:
            return unicode(s).encode(encoding)
Convert argument to string type returned by __str__.
dataset/ETHPy150Open nigelsmall/httpstream/httpstream/util.py/xstr