CLN: remove isinstance(x, str) calls
CLN: pep8
CLN: remove redundant parens in conditionals
CLN: functions that take a sym argument should raise if the argument is not given
CLN: range -> xrange
CLN: remove backslashes
CLN: handle urls with context managers
CLN: use appropriate exception types
CLN: replace special method calls with their toplevel names
CLN: replace most empty exceptions with relevant exception types