def METHOD_NAME(dirname, pattern, dir_fd, dironly):
    names = _listdir(dirname, dir_fd, dironly)
    if not _ishidden(pattern):
        names = (x for x in names if not _ishidden(x))
    return fnmatch.filter(names, pattern)