def write_template(template_dict, temp_file):
    """
    Write a CrackQ json state file

    This could be a job template or a current
    job state file.

    Arguments
    ---------
    template_dict: dict
        JSON job details in dict format
    temp_file: Path object
        File path location to store the file

    Returns
    """
    logger.debug('Writing template/status file')
    try:
        with open(temp_file, 'x') as fh_temp:
            fh_temp.write(json.dumps(template_dict))
        return True
    except FileExistsError as err:
        logger.debug('Status/Template file already exists {}'.format(err))
        return False

    Write a CrackQ json state file

    This could be a job template or a current
    job state file.

    Arguments
    ---------
    template_dict: dict
        JSON job details in dict format
    temp_file: Path object
        File path location to store the file

    Returns
    
crackq/cq_api.py