Make dirs for file file_path, if these dirs are not exist.

def make_dirs_for_file_path(file_path, mode=0o775):
    """
    Make dirs for file file_path, if these dirs are not exist.
    """
    dirname = os.path.dirname(file_path)
    if not os.path.exists(dirname):
        os.makedirs(dirname, mode=mode)