parameters: (s)
return_statement: return s
docstring: Encode s if it is a sequence of chars.
docstring_summary: Encode s if it is a sequence of chars.
docstring_tokens: Encode s if it is a sequence of chars .
function: def _to_bytes(s):
    """Encode s if it is a sequence of chars."""
    if isinstance(s, _six.text_type):
      return s.encode("utf-8", errors="surrogateescape")
    return s
function_tokens: def _to_bytes ( s ) : if isinstance ( s , _six . text_type ) : return s . encode ( "utf-8" , errors = "surrogateescape" ) return s