Visit the elements and assemble the results into a tuple.
437292
def visit_Tuple(self, node: ast.Tuple) -> Tuple[Any, ...]:
        """"""
        if isinstance(node.ctx, ast.Store):
            raise NotImplementedError("Can not compute the value of a Store on a tuple")

        result = tuple(self.visit(node=elt) for elt in node.elts)

        self.recomputed_values[node] = result
        return result
927947
def _subtotals(self):
        """"""
        return tuple(
            _Subtotal(subtotal_dict, self.valid_elements)
            for subtotal_dict in self._iter_valid_subtotal_dicts()
        )
630779
def _make_table(values):
        """"""
        import collections
        table = collections.deque()
        start, end = values[0], values[0]
        for num, value in enumerate(values):
            if num == 0:
                table.append((value, value,))
                continue
            start, end = table.pop()
            if end == value - 1:
                table.append((start, value,))
            else:
                table.append((start, end,))
                table.append((value, value,))
        return tuple(table)
516154
def __wrap_with_tuple(self) -> tuple:
        """"""
        l = list()
        length = len(self.data)
        while self.idx < length:
            l.append(self.__parse())
        return tuple(l)
1150459
def _to_tuple(self, _list):
        
        result = list()
        for l in _list:
            if isinstance(l, list):
                result.append(tuple(self._to_tuple(l)))
            else:
                result.append(l)
        return tuple(result)
526464
def to_tuple(self):
        """"""
        return (
            self.data_type,
            self.unit,
            self.analysis_period,
            self.metadata
        )
372960
def itertypes(iterable):
    """"""
    seen = set()
    for entry in iterable:
        if isinstance(entry, tuple):
            for type_ in entry:
                if type_ not in seen:
                    seen.add(type_)
                    yield type_
        else:
            if entry not in seen:
                seen.add(entry)
                yield entry
563208
def values(self):
        ""
        return tuple(set(self.new.values()).union(self.old.values()))
818990
def __get_values(self):
        
        array = self._get_target().getDataArray()
        return tuple(itertools.chain.from_iterable(array))
960649
def construct_results(value)
      values = split_value(value)

      value.providedLabel = values.shift
      results = [value]

      values.each { |v| results << build_resource(value.class, v) }

      results
    end
829612
def iter_coords(obj):
    
    if isinstance(obj, (tuple, list)):
        coords = obj
    elif 'features' in obj:
        coords = [geom['geometry']['coordinates'] for geom in obj['features']]
    elif 'geometry' in obj:
        coords = obj['geometry']['coordinates']
    else:
        coords = obj.get('coordinates', obj)
    for coord in coords:
        if isinstance(coord, (float, int)):
            yield tuple(coords)
            break
        else:
            for f in iter_coords(coord):
                yield f
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]
160016
def visit_Set(self, node: ast.Set) -> Set[Any]:
        """"""
        result = set(self.visit(node=elt) for elt in node.elts)

        self.recomputed_values[node] = result
        return result
83145
def visit_tuple(self, node):
        """"""
        if len(node.elts) == 1:
            return "(%s, )" % node.elts[0].accept(self)
        return "(%s)" % ", ".join(child.accept(self) for child in node.elts)
184952
def process(self, element):
    
    import collections
    import apache_beam as beam

    num_in_batch = 0
    try:
      assert self._session is not None

      feed_dict = collections.defaultdict(list)
      for line in element:

        # Remove trailing newline.
        if line.endswith('\n'):
          line = line[:-1]

        feed_dict[self._input_alias_map.values()[0]].append(line)
        num_in_batch += 1

      # batch_result is list of numpy arrays with batch_size many rows.
      batch_result = self._session.run(fetches=self._tensor_names,
                                       feed_dict=feed_dict)

      # ex batch_result for batch_size > 1:
      # (array([value1, value2, ..., value_batch_size]),
      #  array([[a1, b1, c1]], ..., [a_batch_size, b_batch_size, c_batch_size]]),
      #  ...)
      # ex batch_result for batch_size == 1:
      # (value,
      #  array([a1, b1, c1]),
      #  ...)

      # Convert the results into a dict and unbatch the results.
      if num_in_batch > 1:
        for result in zip(*batch_result):
          predictions = {}
          for name, value in zip(self._aliases, result):
            predictions[name] = (value.tolist() if getattr(value, 'tolist', None) else value)
          yield predictions
      else:
        predictions = {}
        for i in range(len(self._aliases)):
          value = batch_result[i]
          value = (value.tolist() if getattr(value, 'tolist', None)
                   else value)
          predictions[self._aliases[i]] = value
        yield predictions

    except Exception as e:  # pylint: disable=broad-except
      yield beam.pvalue.TaggedOutput('errors', (str(e), element))
687700
def ensure_tuple(length, tuples):
	
	
	for elem in tuples:
		# Handle non-tuples and non-lists as a single repeated element.
		if not isinstance(elem, (tuple, list)):
			yield (elem, ) * length
			continue
		
		l = len(elem)
		
		# If we have the correct length already, yield it.
		if l == length:
			yield elem
		
		# If we're too long, truncate.
		elif l > length:
			yield tuple(elem[:length])
		
		# If we're too short, pad the *leading* element out.
		elif l < length:
			yield (elem[0], ) * (length - l) + tuple(elem)
759321
def map_blocks(data, f, blen=None, storage=None, create='array', **kwargs):
    """"""

    # setup
    storage = _util.get_storage(storage)
    if isinstance(data, tuple):
        blen = max(_util.get_blen_array(d, blen) for d in data)
    else:
        blen = _util.get_blen_array(data, blen)
    if isinstance(data, tuple):
        _util.check_equal_length(*data)
        length = len(data[0])
    else:
        length = len(data)

    # block-wise iteration
    out = None
    for i in range(0, length, blen):
        j = min(i+blen, length)

        # obtain blocks
        if isinstance(data, tuple):
            blocks = [d[i:j] for d in data]
        else:
            blocks = [data[i:j]]

        # map
        res = f(*blocks)

        # store
        if out is None:
            out = getattr(storage, create)(res, expectedlen=length, **kwargs)
        else:
            out.append(res)

    return out