code: def _nucleotide_to_onehot(nucleotide):
      """Encodes a nucleotide using a one hot encoding."""
      a_onehot = tf.constant([1, 0, 0, 0])
      c_onehot = tf.constant([0, 1, 0, 0])
      g_onehot = tf.constant([0, 0, 1, 0])
      t_onehot = tf.constant([0, 0, 0, 1])
      error_onehot = tf.constant([1, 1, 1, 1])
  
      if tf.math.equal(
          nucleotide, tf.constant(b"A")
      ):  # pylint: disable=no-else-return
          return a_onehot
      elif tf.math.equal(nucleotide, tf.constant(b"C")):
          return c_onehot
      elif tf.math.equal(nucleotide, tf.constant(b"G")):
          return g_onehot
      elif tf.math.equal(nucleotide, tf.constant(b"T")):
          return t_onehot
      else:
          # TODO(suyashkumar): how best to raise error from within tf.function?
          return error_onehot
  
file_path: io/tensorflow_io/python/ops/genome_ops.py
imports: import tensorflow
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 2 for calling a global function with example usage: _nucleotide_to_onehot(nucleotide) and returns: a_onehot, c_onehot, g_onehot, t_onehot, error_onehot