def check_site_available(site, secure=False):
if not isinstance(site, str):<EOL><INDENT>url = id_source(site, full=True).lower()<EOL><DEDENT>else:<EOL><INDENT>url = site<EOL><DEDENT>if not url.startswith('<STR_LIT:http>'):<EOL><INDENT>prefix = '<STR_LIT>' if secure else '<STR_LIT:http>'<EOL>url = f'<STR_LIT>'<EOL><DEDENT>try:<EOL><INDENT>get_url(url, parser='<STR_LIT>')<EOL><DEDENT>except HTTPError:<EOL><INDENT>return False<EOL><DEDENT>except (URLError, RemoteDisconnected):<EOL><INDENT>if secure:<EOL><INDENT>return False<EOL><DEDENT>return check_site_available(site, secure=True)<EOL><DEDENT>return True<EOL>
Helper function to check if a specific website is available.