import requests


def get_product_availability(product_id, sku):
    """Get product's availability
    
    Args:
        product_id (str): J.Crew's product ID (as found in the product URL)
        sku (str): J.Crew's SKU for the specific color and size of a product
        
    Returns:
        bool: Whether SKU is in stock
        
    Raises:
        Exception: The availability couldn't be determined
    """

    inventory = requests.get('https://www.jcrew.com/data/v1/US/products/inventory/%s' % product_id)
    inventory.raise_for_status()
    inventory_json = inventory.json()

    product = inventory_json['inventory'][sku]

    if 'inStock' in product:
        return product['inStock']

    if 'quantity' in product:
        return bool(product['quantity'])

    raise Exception("Could not find `inStock` or `quantity` keys")