MCPcopy Index your code
hub / github.com/grapeot/devin.cursorrules / validate_url

Function validate_url

tools/web_scraper.py:157–163  ·  view source on GitHub ↗

Validate if the given string is a valid URL.

(url: str)

Source from the content-addressed store, hash-verified

155 await browser.close()
156
157def validate_url(url: str) -> bool:
158 """Validate if the given string is a valid URL."""
159 try:
160 result = urlparse(url)
161 return all([result.scheme, result.netloc])
162 except:
163 return False
164
165def main():
166 parser = argparse.ArgumentParser(description='Fetch and extract text content from webpages.')

Callers 2

test_validate_urlMethod · 0.90
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_validate_urlMethod · 0.72