<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resolve_extensions(bot: commands.Bot, name: str) -> list: """ Tries to resolve extension queries into a list of extension names. """


    if name.endswith('.*'):
        module_parts = name[:-2].split('.')
        path = pathlib.Path(module_parts.pop(0))

        for part in module_parts:
            path = path / part

        return find_extensions_in(path)

    if name == '~':
        return list(bot.extensions.keys())

    return [name]