def __find_file(name, path, deep=False, partial=False):
    """
    Searches for a file and returns its path upon finding it.

    Searches for a file with the given `name` in the list of directory
    mentioned in `path`. It also supports `deep` search (recursive) and
    `partial` search (searching for files having filename matching
    partially with the query) through the respective boolean arguments.
    This function is internally called by `find_file` for each of the
    input directory of that.


    Parameters
    ----------
    name : str
        The name of the file to search for.
    path : str
        The path of the directory to be searched.
    deep : bool, optional
        Enables deep-searching, i.e. recursively looking for the file 
        in the sub-directories of the mentioned directory.
    partial : bool, optional
        Whether look for files having filename partially matching with 
        the query `name`.

    Returns
    -------
    str
        The path of the file. In case of multiple hits, it only returns 
        the first one.
    """

    if deep:
        for root, dirs, files in os.walk(path):
            if partial:
                for file in files:
                    if name in file:
                        return os.path.join(root, file)
            else:
                if name in files:
                    return os.path.join(root, name)
    else:
        f = os.path.join(path, name)
        if os.path.isfile(f):
            return f