def is_story_file(file_path: Text) -> bool:
    "Checks if a file is a Rasa story file.\n\n    Args:\n        file_path: Path of the file which should be checked.\n\n    Returns:\n        `True` if it's a story file, otherwise `False`.\n    "
    if (not file_path.endswith('.md')):
        return False
    try:
        with open(file_path, encoding=DEFAULT_ENCODING, errors='surrogateescape') as lines:
            return any((_contains_story_pattern(line) for line in lines))
    except Exception as e:
        logger.error(f"Tried to check if '{file_path}' is a story file, but failed to read it. If this file contains story data, you should investigate this error, otherwise it is probably best to move the file to a different location. Error: {e}")
        return False
Checks if a file is a Rasa story file.

Args:
    file_path: Path of the file which should be checked.

Returns:
    `True` if it's a story file, otherwise `False`.
def is_story_file(file_path: Text) -> bool:
    "Checks if a file is a Rasa story file.\n\n    Args:\n        file_path: Path of the file which should be checked.\n\n    Returns:\n        `True` if it's a story file, otherwise `False`.\n    "
    if (not file_path.endswith('.md')):
        return False
    try:
        with open(file_path, encoding=DEFAULT_ENCODING, errors='surrogateescape') as lines:
            return any((_contains_story_pattern(line) for line in lines))
    except Exception as e:
        logger.error(f"Tried to check if '{file_path}' is a story file, but failed to read it. If this file contains story data, you should investigate this error, otherwise it is probably best to move the file to a different location. Error: {e}")
        return False