def StaticServe(base_path='/views/static/'):
    """
    Meta program for serving any file based on the path
    """
    def get_file(path=RAW_INVOCATION_ARGS):
        fullpath = get_config('project_path') + os.path.join(base_path, path)
        try:
            mime, encoding = mimetypes.guess_type(fullpath)
            return open(fullpath, 'rb'), mime or 'application/octet-stream'
        except __HOLE__:
            raise DataNotFound("File does not exist")

    class StaticServe(Program):
        controllers = ['http-get']
        model = [get_file]
        view = FileView()

    return StaticServe()
dataset/ETHPy150Open priestc/giotto/giotto/contrib/static/programs.py/StaticServe