import glob


def doc_finder_handle(basepath, fileformat):
    """
    Finds files of a particular format in dir that is given in basepath.

    Parameters
    ----------
    arg1: String defining a file path
    arg2: String defining document format 

    Default args
    ------------
    None

    Exceptions
    ----------
    None

    Usage
    -----
    # add test.txt to data/test dir
    doc_finder_handle(data/test, 'txt')

    Returns
    -------
    ['text.txt']

    Doctest
    -------
    None

    """
    # place holder
    docs = []

    # Loop over files
    for each_file in glob.glob(basepath + '/*.' + fileformat):
        docs.append(each_file)

    # return docs
    return docs