# Buggy code
def process_input(cls, query: Union[LocalPath, lavalink.Track, "Query", str], **kwargs):
    """A replacement for :code:`lavalink.Player.load_tracks`. This will try to get a valid
    cached entry first if not found or if in valid it will then call the lavalink API.

    Parameters
    ----------
    query : Union[Query, LocalPath, lavalink.Track, str]
        The query string or LocalPath object.
    Returns
    -------
    Query
        Returns a parsed Query object.
    """
    if not query:
        query = "InvalidQueryPlaceHolderName"
    possible_values = {}

    if isinstance(query, str):
        query = query.strip("<>")
        while "ytsearch:" in query:
            query = query.replace("ytsearch:", "")
        while "scsearch:" in query:
            query = query.replace("scsearch:", "")

    elif isinstance(query, Query):
        for key, val in kwargs.items():
            setattr(query, key, val)
        return query
    elif isinstance(query, lavalink.Track):
        possible_values["stream"] = query.is_stream
        query = query.uri

    possible_values.update(dict(**kwargs))
    possible_values.update(cls._parse(query, **kwargs))
    return cls(query, **possible_values)


# Traceback (AttributeError)
Traceback (most recent call last):
File "/home/bot/botenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 83, in wrapped
ret = await coro(*args, **kwargs)
File "/home/bot/botenv/lib/python3.8/site-packages/redbot/cogs/audio/audio.py", line 4937, in _playlist_list
playlists = await get_all_playlist(scope, self.bot, guild, author, specified_user)
File "/home/bot/botenv/lib/python3.8/site-packages/redbot/cogs/audio/playlists.py", line 475, in get_all_playlist
scope_standard, scope_id = _prepare_config_scope(scope, author, guild)
File "/home/bot/botenv/lib/python3.8/site-packages/redbot/cogs/audio/playlists.py", line 86, in _prepare_config_scope
scope = standardize_scope(scope)
File "/home/bot/botenv/lib/python3.8/site-packages/redbot/cogs/audio/playlists.py", line 62, in standardize_scope
scope = scope.upper()
AttributeError: 'NoneType' object has no attribute 'upper'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/bot/botenv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
File "/home/bot/botenv/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 799, in invoke
await super().invoke(ctx)
File "/home/bot/botenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1234, in invoke
await ctx.invoked_subcommand.invoke(ctx)
File "/home/bot/botenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 797, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/bot/botenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 92, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'upper'

# Fixed code
def process_input(
    cls,
    query: Union[LocalPath, lavalink.Track, "Query", str],
    _local_folder_current_path: Path,
    **kwargs,
) -> "Query":
    """
    Process the input query into its type

    Parameters
    ----------
    query : Union[Query, LocalPath, lavalink.Track, str]
        The query string or LocalPath object.
    _local_folder_current_path: Path
        The Current Local Track folder
    Returns
    -------
    Query
        Returns a parsed Query object.
    """
    if not query:
        query = "InvalidQueryPlaceHolderName"
    possible_values = {}

    if isinstance(query, str):
        query = query.strip("<>")
        while "ytsearch:" in query:
            query = query.replace("ytsearch:", "")
        while "scsearch:" in query:
            query = query.replace("scsearch:", "")

    elif isinstance(query, Query):
        for key, val in kwargs.items():
            setattr(query, key, val)
        return query
    elif isinstance(query, lavalink.Track):
        possible_values["stream"] = query.is_stream
        query = query.uri

    possible_values.update(dict(**kwargs))
    possible_values.update(cls._parse(query, _local_folder_current_path, **kwargs))
    return cls(query, _local_folder_current_path, **possible_values)