Code
stringlengths
103
85.9k
Summary
listlengths
0
94
Please provide a description of the function:def _merge_assets_key_collection(saved_model_proto, path): for meta_graph in saved_model_proto.meta_graphs: node_asset_map = {} if tf_v1.saved_model.constants.ASSETS_KEY in meta_graph.collection_def: assets_any_proto = meta_graph.collection_def[ ...
[ "Merges the ASSETS_KEY collection into the GraphDefs in saved_model_proto.\n\n Removes the ASSETS_KEY collection from the GraphDefs in the SavedModel and\n modifies nodes with the assets filenames to point to the assets in `path`.\n After this transformation, the SavedModel GraphDefs can be used without\n feedi...
Please provide a description of the function:def _make_assets_key_collection(saved_model_proto, export_path): asset_filenames = {} used_asset_filenames = set() def _make_asset_filename(original_filename): if original_filename in asset_filenames: return asset_filenames[original_filename] ba...
[ "Creates an ASSETS_KEY collection in the GraphDefs in saved_model_proto.\n\n Adds an ASSETS_KEY collection to the GraphDefs in the SavedModel and returns\n a map from original asset filename to filename when exporting the SavedModel\n to `export_path`.\n\n This is roughly the inverse operation of `_merge_assets...
Please provide a description of the function:def _parse_saved_model(path): # Based on tensorflow/python/saved_model/loader.py implementation. path_to_pb = _get_saved_model_proto_path(path) file_content = tf_v1.gfile.Open(path_to_pb, "rb").read() saved_model = saved_model_pb2.SavedModel() try: saved_mod...
[ "Reads the savedmodel.pb file containing `SavedModel`." ]
Please provide a description of the function:def load(path): proto = _parse_saved_model(path) _merge_assets_key_collection(proto, path) handler = SavedModelHandler() handler._proto = proto # pylint: disable=protected-access return handler
[ "Creates a SavedModelHandler from a SavedModel in `path`." ]
Please provide a description of the function:def add_graph_copy(self, graph, tags=None): with graph.as_default(): # Remove default attrs so that Modules created by a tensorflow version # with ops that have new attrs that are left to their default values can # still be loaded by older versions...
[ "Adds a copy of Graph with the specified set of tags." ]
Please provide a description of the function:def get_meta_graph_copy(self, tags=None): meta_graph = self.get_meta_graph(tags) copy = tf_v1.MetaGraphDef() copy.CopyFrom(meta_graph) return copy
[ "Returns a copy of a MetaGraph with the identical set of tags." ]
Please provide a description of the function:def get_tags(self): return sorted([frozenset(meta_graph.meta_info_def.tags) for meta_graph in self.meta_graphs])
[ "Returns a list of set of tags." ]
Please provide a description of the function:def export(self, path, variables_saver=None): # Operate on a copy of self._proto since it needs to be modified. proto = saved_model_pb2.SavedModel() proto.CopyFrom(self._proto) assets_map = _make_assets_key_collection(proto, path) self._save_all_ass...
[ "Exports to SavedModel directory.\n\n Args:\n path: path where to export the SavedModel to.\n variables_saver: lambda that receives a directory path where to\n export checkpoints of variables.\n " ]
Please provide a description of the function:def get_meta_graph(self, tags=None): 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 graph with tags: ...
[ "Returns the matching MetaGraphDef or raises KeyError." ]
Please provide a description of the function:def _add_existing_weight(self, weight, trainable=None): if trainable is None: trainable = weight.trainable self.add_weight(name=weight.name, shape=weight.shape, dtype=weight.dtype, trainable=trainable, getter=lambda *_, **__: weight)
[ "Calls add_weight() to register but not create an existing weight." ]
Please provide a description of the function:def export_module_spec(spec, path, checkpoint_path, name_transform_fn): 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...
[ "Helper function to ModuleSpec.export()." ]
Please provide a description of the function:def _try_get_state_scope(name, mark_name_scope_used=True): tmp_scope_name = tf_v1.get_variable_scope().name if tmp_scope_name: tmp_scope_name += "/" with tf.name_scope(tmp_scope_name): # Pick an unused variable scope. with tf_v1.variable_scope( N...
[ "Returns a fresh variable/name scope for a module's state.\n\n In order to import a module into a given scope without major complications\n we require the scope to be empty. This function deals with deciding an unused\n scope where to define the module state. This is non trivial in cases where\n name_scope and ...
Please provide a description of the function:def _prepare_dict_inputs(inputs, tensor_info_map): if inputs is None: dict_inputs = {} elif isinstance(inputs, dict): dict_inputs = inputs elif len(tensor_info_map) == 1: dict_inputs = {list(tensor_info_map.keys())[0]: inputs} elif not tensor_info_map:...
[ "Converts inputs to a dict of inputs and checks extra/missing args.\n\n Args:\n inputs: inputs fed to Module.__call__().\n tensor_info_map: A map from string to `tensor_info.ParsedTensorInfo`\n describing the signature inputs.\n\n Returns:\n A dict of values with the same keys as tensor_info_map.\n\...
Please provide a description of the function:def _convert_dict_inputs(inputs, tensor_info_map): dict_inputs = _prepare_dict_inputs(inputs, tensor_info_map) return tensor_info.convert_dict_to_compatible_tensor(dict_inputs, tensor_info_map)
[ "Converts from inputs into dict of input tensors.\n\n This handles:\n - putting inputs into a dict, per _prepare_dict_inputs(),\n - converting all input values into tensors compatible with the\n expected input tensor (dtype, shape).\n - check sparse/non-sparse tensor types.\n\n Args:\n inputs: in...
Please provide a description of the function:def eval_function_for_module(spec, tags=None): # We create a separate graph and add all the signatures of the module to it. original_graph = tf_v1.get_default_graph() with tf.Graph().as_default(): module = Module(spec, tags=tags) input_tensors_per_signature ...
[ "Context manager that yields a function to directly evaluate a Module.\n\n This creates a separate graph, in which all of the signatures of the module\n are instantiated. Then, it creates a session and initializes the module\n variables. Finally, it returns a function which can be used to evaluate the\n module ...
Please provide a description of the function:def load(handle): if hasattr(tf_v1.saved_model, "load_v2"): module_handle = resolve(handle) return tf_v1.saved_model.load_v2(module_handle) else: raise NotImplementedError("hub.load() is not implemented for TF < 1.14.x, " "Cur...
[ "Loads a module from a handle.\n\n Currently this method only works with Tensorflow 2.x and can only load modules\n created by calling tensorflow.saved_model.save(). The method works in both\n eager and graph modes.\n\n Depending on the type of handle used, the call may involve downloading a\n Tensorflow Hub m...
Please provide a description of the function:def get_input_info_dict(self, signature=None): return self._spec.get_input_info_dict(signature=signature, tags=self._tags)
[ "Describes the inputs required by a signature.\n\n Args:\n signature: A string with the signature to get inputs information for.\n If None, the default signature is used if defined.\n\n Returns:\n The result of ModuleSpec.get_input_info_dict() for the given signature,\n and the graph var...
Please provide a description of the function:def get_output_info_dict(self, signature=None): return self._spec.get_output_info_dict(signature=signature, tags=self._tags)
[ "Describes the outputs provided by a signature.\n\n Args:\n signature: A string with the signature to get ouputs information for.\n If None, the default signature is used if defined.\n\n Returns:\n The result of ModuleSpec.get_output_info_dict() for the given signature,\n and the graph v...
Please provide a description of the function:def get_attached_message(self, key, message_type, required=False): return self._spec.get_attached_message(key, message_type, tags=self._tags, required=required)
[ "Calls ModuleSpec.get_attached_message(); see there for more." ]
Please provide a description of the function:def export(self, path, session): if self._graph is not tf_v1.get_default_graph(): raise RuntimeError("default graph differs from the graph where the " "module was instantiated.") if self._graph is not session.graph: raise Run...
[ "Exports the module with the variables from the session in `path`.\n\n Note that it is the module definition in the ModuleSpec used to create this\n module that gets exported. The session is only used to provide the value\n of variables.\n\n Args:\n path: path where to export the module to.\n ...
Please provide a description of the function:def variables(self): result = [] for _, value in sorted(self.variable_map.items()): if isinstance(value, list): result.extend(value) else: result.append(value) return result
[ "Returns the list of all tf.Variables created by module instantiation." ]
Please provide a description of the function:def text_embedding_column(key, module_spec, trainable=False): module_spec = module.as_module_spec(module_spec) _check_module_is_text_embedding(module_spec) return _TextEmbeddingColumn(key=key, module_spec=module_spec, trainable=trainabl...
[ "Uses a Module to construct a dense representation from a text feature.\n\n This feature column can be used on an input feature whose values are strings\n of arbitrary size.\n\n The result of this feature column is the result of passing its `input`\n through the module `m` instantiated from `module_spec`, as pe...
Please provide a description of the function:def _check_module_is_text_embedding(module_spec): issues = [] # Find issues with signature inputs. input_info_dict = module_spec.get_input_info_dict() if len(input_info_dict) != 1: issues.append("Module default signature must require only one input") else: ...
[ "Raises ValueError if `module_spec` is not a text-embedding module.\n\n Args:\n module_spec: A `ModuleSpec` to test.\n\n Raises:\n ValueError: if `module_spec` default signature is not compatible with\n Tensor(string, shape=(?,)) -> Tensor(float32, shape=(?,K)).\n " ]
Please provide a description of the function:def image_embedding_column(key, module_spec): module_spec = module.as_module_spec(module_spec) _check_module_is_image_embedding(module_spec) return _ImageEmbeddingColumn(key=key, module_spec=module_spec)
[ "Uses a Module to get a dense 1-D representation from the pixels of images.\n\n This feature column can be used on images, represented as float32 tensors of\n RGB pixel data in the range [0,1]. This can be read from a numeric_column()\n if the tf.Example input data happens to have decoded images, all with the\n ...
Please provide a description of the function:def _check_module_is_image_embedding(module_spec): issues = [] # Find issues with "default" signature inputs. The common signatures for # image models prescribe a specific name; we trust it if we find it # and if we can do the necessary inference of input shapes ...
[ "Raises ValueError if `module_spec` is not usable as image embedding.\n\n Args:\n module_spec: A `_ModuleSpec` to test.\n\n Raises:\n ValueError: if `module_spec` default signature is not compatible with\n mappingan \"images\" input to a Tensor(float32, shape=(_,K)).\n " ]
Please provide a description of the function:def name(self): if not hasattr(self, "_name"): self._name = "{}_hub_module_embedding".format(self.key) return self._name
[ "Returns string. Used for variable_scope and naming." ]
Please provide a description of the function:def _get_dense_tensor(self, inputs, weight_collections=None, trainable=None): 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 `Tensor`." ]
Please provide a description of the function:def _parse_example_spec(self): 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 `tf.Example` parsing spec as dict." ]
Please provide a description of the function:def _get_dense_tensor(self, inputs, weight_collections=None, trainable=None): del weight_collections, trainable # Unused. m = module.Module(self.module_spec, trainable=False) images = inputs.get(self) return m({"images": images})
[ "Returns a `Tensor` to represent this feature in the input_layer()." ]
Please provide a description of the function:def load(handle): if hasattr(tf_v1.saved_model, "load_v2"): module_handle = resolve(handle) if tf_v1.gfile.Exists(native_module.get_module_proto_path(module_handle)): raise NotImplementedError("TF Hub module '%s' is stored using TF 1.x " ...
[ "Loads a module from a handle.\n\n Currently this method only works with Tensorflow 2.x and can only load modules\n created by calling tensorflow.saved_model.save(). The method works in both\n eager and graph modes.\n\n Depending on the type of handle used, the call may involve downloading a\n Tensorflow Hub m...
Please provide a description of the function:def tfhub_cache_dir(default_cache_dir=None, use_temp=False): # Note: We are using FLAGS["tfhub_cache_dir"] (and not FLAGS.tfhub_cache_dir) # to access the flag value in order to avoid parsing argv list. The flags # should have been parsed by now in main() by tf.app...
[ "Returns cache directory.\n\n Returns cache directory from either TFHUB_CACHE_DIR environment variable\n or --tfhub_cache_dir or default, if set.\n\n Args:\n default_cache_dir: Default cache location to use if neither TFHUB_CACHE_DIR\n environment variable nor --tfhub_cache_dir are\n ...
Please provide a description of the function:def create_local_module_dir(cache_dir, module_name): tf_v1.gfile.MakeDirs(cache_dir) return os.path.join(cache_dir, module_name)
[ "Creates and returns the name of directory where to cache a module." ]
Please provide a description of the function:def _merge_relative_path(dst_path, rel_path): # 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("/")) if norm_rel_path == ".": ...
[ "Merge a relative tar file to a destination (which can be \"gs://...\")." ]
Please provide a description of the function:def _write_module_descriptor_file(handle, module_dir): readme = _module_descriptor_file(module_dir) readme_content = ( "Module: %s\nDownload Time: %s\nDownloader Hostname: %s (PID:%d)" % (handle, str(datetime.datetime.today()), socket.gethostname(), ...
[ "Writes a descriptor file about the directory containing a module.\n\n Args:\n handle: Module name/handle.\n module_dir: Directory where a module was downloaded.\n " ]
Please provide a description of the function:def _dir_size(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.length return siz...
[ "Returns total size (in bytes) of the given 'directory'." ]
Please provide a description of the function:def _locked_tmp_dir_size(lock_filename): 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
[ "Returns the size of the temp dir pointed to by the given lock file." ]
Please provide a description of the function:def _wait_for_lock_to_disappear(handle, lock_file, lock_file_timeout_sec): locked_tmp_dir_size = 0 locked_tmp_dir_size_check_time = time.time() lock_file_content = None while tf_v1.gfile.Exists(lock_file): try: logging.log_every_n( logging.INFO...
[ "Waits for the lock file to disappear.\n\n The lock file was created by another process that is performing a download\n into its own temporary directory. The name of this temp directory is\n sha1(<module>).<uuid>.tmp where <uuid> comes from the lock file.\n\n Args:\n handle: The location from where a module ...
Please provide a description of the function:def atomic_download(handle, download_fn, module_dir, lock_file_timeout_sec=10 * 60): lock_file = _lock_filename(module_dir) task_uid = uuid.uuid4().hex lock_contents = _lock_file_contents(task_uid) tmp_di...
[ "Returns the path to a Module directory for a given TF-Hub Module handle.\n\n Args:\n handle: (string) Location of a TF-Hub Module.\n download_fn: Callback function that actually performs download. The callback\n receives two arguments, handle and the location of a temporary\n ...
Please provide a description of the function:def _print_download_progress_msg(self, msg, flush=False): if self._interactive_mode(): # Print progress message to console overwriting previous progress # message. self._max_prog_str = max(self._max_prog_str, len(msg)) sys.stdout.write("\r%-{...
[ "Prints a message about download progress either to the console or TF log.\n\n Args:\n msg: Message to print.\n flush: Indicates whether to flush the output (only used in interactive\n mode).\n " ]
Please provide a description of the function:def _log_progress(self, bytes_downloaded): self._total_bytes_downloaded += bytes_downloaded now = time.time() if (self._interactive_mode() or now - self._last_progress_msg_print_time > 15): # Print progress message every 15 secs or if interacti...
[ "Logs progress information about ongoing module download.\n\n Args:\n bytes_downloaded: Number of bytes downloaded.\n " ]
Please provide a description of the function:def _extract_file(self, tgz, tarinfo, dst_path, buffer_size=10<<20): 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) self._log_progre...
[ "Extracts 'tarinfo' from 'tgz' and writes to 'dst_path'." ]
Please provide a description of the function:def download_and_uncompress(self, fileobj, dst_path): try: with tarfile.open(mode="r|*", fileobj=fileobj) as tgz: for tarinfo in tgz: abs_target_path = _merge_relative_path(dst_path, tarinfo.name) if tarinfo.isfile(): s...
[ "Streams the content for the 'fileobj' and stores the result in dst_path.\n\n Args:\n fileobj: File handle pointing to .tar/.tar.gz content.\n dst_path: Absolute path where to store uncompressed data from 'fileobj'.\n\n Raises:\n ValueError: Unknown object encountered inside the TAR file.\n ...
Please provide a description of the function:def prepend_name_scope(name, import_scope): # 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.c...
[ "Prepends name scope to a name." ]
Please provide a description of the function:def prefix_shared_name_attributes(meta_graph, absolute_import_scope): 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.HasField("s"): ...
[ "In-place prefixes shared_name attributes of nodes." ]
Please provide a description of the function:def mark_backward(output_tensor, used_node_names): op = output_tensor.op if op.name in used_node_names: return used_node_names.add(op.name) for input_tensor in op.inputs: mark_backward(input_tensor, used_node_names) for control_input_op in op.control_inp...
[ "Function to propagate backwards in the graph and mark nodes as used.\n\n Traverses recursively through the graph from the end tensor, through the op\n that generates the tensor, and then to the input tensors that feed the op.\n Nodes encountered are stored in used_node_names.\n\n Args:\n output_tensor: A Te...
Please provide a description of the function:def prune_unused_nodes(meta_graph, signature_def): # Instantiate a temporary empty graph so that we have access to Graph API # and import the meta_graph. graph = tf_v1.Graph() with graph.as_default(): tf_v1.train.import_meta_graph(meta_graph, input_map={}, imp...
[ "Function to prune unused ops given a signature def.\n\n This function does a graph traversal through from all outputs as\n defined in the signature_def to collect all used nodes. Then, any\n nodes which are unused can be discarded. This is useful for graph which are\n executing eagerly or on TPUs.\n\n Args:\n...
Please provide a description of the function:def prune_feed_map(meta_graph, feed_map): 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: del feed_map[k]
[ "Function to prune the feedmap of nodes which no longer exist." ]
Please provide a description of the function:def atomic_write_string_to_file(filename, contents, overwrite): temp_pathname = (tf.compat.as_bytes(filename) + tf.compat.as_bytes(".tmp") + tf.compat.as_bytes(uuid.uuid4().hex)) with tf_v1.gfile.GFile(temp_pathname, mode="w") as ...
[ "Writes to `filename` atomically.\n\n This means that when `filename` appears in the filesystem, it will contain\n all of `contents`. With write_string_to_file, it is possible for the file\n to appear in the filesystem with `contents` only partially written.\n\n Accomplished by writing to a temp file and then r...
Please provide a description of the function:def get_timestamped_export_dir(export_dir_base): attempts = 0 while attempts < MAX_DIRECTORY_CREATION_ATTEMPTS: export_timestamp = int(time.time()) export_dir = os.path.join( tf.compat.as_bytes(export_dir_base), tf.compat.as_bytes(str(export_t...
[ "Builds a path to a new subdirectory within the base directory.\n\n Each export is written into a new subdirectory named using the\n current time. This guarantees monotonically increasing version\n numbers even across multiple runs of the pipeline.\n The timestamp used is the number of seconds since epoch UTC....
Please provide a description of the function:def get_temp_export_dir(timestamped_export_dir): (dirname, basename) = os.path.split(timestamped_export_dir) temp_export_dir = os.path.join( tf.compat.as_bytes(dirname), tf.compat.as_bytes("temp-{}".format(basename))) return temp_export_dir
[ "Builds a directory name based on the argument but starting with 'temp-'.\n\n This relies on the fact that TensorFlow Serving ignores subdirectories of\n the base directory that can't be parsed as integers.\n\n Args:\n timestamped_export_dir: the name of the eventual export directory, e.g.\n /foo/bar/<ti...
Please provide a description of the function:def garbage_collect_exports(export_dir_base, exports_to_keep): if exports_to_keep is None: return version_paths = [] # List of tuples (version, path) for filename in tf_v1.gfile.ListDirectory(export_dir_base): path = os.path.join( tf.compat.as_bytes...
[ "Deletes older exports, retaining only a given number of the most recent.\n\n Export subdirectories are assumed to be named with monotonically increasing\n integers; the most recent are taken to be those with the largest values.\n\n Args:\n export_dir_base: the base directory under which each export is in a\n...
Please provide a description of the function:def bytes_to_readable_str(num_bytes, include_b=False): if num_bytes is None: return str(num_bytes) if num_bytes < 1024: result = "%d" % num_bytes elif num_bytes < 1048576: result = "%.2fk" % (num_bytes / float(1 << 10)) elif num_bytes < 1073741824: ...
[ "Generate a human-readable string representing number of bytes.\n\n The units B, kB, MB and GB are used.\n\n Args:\n num_bytes: (`int` or None) Number of bytes.\n include_b: (`bool`) Include the letter B at the end of the unit.\n\n Returns:\n (`str`) A string representing the number of bytes in a human-...
Please provide a description of the function:def announce(version): # 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".format(last_ve...
[ "Generates a new release announcement entry in the docs." ]
Please provide a description of the function:def pre_release(version): announce(version) regen() changelog(version, write_out=True) fix_formatting() msg = "Preparing release version {}".format(version) check_call(["git", "commit", "-a", "-m", msg]) print() print(f"{Fore.CYAN}[gene...
[ "Generates new docs, release announcements and creates a local tag." ]
Please provide a description of the function:def dump(file_name, predictions=None, algo=None, verbose=0): dump_obj = {'predictions': predictions, 'algo': algo } pickle.dump(dump_obj, open(file_name, 'wb'), protocol=pickle.HIGHEST_PROTOCOL) if verbose: ...
[ "A basic wrapper around Pickle to serialize a list of prediction and/or\n an algorithm on drive.\n\n What is dumped is a dictionary with keys ``'predictions'`` and ``'algo'``.\n\n Args:\n file_name(str): The name (with full path) specifying where to dump the\n predictions.\n predic...
Please provide a description of the function:def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.delete_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, ...
[ "\n delete a HorizontalPodAutoscaler\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.delete_namespaced_horizontal_pod_autoscaler(name, namespace, async_req=True)\n >>> result = thread....
Please provide a description of the function:def get_api_resources(self, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_api_resources_with_http_info(**kwargs) else: (data) = self.get_api_resources_with_http_info(**k...
[ "\n get available resources\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.get_api_resources(async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n :ret...
Please provide a description of the function:def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.patch_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespa...
[ "\n partially update the specified HorizontalPodAutoscaler\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.patch_namespaced_horizontal_pod_autoscaler(name, namespace, body, async_req=True)\n ...
Please provide a description of the function:def patch_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.patch_namespaced_horizontal_pod_autoscaler_status_with_http_info...
[ "\n partially update status of the specified HorizontalPodAutoscaler\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.patch_namespaced_horizontal_pod_autoscaler_status(name, namespace, body, a...
Please provide a description of the function:def replace_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.replace_namespaced_horizontal_pod_autoscaler_with_http_info(name, nam...
[ "\n replace the specified HorizontalPodAutoscaler\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.replace_namespaced_horizontal_pod_autoscaler(name, namespace, body, async_req=True)\n ...
Please provide a description of the function:def replace_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.replace_namespaced_horizontal_pod_autoscaler_status_with_http_...
[ "\n replace status of the specified HorizontalPodAutoscaler\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.replace_namespaced_horizontal_pod_autoscaler_status(name, namespace, body, async_re...
Please provide a description of the function:def ca_bundle(self, ca_bundle): if ca_bundle is not None and not re.search('^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', ca_bundle): raise ValueError("Invalid value for `ca_bundle`, must be a follow pattern or equal to `/...
[ "\n Sets the ca_bundle of this V1alpha1WebhookClientConfig.\n `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.\n\n :param ca_bundle: The ca_bundle of this V1alpha1WebhookClientCon...
Please provide a description of the function:def create_namespaced_pod_preset(self, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_namespaced_pod_preset_with_http_info(namespace, body, **kwargs) else: ...
[ "\n create a PodPreset\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.create_namespaced_pod_preset(namespace, body, async_req=True)\n >>> result = thread.get()\n\n :param async...
Please provide a description of the function:def delete_collection_namespaced_pod_preset(self, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.delete_collection_namespaced_pod_preset_with_http_info(namespace, **kwargs) el...
[ "\n delete collection of PodPreset\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.delete_collection_namespaced_pod_preset(namespace, async_req=True)\n >>> result = thread.get()\n\n ...
Please provide a description of the function:def list_pod_preset_for_all_namespaces(self, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.list_pod_preset_for_all_namespaces_with_http_info(**kwargs) else: (data) = self.li...
[ "\n list or watch objects of kind PodPreset\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.list_pod_preset_for_all_namespaces(async_req=True)\n >>> result = thread.get()\n\n :p...
Please provide a description of the function:def create_namespaced_cron_job(self, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_namespaced_cron_job_with_http_info(namespace, body, **kwargs) else: ...
[ "\n create a CronJob\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.create_namespaced_cron_job(namespace, body, async_req=True)\n >>> result = thread.get()\n\n :param async_req...
Please provide a description of the function:def delete_collection_namespaced_cron_job(self, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.delete_collection_namespaced_cron_job_with_http_info(namespace, **kwargs) else: ...
[ "\n delete collection of CronJob\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.delete_collection_namespaced_cron_job(namespace, async_req=True)\n >>> result = thread.get()\n\n ...
Please provide a description of the function:def list_cron_job_for_all_namespaces(self, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.list_cron_job_for_all_namespaces_with_http_info(**kwargs) else: (data) = self.list_c...
[ "\n list or watch objects of kind CronJob\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.list_cron_job_for_all_namespaces(async_req=True)\n >>> result = thread.get()\n\n :param...
Please provide a description of the function:def list_namespaced_cron_job(self, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.list_namespaced_cron_job_with_http_info(namespace, **kwargs) else: (data) = self....
[ "\n list or watch objects of kind CronJob\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.list_namespaced_cron_job(namespace, async_req=True)\n >>> result = thread.get()\n\n :pa...
Please provide a description of the function:def read_namespaced_cron_job(self, name, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.read_namespaced_cron_job_with_http_info(name, namespace, **kwargs) else: (d...
[ "\n read the specified CronJob\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.read_namespaced_cron_job(name, namespace, async_req=True)\n >>> result = thread.get()\n\n :param a...
Please provide a description of the function:def read_namespaced_cron_job_status(self, name, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.read_namespaced_cron_job_status_with_http_info(name, namespace, **kwargs) else: ...
[ "\n read status of the specified CronJob\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.read_namespaced_cron_job_status(name, namespace, async_req=True)\n >>> result = thread.get()\n\...
Please provide a description of the function:def create_custom_resource_definition(self, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_custom_resource_definition_with_http_info(body, **kwargs) else: (data)...
[ "\n create a CustomResourceDefinition\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.create_custom_resource_definition(body, async_req=True)\n >>> result = thread.get()\n\n :pa...
Please provide a description of the function:def delete_custom_resource_definition(self, name, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.delete_custom_resource_definition_with_http_info(name, **kwargs) else: (data)...
[ "\n delete a CustomResourceDefinition\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.delete_custom_resource_definition(name, async_req=True)\n >>> result = thread.get()\n\n :pa...
Please provide a description of the function:def list_custom_resource_definition(self, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.list_custom_resource_definition_with_http_info(**kwargs) else: (data) = self.list_cus...
[ "\n list or watch objects of kind CustomResourceDefinition\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.list_custom_resource_definition(async_req=True)\n >>> result = thread.get()\n...
Please provide a description of the function:def read_custom_resource_definition(self, name, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.read_custom_resource_definition_with_http_info(name, **kwargs) else: (data) = s...
[ "\n read the specified CustomResourceDefinition\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.read_custom_resource_definition(name, async_req=True)\n >>> result = thread.get()\n\n ...
Please provide a description of the function:def read_custom_resource_definition_status(self, name, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.read_custom_resource_definition_status_with_http_info(name, **kwargs) else: ...
[ "\n read status of the specified CustomResourceDefinition\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.read_custom_resource_definition_status(name, async_req=True)\n >>> result = th...
Please provide a description of the function:def delete_namespaced_ingress(self, name, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.delete_namespaced_ingress_with_http_info(name, namespace, **kwargs) else: ...
[ "\n delete an Ingress\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.delete_namespaced_ingress(name, namespace, async_req=True)\n >>> result = thread.get()\n\n :param async_req...
Please provide a description of the function:def list_namespaced_ingress(self, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.list_namespaced_ingress_with_http_info(namespace, **kwargs) else: (data) = self.li...
[ "\n list or watch objects of kind Ingress\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.list_namespaced_ingress(namespace, async_req=True)\n >>> result = thread.get()\n\n :par...
Please provide a description of the function:def patch_namespaced_ingress(self, name, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.patch_namespaced_ingress_with_http_info(name, namespace, body, **kwargs) else: ...
[ "\n partially update the specified Ingress\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.patch_namespaced_ingress(name, namespace, body, async_req=True)\n >>> result = thread.get()\n...
Please provide a description of the function:def patch_namespaced_ingress_status(self, name, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.patch_namespaced_ingress_status_with_http_info(name, namespace, body, **kwargs) ...
[ "\n partially update status of the specified Ingress\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.patch_namespaced_ingress_status(name, namespace, body, async_req=True)\n >>> result...
Please provide a description of the function:def read_namespaced_ingress(self, name, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.read_namespaced_ingress_with_http_info(name, namespace, **kwargs) else: (dat...
[ "\n read the specified Ingress\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.read_namespaced_ingress(name, namespace, async_req=True)\n >>> result = thread.get()\n\n :param as...
Please provide a description of the function:def replace_namespaced_ingress(self, name, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.replace_namespaced_ingress_with_http_info(name, namespace, body, **kwargs) else...
[ "\n replace the specified Ingress\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.replace_namespaced_ingress(name, namespace, body, async_req=True)\n >>> result = thread.get()\n\n ...
Please provide a description of the function:def replace_namespaced_ingress_status(self, name, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.replace_namespaced_ingress_status_with_http_info(name, namespace, body, **kwargs...
[ "\n replace status of the specified Ingress\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.replace_namespaced_ingress_status(name, namespace, body, async_req=True)\n >>> result = thre...
Please provide a description of the function:def connect_delete_namespaced_service_proxy_with_path(self, name, namespace, path, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.connect_delete_namespaced_service_proxy_with_path_with_http_info...
[ "\n connect DELETE requests to proxy of Service\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.connect_delete_namespaced_service_proxy_with_path(name, namespace, path, async_req=True)\n ...
Please provide a description of the function:def connect_get_namespaced_pod_exec(self, name, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.connect_get_namespaced_pod_exec_with_http_info(name, namespace, **kwargs) else: ...
[ "\n connect GET requests to exec of Pod\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.connect_get_namespaced_pod_exec(name, namespace, async_req=True)\n >>> result = thread.get()\n\n...
Please provide a description of the function:def connect_get_namespaced_service_proxy(self, name, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.connect_get_namespaced_service_proxy_with_http_info(name, namespace, **kwargs) ...
[ "\n connect GET requests to proxy of Service\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.connect_get_namespaced_service_proxy(name, namespace, async_req=True)\n >>> result = thread...
Please provide a description of the function:def connect_head_namespaced_pod_proxy(self, name, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.connect_head_namespaced_pod_proxy_with_http_info(name, namespace, **kwargs) el...
[ "\n connect HEAD requests to proxy of Pod\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.connect_head_namespaced_pod_proxy(name, namespace, async_req=True)\n >>> result = thread.get()...
Please provide a description of the function:def connect_head_node_proxy(self, name, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.connect_head_node_proxy_with_http_info(name, **kwargs) else: (data) = self.connect_head...
[ "\n connect HEAD requests to proxy of Node\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.connect_head_node_proxy(name, async_req=True)\n >>> result = thread.get()\n\n :param a...
Please provide a description of the function:def connect_options_namespaced_service_proxy(self, name, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.connect_options_namespaced_service_proxy_with_http_info(name, namespace, **kwar...
[ "\n connect OPTIONS requests to proxy of Service\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.connect_options_namespaced_service_proxy(name, namespace, async_req=True)\n >>> result ...
Please provide a description of the function:def connect_patch_namespaced_pod_proxy(self, name, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.connect_patch_namespaced_pod_proxy_with_http_info(name, namespace, **kwargs) ...
[ "\n connect PATCH requests to proxy of Pod\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.connect_patch_namespaced_pod_proxy(name, namespace, async_req=True)\n >>> result = thread.get...
Please provide a description of the function:def connect_patch_node_proxy(self, name, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.connect_patch_node_proxy_with_http_info(name, **kwargs) else: (data) = self.connect_pa...
[ "\n connect PATCH requests to proxy of Node\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.connect_patch_node_proxy(name, async_req=True)\n >>> result = thread.get()\n\n :param...
Please provide a description of the function:def connect_post_namespaced_pod_portforward(self, name, namespace, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.connect_post_namespaced_pod_portforward_with_http_info(name, namespace, **kwargs...
[ "\n connect POST requests to portforward of Pod\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.connect_post_namespaced_pod_portforward(name, namespace, async_req=True)\n >>> result = ...
Please provide a description of the function:def connect_post_namespaced_service_proxy_with_path(self, name, namespace, path, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.connect_post_namespaced_service_proxy_with_path_with_http_info(nam...
[ "\n connect POST requests to proxy of Service\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.connect_post_namespaced_service_proxy_with_path(name, namespace, path, async_req=True)\n >...
Please provide a description of the function:def connect_put_namespaced_pod_proxy_with_path(self, name, namespace, path, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.connect_put_namespaced_pod_proxy_with_path_with_http_info(name, namespa...
[ "\n connect PUT requests to proxy of Pod\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.connect_put_namespaced_pod_proxy_with_path(name, namespace, path, async_req=True)\n >>> result ...
Please provide a description of the function:def connect_put_node_proxy_with_path(self, name, path, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.connect_put_node_proxy_with_path_with_http_info(name, path, **kwargs) else: ...
[ "\n connect PUT requests to proxy of Node\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.connect_put_node_proxy_with_path(name, path, async_req=True)\n >>> result = thread.get()\n\n ...
Please provide a description of the function:def create_namespaced_endpoints(self, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_namespaced_endpoints_with_http_info(namespace, body, **kwargs) else: ...
[ "\n create Endpoints\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.create_namespaced_endpoints(namespace, body, async_req=True)\n >>> result = thread.get()\n\n :param async_re...
Please provide a description of the function:def create_namespaced_event(self, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_namespaced_event_with_http_info(namespace, body, **kwargs) else: (dat...
[ "\n create an Event\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.create_namespaced_event(namespace, body, async_req=True)\n >>> result = thread.get()\n\n :param async_req boo...
Please provide a description of the function:def create_namespaced_pod(self, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_namespaced_pod_with_http_info(namespace, body, **kwargs) else: (data) =...
[ "\n create a Pod\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.create_namespaced_pod(namespace, body, async_req=True)\n >>> result = thread.get()\n\n :param async_req bool\n ...
Please provide a description of the function:def create_namespaced_replication_controller(self, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_namespaced_replication_controller_with_http_info(namespace, body, **kwar...
[ "\n create a ReplicationController\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.create_namespaced_replication_controller(namespace, body, async_req=True)\n >>> result = thread.get()...
Please provide a description of the function:def create_namespaced_service_account(self, namespace, body, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_namespaced_service_account_with_http_info(namespace, body, **kwargs) el...
[ "\n create a ServiceAccount\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.create_namespaced_service_account(namespace, body, async_req=True)\n >>> result = thread.get()\n\n :p...