<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _find_package(parts):
 """Helper function for _resolve_import_versioned."""

    for i in range(len(parts), 0, -1):
        prefix = '.'.join(parts[0:i])
        if prefix in sys.modules:
            return i, sys.modules[prefix]
    return 0, None