chunk_id
stringlengths
36
36
source
stringclasses
35 values
source_url
stringlengths
0
290
upstream_license
stringclasses
1 value
document_id
stringlengths
36
36
chunk_index
int64
0
324k
retrieved_at
stringclasses
2 values
chunker_version
stringclasses
4 values
content_hash
stringlengths
15
64
content
stringlengths
50
44.7k
namespace
stringclasses
9 values
source_name
stringclasses
35 values
raw_text
stringlengths
50
44.7k
cleaned_text
stringlengths
50
44.7k
tags
stringclasses
49 values
collection_name
stringclasses
11 values
e0256fd3-2611-4f08-a2fa-a673b3cc8a1f
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
2,955
supabase-export-v2
a398fa825e7f0ebd
all construct and return iterators. Some provide streams of infinite length, so they should only be accessed by functions or loops that truncate the stream. .. function:: accumulate(iterable[, function, *, initial=None])
trusted_official_docs
CPython Docs
all construct and return iterators. Some provide streams of infinite length, so they should only be accessed by functions or loops that truncate the stream. .. function:: accumulate(iterable[, function, *, initial=None])
all construct and return iterators. Some provide streams of infinite length, so they should only be accessed by functions or loops that truncate the stream. .. function:: accumulate(iterable[, function, *, initial=None])
python, official-docs, cpython, P0
Local_Trusted_Corpus
e02e7386-e55f-4e12-8812-3ae6ff490d14
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,205
supabase-export-v2
17f414b5381fd217
'b', 'c', 'a', 'b', 'c'] >>> # Verify greedy consumption of input iterator >>> input_iterator = iter('abc') >>> output_iterator = ncycles(input_iterator, 3) >>> list(input_iterator) [] >>> sum_of_squares([10, 20, 30]) 1400
trusted_official_docs
CPython Docs
'b', 'c', 'a', 'b', 'c'] >>> # Verify greedy consumption of input iterator >>> input_iterator = iter('abc') >>> output_iterator = ncycles(input_iterator, 3) >>> list(input_iterator) [] >>> sum_of_squares([10, 20, 30]) 1400
'b', 'c', 'a', 'b', 'c'] >>> # Verify greedy consumption of input iterator >>> input_iterator = iter('abc') >>> output_iterator = ncycles(input_iterator, 3) >>> list(input_iterator) [] >>> sum_of_squares([10, 20, 30]) 1400
python, official-docs, cpython, P0
Local_Trusted_Corpus
e08f9eed-2545-4205-b5e1-b92a0824cae8
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,179
supabase-export-v2
b50c90d3172639a3
def is_prime(n): "Return True if n is prime." # is_prime(1_000_000_000_000_403) → True return n > 1 and next(factor(n)) == n def totient(n): "Count of natural numbers up to n that are coprime to n." # https://mathworld.wolfram.com/TotientFunction.html # totient(12) → 4 because len([1, 5, 7, 11]) == 4 for prime in s...
trusted_official_docs
CPython Docs
def is_prime(n): "Return True if n is prime." # is_prime(1_000_000_000_000_403) → True return n > 1 and next(factor(n)) == n def totient(n): "Count of natural numbers up to n that are coprime to n." # https://mathworld.wolfram.com/TotientFunction.html # totient(12) → 4 because len([1, 5, 7, 11]) == 4 for prime in s...
def is_prime(n): "Return True if n is prime." # is_prime(1_000_000_000_000_403) → True return n > 1 and next(factor(n)) == n def totient(n): "Count of natural numbers up to n that are coprime to n." # https://mathworld.wolfram.com/TotientFunction.html # totient(12) → 4 because len([1, 5, 7, 11]) == 4 for prime in s...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e1142c33-c99e-4c08-bc0b-be61e64f9cf6
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
2,966
supabase-export-v2
c4882e63a6c540dd
4, 6, 6, 6, 9, 9, 9, 9, 9] >>> list(accumulate(data, operator.mul)) # running product [3, 12, 72, 144, 144, 1296, 0, 0, 0, 0] # Amortize a 5% loan of 1000 with 10 annual payments of 90 >>> update = lambda balance, payment: round(balance * 1.05) - payment >>> list(accumulate(repeat(90, 10), update, initial=1_000)) [1...
trusted_official_docs
CPython Docs
4, 6, 6, 6, 9, 9, 9, 9, 9] >>> list(accumulate(data, operator.mul)) # running product [3, 12, 72, 144, 144, 1296, 0, 0, 0, 0] # Amortize a 5% loan of 1000 with 10 annual payments of 90 >>> update = lambda balance, payment: round(balance * 1.05) - payment >>> list(accumulate(repeat(90, 10), update, initial=1_000)) [1...
4, 6, 6, 6, 9, 9, 9, 9, 9] >>> list(accumulate(data, operator.mul)) # running product [3, 12, 72, 144, 144, 1296, 0, 0, 0, 0] # Amortize a 5% loan of 1000 with 10 annual payments of 90 >>> update = lambda balance, payment: round(balance * 1.05) - payment >>> list(accumulate(repeat(90, 10), update, initial=1_000)) [1...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e18ab521-6be7-4c3c-bbe1-98b2312979f0
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,250
supabase-export-v2
e0ed0484a8002a48
Useful for emulating the behavior of the built-in map() function. """ return chain(iterable, repeat(None)) def triplewise(iterable): "Return overlapping triplets from an iterable" # triplewise('ABCDEFG') → ABC BCD CDE DEF EFG for (a, _), (b, c) in pairwise(pairwise(iterable)): yield a, b, c
trusted_official_docs
CPython Docs
Useful for emulating the behavior of the built-in map() function. """ return chain(iterable, repeat(None)) def triplewise(iterable): "Return overlapping triplets from an iterable" # triplewise('ABCDEFG') → ABC BCD CDE DEF EFG for (a, _), (b, c) in pairwise(pairwise(iterable)): yield a, b, c
Useful for emulating the behavior of the built-in map() function. """ return chain(iterable, repeat(None)) def triplewise(iterable): "Return overlapping triplets from an iterable" # triplewise('ABCDEFG') → ABC BCD CDE DEF EFG for (a, _), (b, c) in pairwise(pairwise(iterable)): yield a, b, c
python, official-docs, cpython, P0
Local_Trusted_Corpus
e23ff96d-bb99-4344-84f8-0c0bf479597e
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,028
supabase-export-v2
3b179a0e2802e532
.. function:: filterfalse(predicate, iterable) Make an iterator that filters elements from the *iterable* returning only those for which the *predicate* returns a false value. If *predicate* is ``None``, returns the items that are false. Roughly equivalent to::
trusted_official_docs
CPython Docs
.. function:: filterfalse(predicate, iterable) Make an iterator that filters elements from the *iterable* returning only those for which the *predicate* returns a false value. If *predicate* is ``None``, returns the items that are false. Roughly equivalent to::
.. function:: filterfalse(predicate, iterable) Make an iterator that filters elements from the *iterable* returning only those for which the *predicate* returns a false value. If *predicate* is ``None``, returns the items that are false. Roughly equivalent to::
python, official-docs, cpython, P0
Local_Trusted_Corpus
e3310e59-beaf-46da-b9b4-bedc867dc659
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,077
supabase-export-v2
68ecbb5f332055dd
with itself, specify the number of repetitions with the optional *repeat* keyword argument. For example, ``product(A, repeat=4)`` means the same as ``product(A, A, A, A)``. This function is roughly equivalent to the following code, except that the actual implementation does not build up intermediate results in memory:...
trusted_official_docs
CPython Docs
with itself, specify the number of repetitions with the optional *repeat* keyword argument. For example, ``product(A, repeat=4)`` means the same as ``product(A, A, A, A)``. This function is roughly equivalent to the following code, except that the actual implementation does not build up intermediate results in memory:...
with itself, specify the number of repetitions with the optional *repeat* keyword argument. For example, ``product(A, repeat=4)`` means the same as ``product(A, A, A, A)``. This function is roughly equivalent to the following code, except that the actual implementation does not build up intermediate results in memory:...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e3827bfd-8a20-44c4-bbff-ae0931183877
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,216
supabase-export-v2
f07e2d5abee58a59
be a sequence. >>> seq = [[10, 20], [30, 40], 30, 40, [30, 40], 50] >>> target = [30, 40] >>> list(iter_index(seq, target)) [1, 4] >>> # Verify faithfulness to type specific index() method behaviors. >>> # For example, bytes and str perform continuous-subsequence searches >>> # that do not match the general behavior s...
trusted_official_docs
CPython Docs
be a sequence. >>> seq = [[10, 20], [30, 40], 30, 40, [30, 40], 50] >>> target = [30, 40] >>> list(iter_index(seq, target)) [1, 4] >>> # Verify faithfulness to type specific index() method behaviors. >>> # For example, bytes and str perform continuous-subsequence searches >>> # that do not match the general behavior s...
be a sequence. >>> seq = [[10, 20], [30, 40], 30, 40, [30, 40], 50] >>> target = [30, 40] >>> list(iter_index(seq, target)) [1, 4] >>> # Verify faithfulness to type specific index() method behaviors. >>> # For example, bytes and str perform continuous-subsequence searches >>> # that do not match the general behavior s...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e567baaa-c907-4ff5-a8c5-68b817c884a6
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
2,995
supabase-export-v2
d2c4831c8c54bc4a
pool = tuple(iterable) n = len(pool) if r > n: return indices = list(range(r)) yield tuple(pool[i] for i in indices) while True: for i in reversed(range(r)): if indices[i] != i + n - r: break else: return indices[i] += 1 for j in range(i+1, r): indices[j] = indices[j-1] + 1 yield tuple(pool[i] for i in indice...
trusted_official_docs
CPython Docs
pool = tuple(iterable) n = len(pool) if r > n: return indices = list(range(r)) yield tuple(pool[i] for i in indices) while True: for i in reversed(range(r)): if indices[i] != i + n - r: break else: return indices[i] += 1 for j in range(i+1, r): indices[j] = indices[j-1] + 1 yield tuple(pool[i] for i in indice...
pool = tuple(iterable) n = len(pool) if r > n: return indices = list(range(r)) yield tuple(pool[i] for i in indices) while True: for i in reversed(range(r)): if indices[i] != i + n - r: break else: return indices[i] += 1 for j in range(i+1, r): indices[j] = indices[j-1] + 1 yield tuple(pool[i] for i in indice...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e5bcccc5-5028-43e9-9a01-d619742fbf31
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,152
supabase-export-v2
2f4af5afcbe493d9
n match incomplete: case 'fill': return zip_longest(*iterators, fillvalue=fillvalue) case 'strict': return zip(*iterators, strict=True) case 'ignore': return zip(*iterators) case _: raise ValueError('Expected fill, strict, or ignore') def roundrobin(*iterables): "Visit input iterables in a cycle until each is exhauste...
trusted_official_docs
CPython Docs
n match incomplete: case 'fill': return zip_longest(*iterators, fillvalue=fillvalue) case 'strict': return zip(*iterators, strict=True) case 'ignore': return zip(*iterators) case _: raise ValueError('Expected fill, strict, or ignore') def roundrobin(*iterables): "Visit input iterables in a cycle until each is exhauste...
n match incomplete: case 'fill': return zip_longest(*iterators, fillvalue=fillvalue) case 'strict': return zip(*iterators, strict=True) case 'ignore': return zip(*iterators) case _: raise ValueError('Expected fill, strict, or ignore') def roundrobin(*iterables): "Visit input iterables in a cycle until each is exhauste...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e7455dac-1f4a-4d57-a3b7-e3561563fd60
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,101
supabase-export-v2
5d493b9fc822d622
Roughly equivalent to:: def tee(iterable, n=2): if n < 0: raise ValueError if n == 0: return () iterator = _tee(iterable) result = [iterator] for _ in range(n - 1): result.append(_tee(iterator)) return tuple(result)
trusted_official_docs
CPython Docs
Roughly equivalent to:: def tee(iterable, n=2): if n < 0: raise ValueError if n == 0: return () iterator = _tee(iterable) result = [iterator] for _ in range(n - 1): result.append(_tee(iterator)) return tuple(result)
Roughly equivalent to:: def tee(iterable, n=2): if n < 0: raise ValueError if n == 0: return () iterator = _tee(iterable) result = [iterator] for _ in range(n - 1): result.append(_tee(iterator)) return tuple(result)
python, official-docs, cpython, P0
Local_Trusted_Corpus
e9938dec-0738-46c7-bc62-6a15260b90d7
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,227
supabase-export-v2
29a1172983d879e9
'E', 'F'), ('B', 'C', 'D', 'E', 'F', 'G')] >>> list(sliding_window('ABCDEFG', 7)) [('A', 'B', 'C', 'D', 'E', 'F', 'G')] >>> list(sliding_window('ABCDEFG', 8)) [] >>> try: ... list(sliding_window('ABCDEFG', -1)) ... except ValueError: ... 'zero or negative n not supported' ... 'zero or negative n not supported' >>> ...
trusted_official_docs
CPython Docs
'E', 'F'), ('B', 'C', 'D', 'E', 'F', 'G')] >>> list(sliding_window('ABCDEFG', 7)) [('A', 'B', 'C', 'D', 'E', 'F', 'G')] >>> list(sliding_window('ABCDEFG', 8)) [] >>> try: ... list(sliding_window('ABCDEFG', -1)) ... except ValueError: ... 'zero or negative n not supported' ... 'zero or negative n not supported' >>> ...
'E', 'F'), ('B', 'C', 'D', 'E', 'F', 'G')] >>> list(sliding_window('ABCDEFG', 7)) [('A', 'B', 'C', 'D', 'E', 'F', 'G')] >>> list(sliding_window('ABCDEFG', 8)) [] >>> try: ... list(sliding_window('ABCDEFG', -1)) ... except ValueError: ... 'zero or negative n not supported' ... 'zero or negative n not supported' >>> ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
ea2a473c-6568-4467-a091-dff3000d423a
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,195
supabase-export-v2
d63a76f4e395eb85
9] >>> # Verify that the input is consumed lazily >>> it = iter('abcdef') >>> take(3, it) ['a', 'b', 'c'] >>> list(it) ['d', 'e', 'f'] >>> list(prepend(1, [2, 3, 4])) [1, 2, 3, 4]
trusted_official_docs
CPython Docs
9] >>> # Verify that the input is consumed lazily >>> it = iter('abcdef') >>> take(3, it) ['a', 'b', 'c'] >>> list(it) ['d', 'e', 'f'] >>> list(prepend(1, [2, 3, 4])) [1, 2, 3, 4]
9] >>> # Verify that the input is consumed lazily >>> it = iter('abcdef') >>> take(3, it) ['a', 'b', 'c'] >>> list(it) ['d', 'e', 'f'] >>> list(prepend(1, [2, 3, 4])) [1, 2, 3, 4]
python, official-docs, cpython, P0
Local_Trusted_Corpus
ea36979e-79e9-4bcd-b083-9140da1cef6f
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,238
supabase-export-v2
3155bdb3be21d5e9
>>> multinomial(5, 2, 2, 1, 1) 83160 >>> word = 'coffee' >>> multinomial(*Counter(word).values()) == len(set(permutations(word))) True >>> list(running_mean([8.5, 9.5, 7.5, 6.5])) [8.5, 9.0, 8.5, 8.0] >>> list(running_mean([37, 33, 38, 28])) [37.0, 35.0, 36.0, 34.0]
trusted_official_docs
CPython Docs
>>> multinomial(5, 2, 2, 1, 1) 83160 >>> word = 'coffee' >>> multinomial(*Counter(word).values()) == len(set(permutations(word))) True >>> list(running_mean([8.5, 9.5, 7.5, 6.5])) [8.5, 9.0, 8.5, 8.0] >>> list(running_mean([37, 33, 38, 28])) [37.0, 35.0, 36.0, 34.0]
>>> multinomial(5, 2, 2, 1, 1) 83160 >>> word = 'coffee' >>> multinomial(*Counter(word).values()) == len(set(permutations(word))) True >>> list(running_mean([8.5, 9.5, 7.5, 6.5])) [8.5, 9.0, 8.5, 8.0] >>> list(running_mean([37, 33, 38, 28])) [37.0, 35.0, 36.0, 34.0]
python, official-docs, cpython, P0
Local_Trusted_Corpus
ea4cfb18-135e-4dbb-9a62-d26de7d40e7f
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
2,973
supabase-export-v2
0ef901d2c2a49836
Batch data from the *iterable* into tuples of length *n*. The last batch may be shorter than *n*. If *strict* is true, will raise a :exc:`ValueError` if the final batch is shorter than *n*.
trusted_official_docs
CPython Docs
Batch data from the *iterable* into tuples of length *n*. The last batch may be shorter than *n*. If *strict* is true, will raise a :exc:`ValueError` if the final batch is shorter than *n*.
Batch data from the *iterable* into tuples of length *n*. The last batch may be shorter than *n*. If *strict* is true, will raise a :exc:`ValueError` if the final batch is shorter than *n*.
python, official-docs, cpython, P0
Local_Trusted_Corpus
f3bcac6f-18e3-4494-a025-684e263cddef
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,159
supabase-export-v2
06b48d14860afc80
distinct arrangements of a multiset." # Counter('abracadabra').values() → 5 2 2 1 1 # multinomial(5, 2, 2, 1, 1) → 83160 return prod(map(comb, accumulate(counts), counts)) def powerset(iterable): "Subsequences of the iterable from shortest to longest." # powerset([1,2,3]) → () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)...
trusted_official_docs
CPython Docs
distinct arrangements of a multiset." # Counter('abracadabra').values() → 5 2 2 1 1 # multinomial(5, 2, 2, 1, 1) → 83160 return prod(map(comb, accumulate(counts), counts)) def powerset(iterable): "Subsequences of the iterable from shortest to longest." # powerset([1,2,3]) → () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)...
distinct arrangements of a multiset." # Counter('abracadabra').values() → 5 2 2 1 1 # multinomial(5, 2, 2, 1, 1) → 83160 return prod(map(comb, accumulate(counts), counts)) def powerset(iterable): "Subsequences of the iterable from shortest to longest." # powerset([1,2,3]) → () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)...
python, official-docs, cpython, P0
Local_Trusted_Corpus
f3ff7588-d7eb-41ed-a20e-1f185fb051f4
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,228
supabase-export-v2
c4884c7d665bb8d4
n not supported' >>> try: ... list(sliding_window('ABCDEFG', 0)) ... except ValueError: ... 'zero or negative n not supported' ... 'zero or negative n not supported' >>> list(roundrobin('abc', 'd', 'ef')) ['a', 'd', 'e', 'b', 'f', 'c'] >>> ranges = [range(5, 1000), range(4, 3000), range(0), range(3, 2000), range(2, 5...
trusted_official_docs
CPython Docs
n not supported' >>> try: ... list(sliding_window('ABCDEFG', 0)) ... except ValueError: ... 'zero or negative n not supported' ... 'zero or negative n not supported' >>> list(roundrobin('abc', 'd', 'ef')) ['a', 'd', 'e', 'b', 'f', 'c'] >>> ranges = [range(5, 1000), range(4, 3000), range(0), range(3, 2000), range(2, 5...
n not supported' >>> try: ... list(sliding_window('ABCDEFG', 0)) ... except ValueError: ... 'zero or negative n not supported' ... 'zero or negative n not supported' >>> list(roundrobin('abc', 'd', 'ef')) ['a', 'd', 'e', 'b', 'f', 'c'] >>> ranges = [range(5, 1000), range(4, 3000), range(0), range(3, 2000), range(2, 5...
python, official-docs, cpython, P0
Local_Trusted_Corpus
f40b21cd-46cb-4894-95fc-5dbd0b06209c
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,236
supabase-export-v2
a0fcce0be79d2704
4) >>> next(it) ('c', 3) >>> next(it) ('b', 2) >>> d['e'] = 5 >>> next(it) ('e', 5) >>> next(it) ('a', 1) >>> next(it, 'empty') 'empty' >>> first_true('ABC0DEF1', '9', str.isdigit) '0' >>> # Verify that inputs are consumed lazily >>> it = iter('ABC0DEF1') >>> first_true(it, predicate=str.isdigit) '0' >>> ''.join(...
trusted_official_docs
CPython Docs
4) >>> next(it) ('c', 3) >>> next(it) ('b', 2) >>> d['e'] = 5 >>> next(it) ('e', 5) >>> next(it) ('a', 1) >>> next(it, 'empty') 'empty' >>> first_true('ABC0DEF1', '9', str.isdigit) '0' >>> # Verify that inputs are consumed lazily >>> it = iter('ABC0DEF1') >>> first_true(it, predicate=str.isdigit) '0' >>> ''.join(...
4) >>> next(it) ('c', 3) >>> next(it) ('b', 2) >>> d['e'] = 5 >>> next(it) ('e', 5) >>> next(it) ('a', 1) >>> next(it, 'empty') 'empty' >>> first_true('ABC0DEF1', '9', str.isdigit) '0' >>> # Verify that inputs are consumed lazily >>> it = iter('ABC0DEF1') >>> first_true(it, predicate=str.isdigit) '0' >>> ''.join(...
python, official-docs, cpython, P0
Local_Trusted_Corpus
f480d541-5740-4585-b244-10f318582a1d
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,234
supabase-export-v2
91126df4eba7c7c3
'A', 'D'] >>> # Verify that the input is consumed lazily >>> input_iterator = iter('AAAABBBCCDAABBB') >>> output_iterator = unique_justseen(input_iterator) >>> next(output_iterator) 'A' >>> ''.join(input_iterator) 'AAABBBCCDAABBB' >>> list(unique([[1, 2], [3, 4], [1, 2]])) [[1, 2], [3, 4]] >>> list(unique('ABBcCAD', ...
trusted_official_docs
CPython Docs
'A', 'D'] >>> # Verify that the input is consumed lazily >>> input_iterator = iter('AAAABBBCCDAABBB') >>> output_iterator = unique_justseen(input_iterator) >>> next(output_iterator) 'A' >>> ''.join(input_iterator) 'AAABBBCCDAABBB' >>> list(unique([[1, 2], [3, 4], [1, 2]])) [[1, 2], [3, 4]] >>> list(unique('ABBcCAD', ...
'A', 'D'] >>> # Verify that the input is consumed lazily >>> input_iterator = iter('AAAABBBCCDAABBB') >>> output_iterator = unique_justseen(input_iterator) >>> next(output_iterator) 'A' >>> ''.join(input_iterator) 'AAABBBCCDAABBB' >>> list(unique([[1, 2], [3, 4], [1, 2]])) [[1, 2], [3, 4]] >>> list(unique('ABBcCAD', ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
f668900c-63e6-4f7c-a95a-10bccf615c26
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
2,986
supabase-export-v2
3d8dfa1dac649d35
Alternate constructor for :func:`chain`. Gets chained inputs from a single iterable argument that is evaluated lazily. Roughly equivalent to:: def from_iterable(iterables): # chain.from_iterable(['ABC', 'DEF']) → A B C D E F for iterable in iterables: yield from iterable
trusted_official_docs
CPython Docs
Alternate constructor for :func:`chain`. Gets chained inputs from a single iterable argument that is evaluated lazily. Roughly equivalent to:: def from_iterable(iterables): # chain.from_iterable(['ABC', 'DEF']) → A B C D E F for iterable in iterables: yield from iterable
Alternate constructor for :func:`chain`. Gets chained inputs from a single iterable argument that is evaluated lazily. Roughly equivalent to:: def from_iterable(iterables): # chain.from_iterable(['ABC', 'DEF']) → A B C D E F for iterable in iterables: yield from iterable
python, official-docs, cpython, P0
Local_Trusted_Corpus
f78eb7ff-c021-4a4a-90b9-cb21084c6e93
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
2,945
supabase-export-v2
9813d5184a4a23f9
:func:`batched` p, n (p0, p1, ..., p_n-1), ... ``batched('ABCDEFG', n=3) → ABC DEF G`` :func:`chain` p, q, ... p0, p1, ... plast, q0, q1, ... ``chain('ABC', 'DEF') → A B C D E F`` :func:`chain.from_iterable` iterable p0, p1, ... plast, q0, q1, ... ``chain.from_iterable(['ABC', 'DEF']) → A B C D E F`` :func:`compress` d...
trusted_official_docs
CPython Docs
:func:`batched` p, n (p0, p1, ..., p_n-1), ... ``batched('ABCDEFG', n=3) → ABC DEF G`` :func:`chain` p, q, ... p0, p1, ... plast, q0, q1, ... ``chain('ABC', 'DEF') → A B C D E F`` :func:`chain.from_iterable` iterable p0, p1, ... plast, q0, q1, ... ``chain.from_iterable(['ABC', 'DEF']) → A B C D E F`` :func:`compress` d...
:func:`batched` p, n (p0, p1, ..., p_n-1), ... ``batched('ABCDEFG', n=3) → ABC DEF G`` :func:`chain` p, q, ... p0, p1, ... plast, q0, q1, ... ``chain('ABC', 'DEF') → A B C D E F`` :func:`chain.from_iterable` iterable p0, p1, ... plast, q0, q1, ... ``chain.from_iterable(['ABC', 'DEF']) → A B C D E F`` :func:`compress` d...
python, official-docs, cpython, P0
Local_Trusted_Corpus
f9d8d577-86c5-4bbe-be8c-4cb9d95241a0
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
2,965
supabase-export-v2
d313954f5ffd2785
.. doctest:: >>> data = [3, 4, 6, 2, 1, 9, 0, 7, 5, 8] >>> list(accumulate(data, max)) # running maximum [3, 4, 6, 6, 6, 9, 9, 9, 9, 9] >>> list(accumulate(data, operator.mul)) # running product [3, 12, 72, 144, 144, 1296, 0, 0, 0, 0]
trusted_official_docs
CPython Docs
.. doctest:: >>> data = [3, 4, 6, 2, 1, 9, 0, 7, 5, 8] >>> list(accumulate(data, max)) # running maximum [3, 4, 6, 6, 6, 9, 9, 9, 9, 9] >>> list(accumulate(data, operator.mul)) # running product [3, 12, 72, 144, 144, 1296, 0, 0, 0, 0]
.. doctest:: >>> data = [3, 4, 6, 2, 1, 9, 0, 7, 5, 8] >>> list(accumulate(data, max)) # running maximum [3, 4, 6, 6, 6, 9, 9, 9, 9, 9] >>> list(accumulate(data, operator.mul)) # running product [3, 12, 72, 144, 144, 1296, 0, 0, 0, 0]
python, official-docs, cpython, P0
Local_Trusted_Corpus
faa2de2a-3f3b-4800-898b-12d71fdf189f
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,204
supabase-export-v2
b4ef10ff3073ac87
>>> a = [[1, 2, 3], [4, 5, 6]] >>> list(flatten(a)) [1, 2, 3, 4, 5, 6] >>> list(ncycles('abc', 3)) ['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c'] >>> # Verify greedy consumption of input iterator >>> input_iterator = iter('abc') >>> output_iterator = ncycles(input_iterator, 3) >>> list(input_iterator) []
trusted_official_docs
CPython Docs
>>> a = [[1, 2, 3], [4, 5, 6]] >>> list(flatten(a)) [1, 2, 3, 4, 5, 6] >>> list(ncycles('abc', 3)) ['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c'] >>> # Verify greedy consumption of input iterator >>> input_iterator = iter('abc') >>> output_iterator = ncycles(input_iterator, 3) >>> list(input_iterator) []
>>> a = [[1, 2, 3], [4, 5, 6]] >>> list(flatten(a)) [1, 2, 3, 4, 5, 6] >>> list(ncycles('abc', 3)) ['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c'] >>> # Verify greedy consumption of input iterator >>> input_iterator = iter('abc') >>> output_iterator = ncycles(input_iterator, 3) >>> list(input_iterator) []
python, official-docs, cpython, P0
Local_Trusted_Corpus
fe57a68d-41f7-47c2-a822-5805dc17954b
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,004
supabase-export-v2
1e221b78309a012c
pool = tuple(iterable) n = len(pool) if not n and r: return indices = [0] * r yield tuple(pool[i] for i in indices) while True: for i in reversed(range(r)): if indices[i] != n - 1: break else: return indices[i:] = [indices[i] + 1] * (r - i) yield tuple(pool[i] for i in indices)
trusted_official_docs
CPython Docs
pool = tuple(iterable) n = len(pool) if not n and r: return indices = [0] * r yield tuple(pool[i] for i in indices) while True: for i in reversed(range(r)): if indices[i] != n - 1: break else: return indices[i:] = [indices[i] + 1] * (r - i) yield tuple(pool[i] for i in indices)
pool = tuple(iterable) n = len(pool) if not n and r: return indices = [0] * r yield tuple(pool[i] for i in indices) while True: for i in reversed(range(r)): if indices[i] != n - 1: break else: return indices[i:] = [indices[i] + 1] * (r - i) yield tuple(pool[i] for i in indices)
python, official-docs, cpython, P0
Local_Trusted_Corpus
ffce8ae4-c30a-41e3-b90f-28ba0fd23eb1
CPython Docs
file://datasets/cpython/Doc/library/itertools.rst
unknown
325025cd-dca2-4e2b-be43-fa8be886f8e7
3,042
supabase-export-v2
2af309598bac7606
try: curr_value = next(iterator) except StopIteration: return curr_key = keyfunc(curr_value) while not exhausted: target_key = curr_key curr_group = _grouper(target_key) yield curr_key, curr_group if curr_key == target_key: for _ in curr_group: pass
trusted_official_docs
CPython Docs
try: curr_value = next(iterator) except StopIteration: return curr_key = keyfunc(curr_value) while not exhausted: target_key = curr_key curr_group = _grouper(target_key) yield curr_key, curr_group if curr_key == target_key: for _ in curr_group: pass
try: curr_value = next(iterator) except StopIteration: return curr_key = keyfunc(curr_value) while not exhausted: target_key = curr_key curr_group = _grouper(target_key) yield curr_key, curr_group if curr_key == target_key: for _ in curr_group: pass
python, official-docs, cpython, P0
Local_Trusted_Corpus
10e496d8-27d6-4077-abce-3b211cc9e5fb
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,308
supabase-export-v2
a3d28149b4fb7fdf
.. class:: FileInput(files=None, inplace=False, backup='', *, mode='r', openhook=None, encoding=None, errors=None) Class :class:`FileInput` is the implementation; its methods :meth:`filename`, :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`, :meth:`isstdin`, :meth:`nextfile` and :meth:`close` ...
trusted_official_docs
CPython Docs
.. class:: FileInput(files=None, inplace=False, backup='', *, mode='r', openhook=None, encoding=None, errors=None) Class :class:`FileInput` is the implementation; its methods :meth:`filename`, :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`, :meth:`isstdin`, :meth:`nextfile` and :meth:`close` ...
.. class:: FileInput(files=None, inplace=False, backup='', *, mode='r', openhook=None, encoding=None, errors=None) Class :class:`FileInput` is the implementation; its methods :meth:`filename`, :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`, :meth:`isstdin`, :meth:`nextfile` and :meth:`close` ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
182e1751-013b-4dd2-8ca4-cb7da4a9c0be
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,321
supabase-export-v2
0d9c57ff0815bd04
.. function:: hook_compressed(filename, mode, *, encoding=None, errors=None) Transparently opens files compressed with gzip and bzip2 (recognized by the extensions ``'.gz'`` and ``'.bz2'``) using the :mod:`gzip` and :mod:`bz2` modules. If the filename extension is not ``'.gz'`` or ``'.bz2'``, the file is opened norm...
trusted_official_docs
CPython Docs
.. function:: hook_compressed(filename, mode, *, encoding=None, errors=None) Transparently opens files compressed with gzip and bzip2 (recognized by the extensions ``'.gz'`` and ``'.bz2'``) using the :mod:`gzip` and :mod:`bz2` modules. If the filename extension is not ``'.gz'`` or ``'.bz2'``, the file is opened norm...
.. function:: hook_compressed(filename, mode, *, encoding=None, errors=None) Transparently opens files compressed with gzip and bzip2 (recognized by the extensions ``'.gz'`` and ``'.bz2'``) using the :mod:`gzip` and :mod:`bz2` modules. If the filename extension is not ``'.gz'`` or ``'.bz2'``, the file is opened norm...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1a3d6d99-c73c-4224-be31-ed48e44251dc
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,282
supabase-export-v2
02d25be11758ea7e
*encoding* and/or *errors* are specified, they will be passed to the hook as additional keyword arguments. This module provides a :func:`hook_compressed` to support compressed files. The following function is the primary interface of this module:
trusted_official_docs
CPython Docs
*encoding* and/or *errors* are specified, they will be passed to the hook as additional keyword arguments. This module provides a :func:`hook_compressed` to support compressed files. The following function is the primary interface of this module:
*encoding* and/or *errors* are specified, they will be passed to the hook as additional keyword arguments. This module provides a :func:`hook_compressed` to support compressed files. The following function is the primary interface of this module:
python, official-docs, cpython, P0
Local_Trusted_Corpus
2130ebb0-0bde-471d-b899-ec8c48d655af
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,284
supabase-export-v2
e9609af14fd99a49
.. function:: input(files=None, inplace=False, backup='', *, mode='r', openhook=None, encoding=None, errors=None) Create an instance of the :class:`FileInput` class. The instance will be used as global state for the functions of this module, and is also returned to use during iteration. The parameters to this functio...
trusted_official_docs
CPython Docs
.. function:: input(files=None, inplace=False, backup='', *, mode='r', openhook=None, encoding=None, errors=None) Create an instance of the :class:`FileInput` class. The instance will be used as global state for the functions of this module, and is also returned to use during iteration. The parameters to this functio...
.. function:: input(files=None, inplace=False, backup='', *, mode='r', openhook=None, encoding=None, errors=None) Create an instance of the :class:`FileInput` class. The instance will be used as global state for the functions of this module, and is also returned to use during iteration. The parameters to this functio...
python, official-docs, cpython, P0
Local_Trusted_Corpus
2accd0bc-455e-4bc0-b99c-fde4d6e0a464
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,285
supabase-export-v2
2308e4dc126d44d2
module, and is also returned to use during iteration. The parameters to this function will be passed along to the constructor of the :class:`FileInput` class. The :class:`FileInput` instance can be used as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with...
trusted_official_docs
CPython Docs
module, and is also returned to use during iteration. The parameters to this function will be passed along to the constructor of the :class:`FileInput` class. The :class:`FileInput` instance can be used as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with...
module, and is also returned to use during iteration. The parameters to this function will be passed along to the constructor of the :class:`FileInput` class. The :class:`FileInput` instance can be used as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with...
python, official-docs, cpython, P0
Local_Trusted_Corpus
2f13e33a-2923-4dc2-81af-f704d6055552
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,311
supabase-export-v2
95a82019bb9c6a25
must be a function that takes two arguments, *filename* and *mode*, and returns an accordingly opened file-like object. You cannot use *inplace* and *openhook* together. You can specify *encoding* and *errors* that is passed to :func:`open` or *openhook*.
trusted_official_docs
CPython Docs
must be a function that takes two arguments, *filename* and *mode*, and returns an accordingly opened file-like object. You cannot use *inplace* and *openhook* together. You can specify *encoding* and *errors* that is passed to :func:`open` or *openhook*.
must be a function that takes two arguments, *filename* and *mode*, and returns an accordingly opened file-like object. You cannot use *inplace* and *openhook* together. You can specify *encoding* and *errors* that is passed to :func:`open` or *openhook*.
python, official-docs, cpython, P0
Local_Trusted_Corpus
38349ad0-9469-4098-b8bb-48230603cef6
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,319
supabase-export-v2
2d5e182b88d4e425
by default, the extension is ``'.bak'`` and it is deleted when the output file is closed. In-place filtering is disabled when standard input is read. The two following opening hooks are provided by this module:
trusted_official_docs
CPython Docs
by default, the extension is ``'.bak'`` and it is deleted when the output file is closed. In-place filtering is disabled when standard input is read. The two following opening hooks are provided by this module:
by default, the extension is ``'.bak'`` and it is deleted when the output file is closed. In-place filtering is disabled when standard input is read. The two following opening hooks are provided by this module:
python, official-docs, cpython, P0
Local_Trusted_Corpus
406cf146-5eaa-4c67-8e4d-2da871ac170d
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,309
supabase-export-v2
c56616261326f78b
a :meth:`~io.TextIOBase.readline` method which returns the next input line. The sequence must be accessed in strictly sequential order; random access and :meth:`~io.TextIOBase.readline` cannot be mixed. With *mode* you can specify which file mode will be passed to :func:`open`. It must be one of ``'r'`` and ``'rb'``.
trusted_official_docs
CPython Docs
a :meth:`~io.TextIOBase.readline` method which returns the next input line. The sequence must be accessed in strictly sequential order; random access and :meth:`~io.TextIOBase.readline` cannot be mixed. With *mode* you can specify which file mode will be passed to :func:`open`. It must be one of ``'r'`` and ``'rb'``.
a :meth:`~io.TextIOBase.readline` method which returns the next input line. The sequence must be accessed in strictly sequential order; random access and :meth:`~io.TextIOBase.readline` cannot be mixed. With *mode* you can specify which file mode will be passed to :func:`open`. It must be one of ``'r'`` and ``'rb'``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
51f71d67-c41b-474e-a2b2-1c7797511e2a
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,298
supabase-export-v2
fd0dfea69e0f62d2
.. function:: filelineno() Return the line number in the current file. Before the first line has been read, returns ``0``. After the last line of the last file has been read, returns the line number of that line within the file.
trusted_official_docs
CPython Docs
.. function:: filelineno() Return the line number in the current file. Before the first line has been read, returns ``0``. After the last line of the last file has been read, returns the line number of that line within the file.
.. function:: filelineno() Return the line number in the current file. Before the first line has been read, returns ``0``. After the last line of the last file has been read, returns the line number of that line within the file.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5572056d-973c-4322-bced-3a4c8eb5d9b9
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,318
supabase-export-v2
2748bd69f29191ec
.. versionchanged:: 3.11 The ``'rU'`` and ``'U'`` modes and the :meth:`!__getitem__` method have been removed. **Optional in-place filtering:** if the keyword argument ``inplace=True`` is passed to :func:`fileinput.input` or to the :class:`FileInput` constructor, the file is moved to a backup file and standard output i...
trusted_official_docs
CPython Docs
.. versionchanged:: 3.11 The ``'rU'`` and ``'U'`` modes and the :meth:`!__getitem__` method have been removed. **Optional in-place filtering:** if the keyword argument ``inplace=True`` is passed to :func:`fileinput.input` or to the :class:`FileInput` constructor, the file is moved to a backup file and standard output i...
.. versionchanged:: 3.11 The ``'rU'`` and ``'U'`` modes and the :meth:`!__getitem__` method have been removed. **Optional in-place filtering:** if the keyword argument ``inplace=True`` is passed to :func:`fileinput.input` or to the :class:`FileInput` constructor, the file is moved to a backup file and standard output i...
python, official-docs, cpython, P0
Local_Trusted_Corpus
636f81be-c71a-4f33-8269-b2cbc02486e9
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,313
supabase-export-v2
ddc379b547b0eb9a
as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs:: with FileInput(files=('spam.txt', 'eggs.txt')) as input: process(input)
trusted_official_docs
CPython Docs
as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs:: with FileInput(files=('spam.txt', 'eggs.txt')) as input: process(input)
as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs:: with FileInput(files=('spam.txt', 'eggs.txt')) as input: process(input)
python, official-docs, cpython, P0
Local_Trusted_Corpus
6413cc1d-897a-42d8-9fe1-2c0d7d6b72be
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,275
supabase-export-v2
cba71bebed799513
import fileinput for line in fileinput.input(encoding="utf-8"): process(line) This iterates over the lines of all files listed in ``sys.argv[1:]``, defaulting to ``sys.stdin`` if the list is empty. If a filename is ``'-'``, it is also replaced by ``sys.stdin`` and the optional arguments *mode* and *openhook* are ignore...
trusted_official_docs
CPython Docs
import fileinput for line in fileinput.input(encoding="utf-8"): process(line) This iterates over the lines of all files listed in ``sys.argv[1:]``, defaulting to ``sys.stdin`` if the list is empty. If a filename is ``'-'``, it is also replaced by ``sys.stdin`` and the optional arguments *mode* and *openhook* are ignore...
import fileinput for line in fileinput.input(encoding="utf-8"): process(line) This iterates over the lines of all files listed in ``sys.argv[1:]``, defaulting to ``sys.stdin`` if the list is empty. If a filename is ``'-'``, it is also replaced by ``sys.stdin`` and the optional arguments *mode* and *openhook* are ignore...
python, official-docs, cpython, P0
Local_Trusted_Corpus
64d52fc9-0bfb-4af7-840d-d075dfbf603b
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,279
supabase-export-v2
0e0f60cf65086a0b
once, the second and further use will return no lines, except perhaps for interactive use, or if it has been explicitly reset (e.g. using ``sys.stdin.seek(0)``). Empty files are opened and immediately closed; the only time their presence in the list of filenames is noticeable at all is when the last file opened is empt...
trusted_official_docs
CPython Docs
once, the second and further use will return no lines, except perhaps for interactive use, or if it has been explicitly reset (e.g. using ``sys.stdin.seek(0)``). Empty files are opened and immediately closed; the only time their presence in the list of filenames is noticeable at all is when the last file opened is empt...
once, the second and further use will return no lines, except perhaps for interactive use, or if it has been explicitly reset (e.g. using ``sys.stdin.seek(0)``). Empty files are opened and immediately closed; the only time their presence in the list of filenames is noticeable at all is when the last file opened is empt...
python, official-docs, cpython, P0
Local_Trusted_Corpus
66c9b2c5-d129-4a6c-bcca-c80f72dd73b1
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,286
supabase-export-v2
0b92229063b02494
as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs:: with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding="utf-8") as f: for line in f: process(line)
trusted_official_docs
CPython Docs
as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs:: with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding="utf-8") as f: for line in f: process(line)
as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs:: with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding="utf-8") as f: for line in f: process(line)
python, official-docs, cpython, P0
Local_Trusted_Corpus
69a21633-14d8-49bf-935c-f5d843c997fd
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,272
supabase-export-v2
ef2c5c21a441f307
-------------- This module implements a helper class and functions to quickly write a loop over standard input or a list of files. If you just want to read or write one file see :func:`open`.
trusted_official_docs
CPython Docs
-------------- This module implements a helper class and functions to quickly write a loop over standard input or a list of files. If you just want to read or write one file see :func:`open`.
-------------- This module implements a helper class and functions to quickly write a loop over standard input or a list of files. If you just want to read or write one file see :func:`open`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
6b2320e9-8b85-44e2-83e7-3ae98b753c7e
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,304
supabase-export-v2
91e39d44eeafc94b
.. function:: nextfile() Close the current file so that the next iteration will read the first line from the next file (if any); lines not read from the file will not count towards the cumulative line count. The filename is not changed until after the first line of the next file has been read. Before the first line ...
trusted_official_docs
CPython Docs
.. function:: nextfile() Close the current file so that the next iteration will read the first line from the next file (if any); lines not read from the file will not count towards the cumulative line count. The filename is not changed until after the first line of the next file has been read. Before the first line ...
.. function:: nextfile() Close the current file so that the next iteration will read the first line from the next file (if any); lines not read from the file will not count towards the cumulative line count. The filename is not changed until after the first line of the next file has been read. Before the first line ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6e7c01a0-c61b-4575-9739-fa63dd4afdaf
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,290
supabase-export-v2
43fb5b5836af5a68
.. versionchanged:: 3.10 The keyword-only parameter *encoding* and *errors* are added. The following functions use the global state created by :func:`fileinput.input`; if there is no active state, :exc:`RuntimeError` is raised.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.10 The keyword-only parameter *encoding* and *errors* are added. The following functions use the global state created by :func:`fileinput.input`; if there is no active state, :exc:`RuntimeError` is raised.
.. versionchanged:: 3.10 The keyword-only parameter *encoding* and *errors* are added. The following functions use the global state created by :func:`fileinput.input`; if there is no active state, :exc:`RuntimeError` is raised.
python, official-docs, cpython, P0
Local_Trusted_Corpus
9397e9f1-f424-4b0e-8dad-726df7853a32
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,276
supabase-export-v2
16f0255f6b363d98
*openhook* are ignored. To specify an alternative list of filenames, pass it as the first argument to :func:`.input`. A single file name is also allowed. All files are opened in text mode by default, but you can override this by specifying the *mode* parameter in the call to :func:`.input` or :class:`FileInput`. If an ...
trusted_official_docs
CPython Docs
*openhook* are ignored. To specify an alternative list of filenames, pass it as the first argument to :func:`.input`. A single file name is also allowed. All files are opened in text mode by default, but you can override this by specifying the *mode* parameter in the call to :func:`.input` or :class:`FileInput`. If an ...
*openhook* are ignored. To specify an alternative list of filenames, pass it as the first argument to :func:`.input`. A single file name is also allowed. All files are opened in text mode by default, but you can override this by specifying the *mode* parameter in the call to :func:`.input` or :class:`FileInput`. If an ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
960da837-6c34-476f-b688-1c210aedbb0f
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,280
supabase-export-v2
83dfce93d038adf0
and immediately closed; the only time their presence in the list of filenames is noticeable at all is when the last file opened is empty. Lines are returned with any newlines intact, which means that the last line in a file may not have one.
trusted_official_docs
CPython Docs
and immediately closed; the only time their presence in the list of filenames is noticeable at all is when the last file opened is empty. Lines are returned with any newlines intact, which means that the last line in a file may not have one.
and immediately closed; the only time their presence in the list of filenames is noticeable at all is when the last file opened is empty. Lines are returned with any newlines intact, which means that the last line in a file may not have one.
python, official-docs, cpython, P0
Local_Trusted_Corpus
a32d4ed9-21a5-4083-8d8d-57e8aab33e9a
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,277
supabase-export-v2
c70c875c78aff8f0
specifying the *mode* parameter in the call to :func:`.input` or :class:`FileInput`. If an I/O error occurs during opening or reading a file, :exc:`OSError` is raised. .. versionchanged:: 3.3 :exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`.
trusted_official_docs
CPython Docs
specifying the *mode* parameter in the call to :func:`.input` or :class:`FileInput`. If an I/O error occurs during opening or reading a file, :exc:`OSError` is raised. .. versionchanged:: 3.3 :exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`.
specifying the *mode* parameter in the call to :func:`.input` or :class:`FileInput`. If an I/O error occurs during opening or reading a file, :exc:`OSError` is raised. .. versionchanged:: 3.3 :exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
b5250378-17b5-4edd-91ed-61af6e7e1714
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,322
supabase-export-v2
9508e7c9cf01b1ec
the :mod:`gzip` and :mod:`bz2` modules. If the filename extension is not ``'.gz'`` or ``'.bz2'``, the file is opened normally (ie, using :func:`open` without any decompression). The *encoding* and *errors* values are passed to :class:`io.TextIOWrapper` for compressed files and open for normal files.
trusted_official_docs
CPython Docs
the :mod:`gzip` and :mod:`bz2` modules. If the filename extension is not ``'.gz'`` or ``'.bz2'``, the file is opened normally (ie, using :func:`open` without any decompression). The *encoding* and *errors* values are passed to :class:`io.TextIOWrapper` for compressed files and open for normal files.
the :mod:`gzip` and :mod:`bz2` modules. If the filename extension is not ``'.gz'`` or ``'.bz2'``, the file is opened normally (ie, using :func:`open` without any decompression). The *encoding* and *errors* values are passed to :class:`io.TextIOWrapper` for compressed files and open for normal files.
python, official-docs, cpython, P0
Local_Trusted_Corpus
b5639a02-dc17-470a-ae94-cb953ae2231e
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,310
supabase-export-v2
208b82a852c653e9
With *mode* you can specify which file mode will be passed to :func:`open`. It must be one of ``'r'`` and ``'rb'``. The *openhook*, when given, must be a function that takes two arguments, *filename* and *mode*, and returns an accordingly opened file-like object. You cannot use *inplace* and *openhook* together.
trusted_official_docs
CPython Docs
With *mode* you can specify which file mode will be passed to :func:`open`. It must be one of ``'r'`` and ``'rb'``. The *openhook*, when given, must be a function that takes two arguments, *filename* and *mode*, and returns an accordingly opened file-like object. You cannot use *inplace* and *openhook* together.
With *mode* you can specify which file mode will be passed to :func:`open`. It must be one of ``'r'`` and ``'rb'``. The *openhook*, when given, must be a function that takes two arguments, *filename* and *mode*, and returns an accordingly opened file-like object. You cannot use *inplace* and *openhook* together.
python, official-docs, cpython, P0
Local_Trusted_Corpus
b755c466-b1b1-4e27-93fd-cebdaf69ccec
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,312
supabase-export-v2
5ba0a418f4051fc8
You can specify *encoding* and *errors* that is passed to :func:`open` or *openhook*. A :class:`FileInput` instance can be used as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs::
trusted_official_docs
CPython Docs
You can specify *encoding* and *errors* that is passed to :func:`open` or *openhook*. A :class:`FileInput` instance can be used as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs::
You can specify *encoding* and *errors* that is passed to :func:`open` or *openhook*. A :class:`FileInput` instance can be used as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs::
python, official-docs, cpython, P0
Local_Trusted_Corpus
c1461405-28b6-4253-8ab0-c4e3e15ad7c2
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,278
supabase-export-v2
3149571cedaf3d4b
.. versionchanged:: 3.3 :exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`. If ``sys.stdin`` is used more than once, the second and further use will return no lines, except perhaps for interactive use, or if it has been explicitly reset (e.g. using ``sys.stdin.seek(0)``).
trusted_official_docs
CPython Docs
.. versionchanged:: 3.3 :exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`. If ``sys.stdin`` is used more than once, the second and further use will return no lines, except perhaps for interactive use, or if it has been explicitly reset (e.g. using ``sys.stdin.seek(0)``).
.. versionchanged:: 3.3 :exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`. If ``sys.stdin`` is used more than once, the second and further use will return no lines, except perhaps for interactive use, or if it has been explicitly reset (e.g. using ``sys.stdin.seek(0)``).
python, official-docs, cpython, P0
Local_Trusted_Corpus
e8dd853c-fae5-4d4c-af14-c1ed75ee13bb
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,281
supabase-export-v2
25ffafcf7f3670d1
Lines are returned with any newlines intact, which means that the last line in a file may not have one. You can control how files are opened by providing an opening hook via the *openhook* parameter to :func:`fileinput.input` or :func:`FileInput`. The hook must be a function that takes two arguments, *filename* and *mo...
trusted_official_docs
CPython Docs
Lines are returned with any newlines intact, which means that the last line in a file may not have one. You can control how files are opened by providing an opening hook via the *openhook* parameter to :func:`fileinput.input` or :func:`FileInput`. The hook must be a function that takes two arguments, *filename* and *mo...
Lines are returned with any newlines intact, which means that the last line in a file may not have one. You can control how files are opened by providing an opening hook via the *openhook* parameter to :func:`fileinput.input` or :func:`FileInput`. The hook must be a function that takes two arguments, *filename* and *mo...
python, official-docs, cpython, P0
Local_Trusted_Corpus
f377f31f-8e87-4800-9fe5-bada2ef08330
CPython Docs
file://datasets/cpython/Doc/library/fileinput.rst
unknown
682f1cad-dc1d-44c6-89f1-59592278b10a
3,296
supabase-export-v2
8e006939a697dd94
.. function:: lineno() Return the cumulative line number of the line that has just been read. Before the first line has been read, returns ``0``. After the last line of the last file has been read, returns the line number of that line.
trusted_official_docs
CPython Docs
.. function:: lineno() Return the cumulative line number of the line that has just been read. Before the first line has been read, returns ``0``. After the last line of the last file has been read, returns the line number of that line.
.. function:: lineno() Return the cumulative line number of the line that has just been read. Before the first line has been read, returns ``0``. After the last line of the last file has been read, returns the line number of that line.
python, official-docs, cpython, P0
Local_Trusted_Corpus
012f122e-b6a9-446b-90be-130698a52b31
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,520
supabase-export-v2
fd1e68f18ae4c6d4
:param str name: The name of the SQL aggregate function. :param int n_arg: The number of arguments the SQL aggregate function can accept. If ``-1``, it may take any number of arguments.
trusted_official_docs
CPython Docs
:param str name: The name of the SQL aggregate function. :param int n_arg: The number of arguments the SQL aggregate function can accept. If ``-1``, it may take any number of arguments.
:param str name: The name of the SQL aggregate function. :param int n_arg: The number of arguments the SQL aggregate function can accept. If ``-1``, it may take any number of arguments.
python, official-docs, cpython, P0
Local_Trusted_Corpus
01c3b0e1-8c12-4cfa-b670-3a0414a0a997
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,522
supabase-export-v2
4175d89885607fd2
:param aggregate_class: A class must implement the following methods: * ``step()``: Add a row to the aggregate. * ``finalize()``: Return the final result of the aggregate as :ref:`a type natively supported by SQLite <sqlite3-types>`.
trusted_official_docs
CPython Docs
:param aggregate_class: A class must implement the following methods: * ``step()``: Add a row to the aggregate. * ``finalize()``: Return the final result of the aggregate as :ref:`a type natively supported by SQLite <sqlite3-types>`.
:param aggregate_class: A class must implement the following methods: * ``step()``: Add a row to the aggregate. * ``finalize()``: Return the final result of the aggregate as :ref:`a type natively supported by SQLite <sqlite3-types>`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
031a0e4a-0b7c-48f6-8121-02843e8ff9f5
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,851
supabase-export-v2
b9f5809a36a9e57d
This is how SQLite types are converted to Python types by default: +-------------+----------------------------------------------+ | SQLite type | Python type | +=============+==============================================+ | ``NULL`` | ``None`` | +-------------+----------------------------------------------+ | ``INTEGE...
trusted_official_docs
CPython Docs
This is how SQLite types are converted to Python types by default: +-------------+----------------------------------------------+ | SQLite type | Python type | +=============+==============================================+ | ``NULL`` | ``None`` | +-------------+----------------------------------------------+ | ``INTEGE...
This is how SQLite types are converted to Python types by default: +-------------+----------------------------------------------+ | SQLite type | Python type | +=============+==============================================+ | ``NULL`` | ``None`` | +-------------+----------------------------------------------+ | ``INTEGE...
python, official-docs, cpython, P0
Local_Trusted_Corpus
03d17072-27e9-4649-80c0-96934ebc8896
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,876
supabase-export-v2
0538793c523471b0
"SELECT * FROM stocks WHERE symbol = '%s'" % symbol >>> print(sql) SELECT * FROM stocks WHERE symbol = '' OR TRUE; --' >>> cur.execute(sql) Instead, use the DB-API's parameter substitution. To insert a variable into a query string, use a placeholder in the string, and substitute the actual values into the query by prov...
trusted_official_docs
CPython Docs
"SELECT * FROM stocks WHERE symbol = '%s'" % symbol >>> print(sql) SELECT * FROM stocks WHERE symbol = '' OR TRUE; --' >>> cur.execute(sql) Instead, use the DB-API's parameter substitution. To insert a variable into a query string, use a placeholder in the string, and substitute the actual values into the query by prov...
"SELECT * FROM stocks WHERE symbol = '%s'" % symbol >>> print(sql) SELECT * FROM stocks WHERE symbol = '' OR TRUE; --' >>> cur.execute(sql) Instead, use the DB-API's parameter substitution. To insert a variable into a query string, use a placeholder in the string, and substitute the actual values into the query by prov...
python, official-docs, cpython, P0
Local_Trusted_Corpus
03e6e1d4-9f1c-41a3-a56b-db0f803819c1
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,860
supabase-export-v2
f35022a15af3ac4f
.. note:: The default "timestamp" converter ignores UTC offsets in the database and always returns a naive :class:`datetime.datetime` object. To preserve UTC offsets in timestamps, either leave converters disabled, or register an offset-aware converter with :func:`register_converter`.
trusted_official_docs
CPython Docs
.. note:: The default "timestamp" converter ignores UTC offsets in the database and always returns a naive :class:`datetime.datetime` object. To preserve UTC offsets in timestamps, either leave converters disabled, or register an offset-aware converter with :func:`register_converter`.
.. note:: The default "timestamp" converter ignores UTC offsets in the database and always returns a naive :class:`datetime.datetime` object. To preserve UTC offsets in timestamps, either leave converters disabled, or register an offset-aware converter with :func:`register_converter`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
03fcd886-5e73-42ad-9bc9-b3985d40a100
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,417
supabase-export-v2
545b471bc0fbe013
>>> sqlite3.complete_statement("SELECT foo FROM bar;") True >>> sqlite3.complete_statement("SELECT foo") False This function may be useful during command-line input to determine if the entered text seems to form a complete SQL statement, or if additional input is needed before calling :meth:`~Cursor.execute`.
trusted_official_docs
CPython Docs
>>> sqlite3.complete_statement("SELECT foo FROM bar;") True >>> sqlite3.complete_statement("SELECT foo") False This function may be useful during command-line input to determine if the entered text seems to form a complete SQL statement, or if additional input is needed before calling :meth:`~Cursor.execute`.
>>> sqlite3.complete_statement("SELECT foo FROM bar;") True >>> sqlite3.complete_statement("SELECT foo") False This function may be useful during command-line input to determine if the entered text seems to form a complete SQL statement, or if additional input is needed before calling :meth:`~Cursor.execute`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
0545b031-d938-40ca-ae20-612f4eb00203
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,984
supabase-export-v2
d8eae2e621efe875
How to create and use row factories ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :class:`!tuple` does not suit your needs, you can use the :class:`sqlite3.Row` class or a custom :attr:`~Cursor.row_factory`.
trusted_official_docs
CPython Docs
How to create and use row factories ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :class:`!tuple` does not suit your needs, you can use the :class:`sqlite3.Row` class or a custom :attr:`~Cursor.row_factory`.
How to create and use row factories ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :class:`!tuple` does not suit your needs, you can use the :class:`sqlite3.Row` class or a custom :attr:`~Cursor.row_factory`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
05ece8c4-0506-45cb-97cf-41ec40fdf144
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,924
supabase-export-v2
c7640a7cc60f4cf4
# 1) Parse using declared types p = Point(4.0, -3.2) con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_DECLTYPES) cur = con.execute("CREATE TABLE test(p point)") cur.execute("INSERT INTO test(p) VALUES(?)", (p,)) cur.execute("SELECT p FROM test") print("with declared types:", cur.fetchone()[0]) cur.close(...
trusted_official_docs
CPython Docs
# 1) Parse using declared types p = Point(4.0, -3.2) con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_DECLTYPES) cur = con.execute("CREATE TABLE test(p point)") cur.execute("INSERT INTO test(p) VALUES(?)", (p,)) cur.execute("SELECT p FROM test") print("with declared types:", cur.fetchone()[0]) cur.close(...
# 1) Parse using declared types p = Point(4.0, -3.2) con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_DECLTYPES) cur = con.execute("CREATE TABLE test(p point)") cur.execute("INSERT INTO test(p) VALUES(?)", (p,)) cur.execute("SELECT p FROM test") print("with declared types:", cur.fetchone()[0]) cur.close(...
python, official-docs, cpython, P0
Local_Trusted_Corpus
08652cbe-d231-48fd-993f-a2227ab8c256
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,338
supabase-export-v2
df80f1953d40cdc9
data storage. It's also possible to prototype an application using SQLite and then port the code to a larger database such as PostgreSQL or Oracle. The :mod:`!sqlite3` module was written by Gerhard Häring. It provides an SQL interface compliant with the DB-API 2.0 specification described by :pep:`249`, and requires the...
trusted_official_docs
CPython Docs
data storage. It's also possible to prototype an application using SQLite and then port the code to a larger database such as PostgreSQL or Oracle. The :mod:`!sqlite3` module was written by Gerhard Häring. It provides an SQL interface compliant with the DB-API 2.0 specification described by :pep:`249`, and requires the...
data storage. It's also possible to prototype an application using SQLite and then port the code to a larger database such as PostgreSQL or Oracle. The :mod:`!sqlite3` module was written by Gerhard Häring. It provides an SQL interface compliant with the DB-API 2.0 specification described by :pep:`249`, and requires the...
python, official-docs, cpython, P0
Local_Trusted_Corpus
0a2aa714-9faa-4c76-b71d-521435da1846
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,793
supabase-export-v2
f5e1d8acdf171555
Return a :class:`list` of column names as :class:`strings <str>`. Immediately after a query, it is the first member of each tuple in :attr:`Cursor.description`. .. versionchanged:: 3.5 Added support of slicing.
trusted_official_docs
CPython Docs
Return a :class:`list` of column names as :class:`strings <str>`. Immediately after a query, it is the first member of each tuple in :attr:`Cursor.description`. .. versionchanged:: 3.5 Added support of slicing.
Return a :class:`list` of column names as :class:`strings <str>`. Immediately after a query, it is the first member of each tuple in :attr:`Cursor.description`. .. versionchanged:: 3.5 Added support of slicing.
python, official-docs, cpython, P0
Local_Trusted_Corpus
0a590d28-82a6-4ea6-abd5-66e02ab81a78
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,773
supabase-export-v2
04c9c199241fde01
.. attribute:: description Read-only attribute that provides the column names of the last query. To remain compatible with the Python DB API, it returns a 7-tuple for each column where the last six items of each tuple are ``None``.
trusted_official_docs
CPython Docs
.. attribute:: description Read-only attribute that provides the column names of the last query. To remain compatible with the Python DB API, it returns a 7-tuple for each column where the last six items of each tuple are ``None``.
.. attribute:: description Read-only attribute that provides the column names of the last query. To remain compatible with the Python DB API, it returns a 7-tuple for each column where the last six items of each tuple are ``None``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
0b1f19e0-9363-46df-bb05-2be1b6cbff9d
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,725
supabase-export-v2
95e6b2d7d89669c1
:param str sql: A single SQL statement. :param parameters: Python values to bind to placeholders in *sql*. A :class:`!dict` if named placeholders are used. A :term:`!sequence` if unnamed placeholders are used. See :ref:`sqlite3-placeholders`. :type parameters: :class:`dict` | :term:`sequence`
trusted_official_docs
CPython Docs
:param str sql: A single SQL statement. :param parameters: Python values to bind to placeholders in *sql*. A :class:`!dict` if named placeholders are used. A :term:`!sequence` if unnamed placeholders are used. See :ref:`sqlite3-placeholders`. :type parameters: :class:`dict` | :term:`sequence`
:param str sql: A single SQL statement. :param parameters: Python values to bind to placeholders in *sql*. A :class:`!dict` if named placeholders are used. A :term:`!sequence` if unnamed placeholders are used. See :ref:`sqlite3-placeholders`. :type parameters: :class:`dict` | :term:`sequence`
python, official-docs, cpython, P0
Local_Trusted_Corpus
0c88509d-be38-46ba-a517-005ba6ca21cc
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,993
supabase-export-v2
73de4481536da289
.. note:: The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the above example. In such cases, SQLite returns a single row with columns defined by expressions, e.g. literals, with the given aliases ``expr AS alias``.
trusted_official_docs
CPython Docs
.. note:: The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the above example. In such cases, SQLite returns a single row with columns defined by expressions, e.g. literals, with the given aliases ``expr AS alias``.
.. note:: The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the above example. In such cases, SQLite returns a single row with columns defined by expressions, e.g. literals, with the given aliases ``expr AS alias``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
0e99bf2e-9816-4b0d-956d-87cb74fa1ed8
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,991
supabase-export-v2
b22a83d9782897c7
.. doctest:: >>> res = con.execute("SELECT 'Earth' AS name, 6378 AS radius") >>> row = res.fetchone() >>> row.keys() ['name', 'radius'] >>> row[0] # Access by index. 'Earth' >>> row["name"] # Access by name. 'Earth' >>> row["RADIUS"] # Column names are case-insensitive. 6378 >>> con.close()
trusted_official_docs
CPython Docs
.. doctest:: >>> res = con.execute("SELECT 'Earth' AS name, 6378 AS radius") >>> row = res.fetchone() >>> row.keys() ['name', 'radius'] >>> row[0] # Access by index. 'Earth' >>> row["name"] # Access by name. 'Earth' >>> row["RADIUS"] # Column names are case-insensitive. 6378 >>> con.close()
.. doctest:: >>> res = con.execute("SELECT 'Earth' AS name, 6378 AS radius") >>> row = res.fetchone() >>> row.keys() ['name', 'radius'] >>> row[0] # Access by index. 'Earth' >>> row["name"] # Access by name. 'Earth' >>> row["RADIUS"] # Column names are case-insensitive. 6378 >>> con.close()
python, official-docs, cpython, P0
Local_Trusted_Corpus
0f820e50-3694-4b29-a62f-419f487a8f13
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,986
supabase-export-v2
a882259587fdcc12
on the :class:`Cursor` and the :class:`Connection`, it is recommended to set :class:`Connection.row_factory`, so all cursors created from the connection will use the same row factory. :class:`!Row` provides indexed and case-insensitive named access to columns, with minimal memory overhead and performance impact over a ...
trusted_official_docs
CPython Docs
on the :class:`Cursor` and the :class:`Connection`, it is recommended to set :class:`Connection.row_factory`, so all cursors created from the connection will use the same row factory. :class:`!Row` provides indexed and case-insensitive named access to columns, with minimal memory overhead and performance impact over a ...
on the :class:`Cursor` and the :class:`Connection`, it is recommended to set :class:`Connection.row_factory`, so all cursors created from the connection will use the same row factory. :class:`!Row` provides indexed and case-insensitive named access to columns, with minimal memory overhead and performance impact over a ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
104a5ba3-b9a9-499b-bd66-49a2b87d49a6
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,682
supabase-export-v2
177e97ba64d239b1
This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!autocommit` has three allowed values: * ``False``: Select :pep:`249`-compliant transaction behaviour, implying that :mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :meth:`rollback` to close transactions.
trusted_official_docs
CPython Docs
This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!autocommit` has three allowed values: * ``False``: Select :pep:`249`-compliant transaction behaviour, implying that :mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :meth:`rollback` to close transactions.
This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!autocommit` has three allowed values: * ``False``: Select :pep:`249`-compliant transaction behaviour, implying that :mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :meth:`rollback` to close transactions.
python, official-docs, cpython, P0
Local_Trusted_Corpus
1159ae2b-3b81-4457-9667-4153cd5f35d3
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
4,005
supabase-export-v2
27486ccbdd96a1c8
.. doctest:: >>> con = sqlite3.connect(":memory:") >>> con.row_factory = namedtuple_factory >>> cur = con.execute("SELECT 1 AS a, 2 AS b") >>> row = cur.fetchone() >>> row Row(a=1, b=2) >>> row[0] # Indexed access. 1 >>> row.b # Attribute access. 2 >>> con.close()
trusted_official_docs
CPython Docs
.. doctest:: >>> con = sqlite3.connect(":memory:") >>> con.row_factory = namedtuple_factory >>> cur = con.execute("SELECT 1 AS a, 2 AS b") >>> row = cur.fetchone() >>> row Row(a=1, b=2) >>> row[0] # Indexed access. 1 >>> row.b # Attribute access. 2 >>> con.close()
.. doctest:: >>> con = sqlite3.connect(":memory:") >>> con.row_factory = namedtuple_factory >>> cur = con.execute("SELECT 1 AS a, 2 AS b") >>> row = cur.fetchone() >>> row Row(a=1, b=2) >>> row[0] # Indexed access. 1 >>> row.b # Attribute access. 2 >>> con.close()
python, official-docs, cpython, P0
Local_Trusted_Corpus
116d0a01-6b85-4dff-9db9-c5ed98cd5a6d
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,368
supabase-export-v2
51ac12039996a1af
cur.execute(""" INSERT INTO movie VALUES ('Monty Python and the Holy Grail', 1975, 8.2), ('And Now for Something Completely Different', 1971, 7.5) """) The ``INSERT`` statement implicitly opens a transaction, which needs to be committed before changes are saved in the database (see :ref:`sqlite3-controlling-transaction...
trusted_official_docs
CPython Docs
cur.execute(""" INSERT INTO movie VALUES ('Monty Python and the Holy Grail', 1975, 8.2), ('And Now for Something Completely Different', 1971, 7.5) """) The ``INSERT`` statement implicitly opens a transaction, which needs to be committed before changes are saved in the database (see :ref:`sqlite3-controlling-transaction...
cur.execute(""" INSERT INTO movie VALUES ('Monty Python and the Holy Grail', 1975, 8.2), ('And Now for Something Completely Different', 1971, 7.5) """) The ``INSERT`` statement implicitly opens a transaction, which needs to be committed before changes are saved in the database (see :ref:`sqlite3-controlling-transaction...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1196e719-fdb8-4aa5-961b-792019cdc402
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,496
supabase-export-v2
3f6022192133ea38
.. method:: commit() Commit any pending transaction to the database. If :attr:`autocommit` is ``True``, or there is no open transaction, this method does nothing. If :attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a pending transaction was committed by this method.
trusted_official_docs
CPython Docs
.. method:: commit() Commit any pending transaction to the database. If :attr:`autocommit` is ``True``, or there is no open transaction, this method does nothing. If :attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a pending transaction was committed by this method.
.. method:: commit() Commit any pending transaction to the database. If :attr:`autocommit` is ``True``, or there is no open transaction, this method does nothing. If :attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a pending transaction was committed by this method.
python, official-docs, cpython, P0
Local_Trusted_Corpus
12169309-66bf-4cb7-b804-6091cb770aca
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,705
supabase-export-v2
e98fb9f6fd6d4be3
.. attribute:: text_factory A :term:`callable` that accepts a :class:`bytes` parameter and returns a text representation of it. The callable is invoked for SQLite values with the ``TEXT`` data type. By default, this attribute is set to :class:`str`.
trusted_official_docs
CPython Docs
.. attribute:: text_factory A :term:`callable` that accepts a :class:`bytes` parameter and returns a text representation of it. The callable is invoked for SQLite values with the ``TEXT`` data type. By default, this attribute is set to :class:`str`.
.. attribute:: text_factory A :term:`callable` that accepts a :class:`bytes` parameter and returns a text representation of it. The callable is invoked for SQLite values with the ``TEXT`` data type. By default, this attribute is set to :class:`str`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
1276c363-5969-4546-880e-51922c4a6e35
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,667
supabase-export-v2
63644a926afe6527
a "temp" database, the serialization is the same sequence of bytes which would be written to disk if that database were backed up to disk. :param str name: The database name to be serialized. Defaults to ``"main"``.
trusted_official_docs
CPython Docs
a "temp" database, the serialization is the same sequence of bytes which would be written to disk if that database were backed up to disk. :param str name: The database name to be serialized. Defaults to ``"main"``.
a "temp" database, the serialization is the same sequence of bytes which would be written to disk if that database were backed up to disk. :param str name: The database name to be serialized. Defaults to ``"main"``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
12c8afbe-b54b-441e-b454-0c8c84905948
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,400
supabase-export-v2
4705c3a5ab47b766
:const:`PARSE_DECLTYPES` and :const:`PARSE_COLNAMES` to enable this. Column names take precedence over declared types if both flags are set. By default (``0``), type detection is disabled. :param isolation_level: Control legacy transaction handling behaviour. See :attr:`Connection.isolation_level` and :ref:`sqlite3-t...
trusted_official_docs
CPython Docs
:const:`PARSE_DECLTYPES` and :const:`PARSE_COLNAMES` to enable this. Column names take precedence over declared types if both flags are set. By default (``0``), type detection is disabled. :param isolation_level: Control legacy transaction handling behaviour. See :attr:`Connection.isolation_level` and :ref:`sqlite3-t...
:const:`PARSE_DECLTYPES` and :const:`PARSE_COLNAMES` to enable this. Column names take precedence over declared types if both flags are set. By default (``0``), type detection is disabled. :param isolation_level: Control legacy transaction handling behaviour. See :attr:`Connection.isolation_level` and :ref:`sqlite3-t...
python, official-docs, cpython, P0
Local_Trusted_Corpus
132cb2e7-ea39-41cf-8034-7ace7e83e509
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,365
supabase-export-v2
355c7572776da84f
>>> res = cur.execute("SELECT name FROM sqlite_master WHERE name='spam'") >>> res.fetchone() is None True Now, add two rows of data supplied as SQL literals by executing an ``INSERT`` statement, once again by calling :meth:`cur.execute(...) <Cursor.execute>`:
trusted_official_docs
CPython Docs
>>> res = cur.execute("SELECT name FROM sqlite_master WHERE name='spam'") >>> res.fetchone() is None True Now, add two rows of data supplied as SQL literals by executing an ``INSERT`` statement, once again by calling :meth:`cur.execute(...) <Cursor.execute>`:
>>> res = cur.execute("SELECT name FROM sqlite_master WHERE name='spam'") >>> res.fetchone() is None True Now, add two rows of data supplied as SQL literals by executing an ``INSERT`` statement, once again by calling :meth:`cur.execute(...) <Cursor.execute>`:
python, official-docs, cpython, P0
Local_Trusted_Corpus
157d40ab-0d15-4b22-b69b-bdd0f7af08b7
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,800
supabase-export-v2
ade8ecb4762fad91
con = sqlite3.connect(":memory:") con.execute("CREATE TABLE test(blob_col blob)") con.execute("INSERT INTO test(blob_col) VALUES(zeroblob(13))") # Write to our blob, using two write operations: with con.blobopen("test", "blob_col", 1) as blob: blob.write(b"hello, ") blob.write(b"world.") # Modify the first and last...
trusted_official_docs
CPython Docs
con = sqlite3.connect(":memory:") con.execute("CREATE TABLE test(blob_col blob)") con.execute("INSERT INTO test(blob_col) VALUES(zeroblob(13))") # Write to our blob, using two write operations: with con.blobopen("test", "blob_col", 1) as blob: blob.write(b"hello, ") blob.write(b"world.") # Modify the first and last...
con = sqlite3.connect(":memory:") con.execute("CREATE TABLE test(blob_col blob)") con.execute("INSERT INTO test(blob_col) VALUES(zeroblob(13))") # Write to our blob, using two write operations: with con.blobopen("test", "blob_col", 1) as blob: blob.write(b"hello, ") blob.write(b"world.") # Modify the first and last...
python, official-docs, cpython, P0
Local_Trusted_Corpus
167af9c0-ce06-49b8-a812-66e37b307267
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,646
supabase-export-v2
05c5dd8bc7e9ab85
.. method:: setlimit(category, limit, /) Set a connection runtime limit. Attempts to increase a limit above its hard upper bound are silently truncated to the hard upper bound. Regardless of whether or not the limit was changed, the prior value of the limit is returned.
trusted_official_docs
CPython Docs
.. method:: setlimit(category, limit, /) Set a connection runtime limit. Attempts to increase a limit above its hard upper bound are silently truncated to the hard upper bound. Regardless of whether or not the limit was changed, the prior value of the limit is returned.
.. method:: setlimit(category, limit, /) Set a connection runtime limit. Attempts to increase a limit above its hard upper bound are silently truncated to the hard upper bound. Regardless of whether or not the limit was changed, the prior value of the limit is returned.
python, official-docs, cpython, P0
Local_Trusted_Corpus
169837e5-e6fe-438d-986c-3aa3045bf0d2
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,435
supabase-export-v2
b24c681cd247080b
.. code-block:: sql CREATE TABLE test( i integer primary key, ! will look up a converter named "integer" p point, ! will look up a converter named "point" n number(10) ! will look up a converter named "number" )
trusted_official_docs
CPython Docs
.. code-block:: sql CREATE TABLE test( i integer primary key, ! will look up a converter named "integer" p point, ! will look up a converter named "point" n number(10) ! will look up a converter named "number" )
.. code-block:: sql CREATE TABLE test( i integer primary key, ! will look up a converter named "integer" p point, ! will look up a converter named "point" n number(10) ! will look up a converter named "number" )
python, official-docs, cpython, P0
Local_Trusted_Corpus
18318177-ed9e-4b66-921f-bea8a004ef0c
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,753
supabase-export-v2
1b7b90eada35859a
Return the next set of rows of a query result as a :class:`list`. Return an empty list if no more rows are available. The number of rows to fetch per call is specified by the *size* parameter. If *size* is not given, :attr:`arraysize` determines the number of rows to be fetched. If fewer than *size* rows are available...
trusted_official_docs
CPython Docs
Return the next set of rows of a query result as a :class:`list`. Return an empty list if no more rows are available. The number of rows to fetch per call is specified by the *size* parameter. If *size* is not given, :attr:`arraysize` determines the number of rows to be fetched. If fewer than *size* rows are available...
Return the next set of rows of a query result as a :class:`list`. Return an empty list if no more rows are available. The number of rows to fetch per call is specified by the *size* parameter. If *size* is not given, :attr:`arraysize` determines the number of rows to be fetched. If fewer than *size* rows are available...
python, official-docs, cpython, P0
Local_Trusted_Corpus
186e1c09-dba4-413c-b207-766d9735e186
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,852
supabase-export-v2
09a6ac73b4518416
``REAL`` | :class:`float` | +-------------+----------------------------------------------+ | ``TEXT`` | depends on :attr:`~Connection.text_factory`, | | | :class:`str` by default | +-------------+----------------------------------------------+ | ``BLOB`` | :class:`bytes` | +-------------+-------------------------------...
trusted_official_docs
CPython Docs
``REAL`` | :class:`float` | +-------------+----------------------------------------------+ | ``TEXT`` | depends on :attr:`~Connection.text_factory`, | | | :class:`str` by default | +-------------+----------------------------------------------+ | ``BLOB`` | :class:`bytes` | +-------------+-------------------------------...
``REAL`` | :class:`float` | +-------------+----------------------------------------------+ | ``TEXT`` | depends on :attr:`~Connection.text_factory`, | | | :class:`str` by default | +-------------+----------------------------------------------+ | ``BLOB`` | :class:`bytes` | +-------------+-------------------------------...
python, official-docs, cpython, P0
Local_Trusted_Corpus
18a4facc-3219-484f-b8eb-54758a23dcb8
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,341
supabase-export-v2
7fa4de1d07e2acdd
This document includes four main sections: * :ref:`sqlite3-tutorial` teaches how to use the :mod:`!sqlite3` module. * :ref:`sqlite3-reference` describes the classes and functions this module defines. * :ref:`sqlite3-howtos` details how to handle specific tasks. * :ref:`sqlite3-explanation` provides in-depth background...
trusted_official_docs
CPython Docs
This document includes four main sections: * :ref:`sqlite3-tutorial` teaches how to use the :mod:`!sqlite3` module. * :ref:`sqlite3-reference` describes the classes and functions this module defines. * :ref:`sqlite3-howtos` details how to handle specific tasks. * :ref:`sqlite3-explanation` provides in-depth background...
This document includes four main sections: * :ref:`sqlite3-tutorial` teaches how to use the :mod:`!sqlite3` module. * :ref:`sqlite3-reference` describes the classes and functions this module defines. * :ref:`sqlite3-howtos` details how to handle specific tasks. * :ref:`sqlite3-explanation` provides in-depth background...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1a2da370-9bc1-4d22-96e0-8c1970504c05
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,703
supabase-export-v2
7b2b359bbc654085
affect the :attr:`!row_factory` of existing cursors belonging to this connection, only new ones. Is ``None`` by default, meaning each row is returned as a :class:`tuple`. See :ref:`sqlite3-howto-row-factory` for more details.
trusted_official_docs
CPython Docs
affect the :attr:`!row_factory` of existing cursors belonging to this connection, only new ones. Is ``None`` by default, meaning each row is returned as a :class:`tuple`. See :ref:`sqlite3-howto-row-factory` for more details.
affect the :attr:`!row_factory` of existing cursors belonging to this connection, only new ones. Is ``None`` by default, meaning each row is returned as a :class:`tuple`. See :ref:`sqlite3-howto-row-factory` for more details.
python, official-docs, cpython, P0
Local_Trusted_Corpus
1c60faa5-c9ef-442e-87cd-74cc8e90fa78
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
4,027
supabase-export-v2
599dd29efe8fc9e3
using :meth:`!commit`. * Transactions should be rolled back explicitly using :meth:`!rollback`. * An implicit rollback is performed if the database is :meth:`~Connection.close`-ed with pending changes. Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this mode, :meth:`Connection.commit` and :meth:...
trusted_official_docs
CPython Docs
using :meth:`!commit`. * Transactions should be rolled back explicitly using :meth:`!rollback`. * An implicit rollback is performed if the database is :meth:`~Connection.close`-ed with pending changes. Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this mode, :meth:`Connection.commit` and :meth:...
using :meth:`!commit`. * Transactions should be rolled back explicitly using :meth:`!rollback`. * An implicit rollback is performed if the database is :meth:`~Connection.close`-ed with pending changes. Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this mode, :meth:`Connection.commit` and :meth:...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1c6b82a6-d885-4831-8ceb-79c01fff2a11
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,536
supabase-export-v2
58d1982d73a70a62
:param int num_params: The number of arguments the SQL aggregate window function can accept. If ``-1``, it may take any number of arguments. :param aggregate_class: A class that must implement the following methods:
trusted_official_docs
CPython Docs
:param int num_params: The number of arguments the SQL aggregate window function can accept. If ``-1``, it may take any number of arguments. :param aggregate_class: A class that must implement the following methods:
:param int num_params: The number of arguments the SQL aggregate window function can accept. If ``-1``, it may take any number of arguments. :param aggregate_class: A class that must implement the following methods:
python, official-docs, cpython, P0
Local_Trusted_Corpus
1df27a9c-8fd1-4ecc-9c84-2e2d7b7527d1
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,925
supabase-export-v2
4bbc9e5d12d481ce
cur.execute("INSERT INTO test(p) VALUES(?)", (p,)) cur.execute("SELECT p FROM test") print("with declared types:", cur.fetchone()[0]) cur.close() con.close() # 2) Parse using column names con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_COLNAMES) cur = con.execute("CREATE TABLE test(p)")
trusted_official_docs
CPython Docs
cur.execute("INSERT INTO test(p) VALUES(?)", (p,)) cur.execute("SELECT p FROM test") print("with declared types:", cur.fetchone()[0]) cur.close() con.close() # 2) Parse using column names con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_COLNAMES) cur = con.execute("CREATE TABLE test(p)")
cur.execute("INSERT INTO test(p) VALUES(?)", (p,)) cur.execute("SELECT p FROM test") print("with declared types:", cur.fetchone()[0]) cur.close() con.close() # 2) Parse using column names con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_COLNAMES) cur = con.execute("CREATE TABLE test(p)")
python, official-docs, cpython, P0
Local_Trusted_Corpus
1e089748-2a73-47d5-9348-e721d7769cb8
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,567
supabase-export-v2
9d056f54af052ef1
The callback should return one of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE` to signal how access to the column should be handled by the underlying SQLite library. The first argument to the callback signifies what kind of operation is to be authorized. The second and third argument will be arg...
trusted_official_docs
CPython Docs
The callback should return one of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE` to signal how access to the column should be handled by the underlying SQLite library. The first argument to the callback signifies what kind of operation is to be authorized. The second and third argument will be arg...
The callback should return one of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE` to signal how access to the column should be handled by the underlying SQLite library. The first argument to the callback signifies what kind of operation is to be authorized. The second and third argument will be arg...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1e12bb21-2f59-42f4-a157-1bff6b7b1be3
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,698
supabase-export-v2
bfebfa1dca9e80d5
never implicitly opened. If set to one of ``"DEFERRED"``, ``"IMMEDIATE"``, or ``"EXCLUSIVE"``, corresponding to the underlying `SQLite transaction behaviour`_, :ref:`implicit transaction management <sqlite3-transaction-control-isolation-level>` is performed. If not overridden by the *isolation_level* parameter of :func...
trusted_official_docs
CPython Docs
never implicitly opened. If set to one of ``"DEFERRED"``, ``"IMMEDIATE"``, or ``"EXCLUSIVE"``, corresponding to the underlying `SQLite transaction behaviour`_, :ref:`implicit transaction management <sqlite3-transaction-control-isolation-level>` is performed. If not overridden by the *isolation_level* parameter of :func...
never implicitly opened. If set to one of ``"DEFERRED"``, ``"IMMEDIATE"``, or ``"EXCLUSIVE"``, corresponding to the underlying `SQLite transaction behaviour`_, :ref:`implicit transaction management <sqlite3-transaction-control-isolation-level>` is performed. If not overridden by the *isolation_level* parameter of :func...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1e84f1ab-3bf9-4cb1-8a84-b5c0affd6d0a
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,588
supabase-export-v2
279a3a3902d3a62e
platforms (notably macOS) have SQLite libraries which are compiled without this feature. To get loadable extension support, you must pass the :option:`--enable-loadable-sqlite-extensions` option to :program:`configure`. .. audit-event:: sqlite3.enable_load_extension connection,enabled sqlite3.Connection.enable_load_ext...
trusted_official_docs
CPython Docs
platforms (notably macOS) have SQLite libraries which are compiled without this feature. To get loadable extension support, you must pass the :option:`--enable-loadable-sqlite-extensions` option to :program:`configure`. .. audit-event:: sqlite3.enable_load_extension connection,enabled sqlite3.Connection.enable_load_ext...
platforms (notably macOS) have SQLite libraries which are compiled without this feature. To get loadable extension support, you must pass the :option:`--enable-loadable-sqlite-extensions` option to :program:`configure`. .. audit-event:: sqlite3.enable_load_extension connection,enabled sqlite3.Connection.enable_load_ext...
python, official-docs, cpython, P0
Local_Trusted_Corpus
214094f0-4608-4aa4-83f9-8bb54257d56b
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,966
supabase-export-v2
ce37f3ec4cd8ced4
# Successful, con.commit() is called automatically afterwards with con: con.execute("INSERT INTO lang(name) VALUES(?)", ("Python",)) # con.rollback() is called after the with block finishes with an exception, # the exception is still raised and must be caught try: with con: con.execute("INSERT INTO lang(name) VALUE...
trusted_official_docs
CPython Docs
# Successful, con.commit() is called automatically afterwards with con: con.execute("INSERT INTO lang(name) VALUES(?)", ("Python",)) # con.rollback() is called after the with block finishes with an exception, # the exception is still raised and must be caught try: with con: con.execute("INSERT INTO lang(name) VALUE...
# Successful, con.commit() is called automatically afterwards with con: con.execute("INSERT INTO lang(name) VALUES(?)", ("Python",)) # con.rollback() is called after the with block finishes with an exception, # the exception is still raised and must be caught try: with con: con.execute("INSERT INTO lang(name) VALUE...
python, official-docs, cpython, P0
Local_Trusted_Corpus
21b8ed25-9143-4e6c-bbe3-c47a79e6c8b1
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
4,009
supabase-export-v2
64155b5a8fb62281
How to handle non-UTF-8 text encodings ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might fail for other encodings and invalid UTF-8. You can use a custom :attr:`~Connection.text_fa...
trusted_official_docs
CPython Docs
How to handle non-UTF-8 text encodings ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might fail for other encodings and invalid UTF-8. You can use a custom :attr:`~Connection.text_fa...
How to handle non-UTF-8 text encodings ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might fail for other encodings and invalid UTF-8. You can use a custom :attr:`~Connection.text_fa...
python, official-docs, cpython, P0
Local_Trusted_Corpus
230c8293-ab92-4bc5-ad9e-1a33efe86f4d
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,382
supabase-export-v2
8dd7545507ce3968
Each row is a two-item :class:`tuple` of ``(year, title)``, matching the columns selected in the query. Finally, verify that the database has been written to disk by calling :meth:`con.close() <Connection.close>` to close the existing connection, opening a new one, creating a new cursor, then querying the database:
trusted_official_docs
CPython Docs
Each row is a two-item :class:`tuple` of ``(year, title)``, matching the columns selected in the query. Finally, verify that the database has been written to disk by calling :meth:`con.close() <Connection.close>` to close the existing connection, opening a new one, creating a new cursor, then querying the database:
Each row is a two-item :class:`tuple` of ``(year, title)``, matching the columns selected in the query. Finally, verify that the database has been written to disk by calling :meth:`con.close() <Connection.close>` to close the existing connection, opening a new one, creating a new cursor, then querying the database:
python, official-docs, cpython, P0
Local_Trusted_Corpus
2396f8b5-61cf-48bb-9d7f-f680fb9b3f4d
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,414
supabase-export-v2
e7b95c0fbffa09e5
.. function:: complete_statement(statement) Return ``True`` if the string *statement* appears to contain one or more complete SQL statements. No syntactic verification or parsing of any kind is performed, other than checking that there are no unclosed string literals and the statement is terminated by a semicolon.
trusted_official_docs
CPython Docs
.. function:: complete_statement(statement) Return ``True`` if the string *statement* appears to contain one or more complete SQL statements. No syntactic verification or parsing of any kind is performed, other than checking that there are no unclosed string literals and the statement is terminated by a semicolon.
.. function:: complete_statement(statement) Return ``True`` if the string *statement* appears to contain one or more complete SQL statements. No syntactic verification or parsing of any kind is performed, other than checking that there are no unclosed string literals and the statement is terminated by a semicolon.
python, official-docs, cpython, P0
Local_Trusted_Corpus
23f8cd67-e63e-4742-bf9f-5e304ece45e6
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,353
supabase-export-v2
66cb3c669fce60bb
The returned :class:`Connection` object ``con`` represents the connection to the on-disk database. In order to execute SQL statements and fetch results from SQL queries, we will need to use a database cursor. Call :meth:`con.cursor() <Connection.cursor>` to create the :class:`Cursor`:
trusted_official_docs
CPython Docs
The returned :class:`Connection` object ``con`` represents the connection to the on-disk database. In order to execute SQL statements and fetch results from SQL queries, we will need to use a database cursor. Call :meth:`con.cursor() <Connection.cursor>` to create the :class:`Cursor`:
The returned :class:`Connection` object ``con`` represents the connection to the on-disk database. In order to execute SQL statements and fetch results from SQL queries, we will need to use a database cursor. Call :meth:`con.cursor() <Connection.cursor>` to create the :class:`Cursor`:
python, official-docs, cpython, P0
Local_Trusted_Corpus
2443b771-bf84-43fb-8326-30a1f33e0a82
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,962
supabase-export-v2
42449c6237c7b94d
If there is no open transaction upon leaving the body of the ``with`` statement, or if :attr:`~Connection.autocommit` is ``True``, the context manager does nothing. .. note:: The context manager neither implicitly opens a new transaction nor closes the connection. If you need a closing context manager, consider usin...
trusted_official_docs
CPython Docs
If there is no open transaction upon leaving the body of the ``with`` statement, or if :attr:`~Connection.autocommit` is ``True``, the context manager does nothing. .. note:: The context manager neither implicitly opens a new transaction nor closes the connection. If you need a closing context manager, consider usin...
If there is no open transaction upon leaving the body of the ``with`` statement, or if :attr:`~Connection.autocommit` is ``True``, the context manager does nothing. .. note:: The context manager neither implicitly opens a new transaction nor closes the connection. If you need a closing context manager, consider usin...
python, official-docs, cpython, P0
Local_Trusted_Corpus
24d9427d-9a14-4fcb-b5b8-6cc686594107
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,757
supabase-export-v2
f45592ae5295c26a
.. method:: fetchall() Return all (remaining) rows of a query result as a :class:`list`. Return an empty list if no rows are available. Note that the :attr:`arraysize` attribute can affect the performance of this operation.
trusted_official_docs
CPython Docs
.. method:: fetchall() Return all (remaining) rows of a query result as a :class:`list`. Return an empty list if no rows are available. Note that the :attr:`arraysize` attribute can affect the performance of this operation.
.. method:: fetchall() Return all (remaining) rows of a query result as a :class:`list`. Return an empty list if no rows are available. Note that the :attr:`arraysize` attribute can affect the performance of this operation.
python, official-docs, cpython, P0
Local_Trusted_Corpus
25c4b81c-3f43-460d-b2b8-e3988d4a9396
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,952
supabase-export-v2
234bd59d5b0282d3
.. testcode:: # Create and fill the table. con = sqlite3.connect(":memory:") con.execute("CREATE TABLE lang(name, first_appeared)") data = [ ("C++", 1985), ("Objective-C", 1984), ] con.executemany("INSERT INTO lang(name, first_appeared) VALUES(?, ?)", data)
trusted_official_docs
CPython Docs
.. testcode:: # Create and fill the table. con = sqlite3.connect(":memory:") con.execute("CREATE TABLE lang(name, first_appeared)") data = [ ("C++", 1985), ("Objective-C", 1984), ] con.executemany("INSERT INTO lang(name, first_appeared) VALUES(?, ?)", data)
.. testcode:: # Create and fill the table. con = sqlite3.connect(":memory:") con.execute("CREATE TABLE lang(name, first_appeared)") data = [ ("C++", 1985), ("Objective-C", 1984), ] con.executemany("INSERT INTO lang(name, first_appeared) VALUES(?, ?)", data)
python, official-docs, cpython, P0
Local_Trusted_Corpus
25d70a1e-df50-4806-9d8b-dd4d22f19a68
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,386
supabase-export-v2
5f7cd7b3299d3414
You've now created an SQLite database using the :mod:`!sqlite3` module, inserted data and retrieved values from it in multiple ways. .. _SQL injection attacks: https://en.wikipedia.org/wiki/SQL_injection .. _The Schema Table: https://www.sqlite.org/schematab.html .. _cursors: https://en.wikipedia.org/wiki/Cursor_(datab...
trusted_official_docs
CPython Docs
You've now created an SQLite database using the :mod:`!sqlite3` module, inserted data and retrieved values from it in multiple ways. .. _SQL injection attacks: https://en.wikipedia.org/wiki/SQL_injection .. _The Schema Table: https://www.sqlite.org/schematab.html .. _cursors: https://en.wikipedia.org/wiki/Cursor_(datab...
You've now created an SQLite database using the :mod:`!sqlite3` module, inserted data and retrieved values from it in multiple ways. .. _SQL injection attacks: https://en.wikipedia.org/wiki/SQL_injection .. _The Schema Table: https://www.sqlite.org/schematab.html .. _cursors: https://en.wikipedia.org/wiki/Cursor_(datab...
python, official-docs, cpython, P0
Local_Trusted_Corpus
265a5039-7fc6-4eda-a8dc-d716f4521acc
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
4,037
supabase-export-v2
8eb4a57220ee8f5b
The :meth:`~Cursor.executescript` method implicitly commits any pending transaction before execution of the given SQL script, regardless of the value of :attr:`~Connection.isolation_level`. .. versionchanged:: 3.6 :mod:`!sqlite3` used to implicitly commit an open transaction before DDL statements. This is no longer t...
trusted_official_docs
CPython Docs
The :meth:`~Cursor.executescript` method implicitly commits any pending transaction before execution of the given SQL script, regardless of the value of :attr:`~Connection.isolation_level`. .. versionchanged:: 3.6 :mod:`!sqlite3` used to implicitly commit an open transaction before DDL statements. This is no longer t...
The :meth:`~Cursor.executescript` method implicitly commits any pending transaction before execution of the given SQL script, regardless of the value of :attr:`~Connection.isolation_level`. .. versionchanged:: 3.6 :mod:`!sqlite3` used to implicitly commit an open transaction before DDL statements. This is no longer t...
python, official-docs, cpython, P0
Local_Trusted_Corpus
276e18ae-d53f-4827-b07e-7b4d49b7f64c
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
4,035
supabase-export-v2
e9e91d46eb37c7b4
can choose the underlying `SQLite transaction behaviour`_ — that is, whether and what type of ``BEGIN`` statements :mod:`!sqlite3` implicitly executes – via the :attr:`~Connection.isolation_level` attribute. If :attr:`~Connection.isolation_level` is set to ``None``, no transactions are implicitly opened at all. This le...
trusted_official_docs
CPython Docs
can choose the underlying `SQLite transaction behaviour`_ — that is, whether and what type of ``BEGIN`` statements :mod:`!sqlite3` implicitly executes – via the :attr:`~Connection.isolation_level` attribute. If :attr:`~Connection.isolation_level` is set to ``None``, no transactions are implicitly opened at all. This le...
can choose the underlying `SQLite transaction behaviour`_ — that is, whether and what type of ``BEGIN`` statements :mod:`!sqlite3` implicitly executes – via the :attr:`~Connection.isolation_level` attribute. If :attr:`~Connection.isolation_level` is set to ``None``, no transactions are implicitly opened at all. This le...
python, official-docs, cpython, P0
Local_Trusted_Corpus
2b121189-7b65-48b1-8d13-86a31d6909ae
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,576
supabase-export-v2
f618b227cdec2b83
Returning a non-zero value from the handler function will terminate the currently executing query and cause it to raise a :exc:`DatabaseError` exception. .. versionchanged:: 3.15 The first parameter is now positional-only.
trusted_official_docs
CPython Docs
Returning a non-zero value from the handler function will terminate the currently executing query and cause it to raise a :exc:`DatabaseError` exception. .. versionchanged:: 3.15 The first parameter is now positional-only.
Returning a non-zero value from the handler function will terminate the currently executing query and cause it to raise a :exc:`DatabaseError` exception. .. versionchanged:: 3.15 The first parameter is now positional-only.
python, official-docs, cpython, P0
Local_Trusted_Corpus
2b4a2c81-9c11-46f4-86e9-12c54f18c87d
CPython Docs
file://datasets/cpython/Doc/library/sqlite3.rst
unknown
f609689a-7ecb-41dc-8f88-bd517d46a50a
3,777
supabase-export-v2
4018011edd7de386
other statements, after :meth:`executemany` or :meth:`executescript`, or if the insertion failed, the value of ``lastrowid`` is left unchanged. The initial value of ``lastrowid`` is ``None``. .. note:: Inserts into ``WITHOUT ROWID`` tables are not recorded.
trusted_official_docs
CPython Docs
other statements, after :meth:`executemany` or :meth:`executescript`, or if the insertion failed, the value of ``lastrowid`` is left unchanged. The initial value of ``lastrowid`` is ``None``. .. note:: Inserts into ``WITHOUT ROWID`` tables are not recorded.
other statements, after :meth:`executemany` or :meth:`executescript`, or if the insertion failed, the value of ``lastrowid`` is left unchanged. The initial value of ``lastrowid`` is ``None``. .. note:: Inserts into ``WITHOUT ROWID`` tables are not recorded.
python, official-docs, cpython, P0
Local_Trusted_Corpus