def get_module(value, signature=None):
    """
    Creates a module for value, in order to do the type checking.
    """
    if isinstance(value, Constant):
        return type(value)
    elif isinstance(value, bool):
        return Boolean
    elif isinstance(value, str):
        return String
    elif isinstance(value, int):
        return Integer
    elif isinstance(value, float):
        return Float
    if isinstance(value, list):
        return List
    elif isinstance(value, tuple):
        # Variant supports signatures of any length
        if signature is None or \
           (len(signature) == 1 and signature[0][0] == Variant):
            return (Variant,)*len(value)
        v_modules = ()
        for element in xrange(len(value)):
            v_modules += (get_module(value[element], signature[element]),)
        if None in v_modules: # Identification failed
            return None
        return v_modules
    else: # pragma: no cover
        debug.warning("Could not identify the type of the list element.")
        debug.warning("Type checking is not going to be done inside "
                      "iterated module.")
        return None

###############################################################################
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/core/modules/basic_modules.py/get_module/original