Apply the corresponding TupleType's `dress` to every element of `value`
 (any enumerable). Return a Set of transformed tuples. Fail if anything
 goes wrong transforming tuples or if duplicates are found.
777491
def dress(value, handler = DressHelper.new)
      handler.failed!(self, value) unless value.respond_to?(:each)

      # Up every tuple and keep results in a Set
      set = Set.new
      handler.iterate(value) do |tuple, index|
        tuple = tuple_type.dress(tuple, handler)
        handler.fail!("Duplicate tuple") if set.include?(tuple)
        set << tuple
      end

      # Return built tuples
      set
    end
916272
def compose(*enumerables)
      res=[]
      enumerables.map(&:size).max.times do
        tupla=[]
        for enumerable in enumerables
          tupla << enumerable.shift
        end
        res << (block_given? ? yield(tupla) : tupla)
      end
      res
    end
577294
def _flatten(self, field, items, transform = None):
		
		
		# Retrieve the value for each item in the iterable
		values = [item[field] for item in items]
		
		# Flatten any nested lists
		flattened = []
		for value in values:
			flattened.extend([value] if isinstance(value, str) else value)
		
		# Apply any supplied transformation function
		return transform(flattened) if transform != None else flattened
945526
def applyTuple(self, tuple, right, env):
    """"""
    if len(right) != 1:
      raise exceptions.EvaluationError('Tuple (%r) can only be applied to one argument, got %r' % (self.left, self.right))
    right = right[0]

    return tuple(right)
1325961
def wrap_list(item):
    
    if item is None:
        return []
    elif isinstance(item, list):
        return item
    elif isinstance(item, (tuple, set)):
        return list(item)
    else:
        return [item]
1258028
def setCurrentValue(self, value):
        
        enum = self.enum()
        if not enum:
            return
        
        if self.isCheckable():
            indexes = []
            for i in range(self.count()):
                try:
                    check_value = enum[nativestring(self.itemText(i))]
                except KeyError:
                    continue
                
                if check_value & value:
                    indexes.append(i)
            self.setCheckedIndexes(indexes)
        else:
            try:
                text = enum[value]
            except (AttributeError, KeyError):
                return
            
            self.setCurrentIndex(self.findText(text))
910745
def wrap(self, value):
        ''' 
        '''
        self.validate_wrap(value)
        ret = {}
        for k, v in value.items():
            ret[k] = self.value_type.wrap(v)
        return ret
1093765
def convert(self, value, view):
        
        if (SUPPORTS_ENUM and isinstance(self.choices, type)
                and issubclass(self.choices, enum.Enum)):
            try:
                return self.choices(value)
            except ValueError:
                self.fail(
                    u'must be one of {0!r}, not {1!r}'.format(
                        [c.value for c in self.choices], value
                    ),
                    view
                )

        if value not in self.choices:
            self.fail(
                u'must be one of {0!r}, not {1!r}'.format(
                    list(self.choices), value
                ),
                view
            )

        if isinstance(self.choices, abc.Mapping):
            return self.choices[value]
        else:
            return value
1104027
def fmt(self, value):
        
        if isinstance(value, str):
            value = value.split(self.join_str)
        if not (value and isinstance(value, (list, tuple))):
            raise TypeError(
                ' '.join((
                    'Expecting str or list/tuple of formats {!r}.',
                    'Got: ({}) {!r}'
                )).format(
                    self.default_format,
                    type(value).__name__,
                    value,
                ))
        self._fmt = value
288815
def dress(value, handler = DressHelper.new)
      error = nil

      # Do nothing on TypeError as the next candidate could be the good one!
      candidates.each do |c|
        success, uped = handler.just_try do
          c.dress(value, handler)
        end
        return uped if success
        error ||= uped
      end

      # No one succeed, just fail
      handler.failed!(self, value, error)
    end
1303823
def is_valid(self, value):
        
        if not self.is_array:
            return self._valid(value)

        if isinstance(value, (list, set, tuple)):
            return all([self._valid(item) for item in value])

        return self._valid(value)
390244
def validate_wrap(self, value):
        '''  '''
        self.item_type.validate_wrap(value)

        if value not in self.values:
            self._fail_validation(value, 'Value was not in the enum values')
401611
def wrap(self, value):
        ''' 
        '''
        self.validate_wrap(value)
        ret = []
        for field, value in izip(self.types, value):
            ret.append(field.wrap(value))
        return ret
233176
private void setCollectionTupleValues(Tuple tuple, int position, Object value, AbstractType<?> validator) throws ExecException
    {
        if (validator instanceof MapType)
        {
            setMapTupleValues(tuple, position, value, validator);
            return;
        }
        AbstractType elementValidator;
        if (validator instanceof SetType)
            elementValidator = ((SetType<?>) validator).getElementsType();
        else if (validator instanceof ListType)
            elementValidator = ((ListType<?>) validator).getElementsType();
        else
            return;

        int i = 0;
        Tuple innerTuple = TupleFactory.getInstance().newTuple(((Collection<?>) value).size());
        for (Object entry : (Collection<?>) value)
        {
            setTupleValue(innerTuple, i, cassandraToPigData(entry, elementValidator), elementValidator);
            i++;
        }
        tuple.set(position, innerTuple);
    }
1285931
def tuple_replace(tup, *pairs):
    
    tuple_list = list(tup)
    for index, value in pairs:
        tuple_list[index] = value
    return tuple(tuple_list)
1287841
def dress(value, handler = DressHelper.new)
      handler.failed!(self, value) unless ruby_type===value
      value
    end
266449
def typify(value: Union[dict, list, set, str]):
    
    if type(value) == dict:
        return walk_values(typify, value)

    if type(value) in [list, set]:
        return list(map(typify, value))

    if type(value) == str:
        if re.match('^\d+\.\d+ (STEEM|SBD|VESTS)$', value):
            return keep_in_dict(dict(Amount(value)), ['amount', 'asset'])

        if re.match('^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$', value):
            return parse_time(value)

    return value