Python version of PHP's stripslashes
<p>I wrote a piece of code to convert PHP's striplashes into valid Python [backslash] escapes:</p>

<pre><code>cleaned = stringwithslashes
cleaned = cleaned.replace('\\n', '\n')
cleaned = cleaned.replace('\\r', '\n')
cleaned = cleaned.replace('\\', '')
</code></pre>

<p>How can I condense it? </p>

<p>Not totally sure this is what you want, but..</p>

<pre><code>cleaned = stringwithslashes.decode('string_escape')
</code></pre>
