# Path: deepcpg/utils.py
# def to_list(value):
#     """Convert `value` to a list."""
#     if not isinstance(value, list) and value is not None:
#         value = [value]
#     return value


import os
import gzip as gz
from glob import glob
from six.moves import range
from ..utils import to_list
    Returns
    -------
        List of :class:`FastaSeq` objects.
    """
    list
    if gzip is None:
        gzip = filename.endswith('.gz')
    if gzip:
        lines = gz.open(filename, 'r').read().decode()
    else:
        lines = open(filename, 'r').read()
    lines = lines.splitlines()
    return parse_lines(lines)


def select_file_by_chromo(filenames, chromo):
    """Select file of chromosome `chromo`.

    Parameters
    ----------
    filenames: list
        List of file names or directory with FASTA files.
    chromo: str
        Chromosome that is selected.

    Returns
    -------
    str
        Filename in `filenames` that contains chromosome `chromo`.
    """

# Path: deepcpg/utils.py
# def to_list(value):
#     """Convert `value` to a list."""
#     if not isinstance(value, list) and value is not None:
#         value = [value]
#     return value


# Path: deepcpg/data/fasta.py
import os
import gzip as gz
from glob import glob
from six.moves import range
from ..utils import to_list

    Returns
    -------
        List of :class:`FastaSeq` objects.
    """
    list
    if gzip is None:
        gzip = filename.endswith('.gz')
    if gzip:
        lines = gz.open(filename, 'r').read().decode()
    else:
        lines = open(filename, 'r').read()
    lines = lines.splitlines()
    return parse_lines(lines)


def select_file_by_chromo(filenames, chromo):
    """Select file of chromosome `chromo`.

    Parameters
    ----------
    filenames: list
        List of file names or directory with FASTA files.
    chromo: str
        Chromosome that is selected.

    Returns
    -------
    str
        Filename in `filenames` that contains chromosome `chromo`.
    """

    filenames = to_list(filenames)