# Path: graphscale/utils.py
# def reverse_dict(dict_to_reverse: Dict[K, V]) -> Dict[V, K]:
#     """Swap the keys and values of a dictionary. Duplicate values (that will become keys)
#     do not cause error. One of the keys will be the new value non-deterministically
#     """
#     return {v: k for k, v in dict_to_reverse.items()}
# 
# async def async_list(coros: List[Awaitable[T]]) -> List[T]:
#     """Use to await a list and return a list.
#     Example: list_of_results = await async_list(list_of_gens)
#     """
#     return await asyncio.gather(*coros)
# 
# async def async_tuple(*coros: Awaitable) -> Tuple[Any, ...]:
#     """Await on a parameters and get a tuple back.
#     Example: result_one, result_two = await async_tuple(gen_one(), gen_two())
#     """
#     return tuple(await asyncio.gather(*coros))
# 
# def is_camel_case(string: str) -> bool:
#     """Is the string potentially camel case? Only checks for capital letters currently"""
#     return bool(re.search('[A-Z]', string))
# 
# def to_snake_case(camel_case: str) -> str:
#     """Convert a camel case string to snake case. e.g. fooBar ==> foo_bar"""
#     with_underscores = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', camel_case)
#     return re.sub('([a-z0-9])([A-Z])', r'\1_\2', with_underscores).lower()


import pytest
from graphscale.utils import reverse_dict, async_list, async_tuple, is_camel_case, to_snake_case


def test_reverse_dictionary() -> None:
    assert reverse_dict({1: '1', 2: '2'}) == {'2': 2, '1': 1}


def test_reverse_dictionary_dup_key() -> None:

# Path: graphscale/utils.py
# def reverse_dict(dict_to_reverse: Dict[K, V]) -> Dict[V, K]:
#     """Swap the keys and values of a dictionary. Duplicate values (that will become keys)
#     do not cause error. One of the keys will be the new value non-deterministically
#     """
#     return {v: k for k, v in dict_to_reverse.items()}
# 
# async def async_list(coros: List[Awaitable[T]]) -> List[T]:
#     """Use to await a list and return a list.
#     Example: list_of_results = await async_list(list_of_gens)
#     """
#     return await asyncio.gather(*coros)
# 
# async def async_tuple(*coros: Awaitable) -> Tuple[Any, ...]:
#     """Await on a parameters and get a tuple back.
#     Example: result_one, result_two = await async_tuple(gen_one(), gen_two())
#     """
#     return tuple(await asyncio.gather(*coros))
# 
# def is_camel_case(string: str) -> bool:
#     """Is the string potentially camel case? Only checks for capital letters currently"""
#     return bool(re.search('[A-Z]', string))
# 
# def to_snake_case(camel_case: str) -> str:
#     """Convert a camel case string to snake case. e.g. fooBar ==> foo_bar"""
#     with_underscores = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', camel_case)
#     return re.sub('([a-z0-9])([A-Z])', r'\1_\2', with_underscores).lower()


# Path: tests/test_utils.py
import pytest
from graphscale.utils import reverse_dict, async_list, async_tuple, is_camel_case, to_snake_case



def test_reverse_dictionary() -> None:
    assert reverse_dict({1: '1', 2: '2'}) == {'2': 2, '1': 1}


def test_reverse_dictionary_dup_key() -> None:

    assert reverse_dict({1: '1', 2: '1'})