def extract_single(value):
    """Return a single value if the given value is of len 1."""
    try:
        if len(value) == 1:
            return value[0]
    except(ValueError, TypeError, Exception):
        pass
    return value