<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def checkValidNodeTypes(provisioner, nodeTypes):
 """ Raises if an invalid nodeType is specified for aws, azure, or gce. :param str provisioner: 'aws', 'gce', or 'azure' to specify which cloud provisioner used. :param nodeTypes: A list of node types. Example: ['t2.micro', 't2.medium'] :return: Nothing. Raises if invalid nodeType. """

    if not nodeTypes:
        return
    if not isinstance(nodeTypes, list):
        nodeTypes = [nodeTypes]
    if not isinstance(nodeTypes[0], string_types):
        return
    # check if a valid node type for aws
    from toil.lib.generatedEC2Lists import E2Instances, regionDict
    if provisioner == 'aws':
        from toil.provisioners.aws import getCurrentAWSZone
        currentZone = getCurrentAWSZone()
        if not currentZone:
            currentZone = 'us-west-2'
        else:
            currentZone = currentZone[:-1] # adds something like 'a' or 'b' to the end
        # check if instance type exists in this region
        for nodeType in nodeTypes:
            if nodeType and ':' in nodeType:
                nodeType = nodeType.split(':')[0]
            if nodeType not in regionDict[currentZone]:
                # They probably misspelled it and can't tell.
                close = get_close_matches(nodeType, regionDict[currentZone], 1)
                if len(close) > 0:
                    helpText = ' Did you mean ' + close[0] + '?'
                else:
                    helpText = ''
                raise RuntimeError('Invalid nodeType (%s) specified for AWS in region: %s.%s'
                                   '' % (nodeType, currentZone, helpText))
    # Only checks if aws nodeType specified for gce/azure atm.
    if provisioner == 'gce' or provisioner == 'azure':
        for nodeType in nodeTypes:
            if nodeType and ':' in nodeType:
                nodeType = nodeType.split(':')[0]
            try:
                E2Instances[nodeType]
                raise RuntimeError("It looks like you've specified an AWS nodeType with the "
                                   "{} provisioner.  Please specify an {} nodeType."
                                   "".format(provisioner, provisioner))
            except KeyError:
                pass