Defines a generator used to walk files using given filters.

    Usage::

        >>> for file in files_walker("./foundations/tests/tests_foundations/resources/standard/level_0"):
        ...     print(file)
        ...
        ./foundations/tests/tests_foundations/resources/standard/level_0/level_1/level_2/standard.sIBLT
        ./foundations/tests/tests_foundations/resources/standard/level_0/level_1/lorem_ipsum.txt
        ./foundations/tests/tests_foundations/resources/standard/level_0/level_1/standard.rc
        ./foundations/tests/tests_foundations/resources/standard/level_0/standard.ibl
        >>> for file in files_walker("./foundations/tests/tests_foundations/resources/standard/level_0", ("\.sIBLT",)):
        ...     print(file)
        ...
        ./foundations/tests/tests_foundations/resources/standard/level_0/level_1/level_2/standard.sIBLT

    :param directory: Directory to recursively walk.
    :type directory: unicode
    :param filters_in: Regex filters in list.
    :type filters_in: tuple or list
    :param filters_in: Regex filters out list.
    :type filters_in: tuple or list
    :param flags: Regex flags.
    :type flags: int
    :return: File.
    :rtype: unicode

def files_walker(directory, filters_in=None, filters_out=None, flags=0):
    """
    Defines a generator used to walk files using given filters.

    Usage::

        >>> for file in files_walker("./foundations/tests/tests_foundations/resources/standard/level_0"):
        ...     print(file)
        ...
        ./foundations/tests/tests_foundations/resources/standard/level_0/level_1/level_2/standard.sIBLT
        ./foundations/tests/tests_foundations/resources/standard/level_0/level_1/lorem_ipsum.txt
        ./foundations/tests/tests_foundations/resources/standard/level_0/level_1/standard.rc
        ./foundations/tests/tests_foundations/resources/standard/level_0/standard.ibl
        >>> for file in files_walker("./foundations/tests/tests_foundations/resources/standard/level_0", ("\.sIBLT",)):
        ...     print(file)
        ...
        ./foundations/tests/tests_foundations/resources/standard/level_0/level_1/level_2/standard.sIBLT

    :param directory: Directory to recursively walk.
    :type directory: unicode
    :param filters_in: Regex filters in list.
    :type filters_in: tuple or list
    :param filters_in: Regex filters out list.
    :type filters_in: tuple or list
    :param flags: Regex flags.
    :type flags: int
    :return: File.
    :rtype: unicode
    """

    if filters_in:
        LOGGER.debug("> Current filters in: '{0}'.".format(filters_in))

    if filters_out:
        LOGGER.debug("> Current filters out: '{0}'.".format(filters_out))

    for parent_directory, directories, files in os.walk(directory, topdown=False, followlinks=True):
        for file in files:
            LOGGER.debug("> Current file: '{0}' in '{1}'.".format(file, directory))
            path = foundations.strings.to_forward_slashes(os.path.join(parent_directory, file))
            if os.path.isfile(path):
                if not foundations.strings.filter_words((path,), filters_in, filters_out, flags):
                    continue

                LOGGER.debug("> '{0}' file filtered in!".format(path))

                yield path