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

Function new_configure

patches/sitecustomize.py:88–113  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

86 def init_wrapper(wrapped, instance, args, kwargs):
87 # Don't want to forward requests that are to Vertex AI, debug mode, or have their own http_options specified
88 # Thus, if the client constructor contains any params other than api_key, we don't set up forwarding
89 if any(value is not None for key, value in kwargs.items() if key != 'api_key'):
90 return wrapped(*args, **kwargs)
91
92 default_metadata = {
93 "x-kaggle-proxy-data": os.environ['KAGGLE_DATA_PROXY_TOKEN'],
94 'x-kaggle-authorization': f"Bearer {os.environ['KAGGLE_USER_SECRETS_TOKEN']}"
95 }
96 http_options = {
97 'base_url': os.getenv('KAGGLE_DATA_PROXY_URL') + '/palmapi/',
98 'headers': default_metadata
99 }
100 kwargs['http_options'] = http_options
101 return wrapped(*args, **kwargs)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected