code: def setup_package():
      package_data = {}
      package_data["Windows"] = list(
          map(lambda x: os.path.join("libs", x), windows_binarys)
      )
      package_data["Linux"] = list(
          map(
              lambda x: os.path.join("libs", x),
              linux_binarys + ext_libs,
          )
      )
      platform_name = None
      if "--win" in sys.argv:
          platform_name = "Windows"
          sys.argv.remove("--win")
      if "--linux" in sys.argv:
          platform_name = "Linux"
          sys.argv.remove("--linux")
  
      if platform_name is None:
          if platform.platform().startswith("Windows"):
              platform_name = "Windows"
          else:
              platform_name = "Linux"
  
      change_permission = True if platform_name == "Linux" else False
  
      # Delete legacy libs
      if os.path.exists(libs_dir):
          print(f"Deleting existing libs_dir {libs_dir} ....")
          shutil.rmtree(libs_dir)
      os.makedirs(libs_dir, exist_ok=True)
      open(os.path.join(libs_dir, "__init__.py"), "w").close()
  
      # copy built files for github workflow
      for built_file in glob.glob(
          os.path.join(github_artifact_dir, "*")
      ):
          print(f"Copy workflow built file: {built_file}")
          if change_permission:
              os.chmod(built_file, 0o775)
          shutil.copy(built_file, libs_dir)
  
      lib_urls = obtain_lib_urls()
  
      for url in lib_urls[platform_name]:
          download_libs(url, change_permission=change_permission)
  
      # Check if all package files are ready
      for file in package_data[platform_name]:
          file_path = os.path.join(libs_dir, os.path.basename(file))
          if not os.path.exists(file_path):
              print(
                  f"Could not find package dependency file: {file_path}"
              )
              raise FileNotFoundError(
                  f"Could not find package dependency file: {file_path}"
              )
  
      all_requires = [
          "py-cpuinfo",
          "protobuf",
          "intel-openmp; (platform_machine=='x86_64' or platform_machine == 'AMD64')",
      ]
      all_requires += CONVERT_DEP
  
      # Linux install with -f https://developer.intel.com/ipex-whl-stable-xpu
      xpu_20_requires = copy.deepcopy(all_requires)
      xpu_20_requires.remove("torch")
      # xpu_20 only works for linux now
      xpu_20_requires += [
          "torch==2.0.1a0;platform_system=='Linux'",
          "torchvision==0.15.2a0;platform_system=='Linux'",
          "intel_extension_for_pytorch==2.0.110+xpu;platform_system=='Linux'",
          "bigdl-core-xe==" + VERSION + ";platform_system=='Linux'",
          "bigdl-core-xe-esimd=="
          + VERSION
          + ";platform_system=='Linux'",
      ]
  
      xpu_21_requires = copy.deepcopy(all_requires)
      xpu_21_requires.remove("torch")
      xpu_21_requires += [
          "torch==2.1.0a0",
          "torchvision==0.16.0a0",
          "intel_extension_for_pytorch==2.1.10+xpu",
          "bigdl-core-xe-21==" + VERSION,
          "bigdl-core-xe-esimd-21=="
          + VERSION
          + ";platform_system=='Linux'",
      ]
      # default to ipex 2.1 for linux and windows
      xpu_requires = copy.deepcopy(xpu_21_requires)
  
      serving_requires = ["py-cpuinfo"]
      serving_requires += SERVING_DEP
  
      metadata = dict(
          name="bigdl-llm",
          version=VERSION,
          description="Large Language Model Develop Toolkit",
          long_description=long_description,
          long_description_content_type="text/markdown",
          author="BigDL Authors",
          author_email="bigdl-user-group@googlegroups.com",
          license="Apache License, Version 2.0",
          url="https://github.com/intel-analytics/BigDL",
          packages=get_llm_packages(),
          package_dir={"": "src"},
          package_data={
              "bigdl.llm": package_data[platform_name]
              + ["cli/prompts/*.txt"]
          },
          include_package_data=True,
          entry_points={
              "console_scripts": [
                  "llm-convert=bigdl.llm.convert_model:main"
              ]
          },
          extras_require={
              "all": all_requires,
              "xpu": xpu_requires,  # default to ipex 2.1 for linux and windows
              "xpu-2-0": xpu_20_requires,
              "xpu-2-1": xpu_21_requires,
              "serving": serving_requires,
          },
          classifiers=[
              "License :: OSI Approved :: Apache Software License",
              "Programming Language :: Python :: 3",
              "Programming Language :: Python :: 3.9",
              "Programming Language :: Python :: Implementation :: CPython",
          ],
          scripts={
              "Linux": [
                  "src/bigdl/llm/cli/llm-cli",
                  "src/bigdl/llm/cli/llm-chat",
                  "scripts/bigdl-llm-init",
              ],
              "Windows": [
                  "src/bigdl/llm/cli/llm-cli.ps1",
                  "src/bigdl/llm/cli/llm-chat.ps1",
              ],
          }[platform_name],
          platforms=["windows"],
      )
  
      setup(**metadata)
  
file_path: BigDL/python/llm/setup.py
imports: import fnmatch
  import os
  import platform
  import shutil
  import sys
  import urllib.request
  import requests
  import re
  import glob
  import copy
  from setuptools import setup
label_desc: Use image node_id 4 for calling a global function with example usage: setup_package() without return types