or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/us@3.2.x
tile.json

tessl/pypi-us

tessl install tessl/pypi-us@3.2.0

A package for easily working with US and state metadata

Agent Success

Agent success rate when using this tile

88%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.24x

Baseline

Agent success rate without this tile

71%

task.mdevals/scenario-5/

US Territory Validator

Build a utility that validates and categorizes US geographic entities to distinguish between states and territories.

Capabilities

Validate Territory Status

  • When given "PR", return True indicating it is a territory @test
  • When given "Guam", return True indicating it is a territory @test
  • When given "California", return False indicating it is not a territory @test
  • When given "TX", return False indicating it is not a territory @test

List All Territories

  • Return a list of all 5 US territory names in alphabetical order @test

Count Entities by Type

  • When given a list containing ["CA", "PR", "NY", "GU"], return {"states": 2, "territories": 2} @test
  • When given a list containing ["Alaska", "Virgin Islands", "Texas"], return {"states": 2, "territories": 1} @test

Implementation

@generates

API

def is_territory(identifier: str) -> bool:
    """
    Check if the given identifier (name or abbreviation) represents a US territory.

    Args:
        identifier: State/territory name or postal abbreviation (case-insensitive)

    Returns:
        True if the identifier represents a territory, False otherwise

    Raises:
        ValueError: If the identifier is not a valid US state or territory
    """
    pass

def list_all_territories() -> list[str]:
    """
    Return a list of all US territory names in alphabetical order.

    Returns:
        List of territory names sorted alphabetically
    """
    pass

def count_by_type(identifiers: list[str]) -> dict[str, int]:
    """
    Count how many states and territories are in the given list.

    Args:
        identifiers: List of state/territory names or abbreviations

    Returns:
        Dictionary with keys "states" and "territories" containing counts

    Raises:
        ValueError: If any identifier is not a valid US state or territory
    """
    pass

Dependencies { .dependencies }

us { .dependency }

Provides US state and territory metadata including territory identification.

@satisfied-by