<jupyter_start><jupyter_text><jupyter_code>tuple_gen = ((i, j, dist) for (i, j, dist) in [(0, 1, 1), (0, 2, 3)])
tuple_gen
next(tuple_gen)
next(tuple_gen)
next(tuple_gen)<jupyter_output><empty_output><jupyter_text>[itertools.chain](https://docs.python.org/3/library/itertools.htmlitertools.chain)<jupyter_code>from itertools import chain
list(chain('ABC', 'DEF'))
def gen1():
    for i in range(3):
        yield i

def gen2():
    while True:
        yield -1

g1 = gen1()
g2 = gen2()
res = chain(*[g1, g2])
res
next(res)
next(res)
next(res)
next(res)
next(res)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17567567567567569, 'fraction_numerical': 0.028716216216216218, 'mean_word_length': 5.445652173913044, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '163460', 'license': 'Apache-2.0', 'n_tokens_mistral': 258, 'n_tokens_neox': 251, 'n_words': 51, 'path': 'Python/itertools.ipynb', 'repo_name': 'Chet-Sheng/Speedy', 'size': '592'}