def can_connect(url, error_classes=_network_error_classes):
try:<EOL><INDENT>with urlopen(url):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>except error_classes:<EOL><INDENT>return False<EOL><DEDENT>else:<EOL><INDENT>return True<EOL><DEDENT>
Try to connect to the given url. True if succeeds, False if IOError
    raised

    Parameters
    ----------
    url : basestring
        The URL to try to connect to

    Returns
    -------
    connectable : bool
        Return True if no IOError (unable to connect) or URLError (bad url) was
        raised