| 24 | |
| 25 | |
| 26 | class Pattern: |
| 27 | @staticmethod |
| 28 | def create(length: int=8192): |
| 29 | pattern = '' |
| 30 | parts = ['A', 'a', '0'] |
| 31 | while len(pattern) != length: |
| 32 | pattern += parts[len(pattern) % 3] |
| 33 | if len(pattern) % 3 == 0: |
| 34 | parts[2] = chr(ord(parts[2]) + 1) |
| 35 | if parts[2] > '9': |
| 36 | parts[2] = '0' |
| 37 | parts[1] = chr(ord(parts[1]) + 1) |
| 38 | if parts[1] > 'z': |
| 39 | parts[1] = 'a' |
| 40 | parts[0] = chr(ord(parts[0]) + 1) |
| 41 | if parts[0] > 'Z': |
| 42 | parts[0] = 'A' |
| 43 | return pattern |
| 44 | |
| 45 | @staticmethod |
| 46 | def offset(value: str, length: int=8192): |
| 47 | return Pattern.create(length).index(value) |
| 48 | |
| 49 | |
| 50 | def popen(cmd:str) -> str: |
nothing calls this directly
no outgoing calls
no test coverage detected