def _pelita_member_filter(parent_name, item_names):
filtered_names = []<EOL>if parent_name not in sys.modules:<EOL><INDENT>return item_names<EOL><DEDENT>module = sys.modules[parent_name]<EOL>for item_name in item_names:<EOL><INDENT>item = getattr(module, item_name, None)<EOL>location = getattr(item, '<STR_LIT>', None)<EOL>if location is None or (location + "<STR_LIT:.>").startswith(parent_name + "<STR_LIT:.>"):<EOL><INDENT>filtered_names.append(item_name)<EOL><DEDENT><DEDENT>return filtered_names<EOL>
Filter a list of autodoc items for which to generate documentation.

Include only imports that come from the documented module or its
submodules.