Deconstructs a composite type to a Tuple.
334738
protected Tuple composeComposite(AbstractCompositeType comparator, ByteBuffer name) throws IOException
    {
        List<CompositeComponent> result = comparator.deconstruct(name);
        Tuple t = TupleFactory.getInstance().newTuple(result.size());
        for (int i=0; i<result.size(); i++)
            setTupleValue(t, i, cassandraToObj(result.get(i).comparator, result.get(i).value));

        return t;
    }
440348
public static <T1, T2> TypeFactory<Tuple2<T1, T2>> typeFactory( TypeFactory<T1> type1,
                                                                    TypeFactory<T2> type2 ) {
        return new Tuple2TypeFactory<>(type1, type2);
    }
1173751
function tupleToArray(tuple) {
  if(isFunction(tuple)) {
    return function(x) {
      const m = tuple(x)

      if(!isFunction(m.tupleLength)) {
        throw new TypeError('tupleToArray: Tuple returning function required')
      }

      return m.toArray()
    }
  }

  if(isFunction(tuple.tupleLength)) {
    return tuple.toArray()
  }

  throw new TypeError('tupleToArray: Tuple or Tuple returning function required')
}
36236
def deconstruct(self):
        
        name, path, args, kwargs = super(CountryField, self).deconstruct()
        kwargs.pop("choices")
        if self.multiple:  # multiple determines the length of the field
            kwargs["multiple"] = self.multiple
        if self.countries is not countries:
            # Include the countries class if it's not the default countries
            # instance.
            kwargs["countries"] = self.countries.__class__
        return name, path, args, kwargs
1048763
def tupleize(element, ignore_types=(str, bytes)):
    """"""
    if hasattr(element, '__iter__') and not isinstance(element, ignore_types):
        return element
    else:
        return tuple((element,))
437958
function _Type(
    type,       // :: String
    name,       // :: String
    url,        // :: String
    arity,      // :: NonNegativeInteger
    format,
    // :: Nullable ((String -> String, String -> String -> String) -> String)
    supertypes, // :: Array Type
    test,       // :: Any -> Boolean
    tuples      // :: Array (Array3 String (a -> Array b) Type)
  ) {
    var t = Object.create (Type$prototype);
    t._test = test;
    t._extractors = tuples.reduce (function(_extractors, tuple) {
      _extractors[tuple[0]] = tuple[1];
      return _extractors;
    }, {});
    t.arity = arity;  // number of type parameters
    t.extractors = Z.map (B (toArray), t._extractors);
    t.format = format || function(outer, inner) {
      return Z.reduce (function(s, tuple) {
        return s +
               outer (' ') +
               when (tuple[2].arity > 0)
                    (parenthesize (outer))
                    (inner (tuple[0]) (show (tuple[2])));
      }, outer (name), tuples);
    };
    t.keys = tuples.map (function(tuple) { return tuple[0]; });
    t.name = name;
    t.supertypes = supertypes;
    t.type = type;
    t.types = tuples.reduce (function(types, tuple) {
      types[tuple[0]] = tuple[2];
      return types;
    }, {});
    t.url = url;
    return t;
  }
55038
public static <A, B, EA extends A, A1> DecomposableMatchBuilder1<Tuple2<A, B>, A1> tuple2(
      DecomposableMatchBuilder1<EA, A1> a, MatchesExact<B> b) {
    List<Matcher<Object>> matchers = Lists.of(ArgumentMatchers.any(), ArgumentMatchers.eq(b.t));
    return new DecomposableMatchBuilder1<Tuple2<A, B>, EA>(
        matchers, 0, new Tuple2FieldExtractor<>()).decomposeFirst(a);
  }
96845
public static <T> Column<T> fromDecomposed(String name, ByteBuffer decomposedValue, AbstractType<T> type) {
        T composedValue = type.compose(decomposedValue);
        return new Column<>(name, null, decomposedValue, composedValue, type);
    }
1113924
def _clean_listofcomponents_tuples(listofcomponents_tuples):
    """"""
    def to3tuple(item):
        """return a 3 item tuple"""
        if len(item) == 3:
            return item
        else:
            return (item[0], item[1], None)
    return [to3tuple(item) for item in listofcomponents_tuples]
1164951
public static <A> DecomposableMatchBuilder0<Tuple1<A>> tuple1(MatchesExact<A> a) {
    List<Matcher<Object>> matchers = Lists.of(ArgumentMatchers.eq(a.t));
    return new DecomposableMatchBuilder0<Tuple1<A>>(matchers, new Tuple1FieldExtractor<>());
  }
452273
public static <T1, T2, T3> Tuple3<T1, T2, T3> tuple(T1 v1, T2 v2, T3 v3) {
        return new Tuple3<>(v1, v2, v3);
    }
264758
def as_tuple(self):
        
        ptr = self._pointer
        return (ptr.xx, ptr.yx, ptr.xy, ptr.yy, ptr.x0, ptr.y0)
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,)
529809
function tuple5Of(a, b, c, d, e) {
    var self = getInstance(this, tuple5Of);
    self.types = rest(arguments);
    return self;
}
66956
def simplify_recursive(typ):
    # type: (AbstractType) -> AbstractType
    """"""
    if isinstance(typ, UnionType):
        return combine_types(typ.items)
    elif isinstance(typ, ClassType):
        simplified = ClassType(typ.name, [simplify_recursive(arg) for arg in typ.args])
        args = simplified.args
        if (simplified.name == 'Dict' and len(args) == 2
                and isinstance(args[0], ClassType) and args[0].name in ('str', 'Text')
                and isinstance(args[1], UnionType) and not is_optional(args[1])):
            # Looks like a potential case for TypedDict, which we don't properly support yet.
            return ClassType('Dict', [args[0], AnyType()])
        return simplified
    elif isinstance(typ, TupleType):
        return TupleType([simplify_recursive(item) for item in typ.items])
    return typ
405483
def __remove_alias(type_):
    
    if isinstance(type_, cpptypes.declarated_t) and \
            isinstance(type_.declaration, typedef.typedef_t):
        return __remove_alias(type_.declaration.decl_type)
    if isinstance(type_, cpptypes.compound_t):
        type_.base = __remove_alias(type_.base)
        return type_
    return type_
31282
def get_decomposition_type_property(value, is_bytes=False):
    """"""

    obj = unidata.ascii_decomposition_type if is_bytes else unidata.unicode_decomposition_type

    if value.startswith('^'):
        negated = value[1:]
        value = '^' + unidata.unicode_alias['decompositiontype'].get(negated, negated)
    else:
        value = unidata.unicode_alias['decompositiontype'].get(value, value)

    return obj[value]