>>> def http(e):
... match e:
... case 400:
... print('Error 400')
... case 401:
... print('Auth request')
... case _:
... print('Unknow error')
...
>>> http(12)
Unknow error
>>> http(500)
Unknow error
>>> http(400)
Error 400
>>> def http(e):
... match e:
... case 400:
... print('Error 400')
... case 401:
... print('Auth request')
... case _:
... print('Unknow error')
...
>>> http(12)
Unknow error
>>> http(500)
Unknow error
>>> http(400)
Error 400
https://platform.openai.com/docs/guides/realtime-websocket?websocket-examples=python
>>> users
{'Hans': 'active', 'Éléonore': 'inactive', '景太郎': 'active'}
>>> [a for a in users.keys() if users.get(a)=='active']
['Hans', '景太郎']
>>> r
{'Name': 'Ambiorix', 'age': 34}
>>> {r[a]:a for a in r if type(r[a])==int}
{34: 'age'}
>>> {r[a]:a for a in r if type(r[a])==str}
{'Ambiorix': 'Name'}
>>>
>>>
>>> answer
'Ambiorix Rodriguez Placencio'
>>> chr(max({a:ord(a) for a in answer}.values()))
'z'
>>> chr(max({a:ord(a) for a in answer}.values()))