<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _pelita_member_filter(parent_name, item_names):
 """ Filter a list of autodoc items for which to generate documentation. Include only imports that come from the documented module or its submodules. """

    filtered_names = []

    if parent_name not in sys.modules:
        return item_names
    module = sys.modules[parent_name]

    for item_name in item_names:
        item = getattr(module, item_name, None)
        location = getattr(item, '__module__', None)

        if location is None or (location + ".").startswith(parent_name + "."):
            filtered_names.append(item_name)

    return filtered_names