def _parse_module_size(description):
    """Return a string size of the memory module in description.

    >>> _parse_module_size('4GB')
    '4'
    >>> _parse_module_size('8 GB')
    '8'
    >>> _parse_module_size('16GB (2x8GB)')
    '2x8'
    >>> _parse_module_size('(2 x 8GB) 16GB')
    '2x8'

    Args:
        description: String description of a RAM module.
    Returns:
        String size of the memory module in description.
    """
    if not isinstance(description, str):
        raise TypeError('description must be a string.')

    sizes = []
    end = -1
    while True:
        end = description.find('GB', end + 1)
        if end <= 0:
            break
        start = end - 1
        # Skip any space between the size and "GB"
        while (start >= 0) and description[start].isspace():
            start -= 1
        # Move to the start of the size
        while (start >= 0) and description[start].isdigit():
            start -= 1
        start += 1
        try:
            sizes.append(int(description[start:end].strip()))
        except ValueError:
            pass

    if len(sizes) <= 0:
        return None
    if len(sizes) == 1:
        return str(sizes[0])
    else:
        if sizes[0] == sizes[1]:
            return str(sizes[0])
        else:
            numerator = max(*sizes[:2])
            denominator = min(*sizes[:2])
            return '{}x{}'.format(numerator // denominator, denominator)