def lowercase_value(value):
    """
    Lowercase the provided value.

    In case of a list, all the string item values are lowercases and in case of a dictionary, all
    of the string keys and values are lowercased.
    """
    if isinstance(value, six.string_types):
        result = value.lower()
    elif isinstance(value, (list, tuple)):
        result = [str(item).lower() for item in value]
    elif isinstance(value, dict):
        result = {}
        for key, value in six.iteritems(value):
            result[key.lower()] = str(value).lower()
    else:
        result = value

    return result

    Lowercase the provided value.

    In case of a list, all the string item values are lowercases and in case of a dictionary, all
    of the string keys and values are lowercased.
    
st2common/st2common/util/misc.py