Download src/utils/names.py from InternsProgressUpdate/Venket: direct link, hf CLI and curl.
- Browser
- Download file 2.79 kB
-
https://huggingface.co/InternsProgressUpdate/Venket/resolve/main/src/utils/names.py
- Command line
-
hf download hf://InternsProgressUpdate/Venket/src/utils/names.py
-
curl -L -o names.py https://huggingface.co/InternsProgressUpdate/Venket/resolve/main/src/utils/names.py
2.79 kB
| """Deterministic synthetic signer name/role generation. | |
| No external dependency (e.g. Faker) is required: a compact, self-contained | |
| name pool keeps the pipeline dependency-light and fully reproducible from a | |
| seed alone (Faker's own generators are not guaranteed stable across | |
| versions, which would break the "same seed -> same output" contract). | |
| """ | |
| from __future__ import annotations | |
| import random | |
| FIRST_NAMES: tuple[str, ...] = ( | |
| "James", "Mary", "Robert", "Patricia", "John", "Jennifer", "Michael", "Linda", | |
| "David", "Elizabeth", "William", "Barbara", "Richard", "Susan", "Joseph", "Jessica", | |
| "Thomas", "Sarah", "Charles", "Karen", "Christopher", "Nancy", "Daniel", "Lisa", | |
| "Matthew", "Betty", "Anthony", "Margaret", "Mark", "Sandra", "Donald", "Ashley", | |
| "Steven", "Kimberly", "Paul", "Emily", "Andrew", "Donna", "Joshua", "Michelle", | |
| "Kenneth", "Carol", "Kevin", "Amanda", "Brian", "Melissa", "George", "Deborah", | |
| "Edward", "Stephanie", "Ronald", "Rebecca", "Timothy", "Laura", "Jason", "Sharon", | |
| "Jeffrey", "Cynthia", "Ryan", "Kathleen", "Jacob", "Amy", "Gary", "Angela", | |
| "Nicholas", "Shirley", "Eric", "Anna", "Jonathan", "Brenda", "Stephen", "Pamela", | |
| "Larry", "Emma", "Justin", "Nicole", "Scott", "Helen", "Brandon", "Samantha", | |
| "Wei", "Mei", "Hiroshi", "Yuki", "Raj", "Priya", "Ahmed", "Fatima", | |
| "Carlos", "Sofia", "Hans", "Ingrid", "Liam", "Olivia", "Noah", "Ava", | |
| ) | |
| LAST_NAMES: tuple[str, ...] = ( | |
| "Smith", "Johnson", "Williams", "Brown", "Jones", "Garcia", "Miller", "Davis", | |
| "Rodriguez", "Martinez", "Hernandez", "Lopez", "Gonzalez", "Wilson", "Anderson", "Thomas", | |
| "Taylor", "Moore", "Jackson", "Martin", "Lee", "Perez", "Thompson", "White", | |
| "Harris", "Sanchez", "Clark", "Ramirez", "Lewis", "Robinson", "Walker", "Young", | |
| "Allen", "King", "Wright", "Scott", "Torres", "Nguyen", "Hill", "Flores", | |
| "Green", "Adams", "Nelson", "Baker", "Hall", "Rivera", "Campbell", "Mitchell", | |
| "Carter", "Roberts", "Chen", "Tan", "Kumar", "Patel", "Khan", "Ali", | |
| "Muller", "Schmidt", "Rossi", "Dubois", "Kowalski", "Ivanov", "Suzuki", "Tanaka", | |
| ) | |
| ROLE_POOL: tuple[str, ...] = ( | |
| "Account Holder", | |
| "Authorized Signatory", | |
| "Branch Manager", | |
| "Bank Representative", | |
| "Bank Officer", | |
| "Loan Officer", | |
| "Notary Public", | |
| "Guarantor", | |
| "Co-Signer", | |
| "Compliance Officer", | |
| "First Authorised Signatory", | |
| "Second Authorised Signatory", | |
| ) | |
| def generate_name(rng: random.Random) -> str: | |
| """Generate a deterministic synthetic full name from a seeded RNG.""" | |
| return f"{rng.choice(FIRST_NAMES)} {rng.choice(LAST_NAMES)}" | |
| def generate_role(rng: random.Random) -> str: | |
| """Generate a deterministic synthetic role from a seeded RNG.""" | |
| return rng.choice(ROLE_POOL) | |