id int64 0 190k | prompt stringlengths 21 13.4M | docstring stringlengths 1 12k ⌀ |
|---|---|---|
166,312 | import collections
import contextlib
import copy
import threading
import typing
from typing import Callable, Iterator, MutableMapping, Optional
import cachetools
from tfx.orchestration import metadata
from google.protobuf.internal import containers
from ml_metadata.proto import metadata_store_pb2
_execution_cache = _Ex... | Clears cached state. Useful in tests. |
166,313 | from concurrent import futures
import contextlib
import dataclasses
import queue
import threading
from typing import Any, Callable, List, Optional, Union
from absl import logging
from tfx.orchestration.experimental.core import task as task_lib
from tfx.utils import status as status_lib
from ml_metadata.proto import met... | Register an observer. Registers an observer. The observer function will be called whenever an event triggers. Silently does nothing if not in an init() context. Args: observer_fn: A function that takes in an Event. |
166,314 | from concurrent import futures
import contextlib
import dataclasses
import queue
import threading
from typing import Any, Callable, List, Optional, Union
from absl import logging
from tfx.orchestration.experimental.core import task as task_lib
from tfx.utils import status as status_lib
from ml_metadata.proto import met... | null |
166,315 | import builtins
import html
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
from tfx.dsl.components.base.base_component import BaseComponent
from tfx.orchestration.experimental.interactive.execution_result import ExecutionResult
from tfx.types.artifact import Artifact
from tfx.types.chan... | null |
166,316 | import builtins
import html
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
from tfx.dsl.components.base.base_component import BaseComponent
from tfx.orchestration.experimental.interactive.execution_result import ExecutionResult
from tfx.types.artifact import Artifact
from tfx.types.chan... | Register HTML notebook formatters for TFX classes. This method registers HTML formatters for TFX classes for display in IPython / Jupyter / Colab notebooks. No action will be performed if called outside a notebook environment. |
166,317 | from IPython.core.magic import cell_magic
from IPython.core.magic import Magics
from IPython.core.magic import magics_class
class SkipMagics(Magics):
def skip_for_export(self, line, cell):
# Execute the cell normally for now. During export to pipeline, this cell
# will be skipped.
self.shell.run_cell(cell... | null |
166,318 | import builtins
import functools
from absl import logging
The provided code snippet includes necessary dependencies for implementing the `requires_ipython` function. Write a Python function `def requires_ipython(fn)` to solve the following problem:
Decorator for methods that can only be run in IPython.
Here is the fu... | Decorator for methods that can only be run in IPython. |
166,319 | import os
import tensorflow_data_validation as tfdv
import tensorflow_model_analysis as tfma
from tfx import types
from tfx.components.statistics_gen import stats_artifact_utils
from tfx.orchestration.experimental.interactive import visualizations
from tfx.types import artifact_utils
from tfx.types import standard_arti... | null |
166,320 | import hashlib
import os
from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Set, Tuple, Union
from absl import logging
import apache_beam as beam
import pyarrow as pa
import tensorflow as tf
import tensorflow_data_validation as tfdv
import tensorflow_transform as tft
from tensorflow_tr... | Invokes the provided stats_options_updater_fn. Args: stats_options_updater_fn: The function to call. stats_type: The stats_type use in the function call. schema: The input schema to use in the function call. asset_map: A dictionary containing key to filename mappings. transform_output_path: The path to the transform ou... |
166,321 | import hashlib
import os
from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Set, Tuple, Union
from absl import logging
import apache_beam as beam
import pyarrow as pa
import tensorflow as tf
import tensorflow_data_validation as tfdv
import tensorflow_transform as tft
from tensorflow_tr... | Returns shallow copy of a RecordBatch with internal column removed. |
166,322 | import hashlib
import os
from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Set, Tuple, Union
from absl import logging
import apache_beam as beam
import pyarrow as pa
import tensorflow as tf
import tensorflow_data_validation as tfdv
import tensorflow_transform as tft
from tensorflow_tr... | Returns the number of datasests which should be cached based on heuristic. We allow pipelines with a small amount of analyzers (0-50) to cache many datasets, and restrict it further as the number of analyzers increases, so that a pipeline which has hundreds of analyzers can only cache a few datasets. If a pipeline does... |
166,323 | import argparse
from typing import List, Tuple
import absl
from absl import app
from absl.flags import argparse_flags
import apache_beam as beam
from tfx.components.transform import executor
from tfx.components.transform import labels
from tfx.components.util import udf_utils
from tfx.proto import example_gen_pb2
from ... | Construct and run transform executor. |
166,324 | import argparse
from typing import List, Tuple
import absl
from absl import app
from absl.flags import argparse_flags
import apache_beam as beam
from tfx.components.transform import executor
from tfx.components.transform import labels
from tfx.components.util import udf_utils
from tfx.proto import example_gen_pb2
from ... | Command lines flag parsing. |
166,325 | import functools
import os
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence
from absl import logging
from tfx import types
from tfx.components.transform import labels
from tfx.components.util import value_utils
from tfx.proto import transform_pb2
from tfx.types import artifact_utils
from tfx.ty... | null |
166,326 | import functools
import os
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence
from absl import logging
from tfx import types
from tfx.components.transform import labels
from tfx.components.util import value_utils
from tfx.proto import transform_pb2
from tfx.types import artifact_utils
from tfx.ty... | Check whether only one of given keys are specified in the input. NOTE: False-equivalent values like 0, '' are regarded as not specified. Args: inputs: input dictionary. keys: keys to check the existence of values. allow_missing: If False, one of keys should be set in inputs. Returns: True if one of the key has a value.... |
166,327 | import functools
import os
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence
from absl import logging
from tfx import types
from tfx.components.transform import labels
from tfx.components.util import value_utils
from tfx.proto import transform_pb2
from tfx.types import artifact_utils
from tfx.ty... | Alters output_dict to have the same number of examples to input. If there are multiple input Examples artifacts, replicate Examples artifact in output_dict to have the same number of artifacts. The resulting artifact will have URIs that is located under the original output uri. No-op if there is one or less Examples ar... |
166,328 | import functools
import os
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence
from absl import logging
from tfx import types
from tfx.components.transform import labels
from tfx.components.util import value_utils
from tfx.proto import transform_pb2
from tfx.types import artifact_utils
from tfx.ty... | Resolve SplitsConfig proto for the transfrom request. |
166,329 | import functools
import os
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence
from absl import logging
from tfx import types
from tfx.components.transform import labels
from tfx.components.util import value_utils
from tfx.proto import transform_pb2
from tfx.types import artifact_utils
from tfx.ty... | Sets split_names property of input artifacts. |
166,330 | import functools
import os
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence
from absl import logging
from tfx import types
from tfx.components.transform import labels
from tfx.components.util import value_utils
from tfx.proto import transform_pb2
from tfx.types import artifact_utils
from tfx.ty... | Gets all paths for splits in the input artifacts. |
166,331 | import functools
import os
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence
from absl import logging
from tfx import types
from tfx.components.transform import labels
from tfx.components.util import value_utils
from tfx.proto import transform_pb2
from tfx.types import artifact_utils
from tfx.ty... | Returns a cachePath entry if label exists in params_dict. |
166,332 | import functools
import os
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence
from absl import logging
from tfx import types
from tfx.components.transform import labels
from tfx.components.util import value_utils
from tfx.proto import transform_pb2
from tfx.types import artifact_utils
from tfx.ty... | Returns output entries for stats output path. |
166,333 | import os
from typing import Any, Dict
from absl import logging
import tensorflow_data_validation as tfdv
from tensorflow_data_validation.utils import path
from tensorflow_data_validation.utils import schema_util
from tfx import types
from tfx.components.statistics_gen import stats_artifact_utils
from tfx.dsl.component... | Returns new Anomalies proto with only info from statistics comparison. |
166,334 | import os
from typing import Any, Dict
from absl import logging
import tensorflow_data_validation as tfdv
from tensorflow_data_validation.utils import path
from tensorflow_data_validation.utils import schema_util
from tfx import types
from tfx.components.statistics_gen import stats_artifact_utils
from tfx.dsl.component... | Converts a config to a schema that can be used for data validation. |
166,335 | import os
from typing import Any, Dict
from absl import logging
import tensorflow_data_validation as tfdv
from tensorflow_data_validation.utils import path
from tensorflow_data_validation.utils import schema_util
from tfx import types
from tfx.components.statistics_gen import stats_artifact_utils
from tfx.dsl.component... | Identifies whether comparison could be done on the configured features. If comparison was not done for a configured feature, adds an anomaly flagging that. Args: raw_anomalies: The Anomalies proto to be checked for comparison. config: The config that identifies the features for which distribution validation will be don... |
166,336 | import os
from typing import Any, Dict
from absl import logging
import tensorflow_data_validation as tfdv
from tensorflow_data_validation.utils import path
from tensorflow_data_validation.utils import schema_util
from tfx import types
from tfx.components.statistics_gen import stats_artifact_utils
from tfx.dsl.component... | Creates an alert for each anomaly in the anomalies artifact. |
166,337 |
def get_no_validation_file_value(validation_path: str) -> str:
return (
f'No validations.tfrecords file found at {validation_path}. The '
'"blessed" custom_property will not be set.'
) | null |
166,338 | import json
import os
from typing import Any, Dict, List
import absl
from tensorflow import estimator as tf_estimator
import tensorflow_model_analysis as tfma
from tfx import types
from tfx.components.trainer import constants
from tfx.components.trainer import fn_args_utils
from tfx.components.util import udf_utils
fro... | null |
166,339 | import json
import os
from typing import Any, Dict, List
import absl
from tensorflow import estimator as tf_estimator
import tensorflow_model_analysis as tfma
from tfx import types
from tfx.components.trainer import constants
from tfx.components.trainer import fn_args_utils
from tfx.components.util import udf_utils
fro... | Returns true if this is run in the master (chief) of training cluster. |
166,340 | import os
import time
from typing import Iterable, Optional, Sequence
import numpy as np
import tensorflow as tf
from tfx.components.trainer.rewriting import rewriter
from tfx.dsl.io import fileio
from tfx.utils import io_utils
EXTRA_ASSETS_DIRECTORY = 'assets.extra'
def _create_tflite_compatible_saved_model(src: str,... | null |
166,341 | import os
import time
from typing import Iterable, Optional, Sequence
import numpy as np
import tensorflow as tf
from tfx.components.trainer.rewriting import rewriter
from tfx.dsl.io import fileio
from tfx.utils import io_utils
def _ensure_str(value):
if isinstance(value, str):
return value
elif isinstance(val... | null |
166,342 | import os
import time
from typing import Iterable, Optional, Sequence
import numpy as np
import tensorflow as tf
from tfx.components.trainer.rewriting import rewriter
from tfx.dsl.io import fileio
from tfx.utils import io_utils
def _ensure_bytes(value):
if isinstance(value, bytes):
return value
elif isinstance... | null |
166,343 | import importlib
from tfx.components.trainer.rewriting import rewriter
def _load_tflite_rewriter():
importlib.import_module('tfx.components.trainer.rewriting.tflite_rewriter') | null |
166,344 | import importlib
from tfx.components.trainer.rewriting import rewriter
def _load_tfjs_rewriter():
try:
importlib.import_module('tensorflowjs')
except ImportError as e:
raise RuntimeError(
'tensorflowjs is not installed. Please install [tfjs] extra '
'dependencies to use tfjs_rewriter.') fro... | null |
166,345 | from tensorflowjs.converters import converter
from tfx.components.trainer.rewriting import rewriter
CONVERTER_SAVED_MODEL_INPUT_FLAG = '--input_format=tf_saved_model'
CONVERTER_SERVING_TAG_FLAG = '--saved_model_tags=serve'
CONVERTER_DEFAULT_SIGNATURE_FLAG = '--signature_name=serving_default'
def _convert_tfjs_model(sa... | null |
166,346 | from tensorflowjs.converters import converter
from tfx.components.trainer.rewriting import rewriter
def _ensure_str(value):
if isinstance(value, str):
return value
elif isinstance(value, bytes):
return value.decode('utf-8')
else:
raise TypeError(f'Unexpected type {type(value)}.') | null |
166,347 | import json
import os
from typing import Any, Callable, Dict, List, Optional
from absl import logging
from keras_tuner.engine import base_tuner
from keras_tuner.engine import trial
from tfx import types
from tfx.components.trainer import fn_args_utils
from tfx.components.util import udf_utils
from tfx.dsl.components.ba... | Returns TuneArgs protos from execution properties, if present. |
166,348 | import json
import os
from typing import Any, Callable, Dict, List, Optional
from absl import logging
from keras_tuner.engine import base_tuner
from keras_tuner.engine import trial
from tfx import types
from tfx.components.trainer import fn_args_utils
from tfx.components.util import udf_utils
from tfx.dsl.components.ba... | Writes out best hyperpeameters and tuner results. |
166,349 | import json
import os
from typing import Any, Callable, Dict, List, Optional
from absl import logging
from keras_tuner.engine import base_tuner
from keras_tuner.engine import trial
from tfx import types
from tfx.components.trainer import fn_args_utils
from tfx.components.util import udf_utils
from tfx.dsl.components.ba... | Conduct a single hyperparameter search loop, and return the Tuner. |
166,350 | import importlib
import os
from typing import Any, Callable, Dict, List, Optional, Union
from absl import logging
import apache_beam as beam
import tensorflow as tf
from tfx import types
from tfx.components.bulk_inferrer import prediction_to_example_utils
from tfx.components.util import model_utils
from tfx.components.... | Runs model inference on given examples data. |
166,351 | import importlib
import os
from typing import Any, Callable, Dict, List, Optional, Union
from absl import logging
import apache_beam as beam
import tensorflow as tf
from tfx import types
from tfx.components.bulk_inferrer import prediction_to_example_utils
from tfx.components.util import model_utils
from tfx.components.... | Converts `prediction_log` to `tf.train.Example` and materializes. |
166,352 | import os
from typing import Any, Dict, Union
from absl import logging
import apache_beam as beam
import pyarrow.parquet as pq
import tensorflow as tf
from tfx.components.example_gen import base_example_gen_executor
from tfx.dsl.io import fileio
from tfx.proto import example_gen_pb2
from tfx.types import standard_compo... | Read TFRecord files to PCollection of records. Note that each input split will be transformed by this function separately. Args: pipeline: Beam pipeline. exec_properties: A dict of execution properties. - input_base: input dir that contains input data. split_pattern: Split.pattern in Input config, glob relative file pa... |
166,353 | import os
from typing import Any, Dict, Union
from absl import logging
import apache_beam as beam
import pyarrow.parquet as pq
import tensorflow as tf
from tfx.components.example_gen import base_example_gen_executor
from tfx.dsl.io import fileio
from tfx.proto import example_gen_pb2
from tfx.types import standard_compo... | Read parquet files to PCollection of records represented by dicts. Note that each input split will be transformed by this function separately. Args: pipeline: Beam pipeline. exec_properties: A dict of execution properties. - input_base: input dir that contains input data. split_pattern: Split.pattern in Input config, g... |
166,354 | import datetime
import os
import re
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
from absl import logging
import numpy as np
from tfx.dsl.io import fileio
from tfx.proto import example_gen_pb2
from tfx.proto import range_config_pb2
from tfx.utils import io_utils
from google.protobuf import json_... | Return output split name based on input and output config. Return output split name if it's specified and input only contains one split, otherwise output split will be same as input. Args: input_config: example_gen_pb2.Input instance. If any field is provided as a RuntimeParameter, input_config should be constructed as... |
166,355 | import datetime
import os
import re
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
from absl import logging
import numpy as np
from tfx.dsl.io import fileio
from tfx.proto import example_gen_pb2
from tfx.proto import range_config_pb2
from tfx.utils import io_utils
from google.protobuf import json_... | Returns default input config. |
166,356 | import datetime
import os
import re
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
from absl import logging
import numpy as np
from tfx.dsl.io import fileio
from tfx.proto import example_gen_pb2
from tfx.proto import range_config_pb2
from tfx.utils import io_utils
from google.protobuf import json_... | Returns default output config based on input config. |
166,357 | import datetime
import os
import re
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
from absl import logging
import numpy as np
from tfx.dsl.io import fileio
from tfx.proto import example_gen_pb2
from tfx.proto import range_config_pb2
from tfx.utils import io_utils
from google.protobuf import json_... | Return query with timestamp placeholders filled. |
166,358 | import datetime
import os
import re
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
from absl import logging
import numpy as np
from tfx.dsl.io import fileio
from tfx.proto import example_gen_pb2
from tfx.proto import range_config_pb2
from tfx.utils import io_utils
from google.protobuf import json_... | Calculates the fingerprint of files in a URI matching split patterns. If a pattern has the {SPAN} placeholder or the Date spec placeholders, {YYYY}, {MM}, and {DD}, and optionally, the {VERSION} placeholder, attempts to find aligned values that results in all splits having the target span and most recent version for th... |
166,359 | import os
from typing import Any, Dict, Iterable, List
from absl import logging
import apache_beam as beam
import tensorflow as tf
from tfx.components.example_gen.base_example_gen_executor import BaseExampleGenExecutor
from tfx.dsl.io import fileio
from tfx.types import standard_component_specs
from tfx.utils import io... | null |
166,360 | import os
from typing import Any, Dict, Iterable, List
from absl import logging
import apache_beam as beam
import tensorflow as tf
from tfx.components.example_gen.base_example_gen_executor import BaseExampleGenExecutor
from tfx.dsl.io import fileio
from tfx.types import standard_component_specs
from tfx.utils import io... | null |
166,361 | import os
from typing import Any, Dict, Iterable, List
from absl import logging
import apache_beam as beam
import tensorflow as tf
from tfx.components.example_gen.base_example_gen_executor import BaseExampleGenExecutor
from tfx.dsl.io import fileio
from tfx.types import standard_component_specs
from tfx.utils import io... | null |
166,362 | import abc
import bisect
import hashlib
import pickle
from typing import Any, Dict, List, Union
from absl import logging
import apache_beam as beam
import tensorflow as tf
from tfx import types
from tfx.components.example_gen import utils
from tfx.components.example_gen import write_split
from tfx.components.util impor... | Partition function for the ExampleGen's output splits. |
166,363 | import os
from typing import Any, Dict
from absl import logging
import apache_beam as beam
import tensorflow as tf
from tfx.components.example_gen import utils
from tfx.components.example_gen.base_example_gen_executor import BaseExampleGenExecutor
from tfx.types import standard_component_specs
The provided code snippe... | Read Parquet files and transform to TF examples. Note that each input split will be transformed by this function separately. Args: pipeline: beam pipeline. exec_properties: A dict of execution properties. - input_base: input dir that contains Parquet data. split_pattern: Split.pattern in Input config, glob relative fil... |
166,364 | import os
from typing import Any, Dict
from absl import logging
import apache_beam as beam
import tensorflow as tf
from tfx.components.example_gen import utils
from tfx.components.example_gen.base_example_gen_executor import BaseExampleGenExecutor
from tfx.types import standard_component_specs
The provided code snippe... | Read Avro files and transform to TF examples. Note that each input split will be transformed by this function separately. Args: pipeline: beam pipeline. exec_properties: A dict of execution properties. - input_base: input dir that contains Avro data. split_pattern: Split.pattern in Input config, glob relative file patt... |
166,365 | import os
from typing import Optional, Any, Dict, Union
import apache_beam as beam
import tensorflow as tf
from tfx.proto import example_gen_pb2
from tfx.types import standard_component_specs
from tfx.utils import deprecation_utils
from tfx_bsl.telemetry import util
DEFAULT_PARQUET_FILE_NAME = 'data_parquet'
DEFAULT_FI... | Shuffles and writes output split as serialized records in TFRecord or Parquet. |
166,366 | import os
from typing import Optional, Any, Dict, Union
import apache_beam as beam
import tensorflow as tf
from tfx.proto import example_gen_pb2
from tfx.types import standard_component_specs
from tfx.utils import deprecation_utils
from tfx_bsl.telemetry import util
def to_file_format_str(file_format: example_gen_pb2.... | null |
166,367 | import os
from typing import Any, Dict, List
from absl import logging
import tensorflow_data_validation as tfdv
from tfx import types
from tfx.components.example_validator import labels
from tfx.components.statistics_gen import stats_artifact_utils
from tfx.components.util import value_utils
from tfx.dsl.components.bas... | Creates an alert for each anomaly in the anomalies artifact. |
166,368 | import contextlib
import functools
import os
import signal
import threading
import time
from typing import Any, Dict, List, Optional
from absl import logging
from tfx import types
from tfx.components.infra_validator import error_types
from tfx.components.infra_validator import request_builder
from tfx.components.infra_... | Create a ModelServerRunner from a model, a ServingBinary and a ServingSpec. Args: model_path: An IV-flavored model path. (See model_path_utils.py) serving_binary: One of ServingBinary instances parsed from the `serving_spec`. serving_spec: A ServingSpec instance of this infra validation. Returns: A ModelServerRunner. |
166,369 | import contextlib
import functools
import os
import signal
import threading
import time
from typing import Any, Dict, List, Optional
from absl import logging
from tfx import types
from tfx.components.infra_validator import error_types
from tfx.components.infra_validator import request_builder
from tfx.components.infra_... | Try convert infra validation request to TF-Serving PredictionLog. |
166,370 | import contextlib
import functools
import os
import signal
import threading
import time
from typing import Any, Dict, List, Optional
from absl import logging
from tfx import types
from tfx.components.infra_validator import error_types
from tfx.components.infra_validator import request_builder
from tfx.components.infra_... | null |
166,371 | import contextlib
import functools
import os
import signal
import threading
import time
from typing import Any, Dict, List, Optional
from absl import logging
from tfx import types
from tfx.components.infra_validator import error_types
from tfx.components.infra_validator import request_builder
from tfx.components.infra_... | null |
166,372 | import abc
import os
from typing import Any, Dict, List, Optional
from docker import types as docker_types
from tfx.components.infra_validator.model_server_clients import base_client
from tfx.components.infra_validator.model_server_clients import tensorflow_serving_client
from tfx.proto import infra_validator_pb2
from ... | Parse `ServingBinary`s from `ServingSpec`. |
166,373 | import abc
import os
from typing import Any, Iterable, List, Mapping, Optional
from absl import logging
import tensorflow as tf
from tfx import types
from tfx.components.infra_validator import types as iv_types
from tfx.components.util import examples_utils
from tfx.components.util import tfxio_utils
from tfx.dsl.io im... | Build model server requests. Examples artifact will be used as a data source to build requests. Caller should guarantee that the logical format of the Examples artifact should be compatible with request type to build. Args: model_name: A model name that model server recognizes. model: A model artifact for model signatu... |
166,374 | import os
import time
from typing import Any, Dict, Optional
from absl import logging
import docker
from docker import errors as docker_errors
from tfx.components.infra_validator import error_types
from tfx.components.infra_validator import serving_bins
from tfx.components.infra_validator.model_server_runners import ba... | null |
166,375 | import os
import time
from typing import Any, Dict, Optional
from absl import logging
import docker
from docker import errors as docker_errors
from tfx.components.infra_validator import error_types
from tfx.components.infra_validator import serving_bins
from tfx.components.infra_validator.model_server_runners import ba... | Find host port from container port mappings. `ports` is a nested dictionary of the following structure: { '8500/tcp': [ {'HostIp': '0.0.0.0', 'HostPort': '32769'}, {'HostIp': '::', 'HostPort': '32770'}, ], '8501/tcp': [ {'HostIp': '0.0.0.0', 'HostPort': '32768'}, {'HostIp': '::', 'HostPort': '32771'}, ], } Args: ports:... |
166,376 | import datetime
import os
import time
from typing import Optional
from absl import logging
from apache_beam.utils import retry
from kubernetes import client as k8s_client
from kubernetes.client import rest
from tfx.components.infra_validator import error_types
from tfx.components.infra_validator import serving_bins
fro... | null |
166,377 | import datetime
import os
import time
from typing import Optional
from absl import logging
from apache_beam.utils import retry
from kubernetes import client as k8s_client
from kubernetes.client import rest
from tfx.components.infra_validator import error_types
from tfx.components.infra_validator import serving_bins
fro... | null |
166,378 | import datetime
import os
import time
from typing import Optional
from absl import logging
from apache_beam.utils import retry
from kubernetes import client as k8s_client
from kubernetes.client import rest
from tfx.components.infra_validator import error_types
from tfx.components.infra_validator import serving_bins
fro... | null |
166,379 | import datetime
import os
import time
from typing import Optional
from absl import logging
from apache_beam.utils import retry
from kubernetes import client as k8s_client
from kubernetes.client import rest
from tfx.components.infra_validator import error_types
from tfx.components.infra_validator import serving_bins
fro... | Convert infra_validator_pb2.EnvVar to kubernetes.V1EnvVar. |
166,380 | import datetime
import os
import time
from typing import Optional
from absl import logging
from apache_beam.utils import retry
from kubernetes import client as k8s_client
from kubernetes.client import rest
from tfx.components.infra_validator import error_types
from tfx.components.infra_validator import serving_bins
fro... | null |
166,381 | import os
import tensorflow_data_validation as tfdv
from tfx.types import artifact
from tfx.types import artifact_utils
BINARY_PB_BASENAME = 'FeatureStats.pb'
TFRECORD_BASENAME = 'stats_tfrecord'
def load_statistics(stats_artifact: artifact.Artifact,
split: str) -> tfdv.DatasetListView:
stats_dir... | null |
166,382 | from typing import Optional
from tfx import types
from tfx.components.experimental.data_view import constants
from tfx.types import standard_artifacts
The provided code snippet includes necessary dependencies for implementing the `get_data_view_uri` function. Write a Python function `def get_data_view_uri(examples: ty... | Returns the URI to the DataView attached to an Examples artifact. Or None, if not attached. Args: examples: an Examples artifact. Returns: The URI to the DataView or None. |
166,383 | import os
from typing import Any, Dict, List
from absl import logging
import apache_beam as beam
import tensorflow as tf
from tensorflow_data_validation.skew import feature_skew_detector
from tfx import types
from tfx.components.util import tfxio_utils
from tfx.dsl.components.base import base_beam_executor
from tfx.pro... | null |
166,384 | import os
from typing import Any, Dict, List
from absl import logging
import apache_beam as beam
import tensorflow as tf
from tensorflow_data_validation.skew import feature_skew_detector
from tfx import types
from tfx.components.util import tfxio_utils
from tfx.dsl.components.base import base_beam_executor
from tfx.pro... | Convert ExampleDiffConfig to DetectFeatureSkewImpl kwargs. |
166,385 | import hashlib
import os
import re
import shutil
import struct
import subprocess
import sys
import tempfile
from typing import Any, Callable, Dict, List, Optional, Tuple
from absl import logging
from tfx.dsl.components.base import base_component
from tfx.dsl.io import fileio
from tfx.utils import import_utils
from tfx.... | Loads and returns user-defined function if exists. |
166,386 | import hashlib
import os
import re
import shutil
import struct
import subprocess
import sys
import tempfile
from typing import Any, Callable, Dict, List, Optional, Tuple
from absl import logging
from tfx.dsl.components.base import base_component
from tfx.dsl.io import fileio
from tfx.utils import import_utils
from tfx.... | Whether to package user modules in the current execution environment. |
166,387 | import hashlib
import os
import re
import shutil
import struct
import subprocess
import sys
import tempfile
from typing import Any, Callable, Dict, List, Optional, Tuple
from absl import logging
from tfx.dsl.components.base import base_component
from tfx.dsl.io import fileio
from tfx.utils import import_utils
from tfx.... | Adds a module file dependency to the current component. |
166,388 | import hashlib
import os
import re
import shutil
import struct
import subprocess
import sys
import tempfile
from typing import Any, Callable, Dict, List, Optional, Tuple
from absl import logging
from tfx.dsl.components.base import base_component
from tfx.dsl.io import fileio
from tfx.utils import import_utils
from tfx.... | Package the given user module file into a Python Wheel package. Args: instance_name: Name of the component instance, for creating a unique wheel package name. module_path: Path to the module file to be packaged. pipeline_root: Text Returns: dist_file_path: Path to the generated wheel file. user_module_path: Path for re... |
166,389 | import hashlib
import os
import re
import shutil
import struct
import subprocess
import sys
import tempfile
from typing import Any, Callable, Dict, List, Optional, Tuple
from absl import logging
from tfx.dsl.components.base import base_component
from tfx.dsl.io import fileio
from tfx.utils import import_utils
from tfx.... | Decode the given user module key into module path and pip dependencies. |
166,390 | import hashlib
import os
import re
import shutil
import struct
import subprocess
import sys
import tempfile
from typing import Any, Callable, Dict, List, Optional, Tuple
from absl import logging
from tfx.dsl.components.base import base_component
from tfx.dsl.io import fileio
from tfx.utils import import_utils
from tfx.... | Install the given pip dependency specifier to a temporary directory. Args: pip_dependency: Path to a wheel file or a pip dependency specifier (e.g. "setuptools==18.0"). temp_dir: Path to temporary installation location (optional). Returns: Temporary directory where the package was installed, that should be added to the... |
166,391 | import json
import os
from typing import Dict, List, Optional, Tuple
from absl import logging
from tfx import types
from tfx.components.example_gen import utils as example_gen_utils
from tfx.proto import example_gen_pb2
from tfx.types import artifact_utils
from tfx.types import standard_artifacts
from tfx.utils import ... | Returns the payload format as a string. |
166,392 | import json
import os
from typing import Dict, List, Optional, Tuple
from absl import logging
from tfx import types
from tfx.components.example_gen import utils as example_gen_utils
from tfx.proto import example_gen_pb2
from tfx.types import artifact_utils
from tfx.types import standard_artifacts
from tfx.utils import ... | Sets the payload format custom property for `examples`. Args: examples: A standard_artifacts.Examples artifact. payload_format: One of the enums in example_gen_pb2.PayloadFormat. |
166,393 | import json
import os
from typing import Dict, List, Optional, Tuple
from absl import logging
from tfx import types
from tfx.components.example_gen import utils as example_gen_utils
from tfx.proto import example_gen_pb2
from tfx.types import artifact_utils
from tfx.types import standard_artifacts
from tfx.utils import ... | Sets the file format custom property for `examples`. Args: examples: A standard_artifacts.Examples artifact. file_format: One of the file format that tfx_bsl understands. |
166,394 | import json
import os
from typing import Dict, List, Optional, Tuple
from absl import logging
from tfx import types
from tfx.components.example_gen import utils as example_gen_utils
from tfx.proto import example_gen_pb2
from tfx.types import artifact_utils
from tfx.types import standard_artifacts
from tfx.utils import ... | Get a custom property name and value encoding custom split patterns. Args: split_to_pattern: A dictionary mapping split names to file patterns. These patterns should be relative to the artifact's uri, which is expected to be an ancestor directory of split patterns. Returns: A tuple consisting of a property name and val... |
166,395 | import logging
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
import pyarrow as pa
import tensorflow as tf
from tfx.components.experimental.data_view import constants
from tfx.components.util import examples_utils
from tfx.proto import example_gen_pb2
from tfx.types import artifact
from ... | Returns a TFXIO for a single split. Args: examples: The Examples artifacts that the TFXIO is intended to access. split: The split to read. Must be a split contained in examples. telemetry_descriptors: A set of descriptors that identify the component that is instantiating the TFXIO. These will be used to construct the n... |
166,396 | import logging
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
import pyarrow as pa
import tensorflow as tf
from tfx.components.experimental.data_view import constants
from tfx.components.util import examples_utils
from tfx.proto import example_gen_pb2
from tfx.types import artifact
from ... | Returns a factory function that creates a proper TFXIO. Args: examples: The Examples artifacts that the TFXIO is intended to access. telemetry_descriptors: A set of descriptors that identify the component that is instantiating the TFXIO. These will be used to construct the namespace to contain metrics for profiling and... |
166,397 | from tfx import types
The provided code snippet includes necessary dependencies for implementing the `is_model_blessed` function. Write a Python function `def is_model_blessed(model_blessing: types.Artifact) -> bool` to solve the following problem:
Returns whether model is blessed by upstream ModelValidator. Args: mod... | Returns whether model is blessed by upstream ModelValidator. Args: model_blessing: model blessing artifact from model_validator. Returns: True if the model is blessed by validator. |
166,398 | from tfx import types
The provided code snippet includes necessary dependencies for implementing the `is_infra_validated` function. Write a Python function `def is_infra_validated(infra_blessing: types.Artifact) -> bool` to solve the following problem:
Returns whether model is infra blessed by upstream InfraValidator.... | Returns whether model is infra blessed by upstream InfraValidator. Args: infra_blessing: A `InfraBlessing` artifact from infra validator. Returns: Whether model is infra validated or not. |
166,399 | from typing import Any, Dict, List, Optional
import apache_beam as beam
from apache_beam.io.gcp import bigquery
from apache_beam.options import value_provider
import tensorflow as tf
from tfx.utils import telemetry_utils
The provided code snippet includes necessary dependencies for implementing the `row_to_example` fu... | Convert bigquery result row to tf example. Args: field_to_type: The name of the field to its type from BigQuery. field_name_to_data: The data need to be converted from BigQuery that contains field name and data. Returns: A tf.train.Example that converted from the BigQuery row. Note that BOOLEAN type in BigQuery result ... |
166,400 | import json
from typing import Any, Dict, Optional
import apache_beam as beam
from google.cloud import bigquery
import tensorflow as tf
from tfx.components.example_gen import base_example_gen_executor
from tfx.extensions.google_cloud_big_query import utils
class _BigQueryConverter:
"""Help class for bigquery result r... | Read from BigQuery and transform to TF examples. Args: pipeline: beam pipeline. exec_properties: A dict of execution properties. split_pattern: Split.pattern in Input config, a BigQuery sql string. Returns: PCollection of TF examples. |
166,401 | from typing import Any, Dict, Iterable, List, Set, Tuple
import apache_beam as beam
from google.cloud import bigquery
import tensorflow as tf
from tfx.components.example_gen import base_example_gen_executor
from tfx.extensions.google_cloud_big_query import utils
from tfx.extensions.google_cloud_big_query.experimental.e... | Read from BigQuery and transform to ExampleListWithContext. When a field has no value in BigQuery, a feature with no value will be generated in the tf.train.Features. This behavior is consistent with BigQueryExampleGen. Args: pipeline: beam pipeline. exec_properties: A dict of execution properties. split_pattern: Split... |
166,402 | from typing import Any, Callable, Dict
from tfx.dsl.component.experimental import container_component
from tfx.dsl.component.experimental import placeholders
from tfx.dsl.components.base import base_component
from tfx.extensions.experimental.kfp_compatibility.proto import kfp_component_spec_pb2
from tfx.types import st... | Creates a container-based component from a Kubeflow component spec. See https://www.kubeflow.org/docs/pipelines/reference/component-spec/ Example: component = load_kfp_yaml_container_component( "kfp_pipelines_root/components/datasets/Chicago_Taxi_Trips/component.yaml" ) Args: path: local file path of a Kubeflow Pipelin... |
166,403 | import datetime
import json
import os
from typing import Any, Dict, List
from absl import logging
from tfx import types
from tfx.components.tuner import executor as tuner_executor
from tfx.dsl.components.base import base_executor
from tfx.extensions.google_cloud_ai_platform import constants
from tfx.extensions.google_c... | Returns True if the Tuner instance requires a chief oracle. |
166,404 | import time
from typing import Any, Dict, List, Optional
from absl import logging
from googleapiclient import discovery
from tfx import types
from tfx.extensions.google_cloud_ai_platform import prediction_clients
from tfx.extensions.google_cloud_ai_platform import training_clients
from tfx.utils import version_utils
_P... | Wait for a long running operation. Args: api: Google API client resource. operation: The operation to wait for. method_name: Operation method name for logging. Returns: Operation completion status. Raises: RuntimeError: If the operation completed with an error. |
166,405 | import time
from typing import Any, Dict, List, Optional
from absl import logging
from googleapiclient import discovery
from tfx import types
from tfx.extensions.google_cloud_ai_platform import prediction_clients
from tfx.extensions.google_cloud_ai_platform import training_clients
from tfx.utils import version_utils
de... | Start a trainer job on AI Platform (AIP). This is done by forwarding the inputs/outputs/exec_properties to the tfx.scripts.run_executor module on a AI Platform training job interpreter. Args: input_dict: Passthrough input dict for tfx.components.Trainer.executor. output_dict: Passthrough input dict for tfx.components.T... |
166,406 | import time
from typing import Any, Dict, List, Optional
from absl import logging
from googleapiclient import discovery
from tfx import types
from tfx.extensions.google_cloud_ai_platform import prediction_clients
from tfx.extensions.google_cloud_ai_platform import training_clients
from tfx.utils import version_utils
_D... | Gets service name and api version from ai_platform_serving_args. Args: ai_platform_serving_args: Dictionary containing arguments for pushing to AI Platform. Returns: Service name and API version. |
166,407 | import time
from typing import Any, Dict, List, Optional
from absl import logging
from googleapiclient import discovery
from tfx import types
from tfx.extensions.google_cloud_ai_platform import prediction_clients
from tfx.extensions.google_cloud_ai_platform import training_clients
from tfx.utils import version_utils
T... | Creates a new CAIP model or Vertex endpoint for serving with AI Platform if not exists. Args: labels: The dict of labels that will be attached to this CAIP job or Vertex endpoint. ai_platform_serving_args: Dictionary containing arguments for pushing to AI Platform. api: (CAIP only, required) Google API client resource.... |
166,408 | import time
from typing import Any, Dict, List, Optional
from absl import logging
from googleapiclient import discovery
from tfx import types
from tfx.extensions.google_cloud_ai_platform import prediction_clients
from tfx.extensions.google_cloud_ai_platform import training_clients
from tfx.utils import version_utils
T... | Deploys a model for serving with AI Platform. Args: serving_path: The path to the model. Must be a GCS URI. model_version_name: Model version for CAIP model being deployed, or model name for the Vertex model being deployed. Must be different from what is currently being served. ai_platform_serving_args: Dictionary cont... |
166,409 | import time
from typing import Any, Dict, List, Optional
from absl import logging
from googleapiclient import discovery
from tfx import types
from tfx.extensions.google_cloud_ai_platform import prediction_clients
from tfx.extensions.google_cloud_ai_platform import training_clients
from tfx.utils import version_utils
T... | Deletes a model version from Google Cloud AI Platform if version exists. Args: ai_platform_serving_args: Dictionary containing arguments for pushing to AI Platform. For the full set of parameters supported, refer to https://cloud.google.com/ml-engine/reference/rest/v1/projects.models api: (CAIP only, required) Google A... |
166,410 | import abc
import sys
import time
from typing import Any, Dict, Optional, Union
from absl import logging
from google.cloud import aiplatform
from googleapiclient import discovery
from googleapiclient import errors
import tensorflow as tf
_TF_COMPATIBILITY_OVERRIDE = {
# Generally, runtimeVersion should be same as <... | Returns the tensorflow runtime version used in Cloud AI Platform. This is only used for prediction service. Args: tf_version: version string returned from `tf.__version__`. Returns: same major.minor version of installed tensorflow, except when overriden by _TF_COMPATIBILITY_OVERRIDE. |
166,411 | import json
import os
import re
from typing import List
from absl import logging
from packaging import version
from tfx.types import artifact as artifact_lib
from ml_metadata.proto import metadata_store_pb2
_Artifact = artifact_lib.Artifact
def get_split_uris(artifact_list: List[_Artifact], split: str) -> List[str]:
... | Get the uri of Artifact with matching split from given list. Args: artifact_list: A list of Artifact objects whose length must be one. split: Name of split. Returns: The uri of Artifact object in artifact_list with matching split. Raises: ValueError: If number with matching split in artifact_list is not one. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.