def _make_metadata_tsv(metadata, save_path):
if isinstance(metadata, NDArray):<EOL><INDENT>metadata = metadata.asnumpy()<EOL><DEDENT>elif isinstance(metadata, list):<EOL><INDENT>metadata = np.array(metadata)<EOL><DEDENT>elif not isinstance(metadata, np.ndarray):<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'.format(str(type(metadata))))<EOL><DEDENT>if len(metadata.shape) > <NUM_LIT:2>:<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'.format(str(metadata.shape)))<EOL><DEDENT>if len(metadata.shape) == <NUM_LIT:1>:<EOL><INDENT>metadata = metadata.reshape(-<NUM_LIT:1>, <NUM_LIT:1>)<EOL><DEDENT>with open(os.path.join(save_path, '<STR_LIT>'), '<STR_LIT:w>') as f:<EOL><INDENT>for row in metadata:<EOL><INDENT>f.write('<STR_LIT:\t>'.join([str(x) for x in row]) + '<STR_LIT:\n>')<EOL><DEDENT><DEDENT>
Given an `NDArray` or a `numpy.ndarray` or a list as metadata e.g. labels, save the
    flattened array into the file metadata.tsv under the path provided by the user. The
    labels can be 1D or 2D with multiple labels per data point.
    Made to satisfy the requirement in the following link:
    https://www.tensorflow.org/programmers_guide/embedding#metadata