def _details_generator(
    element_string: str,
    person_name: str | None,
    person_gender: str | None,
    factory_name: str,
    antagonist_name: str,
    antagonist_gender: str,
    organizer_name: str,
    organizer_gender: str,
    rng: random.Random,
) -> dict[str, str | None]:
  """Fill in details of the characters and their world."""
  generated = {str(key): '' for key in extract_braces(element_string)}
  if 'worker_name' in generated:
    gender = person_gender
    _add_pronouns(generated, gender)
  if 'antagonist_name' in generated:
    _add_pronouns(generated, antagonist_gender, prefix='antagonist_')
  if 'organizer_name' in generated:
    _add_pronouns(generated, organizer_gender, prefix='organizer_')

  for key, value in generated.items():
    if value:
      continue
    else:
      if key == 'neighborhood_name':
        generated[key] = rng.choice(FACTORY_NEIGHBORHOOD_NAMES)
      if key == 'street_name':
        generated[key] = rng.choice(STREET_NAMES)
      if key == 'factory_name':
        generated[key] = factory_name
      if key == 'antagonist_name':
        generated[key] = antagonist_name
      if key == 'organizer_name':
        generated[key] = organizer_name
      if key == 'worker_name':
        generated[key] = person_name

  return generated
Fill in details of the characters and their world.
examples/deprecated/modular/environment/modules/garment_factory_labor.py