def parse_slurm_job_cpus(cpus):
    """Return number of cores allocated on each node in the allocation.

    This method parses value of Slurm's SLURM_JOB_CPUS_PER_NODE variable's value.

    Args:
        cpus (str): the value of SLURM_JOB_CPUS_PER_NODE

    Returns:
        list (int): the number of cores on each node
    """
    result = []

    for part in cpus.split(','):
        if part.find('(') != -1:
            cores, times = part.rstrip(')').replace('(x', 'x').split('x')
            for _ in range(0, int(times)):
                result.append(int(cores))
        else:
            result.append(int(part))

    return result