import pkgutil
import os

def install_kernel_resources(destination):
    """
    Copy the resource files to the kernelspec folder.
    """
    for filename in ["logo-64x64.png", "logo-32x32.png"]:
        data = pkgutil.get_data("metakernel", filename)
        with open(os.path.join(destination, filename), "wb") as fp:
            fp.write(data)

import pkgutil
import os

def install_kernel_resources(destination, resource="metakernel", files=None):
    """
    Copy the resource files to the kernelspec folder.
    """
    if files is None:
        files = ["logo-64x64.png", "logo-32x32.png"]
    for filename in files:
        data = pkgutil.get_data(resource, filename)
        with open(os.path.join(destination, filename), "wb") as fp:
            fp.write(data)

Allow installing resources