Transform a schema, once loaded from its YAML representation, to its
    final internal representation

def _transschema(x):
    """
    Transform a schema, once loaded from its YAML representation, to its
    final internal representation
    """
    if isinstance(x, tuple):
        return x.__class__(_transschema(x[0]), *x[1:])
    elif isinstance(x, dict):
        return dict((_qualify_map(key, _transschema(val)) for key, val in x.iteritems()))
    elif isinstance(x, list):
        return map(_transschema, x)
    else:
        return x