def file_exists(path: Text): """ Returns true if file exists at path. Args: path (str): Local path in filesystem. """ return file_io.file_exists_v2(path)
def create_file_if_not_exists(file_path: Text, file_contents: Text): """ Creates directory if it does not exist. Args: file_path (str): Local path in filesystem. file_contents (str): Contents of file. """ if not file_io.file_exists_v2(file_path): file_io.write_string_to_file(file_path, file_contents)