def value(iterable, key=None, position=1):
    """Generic value getter. Returns containing value."""
    if key is None:
        if hasattr(iterable, '__iter__'):
            return iterable[position]
        else:
            return iterable
    else:
        return iterable[key]
