def create_package_files(target_path, package_template, rosdistro,
                         newfiles=None, meta=False):
    if newfiles is None:
        newfiles = {}
    # allow to replace default templates when path string is equal
    manifest_path = os.path.join(target_path, PACKAGE_MANIFEST_FILENAME)
    if manifest_path not in newfiles:
        newfiles[manifest_path] = \
            create_package_xml(package_template, rosdistro, meta=meta)
    cmake_path = os.path.join(target_path, 'CMakeLists.txt')
    if not cmake_path in newfiles:
        newfiles[cmake_path] = create_cmakelists(package_template, rosdistro, meta=meta)
    _safe_write_files(newfiles, target_path)
    if 'roscpp' in package_template.catkin_deps:
        fname = os.path.join(target_path, 'include', package_template.name)
        os.makedirs(fname)
        print('Created folder %s' % os.path.relpath(fname, os.path.dirname(target_path)))
    if 'roscpp' in package_template.catkin_deps or \
            'rospy' in package_template.catkin_deps:
        fname = os.path.join(target_path, 'src')
        os.makedirs(fname)
        print('Created folder %s' % os.path.relpath(fname, os.path.dirname(target_path)))
creates several files from templates to start a new package.
dataset/ETHPy150Open ros-infrastructure/catkin_pkg/src/catkin_pkg/package_templates.py/create_package_files