def list_sources(embedding_name=None):
text_embedding_reg = registry.get_registry(TokenEmbedding)<EOL>if embedding_name is not None:<EOL><INDENT>embedding_name = embedding_name.lower()<EOL>if embedding_name not in text_embedding_reg:<EOL><INDENT>raise KeyError('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(embedding_name))<EOL><DEDENT>return list(text_embedding_reg[embedding_name].source_file_hash.keys())<EOL><DEDENT>else:<EOL><INDENT>return {embedding_name: list(embedding_cls.source_file_hash.keys())<EOL>for embedding_name, embedding_cls in registry.get_registry(TokenEmbedding).items()}<EOL><DEDENT>
Get valid token embedding names and their pre-trained file names.


    To load token embedding vectors from an externally hosted pre-trained token embedding file,
    such as those of GloVe and FastText, one should use
    `gluonnlp.embedding.create(embedding_name, source)`. This method returns all the
    valid names of `source` for the specified `embedding_name`. If `embedding_name` is set to
    None, this method returns all the valid names of `embedding_name` with their associated
    `source`.


    Parameters
    ----------
    embedding_name : str or None, default None
        The pre-trained token embedding name.


    Returns
    -------
    dict or list:
        A list of all the valid pre-trained token embedding file names (`source`) for the
        specified token embedding name (`embedding_name`). If the text embedding name is set to
        None, returns a dict mapping each valid token embedding name to a list of valid pre-trained
        files (`source`). They can be plugged into
        `gluonnlp.embedding.create(embedding_name, source)`.