MCPcopy Index your code
hub / github.com/FSoft-AI4Code/HyperAgent / check_local_or_remote

Function check_local_or_remote

src/hyperagent/utils.py:45–55  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

43 return free_port
44
45def check_local_or_remote(path: str):
46 # Check if link is a valid folder path
47 if os.path.isdir(path):
48 return (True, path)
49 # Check if link is a valid URL
50 try:
51 result = urlparse(path)
52 if all([result.scheme, result.netloc, result.path]) and 'github.com' in result.netloc:
53 return (False, result.path[1:])
54 except:
55 raise ValueError("Please provide a valid folder path or GitHub URL.")
56
57def get_env_path():
58 python_path = subprocess.check_output("which python", shell=True).strip().decode("utf-8")

Callers 2

SetupFunction · 0.90
setupFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected