def get_core_nlu_files(paths: Optional[Union[(Text, List[Text])]]) -> Tuple[(List[Text], List[Text])]:
    'Recursively collects all training files from a list of paths.\n\n    Args:\n        paths: List of paths to training files or folders containing them.\n\n    Returns:\n        Tuple of paths to story and NLU files.\n    '
    story_files = set()
    nlu_data_files = set()
    if (paths is None):
        paths = []
    elif isinstance(paths, str):
        paths = [paths]
    for path in set(paths):
        if (not path):
            continue
        if _is_valid_filetype(path):
            if is_nlu_file(path):
                nlu_data_files.add(os.path.abspath(path))
            elif is_story_file(path):
                story_files.add(os.path.abspath(path))
        else:
            (new_story_files, new_nlu_data_files) = _find_core_nlu_files_in_directory(path)
            story_files.update(new_story_files)
            nlu_data_files.update(new_nlu_data_files)
    return (sorted(story_files), sorted(nlu_data_files))
Recursively collects all training files from a list of paths.

Args:
    paths: List of paths to training files or folders containing them.

Returns:
    Tuple of paths to story and NLU files.
def get_core_nlu_files(paths: Optional[Union[(Text, List[Text])]]) -> Tuple[(List[Text], List[Text])]:
    'Recursively collects all training files from a list of paths.\n\n    Args:\n        paths: List of paths to training files or folders containing them.\n\n    Returns:\n        Tuple of paths to story and NLU files.\n    '
    story_files = set()
    nlu_data_files = set()
    if (paths is None):
        paths = []
    elif isinstance(paths, str):
        paths = [paths]
    for path in set(paths):
        if (not path):
            continue
        if _is_valid_filetype(path):
            if is_nlu_file(path):
                nlu_data_files.add(os.path.abspath(path))
            elif is_story_file(path):
                story_files.add(os.path.abspath(path))
        else:
            (new_story_files, new_nlu_data_files) = _find_core_nlu_files_in_directory(path)
            story_files.update(new_story_files)
            nlu_data_files.update(new_nlu_data_files)
    return (sorted(story_files), sorted(nlu_data_files))