def loads(text):
from prettytoml.parser import parse_tokens<EOL>from prettytoml.lexer import tokenize as lexer<EOL>from .file import TOMLFile<EOL>tokens = tuple(lexer(text, is_top_level=True))<EOL>elements = parse_tokens(tokens)<EOL>return TOMLFile(elements)<EOL>
Parses TOML text into a dict-like object and returns it.