code: def _create_frontend(
      name: str,
      component: ComponentFiles,
      directory: Path,
      package_name: str,
  ):
      frontend = directory / "frontend"
      frontend.mkdir(exist_ok=True)
  
      p = Path(inspect.getfile(gradio)).parent
  
      def ignore(s, names):
          ignored = []
          for n in names:
              if (
                  n.startswith("CHANGELOG")
                  or n.startswith("README.md")
                  or ".test." in n
                  or ".stories." in n
                  or ".spec." in n
              ):
                  ignored.append(n)
          return ignored
  
      shutil.copytree(
          str(p / "_frontend_code" / component.js_dir),
          frontend,
          dirs_exist_ok=True,
          ignore=ignore,
      )
      source_package_json = json.loads(
          Path(frontend / "package.json").read_text()
      )
      source_package_json["name"] = package_name
      source_package_json = _modify_js_deps(
          source_package_json, "dependencies", p
      )
      source_package_json = _modify_js_deps(
          source_package_json, "devDependencies", p
      )
      (frontend / "package.json").write_text(
          json.dumps(source_package_json, indent=2)
      )
  
imports: from __future__ import annotations
  import dataclasses
  import inspect
  import json
  import re
  import shutil
  import textwrap
  from pathlib import Path
  from typing import Literal
  import gradio
label_desc: Use image node_id 6 for calling a global function with example usage: _create_frontend(name, component, directory, package_name) and returns: ignored