def _details_generator(
    element_string: str,
    person_name: str | None,
    person_gender: str | None,
    railroad_name: str,
    antagonist_name: str,
    antagonist_gender: str,
    organizer_name: str,
    organizer_gender: str,
    rng: random.Random,
) -> dict[str, str | None]:
  """This function generates the details of the characters and their world."""
  generated = {str(key): '' for key in extract_braces(element_string)}
  if 'person_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 == 'town_name':
        generated[key] = rng.choice(TOWN_NAMES)
      if key == 'oasis_name':
        generated[key] = rng.choice(OASIS_NAMES)
      if key == 'desert_name':
        generated[key] = rng.choice(DESERT_NAMES)
      if key == 'plant_name':
        generated[key] = rng.choice(PLANT_NAMES)
      if key == 'saloon_name':
        generated[key] = rng.choice(SALOON_NAMES)
      if key == 'mesa_name':
        generated[key] = rng.choice(MESA_NAMES)
      if key == 'canyon_name':
        generated[key] = rng.choice(CANYON_NAMES)
      if key == 'gang_name':
        generated[key] = rng.choice(GANG_NAMES)
      if key == 'railroad_name':
        generated[key] = railroad_name
      if key == 'antagonist_name':
        generated[key] = antagonist_name
      if key == 'organizer_name':
        generated[key] = organizer_name
      if key == 'person_name':
        generated[key] = person_name

  return generated
This function generates the details of the characters and their world.
examples/deprecated/modular/environment/modules/wild_west_railroad_construction_labor.py