# Path: pytaxize/itis/itis.py
# def hierarchy_down(tsn, as_dataframe=False, **kwargs):
#     """
#     Get hierarchy down from tsn
# 
#     :param tsn: (int) TSN for a taxonomic group
#     :param as_dataframe: (bool) specify return type, if pandas is available
#     :param \*\*kwargs: Curl options passed on to `requests.get`
# 
#     Usage::
# 
#         from pytaxize import itis
#         itis.hierarchy_down(tsn = 179913)
#         itis.hierarchy_down(tsn = 161994)
#         itis.hierarchy_down(tsn = 9999999)
#     """
#     tt = Refactor(
#         itis_base + "getHierarchyDownFromTSN", payload={"tsn": tsn}, request="get"
#     ).json(**kwargs)
#     tt.pop("class")
#     if tt["hierarchyList"]:
#         pass
#     [z.pop("class") for z in tt["hierarchyList"] if z is not None]
#     return _df(tt["hierarchyList"], as_dataframe)


import warnings
import sys
from pytaxize.itis import hierarchy_down
        ## one id
        x = Children(179913)
        x
        x.ids
        x.itis()
        
        ## many ids - with one invalid id
        x = Children([179913, 174321, 9999999])
        x
        x.ids
        res = x.itis()
        res[179913]
        res[174321]
        res[9999999]
    """

    def __init__(self, ids):
        if isinstance(ids, int):
            ids = [ids]
        self.ids = ids

    def __repr__(self):
        x = """<%s>\n""" % type(self).__name__
        y = """  ids: %s""" % ",".join([str(w) for w in self.ids[:10]])
        return x + y

    def itis(self):
        out = []
        for i in range(len(self.ids)):
            id = self.ids[i]

# Path: pytaxize/itis/itis.py
# def hierarchy_down(tsn, as_dataframe=False, **kwargs):
#     """
#     Get hierarchy down from tsn
# 
#     :param tsn: (int) TSN for a taxonomic group
#     :param as_dataframe: (bool) specify return type, if pandas is available
#     :param \*\*kwargs: Curl options passed on to `requests.get`
# 
#     Usage::
# 
#         from pytaxize import itis
#         itis.hierarchy_down(tsn = 179913)
#         itis.hierarchy_down(tsn = 161994)
#         itis.hierarchy_down(tsn = 9999999)
#     """
#     tt = Refactor(
#         itis_base + "getHierarchyDownFromTSN", payload={"tsn": tsn}, request="get"
#     ).json(**kwargs)
#     tt.pop("class")
#     if tt["hierarchyList"]:
#         pass
#     [z.pop("class") for z in tt["hierarchyList"] if z is not None]
#     return _df(tt["hierarchyList"], as_dataframe)


# Path: pytaxize/children/children.py
import warnings
import sys
from pytaxize.itis import hierarchy_down

        ## one id
        x = Children(179913)
        x
        x.ids
        x.itis()
        
        ## many ids - with one invalid id
        x = Children([179913, 174321, 9999999])
        x
        x.ids
        res = x.itis()
        res[179913]
        res[174321]
        res[9999999]
    """

    def __init__(self, ids):
        if isinstance(ids, int):
            ids = [ids]
        self.ids = ids

    def __repr__(self):
        x = """<%s>\n""" % type(self).__name__
        y = """  ids: %s""" % ",".join([str(w) for w in self.ids[:10]])
        return x + y

    def itis(self):
        out = []
        for i in range(len(self.ids)):
            id = self.ids[i]

            res = hierarchy_down(id)