# Path: kipoiseq/utils.py
# def parse_alphabet(alphabet):
#     if isinstance(alphabet, str):
#         return list(alphabet)
#     else:
#         return alphabet
# 
# def parse_dtype(dtype):
#     if isinstance(dtype, string_types):
#         try:
#             return eval(dtype)
#         except Exception as e:
#             raise ValueError(
#                 "Unable to parse dtype: {}. \nException: {}".format(dtype, e))
#     else:
#         return dtype


import pytest
import numpy as np
from kipoiseq.utils import parse_alphabet, parse_dtype


def test_parse_alphabet():
    assert parse_alphabet(['A', 'C']) == ['A', 'C']
    assert parse_alphabet('AC') == ['A', 'C']


def test_parse_type():
    with pytest.raises(Exception):
        parse_dtype('string')
    with pytest.raises(Exception):
        parse_dtype('np.float322')


# Path: kipoiseq/utils.py
# def parse_alphabet(alphabet):
#     if isinstance(alphabet, str):
#         return list(alphabet)
#     else:
#         return alphabet
# 
# def parse_dtype(dtype):
#     if isinstance(dtype, string_types):
#         try:
#             return eval(dtype)
#         except Exception as e:
#             raise ValueError(
#                 "Unable to parse dtype: {}. \nException: {}".format(dtype, e))
#     else:
#         return dtype


# Path: tests/test_3_utils.py
import pytest
import numpy as np
from kipoiseq.utils import parse_alphabet, parse_dtype



def test_parse_alphabet():
    assert parse_alphabet(['A', 'C']) == ['A', 'C']
    assert parse_alphabet('AC') == ['A', 'C']


def test_parse_type():
    with pytest.raises(Exception):
        parse_dtype('string')
    with pytest.raises(Exception):
        parse_dtype('np.float322')


    assert parse_dtype('float') == float