# Path: dbcollection/utils/string_ascii.py
# def convert_ascii_to_str(input_array):
#     """Convert a numpy array to a string (or a list of strings)
# 
#     Parameters
#     ----------
#     input_array : np.ndarray
#         Array of strings encoded in ASCII format.
# 
#     Returns
#     -------
#     str/list
#         String or list of strings.
# 
#     Examples
#     --------
#     Convert a numpy array to a string.
# 
#     >>> from dbcollection.utils.string_ascii import convert_ascii_to_str
#     >>> import numpy as np
#     >>> # ascii format of 'string1'
#     >>> tensor = np.array([[115, 116, 114, 105, 110, 103, 49, 0]], dtype=np.uint8)
#     >>> convert_ascii_to_str(tensor)
#     ['string1']
# 
#     """
#     assert isinstance(input_array, np.ndarray), "Must input a valid numpy array."
#     list_str = input_array.tolist()
#     if input_array.ndim > 1:
#         return [ascii_to_str(list(filter(lambda x: x > 0, str_))) for str_ in list_str]
#     else:
#         return ascii_to_str(list(filter(lambda x: x > 0, list_str)))


import h5py
from dbcollection.utils.string_ascii import convert_ascii_to_str

        Parameters
        ----------
        index : int/list/tuple, optional
            Index number of he field. If it is a list, returns the data
            for all the value indexes of that list.
        convert_to_str : bool, optional
            Convert the output data into a string.
            Warning: output must be of type np.uint8

        Returns
        -------
        np.ndarray/list/str
            Numpy array containing the field's data.
            If convert_to_str is set to True, it returns a string
            or list of strings.

        Note
        ----
        When using lists/tuples of indexes, this method sorts the list
        and removes duplicate values. This is because the h5py
        api requires the indexing elements to be in increasing order when
        retrieving data.

        """
        if index is None:
            data = self._get_all_idx()
        else:
            data = self._get_range_idx(index)
        if convert_to_str:

# Path: dbcollection/utils/string_ascii.py
# def convert_ascii_to_str(input_array):
#     """Convert a numpy array to a string (or a list of strings)
# 
#     Parameters
#     ----------
#     input_array : np.ndarray
#         Array of strings encoded in ASCII format.
# 
#     Returns
#     -------
#     str/list
#         String or list of strings.
# 
#     Examples
#     --------
#     Convert a numpy array to a string.
# 
#     >>> from dbcollection.utils.string_ascii import convert_ascii_to_str
#     >>> import numpy as np
#     >>> # ascii format of 'string1'
#     >>> tensor = np.array([[115, 116, 114, 105, 110, 103, 49, 0]], dtype=np.uint8)
#     >>> convert_ascii_to_str(tensor)
#     ['string1']
# 
#     """
#     assert isinstance(input_array, np.ndarray), "Must input a valid numpy array."
#     list_str = input_array.tolist()
#     if input_array.ndim > 1:
#         return [ascii_to_str(list(filter(lambda x: x > 0, str_))) for str_ in list_str]
#     else:
#         return ascii_to_str(list(filter(lambda x: x > 0, list_str)))


# Path: dbcollection/core/loader.py
import h5py
from dbcollection.utils.string_ascii import convert_ascii_to_str


        Parameters
        ----------
        index : int/list/tuple, optional
            Index number of he field. If it is a list, returns the data
            for all the value indexes of that list.
        convert_to_str : bool, optional
            Convert the output data into a string.
            Warning: output must be of type np.uint8

        Returns
        -------
        np.ndarray/list/str
            Numpy array containing the field's data.
            If convert_to_str is set to True, it returns a string
            or list of strings.

        Note
        ----
        When using lists/tuples of indexes, this method sorts the list
        and removes duplicate values. This is because the h5py
        api requires the indexing elements to be in increasing order when
        retrieving data.

        """
        if index is None:
            data = self._get_all_idx()
        else:
            data = self._get_range_idx(index)
        if convert_to_str:

            data = convert_ascii_to_str(data)