def getTypedValue(data_type, value):
    '''Utility function to cast a string value to the appropriate XSD type. '''

    if data_type == 'boolean':
        return bool(value)
    elif data_type == 'integer':
        return int(value)
    elif data_type == 'float':
        return float(value)
    elif data_type == 'string':
        return str(value)
    else:
        return value # no type casting
dataset/ETHPy150Open geopython/OWSLib/owslib/util.py/getTypedValue/original