<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dumps_list(l, *, escape=True, token='%\n', mapper=None, as_content=True):
 r"""Try to generate a LaTeX string of a list that can contain anything. Args ---- l : list A list of objects to be converted into a single string. escape : bool Whether to escape special LaTeX characters in converted text. token : str The token (default is a newline) to separate objects in the list. mapper: callable or `list` A function, class or a list of functions/classes that should be called on all entries of the list after converting them to a string, for instance `~.bold` or `~.MediumText`. as_content: bool Indicates whether the items in the list should be dumped using `~.LatexObject.dumps_as_content` Returns ------- NoEscape A single LaTeX string. Examples -------- '\\textbf{Test}%\n\\nth{4}' \textbf{Test} \nth{4} There are 4 lights! \$100\% True """

    strings = (_latex_item_to_string(i, escape=escape, as_content=as_content)
               for i in l)

    if mapper is not None:
        if not isinstance(mapper, list):
            mapper = [mapper]

        for m in mapper:
            strings = [m(s) for s in strings]
        strings = [_latex_item_to_string(s) for s in strings]

    return NoEscape(token.join(strings))