MCPcopy Create free account
hub / github.com/Kaggle/docker-python / _is_on_kaggle_notebook

Function _is_on_kaggle_notebook

patches/kaggle_module_resolver.py:10–11  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8long_url_pattern = re.compile(r"https?://([a-z]+\.)?kaggle.com/models/(?P<owner>[^\\/]+)/(?P<model>[^\\/]+)/frameworks/(?P<framework>[^\\/]+)/variations/(?P<variation>[^\\/]+)/versions/(?P<version>[0-9]+)$")
9
10def _is_on_kaggle_notebook():
11 return os.getenv("KAGGLE_KERNEL_RUN_TYPE") != None and os.getenv("KAGGLE_USER_SECRETS_TOKEN") != None
12
13def _is_kaggle_handle(handle):
14 return long_url_pattern.match(handle) != None or short_url_pattern.match(handle) != None

Callers 1

is_supportedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected