import glob


def find_all_filetype(data_dir, extension):
    """ Finds all files in a directory, returns their path

    Args:
        data_dir (str): path to where your MitoGraph output data are
        extension (str): the extension to search for (e.g. ".gnet", ".mitograph")

    Returns:
        path_list (list of strings): a list where each element is a string containing the path for desired files (with extension)
                                    (e.g. path_list = [sample1.gnet, sample2.gnet])

    """

    # create a string to search for, include a wildcard * in place of the name of the file
    search_criteria = "".join([data_dir, "/*", extension])

    # use glob.glob to do the searching and retreive your list!
    path_list = glob.glob(search_criteria)

    return path_list