parameters: (self, s)
docstring: Python 3 compatibility shim
docstring_summary: Python 3 compatibility shim
docstring_tokens: Python 3 compatibility shim
function: def _encode(self, s):
          """
          Python 3 compatibility shim
          """
          if compat.PY3:
              return s.encode(self._encoding)
          else:
              return s
function_tokens: def _encode ( self , s ) : if compat . PY3 : return s . encode ( self . _encoding ) else : return s