Create a program that reports basic statistics for a supplied file. Its capabilities must include:
def file_stats(file_path: str, target: str) -> dict:
The program should return:
Include appropriate test cases, including an empty file, a file containing a single word, and a very large file. For the very large file test, use a file containing 1,000,000 lines, each consisting of cloud.
Input: blank.log containing '', with target word cloud
Output:
cloud: 0Explanation: Because the file has no contents, it has no lines or words, cannot contain the requested word, and occupies zero bytes.