(space, k, v)
Given a search space and a "key",
    if the defined subschema does not exist,
    set it to be the constant v space
Given a search space and a "key",
    if the defined subschema does not exist,
    set it to be the constant v space
Given a search space and a key if the defined subschema does not exist set it to be the constant v space
def add_sub_space(space, k, v):
    """Given a search space and a "key",
    if the defined subschema does not exist,
    set it to be the constant v space
    """
    # TODO!
    # I should parse __ and such and walk down the schema
    if isinstance(space, SearchSpaceObject):
        if k not in space.keys:
            space.keys.append(k)
            space.choices = (c + (SearchSpaceConstant(v),) for c in space.choices)
            return
def add_sub_space ( space , k , v ) : # TODO! # I should parse __ and such and walk down the schema if isinstance ( space , SearchSpaceObject ) : if k not in space . keys : space . keys . append ( k ) space . choices = ( c + ( SearchSpaceConstant ( v ) , ) for c in space . choices ) return