class_docstr: Artifacts of small scalar-values that can be easily loaded into memory.
  
  Value artifacts are stored to a file located at the `uri` of the artifact.
  This is different from other kinds of artifact types that has a directory at
  the `uri`. The payload of the file will be determined by each value artifact
  types which is a subclass of this class.
  
  The content of a value artifact can be read or written using `.value`
  property.
class_docstr_tok: ["Artifacts","of","small","scalar-values","that","can","be","easily","loaded","into","memory",".","Value","artifacts","are","stored","to","a","file","located","at","the","`","uri","`","of","the","artifact",".","This","is","different","from","other","kinds","of","artifact","types","that","has","a","directory","at","the","`","uri","`",".","The","payload","of","the","file","will","be","determined","by","each","value","artifact","types","which","is","a","subclass","of","this","class",".","The","content","of","a","value","artifact","can","be","read","or","written","using","`",".value","`","property","."]
docstr: Annotate the value artifact type with a system artifact class.
  
  Example usage:
  
  ```python
  from tfx import v1 as tfx
  OutputArtifact = tfx.dsl.components.OutputArtifact
  String = tfx.types.standard_artifacts.String
  Model = tfx.dsl.standard_annotations.Model
  
  @tfx.dsl.components.component
  def MyTrainer(
      model: OutputArtifact[String.annotate_as(Model)]
  ):
    ...
  ```
  
  Args:
    type_annotation: the standard annotations used to annotate the value
      artifact type. The possible values are in
      `tfx.v1.dsl.standard_annotations`.
  
  Returns:
    A subclass of the method caller class (e.g., standard_artifacts.String,
    standard_artifacts.Float) with TYPE_ANNOTATION attribute set to be
    `type_annotation`; returns the original class if`type_annotation` is None.
docstr_tok: ["Annotate","the","value","artifact","type","with","a","system","artifact","class",".","Example","usage",":","``","`","python","from","tfx","import","v1","as","tfx","OutputArtifact","=","tfx.dsl.components.OutputArtifact","String","=","tfx.types.standard_artifacts.String","Model","=","tfx.dsl.standard_annotations.Model","@","tfx.dsl.components.component","def","MyTrainer","(","model",":","OutputArtifact","[","String.annotate_as","(","Model",")","]",")",":","...","``","`","Args",":","type_annotation",":","the","standard","annotations","used","to","annotate","the","value","artifact","type",".","The","possible","values","are","in","`","tfx.v1.dsl.standard_annotations","`",".","Returns",":","A","subclass","of","the","method","caller","class","(","e.g.",",","standard_artifacts.String",",","standard_artifacts.Float",")","with","TYPE_ANNOTATION","attribute","set","to","be","`","type_annotation","`",";","returns","the","original","class","if","`","type_annotation","`","is","None","."]
code: def annotate_as(
      cls, type_annotation: Optional[Type[SystemArtifact]] = None
  ):
      """Annotate the value artifact type with a system artifact class.
  
      Example usage:
  
      ```python
      from tfx import v1 as tfx
      OutputArtifact = tfx.dsl.components.OutputArtifact
      String = tfx.types.standard_artifacts.String
      Model = tfx.dsl.standard_annotations.Model
  
      @tfx.dsl.components.component
      def MyTrainer(
          model: OutputArtifact[String.annotate_as(Model)]
      ):
        ...
      ```
  
      Args:
        type_annotation: the standard annotations used to annotate the value
          artifact type. The possible values are in
          `tfx.v1.dsl.standard_annotations`.
  
      Returns:
        A subclass of the method caller class (e.g., standard_artifacts.String,
        standard_artifacts.Float) with TYPE_ANNOTATION attribute set to be
        `type_annotation`; returns the original class if`type_annotation` is None.
      """
      if not type_annotation:
          return cls
      if not issubclass(type_annotation, SystemArtifact):
          raise ValueError(
              "type_annotation %s is not a subclass of SystemArtifact."
              % type_annotation
          )
      type_annotation_str = str(type_annotation.__name__)
      return type(
          str(cls.__name__) + "_" + type_annotation_str,
          (cls,),
          {
              "TYPE_NAME": str(cls.TYPE_NAME)
              + "_"
              + type_annotation_str,
              "TYPE_ANNOTATION": type_annotation,
              "__module__": cls.__module__,
          },
      )
  
file_path: tfx/tfx/types/value_artifact.py
imports: import abc
  from typing import Any, Type, Optional
  from tfx.dsl.io import fileio
  from tfx.types.artifact import Artifact
  from tfx.types.artifact import Property
  from tfx.types.artifact import PropertyType
  from tfx.types.system_artifacts import SystemArtifact
  from tfx.utils import doc_controls
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 8 for calling the ValueArtifact obj's underlying member method code with example usage: obj.annotate_as(cls, type_annotation) and returns: type, cls