Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /MTSWebServices_horizon /tests /factories /base.py
| from __future__ import annotations | |
| from datetime import datetime, timezone | |
| from random import randrange | |
| from string import ascii_letters, digits, punctuation | |
| letters = ascii_letters + digits + punctuation + " " | |
| def random_string(length: int = 16) -> str: | |
| return "".join(letters[randrange(0, len(letters))] for _ in range(length)) | |
| def random_datetime( | |
| start: datetime | None = None, | |
| end: datetime | None = None, | |
| ) -> datetime: | |
| if not start: | |
| start = datetime.fromtimestamp(0, tz=timezone.utc) | |
| if not end: | |
| end = datetime.now(tz=timezone.utc) | |
| return datetime.fromtimestamp(randrange(int(start.timestamp()), int(end.timestamp())), tz=start.tzinfo) | |
Xet Storage Details
- Size:
- 689 Bytes
- Xet hash:
- 3e5d6ee318b98395c9361c780ee745970e27dd6f7d832c2ab88414b6edf7d0b1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.