Download pool/shard000/Python/0000106_helpers.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 815 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard000/Python/0000106_helpers.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard000/Python/0000106_helpers.py
-
curl -L -o 0000106_helpers.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard000/Python/0000106_helpers.py
815 Bytes
| counter = 0 | |
| variables = [] | |
| class Variable: | |
| def __init__(self): | |
| global counter | |
| self._index = counter | |
| counter += 1 | |
| def get_index(self): | |
| return self._index | |
| def to_string(self): | |
| return 'V[ ' + str(self._index) + ']' | |
| def createVariableInstance(): | |
| v = Variable() | |
| variables.append(v) | |
| return v | |
| def createVarPos(): | |
| x = createVariableInstance() | |
| y = createVariableInstance() | |
| z = createVariableInstance() | |
| return [x, y, z] | |
| def equaliseTwoVars(x, y, relations): | |
| fn_str = 'lambda V: ' + x.to_string() + ' - ( ' + y.to_string() + ')' | |
| print (fn_str) | |
| fn = eval(fn_str) | |
| relations.append(fn) | |
| def equaliseTwoLists(xs, ys, relations): | |
| length = len(xs) | |
| for i in range(0, length): | |
| equaliseTwoVars(xs[i], ys[i], relations) | |