def _get_locations(pkgs, package_dir):
    # package_dir contains a dict {package_name: relativepath}
    # Example {'': 'src', 'foo': 'lib', 'bar': 'lib2'}
    #
    # '' means where to look for any package unless a parent package
    # is listed so package bar.pot is expected at lib2/bar/pot,
    # whereas package sup.dee is expected at src/sup/dee
    #
    # if package_dir does not state anything about a package,
    # setuptool expects the package folder to be in the root of the
    # project
    locations = {}
    allprefix = package_dir.get('', '')
    for pkg in pkgs:
        parent_location = None
        splits = pkg.split('.')
        # we iterate over compound name from parent to child
        # so once we found parent, children just append to their parent
        for key_len in range(len(splits)):
            key = '.'.join(splits[:key_len + 1])
            if key not in locations:
                if key in package_dir:
                    locations[key] = package_dir[key]
                elif parent_location is not None:
                    locations[key] = os.path.join(parent_location, splits[key_len])
                else:
                    locations[key] = os.path.join(allprefix, key)
            parent_location = locations[key]
    return locations
Test that shadowing a function definition in a class suite with another one raises a warning.
dataset/ETHPy150Open ros/catkin/cmake/interrogate_setup_dot_py.py/_get_locations--crossover with--dataset/ETHPy150Open timothycrosley/frosted/frosted/test/test_other.py/test_redefinedClassFunction