docs: def pypy_json_encode(value, pretty=False):
      """
      pypy DOES NOT OPTIMIZE GENERATOR CODE WELL
      """
      global _dealing_with_problem
      if pretty:
          return pretty_json(value)
  
      try:
          _buffer = UnicodeBuilder(2048)
          _value2json(value, _buffer)
          output = _buffer.build()
          return output
      except Exception as e:
          # THE PRETTY JSON WILL PROVIDE MORE DETAIL ABOUT THE SERIALIZATION CONCERNS
          from mo_logs import Log
  
          if _dealing_with_problem:
              Log.error("Serialization of JSON problems", e)
          else:
              Log.warning("Serialization of JSON problems", e)
          _dealing_with_problem = True
          try:
              return pretty_json(value)
          except Exception as f:
              Log.error("problem serializing object", f)
          finally:
              _dealing_with_problem = False