def _parameter_present(query_string, key, value=None):
    """
    Check whether the given key/value pair is present in the query string.
    If the value is blank, it simply checks for the presence of the key
    """
    already_there = False
    if query_string:
        for p in query_string.split('&'):
            k, v = p.split('=')
            if str(k) == str(key):
                if value:
                    if str(v) == str(value):
                        already_there = True
                else:
                    already_there = True
    return already_there