Python pandas.compat.str_to_bytes() Examples

The following are 5 code examples of pandas.compat.str_to_bytes(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pandas.compat , or try the search function .
Example #1
Source File: test_ujson.py    From recruit with Apache License 2.0 5 votes vote down vote up
def test_decode_big_escape(self):
        # Make sure no Exception is raised.
        for _ in range(10):
            base = '\u00e5'.encode("utf-8") if compat.PY3 else "\xc3\xa5"
            quote = compat.str_to_bytes("\"")

            escape_input = quote + (base * 1024 * 1024 * 2) + quote
            ujson.decode(escape_input) 
Example #2
Source File: test_ujson.py    From vnpy_crypto with MIT License 5 votes vote down vote up
def test_decodeBigEscape(self):
        for x in range(10):
            if compat.PY3:
                base = '\u00e5'.encode('utf-8')
            else:
                base = "\xc3\xa5"
            quote = compat.str_to_bytes("\"")
            input = quote + (base * 1024 * 1024 * 2) + quote
            output = ujson.decode(input)  # noqa 
Example #3
Source File: test_ujson.py    From Computable with MIT License 5 votes vote down vote up
def test_decodeBigEscape(self):
        for x in range(10):
            if compat.PY3:
                base = '\u00e5'.encode('utf-8')
            else:
                base = "\xc3\xa5"
            quote = compat.str_to_bytes("\"")
            input = quote + (base * 1024 * 1024 * 2) + quote
            output = ujson.decode(input) 
Example #4
Source File: test_ujson.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def test_decode_big_escape(self):
        # Make sure no Exception is raised.
        for _ in range(10):
            base = '\u00e5'.encode("utf-8") if compat.PY3 else "\xc3\xa5"
            quote = compat.str_to_bytes("\"")

            escape_input = quote + (base * 1024 * 1024 * 2) + quote
            ujson.decode(escape_input) 
Example #5
Source File: test_ujson.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def test_decodeBigEscape(self):
        for x in range(10):
            if compat.PY3:
                base = '\u00e5'.encode('utf-8')
            else:
                base = "\xc3\xa5"
            quote = compat.str_to_bytes("\"")
            input = quote + (base * 1024 * 1024 * 2) + quote
            output = ujson.decode(input)  # noqa