code: def _create_or_load_embed(
      embed_name,
      vocab_file,
      embed_file,
      vocab_size,
      embed_size,
      dtype,
      embed_type="dense",
  ):
      """Create a new or load an existing embedding matrix."""
      if vocab_file and embed_file:
          embedding = _create_pretrained_emb_from_txt(
              vocab_file, embed_file
          )
      else:
          with tf.device(_get_embed_device(vocab_size)):
              if embed_type == "dense":
                  embedding = tf.get_variable(
                      embed_name, [vocab_size, embed_size], dtype
                  )
              elif embed_type == "sparse":
                  embedding = tf.get_variable(
                      embed_name, [vocab_size, embed_size], dtype
                  )
                  embedding = tf.contrib.model_pruning.apply_mask(
                      embedding, embed_name
                  )
              else:
                  raise ValueError(
                      "Unknown embedding type %s!" % embed_type
                  )
      return embedding
  
imports: from __future__ import print_function
  import collections
  import os
  import time
  import numpy
  import six
  import tensorflow
  from tensorflow.python.ops import lookup_ops
  from .utils import misc_utils, vocab_utils, iterator_utils
label_desc: Use image node_id 8 for calling a global function with example usage: _create_or_load_embed(embed_name, vocab_file, embed_file, vocab_size, embed_size, dtype, embed_type) and returns: embedding