def scalar(value):
    """
    Take return a value[0] if `value` is a list of length 1 
    """
    if isinstance(value, (list, tuple)) and len(value) == 1:
        return value[0]
    return value
dataset/ETHPy150Open ContinuumIO/flask-ldap-login/flask_ldap_login/__init__.py/scalar/original