generator close() example