Create directory if fmt has a prefix

def create_prefix_dir(nb_file, fmt):
    """Create directory if fmt has a prefix"""
    if 'prefix' in fmt:
        nb_dir = os.path.dirname(nb_file) + os.path.sep
        if not os.path.isdir(nb_dir):
            logging.log(logging.WARNING, "[jupytext] creating missing directory %s", nb_dir)
            os.makedirs(nb_dir)