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