Download pairs/pair_31/output.txt from 23ws-LLMcoder/LLMcoder-GitHub-Python-Mix-Direct: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/datasets/23ws-LLMcoder/LLMcoder-GitHub-Python-Mix-Direct/resolve/main/pairs/pair_31/output.txt
- Command line
-
hf download hf://datasets/23ws-LLMcoder/LLMcoder-GitHub-Python-Mix-Direct/pairs/pair_31/output.txt
-
curl -L -o output.txt https://huggingface.co/datasets/23ws-LLMcoder/LLMcoder-GitHub-Python-Mix-Direct/resolve/main/pairs/pair_31/output.txt
1.04 kB
| break | |
| # remove cutoff% samples from the high end | |
| cut = n * cutoff[1] // 100 | |
| for hi in range(255, -1, -1): | |
| if cut > h[hi]: | |
| cut = cut - h[hi] | |
| h[hi] = 0 | |
| else: | |
| h[hi] -= cut | |
| cut = 0 | |
| if cut <= 0: | |
| break | |
| # find lowest/highest samples after preprocessing | |
| for lo in range(256): | |
| if h[lo]: | |
| break | |
| for hi in range(255, -1, -1): | |
| if h[hi]: | |
| break | |
| if hi <= lo: | |
| # don't bother | |
| lut.extend(list(range(256))) | |
| else: | |
| scale = 255.0 / (hi - lo) | |
| offset = -lo * scale | |
| for ix in range(256): | |
| ix = int(ix * scale + offset) | |
| if ix < 0: | |
| ix = 0 | |
| elif ix > 255: | |
| ix = 255 | |
| lut.append(ix) | |
| return _lut(image, lut) |