def is_pk_descriptor(descriptor, include_alt=False):
    """Return true if `descriptor` is a primary key."""
    if descriptor.pk is True or type(descriptor.pk) is int:
        return True
    if include_alt:
        return descriptor.alt_pk is True or type(descriptor.alt_pk) is int
    else:
        return False
Return true if `descriptor` is a primary key.