def exclude_sources(exclude, section=False):
newlist = sources.copy()<EOL>if not isinstance(exclude, list):<EOL><INDENT>exclude = [exclude]<EOL><DEDENT>for source in exclude:<EOL><INDENT>if not section:<EOL><INDENT>newlist.remove(source)<EOL><DEDENT>else:<EOL><INDENT>pos = newlist.index(source) + <NUM_LIT:1><EOL>if pos == len(sources):<EOL><INDENT>return []<EOL><DEDENT>newlist = sources[pos:]<EOL><DEDENT><DEDENT>return newlist<EOL>
Returns a narrower list of sources.

If the exclude parameter is a list, every one of its items will be removed
from the returned list.
If it's just a function (or a function's name) and 'section' is set to
False (default), a copy of the sources list without this element will be
returned.
If it's a function (or a function's name) but the section parameter is set
to True, the returned list will be a section of the sources list, including
everything between 'exclude' and the end of the list.