def encode(self, o):
        # This is for extremely simple cases and benchmarks.
        if isinstance(o, basestring):
            if isinstance(o, str):
                _encoding = self.encoding
                if (_encoding is not None
                        and not (_encoding == 'utf-8')):
                    o = o.decode(_encoding)
            if self.ensure_ascii:
                return encode_basestring_ascii(o)
            else:
                return encode_basestring(o)
        # This doesn't pass the iterator directly to ''.join() because the
        # exceptions aren't as detailed.  The list call should be roughly
        # equivalent to the PySequence_Fast that ''.join() would do.
        chunks = list(self.iterencode(o))
        return ''.join(chunks)
Access a URL over HTTP and returns the results.
dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/json/encoder.py/JSONEncoder.encode--crossover with--dataset/ETHPy150Open CollabQ/CollabQ/appengine_django/tests/integration_test.py/RetrieveURL