def _add_embedding_config(file_path, data_dir, has_metadata=False, label_img_shape=None):
with open(os.path.join(file_path, '<STR_LIT>'), '<STR_LIT:a>') as f:<EOL><INDENT>s = '<STR_LIT>'<EOL>s += '<STR_LIT>'.format(data_dir)<EOL>s += '<STR_LIT>'.format(os.path.join(data_dir, '<STR_LIT>'))<EOL>if has_metadata:<EOL><INDENT>s += '<STR_LIT>'.format(os.path.join(data_dir, '<STR_LIT>'))<EOL><DEDENT>if label_img_shape is not None:<EOL><INDENT>if len(label_img_shape) != <NUM_LIT:4>:<EOL><INDENT>logging.warning('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>', len(label_img_shape))<EOL><DEDENT>else:<EOL><INDENT>s += '<STR_LIT>'<EOL>s += '<STR_LIT>'.format(os.path.join(data_dir, '<STR_LIT>'))<EOL>s += '<STR_LIT>'.format(label_img_shape[<NUM_LIT:3>])<EOL>s += '<STR_LIT>'.format(label_img_shape[<NUM_LIT:2>])<EOL>s += '<STR_LIT>'<EOL><DEDENT><DEDENT>s += '<STR_LIT>'<EOL>f.write(s)<EOL><DEDENT>
Creates a config file used by the embedding projector.
    Adapted from the TensorFlow function `visualize_embeddings()` at
    https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/tensorboard/plugins/projector/__init__.py