def METHOD_NAME(state_storage_serviceurl, table_ns, table_name):
    """Create the state context based on state storage serviceurl"""
    if state_storage_serviceurl is None:
        return NullStateContext()
    else:
        return BKManagedStateContext(state_storage_serviceurl, table_ns, table_name)