def nsmallest(n, iterable):
if n < <NUM_LIT:0>:<EOL><INDENT>return []<EOL><DEDENT>it = iter(iterable)<EOL>result = list(islice(it, n))<EOL>if not result:<EOL><INDENT>return result<EOL><DEDENT>_heapify_max(result)<EOL>_heappushpop = _heappushpop_max<EOL>for elem in it:<EOL><INDENT>_heappushpop(result, elem)<EOL><DEDENT>result.sort()<EOL>return result<EOL>
Find the n smallest elements in a dataset.

    Equivalent to:  sorted(iterable)[:n]