INSTRUCTION stringlengths 1 46.3k | RESPONSE stringlengths 75 80.2k |
|---|---|
Returns the matching MetaGraphDef or raises KeyError. | def get_meta_graph(self, tags=None):
"""Returns the matching MetaGraphDef or raises KeyError."""
matches = [meta_graph
for meta_graph in self.meta_graphs
if set(meta_graph.meta_info_def.tags) == set(tags or [])]
if not matches:
raise KeyError("SavedModelHandler has no gra... |
Calls add_weight() to register but not create an existing weight. | def _add_existing_weight(self, weight, trainable=None):
"""Calls add_weight() to register but not create an existing weight."""
if trainable is None: trainable = weight.trainable
self.add_weight(name=weight.name, shape=weight.shape, dtype=weight.dtype,
trainable=trainable, getter=lambda ... |
Helper function to ModuleSpec.export(). | def export_module_spec(spec, path, checkpoint_path, name_transform_fn):
"""Helper function to ModuleSpec.export()."""
with tf.Graph().as_default():
m = Module(spec)
assign_map = {
name_transform_fn(name): value for name, value in m.variable_map.items()
}
tf_v1.train.init_from_checkpoint(chec... |
Returns a fresh variable/name scope for a module's state.
In order to import a module into a given scope without major complications
we require the scope to be empty. This function deals with deciding an unused
scope where to define the module state. This is non trivial in cases where
name_scope and variable_s... | def _try_get_state_scope(name, mark_name_scope_used=True):
"""Returns a fresh variable/name scope for a module's state.
In order to import a module into a given scope without major complications
we require the scope to be empty. This function deals with deciding an unused
scope where to define the module state... |
Converts inputs to a dict of inputs and checks extra/missing args.
Args:
inputs: inputs fed to Module.__call__().
tensor_info_map: A map from string to `tensor_info.ParsedTensorInfo`
describing the signature inputs.
Returns:
A dict of values with the same keys as tensor_info_map.
Raises:
... | def _prepare_dict_inputs(inputs, tensor_info_map):
"""Converts inputs to a dict of inputs and checks extra/missing args.
Args:
inputs: inputs fed to Module.__call__().
tensor_info_map: A map from string to `tensor_info.ParsedTensorInfo`
describing the signature inputs.
Returns:
A dict of value... |
Converts from inputs into dict of input tensors.
This handles:
- putting inputs into a dict, per _prepare_dict_inputs(),
- converting all input values into tensors compatible with the
expected input tensor (dtype, shape).
- check sparse/non-sparse tensor types.
Args:
inputs: inputs fed to Mo... | def _convert_dict_inputs(inputs, tensor_info_map):
"""Converts from inputs into dict of input tensors.
This handles:
- putting inputs into a dict, per _prepare_dict_inputs(),
- converting all input values into tensors compatible with the
expected input tensor (dtype, shape).
- check sparse/non-sp... |
Context manager that yields a function to directly evaluate a Module.
This creates a separate graph, in which all of the signatures of the module
are instantiated. Then, it creates a session and initializes the module
variables. Finally, it returns a function which can be used to evaluate the
module signatures... | def eval_function_for_module(spec, tags=None):
"""Context manager that yields a function to directly evaluate a Module.
This creates a separate graph, in which all of the signatures of the module
are instantiated. Then, it creates a session and initializes the module
variables. Finally, it returns a function w... |
Loads a module from a handle.
Currently this method only works with Tensorflow 2.x and can only load modules
created by calling tensorflow.saved_model.save(). The method works in both
eager and graph modes.
Depending on the type of handle used, the call may involve downloading a
Tensorflow Hub module to a l... | def load(handle):
"""Loads a module from a handle.
Currently this method only works with Tensorflow 2.x and can only load modules
created by calling tensorflow.saved_model.save(). The method works in both
eager and graph modes.
Depending on the type of handle used, the call may involve downloading a
Tenso... |
Describes the inputs required by a signature.
Args:
signature: A string with the signature to get inputs information for.
If None, the default signature is used if defined.
Returns:
The result of ModuleSpec.get_input_info_dict() for the given signature,
and the graph variant selected... | def get_input_info_dict(self, signature=None):
"""Describes the inputs required by a signature.
Args:
signature: A string with the signature to get inputs information for.
If None, the default signature is used if defined.
Returns:
The result of ModuleSpec.get_input_info_dict() for the... |
Describes the outputs provided by a signature.
Args:
signature: A string with the signature to get ouputs information for.
If None, the default signature is used if defined.
Returns:
The result of ModuleSpec.get_output_info_dict() for the given signature,
and the graph variant select... | def get_output_info_dict(self, signature=None):
"""Describes the outputs provided by a signature.
Args:
signature: A string with the signature to get ouputs information for.
If None, the default signature is used if defined.
Returns:
The result of ModuleSpec.get_output_info_dict() for ... |
Calls ModuleSpec.get_attached_message(); see there for more. | def get_attached_message(self, key, message_type, required=False):
"""Calls ModuleSpec.get_attached_message(); see there for more."""
return self._spec.get_attached_message(key, message_type,
tags=self._tags, required=required) |
Exports the module with the variables from the session in `path`.
Note that it is the module definition in the ModuleSpec used to create this
module that gets exported. The session is only used to provide the value
of variables.
Args:
path: path where to export the module to.
session: sess... | def export(self, path, session):
"""Exports the module with the variables from the session in `path`.
Note that it is the module definition in the ModuleSpec used to create this
module that gets exported. The session is only used to provide the value
of variables.
Args:
path: path where to e... |
Returns the list of all tf.Variables created by module instantiation. | def variables(self):
"""Returns the list of all tf.Variables created by module instantiation."""
result = []
for _, value in sorted(self.variable_map.items()):
if isinstance(value, list):
result.extend(value)
else:
result.append(value)
return result |
Uses a Module to construct a dense representation from a text feature.
This feature column can be used on an input feature whose values are strings
of arbitrary size.
The result of this feature column is the result of passing its `input`
through the module `m` instantiated from `module_spec`, as per
`result... | def text_embedding_column(key, module_spec, trainable=False):
"""Uses a Module to construct a dense representation from a text feature.
This feature column can be used on an input feature whose values are strings
of arbitrary size.
The result of this feature column is the result of passing its `input`
throu... |
Raises ValueError if `module_spec` is not a text-embedding module.
Args:
module_spec: A `ModuleSpec` to test.
Raises:
ValueError: if `module_spec` default signature is not compatible with
Tensor(string, shape=(?,)) -> Tensor(float32, shape=(?,K)). | def _check_module_is_text_embedding(module_spec):
"""Raises ValueError if `module_spec` is not a text-embedding module.
Args:
module_spec: A `ModuleSpec` to test.
Raises:
ValueError: if `module_spec` default signature is not compatible with
Tensor(string, shape=(?,)) -> Tensor(float32, shape=(?,K)).... |
Uses a Module to get a dense 1-D representation from the pixels of images.
This feature column can be used on images, represented as float32 tensors of
RGB pixel data in the range [0,1]. This can be read from a numeric_column()
if the tf.Example input data happens to have decoded images, all with the
same shap... | def image_embedding_column(key, module_spec):
"""Uses a Module to get a dense 1-D representation from the pixels of images.
This feature column can be used on images, represented as float32 tensors of
RGB pixel data in the range [0,1]. This can be read from a numeric_column()
if the tf.Example input data happe... |
Raises ValueError if `module_spec` is not usable as image embedding.
Args:
module_spec: A `_ModuleSpec` to test.
Raises:
ValueError: if `module_spec` default signature is not compatible with
mappingan "images" input to a Tensor(float32, shape=(_,K)). | def _check_module_is_image_embedding(module_spec):
"""Raises ValueError if `module_spec` is not usable as image embedding.
Args:
module_spec: A `_ModuleSpec` to test.
Raises:
ValueError: if `module_spec` default signature is not compatible with
mappingan "images" input to a Tensor(float32, shape... |
Returns string. Used for variable_scope and naming. | def name(self):
"""Returns string. Used for variable_scope and naming."""
if not hasattr(self, "_name"):
self._name = "{}_hub_module_embedding".format(self.key)
return self._name |
Returns a `Tensor`. | def _get_dense_tensor(self, inputs, weight_collections=None, trainable=None):
"""Returns a `Tensor`."""
del weight_collections
text_batch = tf.reshape(inputs.get(self), shape=[-1])
m = module.Module(self.module_spec, trainable=self.trainable and trainable)
return m(text_batch) |
Returns a `tf.Example` parsing spec as dict. | def _parse_example_spec(self):
"""Returns a `tf.Example` parsing spec as dict."""
height, width = image_util.get_expected_image_size(self.module_spec)
input_shape = [height, width, 3]
return {self.key: tf_v1.FixedLenFeature(input_shape, tf.float32)} |
Returns a `Tensor` to represent this feature in the input_layer(). | def _get_dense_tensor(self, inputs, weight_collections=None, trainable=None):
"""Returns a `Tensor` to represent this feature in the input_layer()."""
del weight_collections, trainable # Unused.
m = module.Module(self.module_spec, trainable=False)
images = inputs.get(self)
return m({"images": image... |
Loads a module from a handle.
Currently this method only works with Tensorflow 2.x and can only load modules
created by calling tensorflow.saved_model.save(). The method works in both
eager and graph modes.
Depending on the type of handle used, the call may involve downloading a
Tensorflow Hub module to a l... | def load(handle):
"""Loads a module from a handle.
Currently this method only works with Tensorflow 2.x and can only load modules
created by calling tensorflow.saved_model.save(). The method works in both
eager and graph modes.
Depending on the type of handle used, the call may involve downloading a
Tenso... |
Returns cache directory.
Returns cache directory from either TFHUB_CACHE_DIR environment variable
or --tfhub_cache_dir or default, if set.
Args:
default_cache_dir: Default cache location to use if neither TFHUB_CACHE_DIR
environment variable nor --tfhub_cache_dir are
... | def tfhub_cache_dir(default_cache_dir=None, use_temp=False):
"""Returns cache directory.
Returns cache directory from either TFHUB_CACHE_DIR environment variable
or --tfhub_cache_dir or default, if set.
Args:
default_cache_dir: Default cache location to use if neither TFHUB_CACHE_DIR
... |
Creates and returns the name of directory where to cache a module. | def create_local_module_dir(cache_dir, module_name):
"""Creates and returns the name of directory where to cache a module."""
tf_v1.gfile.MakeDirs(cache_dir)
return os.path.join(cache_dir, module_name) |
Merge a relative tar file to a destination (which can be "gs://..."). | def _merge_relative_path(dst_path, rel_path):
"""Merge a relative tar file to a destination (which can be "gs://...")."""
# Convert rel_path to be relative and normalize it to remove ".", "..", "//",
# which are valid directories in fileystems like "gs://".
norm_rel_path = os.path.normpath(rel_path.lstrip("/"))... |
Writes a descriptor file about the directory containing a module.
Args:
handle: Module name/handle.
module_dir: Directory where a module was downloaded. | def _write_module_descriptor_file(handle, module_dir):
"""Writes a descriptor file about the directory containing a module.
Args:
handle: Module name/handle.
module_dir: Directory where a module was downloaded.
"""
readme = _module_descriptor_file(module_dir)
readme_content = (
"Module: %s\nDow... |
Returns total size (in bytes) of the given 'directory'. | def _dir_size(directory):
"""Returns total size (in bytes) of the given 'directory'."""
size = 0
for elem in tf_v1.gfile.ListDirectory(directory):
elem_full_path = os.path.join(directory, elem)
stat = tf_v1.gfile.Stat(elem_full_path)
size += _dir_size(elem_full_path) if stat.is_directory else stat.len... |
Returns the size of the temp dir pointed to by the given lock file. | def _locked_tmp_dir_size(lock_filename):
"""Returns the size of the temp dir pointed to by the given lock file."""
task_uid = _task_uid_from_lock_file(lock_filename)
try:
return _dir_size(
_temp_download_dir(_module_dir(lock_filename), task_uid))
except tf.errors.NotFoundError:
return 0 |
Waits for the lock file to disappear.
The lock file was created by another process that is performing a download
into its own temporary directory. The name of this temp directory is
sha1(<module>).<uuid>.tmp where <uuid> comes from the lock file.
Args:
handle: The location from where a module is being dow... | def _wait_for_lock_to_disappear(handle, lock_file, lock_file_timeout_sec):
"""Waits for the lock file to disappear.
The lock file was created by another process that is performing a download
into its own temporary directory. The name of this temp directory is
sha1(<module>).<uuid>.tmp where <uuid> comes from t... |
Returns the path to a Module directory for a given TF-Hub Module handle.
Args:
handle: (string) Location of a TF-Hub Module.
download_fn: Callback function that actually performs download. The callback
receives two arguments, handle and the location of a temporary
directory ... | def atomic_download(handle,
download_fn,
module_dir,
lock_file_timeout_sec=10 * 60):
"""Returns the path to a Module directory for a given TF-Hub Module handle.
Args:
handle: (string) Location of a TF-Hub Module.
download_fn: Callback function tha... |
Prints a message about download progress either to the console or TF log.
Args:
msg: Message to print.
flush: Indicates whether to flush the output (only used in interactive
mode). | def _print_download_progress_msg(self, msg, flush=False):
"""Prints a message about download progress either to the console or TF log.
Args:
msg: Message to print.
flush: Indicates whether to flush the output (only used in interactive
mode).
"""
if self._interactive_mode():
... |
Logs progress information about ongoing module download.
Args:
bytes_downloaded: Number of bytes downloaded. | def _log_progress(self, bytes_downloaded):
"""Logs progress information about ongoing module download.
Args:
bytes_downloaded: Number of bytes downloaded.
"""
self._total_bytes_downloaded += bytes_downloaded
now = time.time()
if (self._interactive_mode() or
now - self._last_progre... |
Extracts 'tarinfo' from 'tgz' and writes to 'dst_path'. | def _extract_file(self, tgz, tarinfo, dst_path, buffer_size=10<<20):
"""Extracts 'tarinfo' from 'tgz' and writes to 'dst_path'."""
src = tgz.extractfile(tarinfo)
dst = tf_v1.gfile.GFile(dst_path, "wb")
while 1:
buf = src.read(buffer_size)
if not buf:
break
dst.write(buf)
... |
Streams the content for the 'fileobj' and stores the result in dst_path.
Args:
fileobj: File handle pointing to .tar/.tar.gz content.
dst_path: Absolute path where to store uncompressed data from 'fileobj'.
Raises:
ValueError: Unknown object encountered inside the TAR file. | def download_and_uncompress(self, fileobj, dst_path):
"""Streams the content for the 'fileobj' and stores the result in dst_path.
Args:
fileobj: File handle pointing to .tar/.tar.gz content.
dst_path: Absolute path where to store uncompressed data from 'fileobj'.
Raises:
ValueError: Unkn... |
Prepends name scope to a name. | def prepend_name_scope(name, import_scope):
"""Prepends name scope to a name."""
# Based on tensorflow/python/framework/ops.py implementation.
if import_scope:
try:
str_to_replace = r"([\^]|loc:@|^)(.*)"
return re.sub(str_to_replace, r"\1" + import_scope + r"/\2",
tf.compat.as_... |
In-place prefixes shared_name attributes of nodes. | def prefix_shared_name_attributes(meta_graph, absolute_import_scope):
"""In-place prefixes shared_name attributes of nodes."""
shared_name_attr = "shared_name"
for node in meta_graph.graph_def.node:
shared_name_value = node.attr.get(shared_name_attr, None)
if shared_name_value and shared_name_value.HasFie... |
Function to propagate backwards in the graph and mark nodes as used.
Traverses recursively through the graph from the end tensor, through the op
that generates the tensor, and then to the input tensors that feed the op.
Nodes encountered are stored in used_node_names.
Args:
output_tensor: A Tensor which w... | def mark_backward(output_tensor, used_node_names):
"""Function to propagate backwards in the graph and mark nodes as used.
Traverses recursively through the graph from the end tensor, through the op
that generates the tensor, and then to the input tensors that feed the op.
Nodes encountered are stored in used_... |
Function to prune unused ops given a signature def.
This function does a graph traversal through from all outputs as
defined in the signature_def to collect all used nodes. Then, any
nodes which are unused can be discarded. This is useful for graph which are
executing eagerly or on TPUs.
Args:
meta_grap... | def prune_unused_nodes(meta_graph, signature_def):
"""Function to prune unused ops given a signature def.
This function does a graph traversal through from all outputs as
defined in the signature_def to collect all used nodes. Then, any
nodes which are unused can be discarded. This is useful for graph which ar... |
Function to prune the feedmap of nodes which no longer exist. | def prune_feed_map(meta_graph, feed_map):
"""Function to prune the feedmap of nodes which no longer exist."""
node_names = [x.name + ":0" for x in meta_graph.graph_def.node]
keys_to_delete = []
for k, _ in feed_map.items():
if k not in node_names:
keys_to_delete.append(k)
for k in keys_to_delete:
... |
Writes to `filename` atomically.
This means that when `filename` appears in the filesystem, it will contain
all of `contents`. With write_string_to_file, it is possible for the file
to appear in the filesystem with `contents` only partially written.
Accomplished by writing to a temp file and then renaming it.... | def atomic_write_string_to_file(filename, contents, overwrite):
"""Writes to `filename` atomically.
This means that when `filename` appears in the filesystem, it will contain
all of `contents`. With write_string_to_file, it is possible for the file
to appear in the filesystem with `contents` only partially wri... |
Builds a path to a new subdirectory within the base directory.
Each export is written into a new subdirectory named using the
current time. This guarantees monotonically increasing version
numbers even across multiple runs of the pipeline.
The timestamp used is the number of seconds since epoch UTC.
Args:
... | def get_timestamped_export_dir(export_dir_base):
"""Builds a path to a new subdirectory within the base directory.
Each export is written into a new subdirectory named using the
current time. This guarantees monotonically increasing version
numbers even across multiple runs of the pipeline.
The timestamp us... |
Builds a directory name based on the argument but starting with 'temp-'.
This relies on the fact that TensorFlow Serving ignores subdirectories of
the base directory that can't be parsed as integers.
Args:
timestamped_export_dir: the name of the eventual export directory, e.g.
/foo/bar/<timestamp>
... | def get_temp_export_dir(timestamped_export_dir):
"""Builds a directory name based on the argument but starting with 'temp-'.
This relies on the fact that TensorFlow Serving ignores subdirectories of
the base directory that can't be parsed as integers.
Args:
timestamped_export_dir: the name of the eventual... |
Deletes older exports, retaining only a given number of the most recent.
Export subdirectories are assumed to be named with monotonically increasing
integers; the most recent are taken to be those with the largest values.
Args:
export_dir_base: the base directory under which each export is in a
versio... | def garbage_collect_exports(export_dir_base, exports_to_keep):
"""Deletes older exports, retaining only a given number of the most recent.
Export subdirectories are assumed to be named with monotonically increasing
integers; the most recent are taken to be those with the largest values.
Args:
export_dir_b... |
Generate a human-readable string representing number of bytes.
The units B, kB, MB and GB are used.
Args:
num_bytes: (`int` or None) Number of bytes.
include_b: (`bool`) Include the letter B at the end of the unit.
Returns:
(`str`) A string representing the number of bytes in a human-readable way,
... | def bytes_to_readable_str(num_bytes, include_b=False):
"""Generate a human-readable string representing number of bytes.
The units B, kB, MB and GB are used.
Args:
num_bytes: (`int` or None) Number of bytes.
include_b: (`bool`) Include the letter B at the end of the unit.
Returns:
(`str`) A strin... |
Generates a new release announcement entry in the docs. | def announce(version):
"""Generates a new release announcement entry in the docs."""
# Get our list of authors
stdout = check_output(["git", "describe", "--abbrev=0", "--tags"])
stdout = stdout.decode("utf-8")
last_version = stdout.strip()
stdout = check_output(
["git", "log", "{}..HEAD... |
Generates new docs, release announcements and creates a local tag. | def pre_release(version):
"""Generates new docs, release announcements and creates a local tag."""
announce(version)
regen()
changelog(version, write_out=True)
fix_formatting()
msg = "Preparing release version {}".format(version)
check_call(["git", "commit", "-a", "-m", msg])
print()
... |
A basic wrapper around Pickle to serialize a list of prediction and/or
an algorithm on drive.
What is dumped is a dictionary with keys ``'predictions'`` and ``'algo'``.
Args:
file_name(str): The name (with full path) specifying where to dump the
predictions.
predictions(list of... | def dump(file_name, predictions=None, algo=None, verbose=0):
"""A basic wrapper around Pickle to serialize a list of prediction and/or
an algorithm on drive.
What is dumped is a dictionary with keys ``'predictions'`` and ``'algo'``.
Args:
file_name(str): The name (with full path) specifying wh... |
delete a HorizontalPodAutoscaler
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_namespaced_horizontal_pod_autoscaler(name, namespace, async_req=True)
>>> result = thread.get()
:par... | def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs):
"""
delete a HorizontalPodAutoscaler
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_namespaced_hori... |
get available resources
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_api_resources(async_req=True)
>>> result = thread.get()
:param async_req bool
:return: V1APIResourceList... | def get_api_resources(self, **kwargs):
"""
get available resources
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_api_resources(async_req=True)
>>> result = thread.get()
... |
partially update the specified HorizontalPodAutoscaler
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.patch_namespaced_horizontal_pod_autoscaler(name, namespace, body, async_req=True)
>>> result =... | def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs):
"""
partially update the specified HorizontalPodAutoscaler
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread =... |
partially update status of the specified HorizontalPodAutoscaler
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.patch_namespaced_horizontal_pod_autoscaler_status(name, namespace, body, async_req=True)
... | def patch_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs):
"""
partially update status of the specified HorizontalPodAutoscaler
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
... |
replace the specified HorizontalPodAutoscaler
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.replace_namespaced_horizontal_pod_autoscaler(name, namespace, body, async_req=True)
>>> result = thread... | def replace_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs):
"""
replace the specified HorizontalPodAutoscaler
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.re... |
replace status of the specified HorizontalPodAutoscaler
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.replace_namespaced_horizontal_pod_autoscaler_status(name, namespace, body, async_req=True)
>>... | def replace_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs):
"""
replace status of the specified HorizontalPodAutoscaler
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>... |
Sets the ca_bundle of this V1alpha1WebhookClientConfig.
`caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used.
:param ca_bundle: The ca_bundle of this V1alpha1WebhookClientConfig.
:type... | def ca_bundle(self, ca_bundle):
"""
Sets the ca_bundle of this V1alpha1WebhookClientConfig.
`caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used.
:param ca_bundle: The ca_bundl... |
create a PodPreset
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_pod_preset(namespace, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:pa... | def create_namespaced_pod_preset(self, namespace, body, **kwargs):
"""
create a PodPreset
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_pod_preset(namespace, body, async... |
delete collection of PodPreset
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_pod_preset(namespace, async_req=True)
>>> result = thread.get()
:param async_req... | def delete_collection_namespaced_pod_preset(self, namespace, **kwargs):
"""
delete collection of PodPreset
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_pod_p... |
create a CronJob
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_cron_job(namespace, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param ... | def create_namespaced_cron_job(self, namespace, body, **kwargs):
"""
create a CronJob
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_cron_job(namespace, body, async_req=T... |
list or watch objects of kind PodPreset
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_pod_preset_for_all_namespaces(async_req=True)
>>> result = thread.get()
:param async_req bool
... | def list_pod_preset_for_all_namespaces(self, **kwargs):
"""
list or watch objects of kind PodPreset
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_pod_preset_for_all_namespaces(async_... |
delete collection of CronJob
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_cron_job(namespace, async_req=True)
>>> result = thread.get()
:param async_req boo... | def delete_collection_namespaced_cron_job(self, namespace, **kwargs):
"""
delete collection of CronJob
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_cron_job(... |
list or watch objects of kind CronJob
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_cron_job_for_all_namespaces(async_req=True)
>>> result = thread.get()
:param async_req bool
... | def list_cron_job_for_all_namespaces(self, **kwargs):
"""
list or watch objects of kind CronJob
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_cron_job_for_all_namespaces(async_req=Tr... |
list or watch objects of kind CronJob
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_namespaced_cron_job(namespace, async_req=True)
>>> result = thread.get()
:param async_req bool
... | def list_namespaced_cron_job(self, namespace, **kwargs):
"""
list or watch objects of kind CronJob
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_namespaced_cron_job(namespace, async_... |
read the specified CronJob
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.read_namespaced_cron_job(name, namespace, async_req=True)
>>> result = thread.get()
:param async_req bool
... | def read_namespaced_cron_job(self, name, namespace, **kwargs):
"""
read the specified CronJob
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.read_namespaced_cron_job(name, namespace, async... |
read status of the specified CronJob
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.read_namespaced_cron_job_status(name, namespace, async_req=True)
>>> result = thread.get()
:param async... | def read_namespaced_cron_job_status(self, name, namespace, **kwargs):
"""
read status of the specified CronJob
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.read_namespaced_cron_job_statu... |
create a CustomResourceDefinition
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_custom_resource_definition(body, async_req=True)
>>> result = thread.get()
:param async_req bool
... | def create_custom_resource_definition(self, body, **kwargs):
"""
create a CustomResourceDefinition
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_custom_resource_definition(body, as... |
delete a CustomResourceDefinition
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_custom_resource_definition(name, async_req=True)
>>> result = thread.get()
:param async_req bool
... | def delete_custom_resource_definition(self, name, **kwargs):
"""
delete a CustomResourceDefinition
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_custom_resource_definition(name, as... |
list or watch objects of kind CustomResourceDefinition
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_custom_resource_definition(async_req=True)
>>> result = thread.get()
:param asyn... | def list_custom_resource_definition(self, **kwargs):
"""
list or watch objects of kind CustomResourceDefinition
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_custom_resource_definiti... |
read the specified CustomResourceDefinition
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.read_custom_resource_definition(name, async_req=True)
>>> result = thread.get()
:param async_req... | def read_custom_resource_definition(self, name, **kwargs):
"""
read the specified CustomResourceDefinition
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.read_custom_resource_definition(na... |
read status of the specified CustomResourceDefinition
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.read_custom_resource_definition_status(name, async_req=True)
>>> result = thread.get()
... | def read_custom_resource_definition_status(self, name, **kwargs):
"""
read status of the specified CustomResourceDefinition
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.read_custom_resou... |
delete an Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_namespaced_ingress(name, namespace, async_req=True)
>>> result = thread.get()
:param async_req bool
:param ... | def delete_namespaced_ingress(self, name, namespace, **kwargs):
"""
delete an Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_namespaced_ingress(name, namespace, async_req=Tr... |
list or watch objects of kind Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_namespaced_ingress(namespace, async_req=True)
>>> result = thread.get()
:param async_req bool
... | def list_namespaced_ingress(self, namespace, **kwargs):
"""
list or watch objects of kind Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_namespaced_ingress(namespace, async_re... |
partially update the specified Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.patch_namespaced_ingress(name, namespace, body, async_req=True)
>>> result = thread.get()
:param asyn... | def patch_namespaced_ingress(self, name, namespace, body, **kwargs):
"""
partially update the specified Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.patch_namespaced_ingress(name... |
partially update status of the specified Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.patch_namespaced_ingress_status(name, namespace, body, async_req=True)
>>> result = thread.get()
... | def patch_namespaced_ingress_status(self, name, namespace, body, **kwargs):
"""
partially update status of the specified Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.patch_namesp... |
read the specified Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.read_namespaced_ingress(name, namespace, async_req=True)
>>> result = thread.get()
:param async_req bool
... | def read_namespaced_ingress(self, name, namespace, **kwargs):
"""
read the specified Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.read_namespaced_ingress(name, namespace, async_r... |
replace the specified Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.replace_namespaced_ingress(name, namespace, body, async_req=True)
>>> result = thread.get()
:param async_req b... | def replace_namespaced_ingress(self, name, namespace, body, **kwargs):
"""
replace the specified Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.replace_namespaced_ingress(name, nam... |
replace status of the specified Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.replace_namespaced_ingress_status(name, namespace, body, async_req=True)
>>> result = thread.get()
:... | def replace_namespaced_ingress_status(self, name, namespace, body, **kwargs):
"""
replace status of the specified Ingress
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.replace_namespaced_... |
connect DELETE requests to proxy of Service
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_delete_namespaced_service_proxy_with_path(name, namespace, path, async_req=True)
>>> result = thr... | def connect_delete_namespaced_service_proxy_with_path(self, name, namespace, path, **kwargs):
"""
connect DELETE requests to proxy of Service
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api... |
connect GET requests to exec of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_get_namespaced_pod_exec(name, namespace, async_req=True)
>>> result = thread.get()
:param async_... | def connect_get_namespaced_pod_exec(self, name, namespace, **kwargs):
"""
connect GET requests to exec of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_get_namespaced_pod_exec... |
connect GET requests to proxy of Service
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_get_namespaced_service_proxy(name, namespace, async_req=True)
>>> result = thread.get()
:pa... | def connect_get_namespaced_service_proxy(self, name, namespace, **kwargs):
"""
connect GET requests to proxy of Service
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_get_namespace... |
connect HEAD requests to proxy of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_head_namespaced_pod_proxy(name, namespace, async_req=True)
>>> result = thread.get()
:param as... | def connect_head_namespaced_pod_proxy(self, name, namespace, **kwargs):
"""
connect HEAD requests to proxy of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_head_namespaced_pod... |
connect HEAD requests to proxy of Node
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_head_node_proxy(name, async_req=True)
>>> result = thread.get()
:param async_req bool
... | def connect_head_node_proxy(self, name, **kwargs):
"""
connect HEAD requests to proxy of Node
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_head_node_proxy(name, async_req=True)
... |
connect OPTIONS requests to proxy of Service
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_options_namespaced_service_proxy(name, namespace, async_req=True)
>>> result = thread.get()
... | def connect_options_namespaced_service_proxy(self, name, namespace, **kwargs):
"""
connect OPTIONS requests to proxy of Service
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_optio... |
connect PATCH requests to proxy of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_patch_namespaced_pod_proxy(name, namespace, async_req=True)
>>> result = thread.get()
:param ... | def connect_patch_namespaced_pod_proxy(self, name, namespace, **kwargs):
"""
connect PATCH requests to proxy of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_patch_namespaced_... |
connect PATCH requests to proxy of Node
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_patch_node_proxy(name, async_req=True)
>>> result = thread.get()
:param async_req bool
... | def connect_patch_node_proxy(self, name, **kwargs):
"""
connect PATCH requests to proxy of Node
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_patch_node_proxy(name, async_req=True... |
connect POST requests to portforward of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_post_namespaced_pod_portforward(name, namespace, async_req=True)
>>> result = thread.get()
... | def connect_post_namespaced_pod_portforward(self, name, namespace, **kwargs):
"""
connect POST requests to portforward of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_post_na... |
connect POST requests to proxy of Service
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_post_namespaced_service_proxy_with_path(name, namespace, path, async_req=True)
>>> result = thread.... | def connect_post_namespaced_service_proxy_with_path(self, name, namespace, path, **kwargs):
"""
connect POST requests to proxy of Service
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.con... |
connect PUT requests to proxy of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_put_namespaced_pod_proxy_with_path(name, namespace, path, async_req=True)
>>> result = thread.get()
... | def connect_put_namespaced_pod_proxy_with_path(self, name, namespace, path, **kwargs):
"""
connect PUT requests to proxy of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_put_n... |
create Endpoints
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_endpoints(namespace, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param... | def create_namespaced_endpoints(self, namespace, body, **kwargs):
"""
create Endpoints
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_endpoints(namespace, body, async_req... |
connect PUT requests to proxy of Node
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_put_node_proxy_with_path(name, path, async_req=True)
>>> result = thread.get()
:param async_re... | def connect_put_node_proxy_with_path(self, name, path, **kwargs):
"""
connect PUT requests to proxy of Node
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_put_node_proxy_with_path(... |
create an Event
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_event(namespace, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str ... | def create_namespaced_event(self, namespace, body, **kwargs):
"""
create an Event
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_event(namespace, body, async_req=True)
... |
create a Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_pod(namespace, body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str names... | def create_namespaced_pod(self, namespace, body, **kwargs):
"""
create a Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_pod(namespace, body, async_req=True)
>... |
create a ReplicationController
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_replication_controller(namespace, body, async_req=True)
>>> result = thread.get()
:param as... | def create_namespaced_replication_controller(self, namespace, body, **kwargs):
"""
create a ReplicationController
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_replicati... |
create a ServiceAccount
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_service_account(namespace, body, async_req=True)
>>> result = thread.get()
:param async_req bool
... | def create_namespaced_service_account(self, namespace, body, **kwargs):
"""
create a ServiceAccount
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_service_account(namespa... |
delete collection of Endpoints
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_endpoints(namespace, async_req=True)
>>> result = thread.get()
:param async_req ... | def delete_collection_namespaced_endpoints(self, namespace, **kwargs):
"""
delete collection of Endpoints
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_endpoi... |
delete collection of Event
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_event(namespace, async_req=True)
>>> result = thread.get()
:param async_req bool
... | def delete_collection_namespaced_event(self, namespace, **kwargs):
"""
delete collection of Event
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_event(namespac... |
delete collection of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_pod(namespace, async_req=True)
>>> result = thread.get()
:param async_req bool
... | def delete_collection_namespaced_pod(self, namespace, **kwargs):
"""
delete collection of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_pod(namespace, asy... |
delete collection of PodTemplate
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_pod_template(namespace, async_req=True)
>>> result = thread.get()
:param async... | def delete_collection_namespaced_pod_template(self, namespace, **kwargs):
"""
delete collection of PodTemplate
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_p... |
delete collection of Secret
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_secret(namespace, async_req=True)
>>> result = thread.get()
:param async_req bool
... | def delete_collection_namespaced_secret(self, namespace, **kwargs):
"""
delete collection of Secret
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_secret(names... |
delete collection of ServiceAccount
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_service_account(namespace, async_req=True)
>>> result = thread.get()
:param... | def delete_collection_namespaced_service_account(self, namespace, **kwargs):
"""
delete collection of ServiceAccount
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namesp... |
delete a Namespace
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_namespace(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: name of t... | def delete_namespace(self, name, **kwargs):
"""
delete a Namespace
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_namespace(name, async_req=True)
>>> result = thread.get()
... |
delete a ConfigMap
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_namespaced_config_map(name, namespace, async_req=True)
>>> result = thread.get()
:param async_req bool
:pa... | def delete_namespaced_config_map(self, name, namespace, **kwargs):
"""
delete a ConfigMap
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_namespaced_config_map(name, namespace, async... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.