def _str_to_path(s, result_type):
assert isinstance(s, str)<EOL>if isinstance(s, bytes) and result_type is text_type:<EOL><INDENT>return s.decode('<STR_LIT:ascii>')<EOL><DEDENT>elif isinstance(s, text_type) and result_type is bytes:<EOL><INDENT>return s.encode('<STR_LIT:ascii>')<EOL><DEDENT>return s<EOL>
Given an ASCII str, returns a path of the given type.