Instantiate the Tuple based on this TupleNode.
172692
def _make_tuple(self, env):
    """"""
    t = runtime.Tuple(self, env, dict2tuple)
    # A tuple also provides its own schema spec
    schema = schema_spec_from_tuple(t)
    t.attach_schema(schema)
    return t
1198005
def from_expr(cls, expr):
        """"""
        return cls(expr.args, expr.kwargs, cls=expr.__class__)
614767
def _create_tuple(self, format, args):
        """"""

        format = format[1:]  # eat the '('
        if args is None:
            # empty value: we need to call _create() to parse the subtype
            rest_format = format
            while rest_format:
                if rest_format.startswith(')'):
                    break
                rest_format = self._create(rest_format, None)[1]
            else:
                raise TypeError('tuple type string not closed with )')

            rest_format = rest_format[1:]  # eat the )
            return (None, rest_format, None)
        else:
            if not args or not isinstance(args[0], tuple):
                raise TypeError('expected tuple argument')

            builder = GLib.VariantBuilder.new(variant_type_from_string('r'))
            for i in range(len(args[0])):
                if format.startswith(')'):
                    raise TypeError('too many arguments for tuple signature')

                (v, format, _) = self._create(format, args[0][i:])
                builder.add_value(v)
            args = args[1:]
            if not format.startswith(')'):
                raise TypeError('tuple type string not closed with )')

            rest_format = format[1:]  # eat the )
            return (builder.end(), rest_format, args)
803492
def is_tuple(node):
    """"""
    if isinstance(node, Node) and node.children == [LParen(), RParen()]:
        return True
    return (isinstance(node, Node)
            and len(node.children) == 3
            and isinstance(node.children[0], Leaf)
            and isinstance(node.children[1], Node)
            and isinstance(node.children[2], Leaf)
            and node.children[0].value == u"("
            and node.children[2].value == u")")
1194171
def ensure_tuple(obj):
    """"""
    if obj is None:
        return tuple()
    if isinstance(obj, Iterable) and not isinstance(obj, six.string_types):
        return tuple(obj)
    return obj,
242147
public final <T3, T4> Tuple4<T1, T2, T3, T4> concat(Tuple2<T3, T4> tuple) {
        return new Tuple4<>(v1, v2, tuple.v1, tuple.v2);
    }
563746
def create(blocks, mode='basic', inplanes=64, cardinality=4, image_features=64, divisor=4, num_classes=1000):
    
    block_dict = {
        # 'basic': BasicBlock,
        'bottleneck': ResNeXtBottleneck
    }

    def instantiate(**_):
        return ResNeXt(block_dict[mode], blocks, inplanes=inplanes, image_features=image_features, cardinality=cardinality, divisor=divisor, num_classes=num_classes)

    return ModelFactory.generic(instantiate)
1083124
def from_dict(cls, d, **kwargs):
        """"""
        args = []
        for k in DATASET_KEYS:
            val = kwargs.get(k, d.get(k))
            # force modifiers to tuple
            if k == 'modifiers' and val is not None:
                val = tuple(val)
            args.append(val)

        return cls(*args)
1186939
def _wrap_type_instantiation(self, type_cls):
        """"""
        def wrapper(*args, **kwargs):
            # use args for struct arguments??
            return type_cls(stream=self._null_stream)
        return wrapper
500779
def make_tuple(obj, cast=True):
    
    if isinstance(obj, tuple):
        return tuple(obj)
    elif is_lazy_iterable(obj):
        return tuple(obj)
    elif isinstance(obj, (list, set)) and cast:
        return tuple(obj)
    else:
        return (obj,)
806927
public TupleCombiner cloneOf()
    {
    TupleCombiner other = new TupleCombiner();
    other.setTupleSize( getTupleSize());
    other.setIncludedVars( new HashSet<VarNamePattern>( getIncludedVars()));
    other.setExcludedVars( new HashSet<VarNamePattern>( getExcludedVars()));
    other.setOnceTuples( new HashSet<TupleRef>( IteratorUtils.toList( getOnceTuples())));
    return other;
    }
639810
protected function instantiateNode()
    {
        return new IntegerNode($this->name, $this->parent, $this->min, $this->max, $this->pathSeparator);
    }
1322836
public static Tuple newInstance(int arity) {
		switch (arity) {
			case 0: return Tuple0.INSTANCE;
			case 1: return new Tuple1();
			case 2: return new Tuple2();
			case 3: return new Tuple3();
			case 4: return new Tuple4();
			case 5: return new Tuple5();
			case 6: return new Tuple6();
			case 7: return new Tuple7();
			case 8: return new Tuple8();
			case 9: return new Tuple9();
			case 10: return new Tuple10();
			case 11: return new Tuple11();
			case 12: return new Tuple12();
			case 13: return new Tuple13();
			case 14: return new Tuple14();
			case 15: return new Tuple15();
			case 16: return new Tuple16();
			case 17: return new Tuple17();
			case 18: return new Tuple18();
			case 19: return new Tuple19();
			case 20: return new Tuple20();
			case 21: return new Tuple21();
			case 22: return new Tuple22();
			case 23: return new Tuple23();
			case 24: return new Tuple24();
			case 25: return new Tuple25();
			default: throw new IllegalArgumentException("The tuple arity must be in [0, " + MAX_ARITY + "].");
		}
	}
63127
public final Tuple2<Tuple0, Tuple5<T1, T2, T3, T4, T5>> split0() {
        return new Tuple2<>(limit0(), skip0());
    }
1331709
def _instantiate(cls, params):
    
    sig_params = inspect.signature(cls.__init__).parameters
    valid_params = dict()
    for key, value in params.items():
        if key in sig_params:
            valid_params[key] = value
        else:
            logger.debug('Type %s does not support parameter \'%s\'' % (cls.__name__, key))
    return cls(**valid_params)
756436
public final Tuple2<Tuple4<T1, T2, T3, T4>, Tuple0> split4() {
        return new Tuple2<>(limit4(), skip4());
    }
553572
def tuplize(nested):
  
  if isinstance(nested, str):
    return nested
  try:
    return tuple(map(tuplize, nested))
  except TypeError:
    return nested