Download pool/shard000/Python/0000006_fakeit.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 707 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard000/Python/0000006_fakeit.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard000/Python/0000006_fakeit.py
-
curl -L -o 0000006_fakeit.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard000/Python/0000006_fakeit.py
707 Bytes
| from bottle import route, view, request, run, template | |
| import socket | |
| import json | |
| def index(): | |
| return template('index_template') | |
| def sendLocation(): | |
| locationDict = request.json['location'] | |
| deviceDict = request.json['device'] | |
| deviceIP = deviceDict['ip'] | |
| devicePorts = deviceDict['port'] | |
| devicePortsList = devicePorts.split(',') | |
| for port in devicePortsList: | |
| sendLocation(locationDict,deviceIP,int(port)) | |
| def sendLocation(dict,ip,port): | |
| message = json.dumps(dict) | |
| sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
| sock.sendto(message, (ip, port)) | |
| run(host='localhost', port=8080, debug=True) | |