def get_TrialIDs(doc, idtype='TrialID'):
    """
    Returns a list of trials ids

    Args:
        doc (odml.doc.BaseDocument):
            odML Document of reach-to-grasp project

    Returns:
        (list of int):
            Trial id list
    """
    output = []

    sec = doc['Recording']['TaskSettings']

    def ff(x): return x.name.startswith('Trial_')
    for trsec in sec.itersections(filter_func=ff):
        def FF(x): return x.name == idtype
        output.append(
            [p for p in trsec.iterproperties(filter_func=FF)][0].values[0])

    return sorted(output)