<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def price_namespace( namespace_id, block_height, units ):
 """ Calculate the cost of a namespace. Returns the price on success Returns None if the namespace is invalid or if the units are invalid """

    price_table = get_epoch_namespace_prices( block_height, units )
    if price_table is None:
        return None

    if len(namespace_id) >= len(price_table) or len(namespace_id) == 0:
        return None

    return price_table[len(namespace_id)]