<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def copy_pkg(self, pkg, src_only=False):
        "Install boost deps from the third_party directory"

        if getattr(self, 'no_' + pkg) is None:
            print('Copying boost dependencies')
            to_copy = pkg,
        else:
            return

        src = os.path.join('third_party', *to_copy)

        # copy to the build tree
        if not src_only:
            target = os.path.join(self.build_lib, 'pythran', *to_copy)
            shutil.rmtree(target, True)
            shutil.copytree(src, target)

        # copy them to the source tree too, needed for sdist
        target = os.path.join('pythran', *to_copy)
        shutil.rmtree(target, True)
        shutil.copytree(src, target)