def generate_numa(self, vcpu_num):
if int(vcpu_num) == <NUM_LIT:2>:<EOL><INDENT>total_cells = <NUM_LIT:2><EOL>cpus_per_cell = <NUM_LIT:1><EOL><DEDENT>elif int(vcpu_num) == <NUM_LIT:4>:<EOL><INDENT>total_cells = <NUM_LIT:2><EOL>cpus_per_cell = <NUM_LIT:2><EOL><DEDENT>else:<EOL><INDENT>cell_info = divmod(int(vcpu_num), <NUM_LIT:4>)<EOL>if cell_info[<NUM_LIT:1>] == <NUM_LIT:0>:<EOL><INDENT>total_cells = cell_info[<NUM_LIT:0>]<EOL>cpus_per_cell = <NUM_LIT:4><EOL><DEDENT>elif cell_info[<NUM_LIT:1>] == <NUM_LIT:2>:<EOL><INDENT>total_cells = (cell_info[<NUM_LIT:0>] * <NUM_LIT:2>) + <NUM_LIT:1><EOL>cpus_per_cell = <NUM_LIT:2><EOL><DEDENT>else:<EOL><INDENT>total_cells = int(vcpu_num)<EOL>cpus_per_cell = <NUM_LIT:1><EOL><DEDENT><DEDENT>numa = ET.Element('<STR_LIT>')<EOL>memory_per_cell = divmod(int(self.memory), total_cells)<EOL>LOGGER.debug(<EOL>'<STR_LIT>'.format(<EOL>cpus_per_cell, total_cells<EOL>)<EOL>)<EOL>for cell_id in xrange(<NUM_LIT:0>, total_cells):<EOL><INDENT>first_cpu_in_cell = cell_id * cpus_per_cell<EOL>if cpus_per_cell == <NUM_LIT:1>:<EOL><INDENT>cpus_in_cell = str(first_cpu_in_cell)<EOL><DEDENT>else:<EOL><INDENT>cpus_in_cell = '<STR_LIT>'.format(<EOL>first_cpu_in_cell, first_cpu_in_cell + cpus_per_cell - <NUM_LIT:1><EOL>)<EOL><DEDENT>cell = ET.Element(<EOL>'<STR_LIT>',<EOL>id=str(cell_id),<EOL>cpus=cpus_in_cell,<EOL>memory=str(memory_per_cell[<NUM_LIT:0>]),<EOL>unit='<STR_LIT>',<EOL>)<EOL>numa.append(cell)<EOL><DEDENT>LOGGER.debug('<STR_LIT>'.format(ET.tostring(numa, pretty_print=True)))<EOL>return numa<EOL>
Generate guest CPU <numa> XML child
Configures 1, 2 or 4 vCPUs per cell.

Args:
    vcpu_num(str): number of virtual CPUs

Returns:
    lxml.etree.Element: numa XML element