def _is_writable_dir(p):
try: p + '<STR_LIT>'  <EOL>except TypeError: return False<EOL>try:<EOL><INDENT>t = tempfile.TemporaryFile(dir=p)<EOL>t.write('<STR_LIT:1>')<EOL>t.close()<EOL><DEDENT>except OSError: return False<EOL>else: return True<EOL>
p is a string pointing to a putative writable dir -- return True p
is such a string, else False