def derive_state(state_list):
    """
    Compute a derived state an object.  This will be based off the states of
    the objects based in.

    :param state_list: List of objects that have a get_state() method.
    :returns: State as a string.
    """
    # If there are no ports passed in, we assume it is an internal element,
    # and is therefore available.
    if state_list is None or len(state_list) == 0:
        return "Available"

    # Otherwise derive off the list
    states = [x.get_state().lower() for x in state_list]
    if('available' in states and
       ('unavailable' in states or 'degraded' in states)):
        return 'Degraded'
    elif 'available' in states:
        return 'Available'
    elif 'degraded' in states:
        return 'Degraded'
    else:
        return 'Unavailable'