class_docstr: This class serves as an `input_fn` for the `tf.estimator` framework.
class_docstr_tok: ["This","class","serves","as","an","`","input_fn","`","for","the","`","tf.estimator","`","framework","."]
docstr: Returns a dict describing features from a TF.example.
docstr_tok: ["Returns","a","dict","describing","features","from","a","TF.example","."]
code: def features_extraction_spec_for_mode(self, include_label_and_locus):
      """Returns a dict describing features from a TF.example."""
      spec = {
          "image/encoded": tf.io.FixedLenFeature((), tf.string),
          "variant/encoded": tf.io.FixedLenFeature((), tf.string),
          "alt_allele_indices/encoded": tf.io.FixedLenFeature(
              (), tf.string
          ),
          "variant_type": tf.io.FixedLenFeature((), tf.int64),
          "sequencing_type": tf.io.FixedLenFeature([], tf.int64),
      }
      if include_label_and_locus:
          # N.B. int32 fails here on TPU.
          spec["label"] = tf.io.FixedLenFeature((), tf.int64)
          spec["locus"] = tf.io.FixedLenFeature((), tf.string)
      return spec
  
imports: import itertools
  from typing import Callable, Optional, Tuple
  from absl import logging
  import ml_collections
  import tensorflow
  from tensorflow import estimator
  from deepvariant import dv_constants
  from deepvariant import dv_utils
  from deepvariant import keras_modeling
  from deepvariant.protos import deepvariant_pb2
  from google.protobuf import text_format
  from third_party.nucleus.io import sharded_file_utils
label_desc: Use image node_id 2 for calling the DeepVariantInput obj's underlying member method code with example usage: obj.features_extraction_spec_for_mode(include_label_and_locus) and returns: spec