# Path: redbot/core/data_manager.py
# def load_existing_config():
# def create_temp_config():
# def load_basic_configuration(instance_name_: str):
# def _base_data_path() -> Path:
# def cog_data_path(cog_instance=None, raw_name: str = None) -> Path:
# def core_data_path() -> Path:
# def load_bundled_data(cog_instance, init_location: str):
# def bundled_data_path(cog_instance: commands.Cog) -> Path:
# def storage_type() -> str:
# def storage_details() -> dict:


import asyncio
import asyncio.subprocess  # disables for # https://github.com/PyCQA/pylint/issues/1469
import itertools
import json
import logging
import pathlib
import platform
import re
import shutil
import sys
import tempfile
import time
import aiohttp
import rich.progress
from typing import ClassVar, Final, List, Optional, Pattern, Tuple
from redbot.core import data_manager
from redbot.core.i18n import Translator
from .errors import LavalinkDownloadFailed
from .utils import task_callback
            if self._proc.returncode is None:
                raise RuntimeError("Internal Lavalink server is already running")
            elif self._shutdown:
                raise RuntimeError("Server manager has already been used - create another one")

        await self.maybe_download_jar()

        # Copy the application.yml across.
        # For people to customise their Lavalink server configuration they need to run it
        # externally
        shutil.copyfile(BUNDLED_APP_YML, LAVALINK_APP_YML)

        args = await self._get_jar_args()
        self._proc = await asyncio.subprocess.create_subprocess_exec(  # pylint:disable=no-member
            *args,
            cwd=str(LAVALINK_DOWNLOAD_DIR),
            stdout=asyncio.subprocess.PIPE,
            stderr=asyncio.subprocess.STDOUT,
        )

        log.info("Internal Lavalink server started. PID: %s", self._proc.pid)

        try:
            await asyncio.wait_for(self._wait_for_launcher(), timeout=120)
        except asyncio.TimeoutError:
            log.warning("Timeout occurred whilst waiting for internal Lavalink server to be ready")

        self._monitor_task = asyncio.create_task(self._monitor())
        self._monitor_task.add_done_callback(task_callback)


# Path: redbot/core/data_manager.py
# def load_existing_config():
# def create_temp_config():
# def load_basic_configuration(instance_name_: str):
# def _base_data_path() -> Path:
# def cog_data_path(cog_instance=None, raw_name: str = None) -> Path:
# def core_data_path() -> Path:
# def load_bundled_data(cog_instance, init_location: str):
# def bundled_data_path(cog_instance: commands.Cog) -> Path:
# def storage_type() -> str:
# def storage_details() -> dict:


# Path: redbot/cogs/audio/manager.py
import asyncio
import asyncio.subprocess  # disables for # https://github.com/PyCQA/pylint/issues/1469
import itertools
import json
import logging
import pathlib
import platform
import re
import shutil
import sys
import tempfile
import time
import aiohttp
import rich.progress
from typing import ClassVar, Final, List, Optional, Pattern, Tuple
from redbot.core import data_manager
from redbot.core.i18n import Translator
from .errors import LavalinkDownloadFailed
from .utils import task_callback

            if self._proc.returncode is None:
                raise RuntimeError("Internal Lavalink server is already running")
            elif self._shutdown:
                raise RuntimeError("Server manager has already been used - create another one")

        await self.maybe_download_jar()

        # Copy the application.yml across.
        # For people to customise their Lavalink server configuration they need to run it
        # externally
        shutil.copyfile(BUNDLED_APP_YML, LAVALINK_APP_YML)

        args = await self._get_jar_args()
        self._proc = await asyncio.subprocess.create_subprocess_exec(  # pylint:disable=no-member
            *args,
            cwd=str(LAVALINK_DOWNLOAD_DIR),
            stdout=asyncio.subprocess.PIPE,
            stderr=asyncio.subprocess.STDOUT,
        )

        log.info("Internal Lavalink server started. PID: %s", self._proc.pid)

        try:
            await asyncio.wait_for(self._wait_for_launcher(), timeout=120)
        except asyncio.TimeoutError:
            log.warning("Timeout occurred whilst waiting for internal Lavalink server to be ready")

        self._monitor_task = asyncio.create_task(self._monitor())
        self._monitor_task.add_done_callback(task_callback)


    async def _get_jar_args(self) -> List[str]: