repo_id
stringclasses
400 values
commit_sha
stringclasses
400 values
commit_index
int32
0
951
in_repo_split
stringclasses
1 value
cross_repo_split
stringclasses
1 value
test_file
stringlengths
7
121
test_function
stringlengths
1
108
assertion_type
stringclasses
32 values
difficulty
stringclasses
8 values
context_lines
int32
3
600
prefix
large_stringlengths
44
113k
target
large_stringlengths
1
498
anchor_sha
stringclasses
400 values
anchor_index
int32
0
951
qna_source
stringclasses
1 value
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/ocr-numbers/ocr_numbers_test.py
test_recognizes_1
self.assertEqual
string_literal
11
import unittest from ocr_numbers import ( convert, ) class OcrNumbersTest(unittest.TestCase): def test_recognizes_1(self): self.assertEqual(convert([" ", " |", " |", " "]),
"1")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/ocr-numbers/ocr_numbers_test.py
test_unreadable_but_correctly_sized_inputs_return
self.assertEqual
string_literal
11
import unittest from ocr_numbers import ( convert, ) class OcrNumbersTest(unittest.TestCase): def test_unreadable_but_correctly_sized_inputs_return(self): self.assertEqual(convert([" ", " _", " |", " "]),
"?")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/ocr-numbers/ocr_numbers_test.py
test_recognizes_2
self.assertEqual
string_literal
11
import unittest from ocr_numbers import ( convert, ) class OcrNumbersTest(unittest.TestCase): def test_recognizes_2(self): self.assertEqual(convert([" _ ", " _|", "|_ ", " "]),
"2")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/ocr-numbers/ocr_numbers_test.py
test_recognizes_3
self.assertEqual
string_literal
11
import unittest from ocr_numbers import ( convert, ) class OcrNumbersTest(unittest.TestCase): def test_recognizes_3(self): self.assertEqual(convert([" _ ", " _|", " _|", " "]),
"3")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/ocr-numbers/ocr_numbers_test.py
test_recognizes_4
self.assertEqual
string_literal
11
import unittest from ocr_numbers import ( convert, ) class OcrNumbersTest(unittest.TestCase): def test_recognizes_4(self): self.assertEqual(convert([" ", "|_|", " |", " "]),
"4")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/ocr-numbers/ocr_numbers_test.py
test_recognizes_5
self.assertEqual
string_literal
11
import unittest from ocr_numbers import ( convert, ) class OcrNumbersTest(unittest.TestCase): def test_recognizes_5(self): self.assertEqual(convert([" _ ", "|_ ", " _|", " "]),
"5")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/ocr-numbers/ocr_numbers_test.py
test_recognizes_6
self.assertEqual
string_literal
11
import unittest from ocr_numbers import ( convert, ) class OcrNumbersTest(unittest.TestCase): def test_recognizes_6(self): self.assertEqual(convert([" _ ", "|_ ", "|_|", " "]),
"6")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/ocr-numbers/ocr_numbers_test.py
test_recognizes_7
self.assertEqual
string_literal
11
import unittest from ocr_numbers import ( convert, ) class OcrNumbersTest(unittest.TestCase): def test_recognizes_7(self): self.assertEqual(convert([" _ ", " |", " |", " "]),
"7")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/ocr-numbers/ocr_numbers_test.py
test_recognizes_8
self.assertEqual
string_literal
11
import unittest from ocr_numbers import ( convert, ) class OcrNumbersTest(unittest.TestCase): def test_recognizes_8(self): self.assertEqual(convert([" _ ", "|_|", "|_|", " "]),
"8")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/ocr-numbers/ocr_numbers_test.py
test_recognizes_9
self.assertEqual
string_literal
11
import unittest from ocr_numbers import ( convert, ) class OcrNumbersTest(unittest.TestCase): def test_recognizes_9(self): self.assertEqual(convert([" _ ", "|_|", " _|", " "]),
"9")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/raindrops/raindrops_test.py
test_the_sound_for_1_is_1
self.assertEqual
string_literal
10
import unittest from raindrops import ( convert, ) class RaindropsTest(unittest.TestCase): def test_the_sound_for_1_is_1(self): self.assertEqual(convert(1),
"1")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/raindrops/raindrops_test.py
test_2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base
self.assertEqual
string_literal
13
import unittest from raindrops import ( convert, ) class RaindropsTest(unittest.TestCase): def test_2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base( self, ): self.assertEqual(convert(8),
"8")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/rna-transcription/rna_transcription_test.py
test_rna_complement_of_cytosine_is_guanine
self.assertEqual
string_literal
11
import unittest from rna_transcription import ( to_rna, ) class RnaTranscriptionTest(unittest.TestCase): def test_rna_complement_of_cytosine_is_guanine(self): self.assertEqual(to_rna("C"),
"G")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/rna-transcription/rna_transcription_test.py
test_rna_complement_of_guanine_is_cytosine
self.assertEqual
string_literal
11
import unittest from rna_transcription import ( to_rna, ) class RnaTranscriptionTest(unittest.TestCase): def test_rna_complement_of_guanine_is_cytosine(self): self.assertEqual(to_rna("G"),
"C")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/rna-transcription/rna_transcription_test.py
test_rna_complement_of_thymine_is_adenine
self.assertEqual
string_literal
11
import unittest from rna_transcription import ( to_rna, ) class RnaTranscriptionTest(unittest.TestCase): def test_rna_complement_of_thymine_is_adenine(self): self.assertEqual(to_rna("T"),
"A")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/rna-transcription/rna_transcription_test.py
test_rna_complement_of_adenine_is_uracil
self.assertEqual
string_literal
11
import unittest from rna_transcription import ( to_rna, ) class RnaTranscriptionTest(unittest.TestCase): def test_rna_complement_of_adenine_is_uracil(self): self.assertEqual(to_rna("A"),
"U")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/roman-numerals/roman_numerals_test.py
test_1_is_i
self.assertEqual
string_literal
10
import unittest from roman_numerals import ( roman, ) class RomanNumeralsTest(unittest.TestCase): def test_1_is_i(self): self.assertEqual(roman(1),
"I")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/roman-numerals/roman_numerals_test.py
test_5_is_v
self.assertEqual
string_literal
11
import unittest from roman_numerals import ( roman, ) class RomanNumeralsTest(unittest.TestCase): def test_5_is_v(self): self.assertEqual(roman(5),
"V")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/rotational-cipher/rotational_cipher_test.py
test_rotate_a_by_0_same_output_as_input
self.assertEqual
string_literal
10
import unittest from rotational_cipher import ( rotate, ) class RotationalCipherTest(unittest.TestCase): def test_rotate_a_by_0_same_output_as_input(self): self.assertEqual(rotate("a", 0),
"a")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/rotational-cipher/rotational_cipher_test.py
test_rotate_a_by_1
self.assertEqual
string_literal
11
import unittest from rotational_cipher import ( rotate, ) class RotationalCipherTest(unittest.TestCase): def test_rotate_a_by_1(self): self.assertEqual(rotate("a", 1),
"b")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/rotational-cipher/rotational_cipher_test.py
test_rotate_m_by_13
self.assertEqual
string_literal
11
import unittest from rotational_cipher import ( rotate, ) class RotationalCipherTest(unittest.TestCase): def test_rotate_m_by_13(self): self.assertEqual(rotate("m", 13),
"z")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/acronym/acronym_test.py
test_apostrophes
self.assertEqual
string_literal
11
import unittest from acronym import ( abbreviate, ) class AcronymTest(unittest.TestCase): def test_apostrophes(self): self.assertEqual(abbreviate("Halley's Comet"),
"HC")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/affine-cipher/affine_cipher_test.py
test_encode_no
self.assertEqual
string_literal
12
import unittest from affine_cipher import ( decode, encode, ) class AffineCipherTest(unittest.TestCase): def test_encode_no(self): self.assertEqual(encode("no", 15, 18),
"fu")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/atbash-cipher/atbash_cipher_test.py
test_encode_no
self.assertEqual
string_literal
12
import unittest from atbash_cipher import ( decode, encode, ) class AtbashCipherTest(unittest.TestCase): def test_encode_no(self): self.assertEqual(encode("no"),
"ml")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/raindrops/raindrops_test.py
test_the_sound_for_52_is_52
self.assertEqual
string_literal
11
import unittest from raindrops import ( convert, ) class RaindropsTest(unittest.TestCase): def test_the_sound_for_52_is_52(self): self.assertEqual(convert(52),
"52")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/roman-numerals/roman_numerals_test.py
test_2_is_ii
self.assertEqual
string_literal
11
import unittest from roman_numerals import ( roman, ) class RomanNumeralsTest(unittest.TestCase): def test_2_is_ii(self): self.assertEqual(roman(2),
"II")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/roman-numerals/roman_numerals_test.py
test_4_is_iv
self.assertEqual
string_literal
11
import unittest from roman_numerals import ( roman, ) class RomanNumeralsTest(unittest.TestCase): def test_4_is_iv(self): self.assertEqual(roman(4),
"IV")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/roman-numerals/roman_numerals_test.py
test_6_is_vi
self.assertEqual
string_literal
11
import unittest from roman_numerals import ( roman, ) class RomanNumeralsTest(unittest.TestCase): def test_6_is_vi(self): self.assertEqual(roman(6),
"VI")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/roman-numerals/roman_numerals_test.py
test_9_is_ix
self.assertEqual
string_literal
11
import unittest from roman_numerals import ( roman, ) class RomanNumeralsTest(unittest.TestCase): def test_9_is_ix(self): self.assertEqual(roman(9),
"IX")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/acronym/acronym_test.py
test_basic
self.assertEqual
string_literal
10
import unittest from acronym import ( abbreviate, ) class AcronymTest(unittest.TestCase): def test_basic(self): self.assertEqual(abbreviate("Portable Network Graphics"),
"PNG")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/acronym/acronym_test.py
test_lowercase_words
self.assertEqual
string_literal
11
import unittest from acronym import ( abbreviate, ) class AcronymTest(unittest.TestCase): def test_lowercase_words(self): self.assertEqual(abbreviate("Ruby on Rails"),
"ROR")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/affine-cipher/affine_cipher_test.py
test_encode_yes
self.assertEqual
string_literal
11
import unittest from affine_cipher import ( decode, encode, ) class AffineCipherTest(unittest.TestCase): def test_encode_yes(self): self.assertEqual(encode("yes", 5, 7),
"xbt")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/affine-cipher/affine_cipher_test.py
test_encode_omg
self.assertEqual
string_literal
12
import unittest from affine_cipher import ( decode, encode, ) class AffineCipherTest(unittest.TestCase): def test_encode_omg(self): self.assertEqual(encode("OMG", 21, 3),
"lvz")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/affine-cipher/affine_cipher_test.py
test_encode_o_m_g
self.assertEqual
string_literal
12
import unittest from affine_cipher import ( decode, encode, ) class AffineCipherTest(unittest.TestCase): def test_encode_o_m_g(self): self.assertEqual(encode("O M G", 25, 47),
"hjp")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/atbash-cipher/atbash_cipher_test.py
test_encode_yes
self.assertEqual
string_literal
11
import unittest from atbash_cipher import ( decode, encode, ) class AtbashCipherTest(unittest.TestCase): def test_encode_yes(self): self.assertEqual(encode("yes"),
"bvh")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/atbash-cipher/atbash_cipher_test.py
test_encode_omg
self.assertEqual
string_literal
12
import unittest from atbash_cipher import ( decode, encode, ) class AtbashCipherTest(unittest.TestCase): def test_encode_omg(self): self.assertEqual(encode("OMG"),
"lnt")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/hangman/hangman_test.py
test_initially_no_letters_are_guessed
self.assertEqual
string_literal
12
import unittest import hangman from hangman import Hangman class HangmanTests(unittest.TestCase): def test_initially_no_letters_are_guessed(self): game = Hangman('foo') self.assertEqual(game.get_masked_word(),
'___')
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/hangman/hangman_test.py
test_winning_on_last_guess_still_counts_as_a_win
self.assertEqual
string_literal
16
import unittest import hangman from hangman import Hangman class HangmanTests(unittest.TestCase): def test_winning_on_last_guess_still_counts_as_a_win(self): game = Hangman('aaa') for ch in 'bcdefghij': game.guess(ch) game.guess('a') self.assertEqual(game.remaining_gue...
'aaa')
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/phone-number/phone_number_test.py
test_area_code
self.assertEqual
string_literal
12
import unittest from phone_number import ( PhoneNumber, ) class PhoneNumberTest(unittest.TestCase): def test_area_code(self): number = PhoneNumber("2234567890") self.assertEqual(number.area_code,
"223")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/roman-numerals/roman_numerals_test.py
test_3_is_iii
self.assertEqual
string_literal
11
import unittest from roman_numerals import ( roman, ) class RomanNumeralsTest(unittest.TestCase): def test_3_is_iii(self): self.assertEqual(roman(3),
"III")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/roman-numerals/roman_numerals_test.py
test_59_is_lix
self.assertEqual
string_literal
11
import unittest from roman_numerals import ( roman, ) class RomanNumeralsTest(unittest.TestCase): def test_59_is_lix(self): self.assertEqual(roman(59),
"LIX")
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
exercism/python
3e40a4faed41663622954e0617b05590d1c1ce43
951
train
train
exercises/practice/alphametics/alphametics_test.py
test_solution_must_have_unique_value_for_each_letter
self.assertEqual
none_literal
11
import unittest from alphametics import ( solve, ) class AlphameticsTest(unittest.TestCase): def test_solution_must_have_unique_value_for_each_letter(self): self.assertEqual(solve("A == B"),
None)
3e40a4faed41663622954e0617b05590d1c1ce43
951
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_component.py
test_component_attributes_ents
assert
numeric_literal
22
import pytest import numpy from spacy.vocab import Vocab from spacy.tokens import Doc, Span from sense2vec import Sense2VecComponent def doc(): vocab = Vocab() doc = Doc(vocab, words=["hello", "world"]) doc[0].pos_ = "INTJ" doc[1].pos_ = "NOUN" return doc def test_component_attributes_ents(doc): ...
0
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_component.py
test_component_attributes_ents
assert
numeric_literal
24
import pytest import numpy from spacy.vocab import Vocab from spacy.tokens import Doc, Span from sense2vec import Sense2VecComponent def doc(): vocab = Vocab() doc = Doc(vocab, words=["hello", "world"]) doc[0].pos_ = "INTJ" doc[1].pos_ = "NOUN" return doc def test_component_attributes_ents(doc): ...
1
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_component.py
test_component_attributes
assert
numeric_literal
25
import pytest import numpy from spacy.vocab import Vocab from spacy.tokens import Doc, Span from sense2vec import Sense2VecComponent def doc(): vocab = Vocab() doc = Doc(vocab, words=["hello", "world"]) doc[0].pos_ = "INTJ" doc[1].pos_ = "NOUN" return doc def test_component_attributes(doc): s2...
123
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_component.py
test_component_similarity
assert
numeric_literal
22
import pytest import numpy from spacy.vocab import Vocab from spacy.tokens import Doc, Span from sense2vec import Sense2VecComponent def doc(): vocab = Vocab() doc = Doc(vocab, words=["hello", "world"]) doc[0].pos_ = "INTJ" doc[1].pos_ = "NOUN" return doc def test_component_similarity(doc): s2...
1.0
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_component.py
test_component_attributes
assert
bool_literal
23
import pytest import numpy from spacy.vocab import Vocab from spacy.tokens import Doc, Span from sense2vec import Sense2VecComponent def doc(): vocab = Vocab() doc = Doc(vocab, words=["hello", "world"]) doc[0].pos_ = "INTJ" doc[1].pos_ = "NOUN" return doc def test_component_attributes(doc): s2...
True
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_component.py
test_component_attributes
assert
none_literal
24
import pytest import numpy from spacy.vocab import Vocab from spacy.tokens import Doc, Span from sense2vec import Sense2VecComponent def doc(): vocab = Vocab() doc = Doc(vocab, words=["hello", "world"]) doc[0].pos_ = "INTJ" doc[1].pos_ = "NOUN" return doc def test_component_attributes(doc): s2...
None
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_component.py
test_component_attributes
assert
bool_literal
22
import pytest import numpy from spacy.vocab import Vocab from spacy.tokens import Doc, Span from sense2vec import Sense2VecComponent def doc(): vocab = Vocab() doc = Doc(vocab, words=["hello", "world"]) doc[0].pos_ = "INTJ" doc[1].pos_ = "NOUN" return doc def test_component_attributes(doc): s2...
False
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_component.py
test_component_lemmatize
assert
string_literal
29
import pytest import numpy from spacy.vocab import Vocab from spacy.tokens import Doc, Span from sense2vec import Sense2VecComponent def doc(): vocab = Vocab() doc = Doc(vocab, words=["hello", "world"]) doc[0].pos_ = "INTJ" doc[1].pos_ = "NOUN" return doc def test_component_lemmatize(doc): loo...
"hll"
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_component.py
test_component_lemmatize
assert
string_literal
26
import pytest import numpy from spacy.vocab import Vocab from spacy.tokens import Doc, Span from sense2vec import Sense2VecComponent def doc(): vocab = Vocab() doc = Doc(vocab, words=["hello", "world"]) doc[0].pos_ = "INTJ" doc[1].pos_ = "NOUN" return doc def test_component_lemmatize(doc): loo...
"wrld"
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_component.py
test_component_to_from_bytes
assert
complex_expr
20
import pytest import numpy from spacy.vocab import Vocab from spacy.tokens import Doc, Span from sense2vec import Sense2VecComponent def doc(): vocab = Vocab() doc = Doc(vocab, words=["hello", "world"]) doc[0].pos_ = "INTJ" doc[1].pos_ = "NOUN" return doc def test_component_to_from_bytes(doc): ...
s2v.s2v
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_component.py
test_component_lemmatize
assert
string_literal
32
import pytest import numpy from spacy.vocab import Vocab from spacy.tokens import Doc, Span from sense2vec import Sense2VecComponent def doc(): vocab = Vocab() doc = Doc(vocab, words=["hello", "world"]) doc[0].pos_ = "INTJ" doc[1].pos_ = "NOUN" return doc def test_component_lemmatize(doc): loo...
"hll|INTJ"
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_component.py
test_component_attributes_ents
assert
string_literal
26
import pytest import numpy from spacy.vocab import Vocab from spacy.tokens import Doc, Span from sense2vec import Sense2VecComponent def doc(): vocab = Vocab() doc = Doc(vocab, words=["hello", "world"]) doc[0].pos_ = "INTJ" doc[1].pos_ = "NOUN" return doc def test_component_attributes_ents(doc): ...
"world|GPE"
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_model.py
test_model_other_senses
assert
numeric_literal
13
import pytest from pathlib import Path from sense2vec import Sense2Vec import numpy def s2v(): data_path = Path(__file__).parent / "data" return Sense2Vec().from_disk(data_path) def test_model_other_senses(s2v): others = s2v.get_other_senses("duck|NOUN") assert len(others) ==
1
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_model.py
test_model_most_similar
assert
variable
13
import pytest from pathlib import Path from sense2vec import Sense2Vec import numpy def s2v(): data_path = Path(__file__).parent / "data" return Sense2Vec().from_disk(data_path) def test_model_most_similar(s2v): s2v.cache = None assert "beekeepers|NOUN" in
s2v
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_model.py
test_model_most_similar_cache
assert
numeric_literal
23
import pytest from pathlib import Path from sense2vec import Sense2Vec import numpy def s2v(): data_path = Path(__file__).parent / "data" return Sense2Vec().from_disk(data_path) def test_model_most_similar_cache(s2v): query = "beekeepers|NOUN" assert s2v.cache assert query in s2v # Modify cach...
2.0
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_model.py
test_model_most_similar_cache
assert
numeric_literal
25
import pytest from pathlib import Path from sense2vec import Sense2Vec import numpy def s2v(): data_path = Path(__file__).parent / "data" return Sense2Vec().from_disk(data_path) def test_model_most_similar_cache(s2v): query = "beekeepers|NOUN" assert s2v.cache assert query in s2v # Modify cach...
3.0
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_model.py
test_model_other_senses
assert
string_literal
14
import pytest from pathlib import Path from sense2vec import Sense2Vec import numpy def s2v(): data_path = Path(__file__).parent / "data" return Sense2Vec().from_disk(data_path) def test_model_other_senses(s2v): others = s2v.get_other_senses("duck|NOUN") assert len(others) == 1 assert others[0] =...
"duck|VERB"
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_model.py
test_model_best_sense
assert
string_literal
12
import pytest from pathlib import Path from sense2vec import Sense2Vec import numpy def s2v(): data_path = Path(__file__).parent / "data" return Sense2Vec().from_disk(data_path) def test_model_best_sense(s2v): assert s2v.get_best_sense("duck") ==
"duck|NOUN"
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_model.py
test_model_most_similar
assert
string_literal
15
import pytest from pathlib import Path from sense2vec import Sense2Vec import numpy def s2v(): data_path = Path(__file__).parent / "data" return Sense2Vec().from_disk(data_path) def test_model_most_similar(s2v): s2v.cache = None assert "beekeepers|NOUN" in s2v ((key1, _), (key2, _)) = s2v.most_sim...
"honey_bees|NOUN"
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_model.py
test_model_most_similar
assert
string_literal
16
import pytest from pathlib import Path from sense2vec import Sense2Vec import numpy def s2v(): data_path = Path(__file__).parent / "data" return Sense2Vec().from_disk(data_path) def test_model_most_similar(s2v): s2v.cache = None assert "beekeepers|NOUN" in s2v ((key1, _), (key2, _)) = s2v.most_sim...
"Beekeepers|NOUN"
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_freqs
assert
numeric_literal
11
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_freqs(): s2v = Sense2Vec(shape=(10, 4)) vector = numpy.asarray([4, 2, 2, 2], dtype=numpy.float32) s2v.add("test1", vector, 123) s2v.add("test2", vector, 456) assert len(s2v.freqs) ==
2
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_most_similar
assert
numeric_literal
24
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_most_similar(): s2v = Sense2Vec(shape=(6, 4)) s2v.add("a", numpy.asarray([4, 2, 2, 2], dtype=numpy.float32)) s2v.add("b", numpy.asarray([4, 4, 2, 2], dtype=numpy.float32)) s2v.add("c", numpy.asarray([4, 4, 4, 2], dt...
3
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_most_similar
assert
numeric_literal
26
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_most_similar(): s2v = Sense2Vec(shape=(6, 4)) s2v.add("a", numpy.asarray([4, 2, 2, 2], dtype=numpy.float32)) s2v.add("b", numpy.asarray([4, 4, 2, 2], dtype=numpy.float32)) s2v.add("c", numpy.asarray([4, 4, 4, 2], dt...
4
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_to_from_bytes
assert
numeric_literal
25
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_to_from_bytes(): s2v = Sense2Vec(shape=(2, 4)) test_vector1 = numpy.asarray([1, 2, 3, 4], dtype=numpy.float32) test_vector2 = numpy.asarray([5, 6, 7, 8], dtype=numpy.float32) s2v.add("test1", test_vector1, 123) ...
0
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_object
assert
numeric_literal
9
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_object(): s2v = Sense2Vec(shape=(10, 4)) assert s2v.vectors.shape == (10, 4) assert len(s2v) ==
10
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_other_senses
assert
collection
16
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_other_senses(): s2v = Sense2Vec(shape=(6, 4)) s2v.cfg["senses"] = ["A", "B", "C", "D"] for key in ["a|A", "a|B", "a|C", "b|A", "b|C", "c|A"]: s2v.add(key, numpy.asarray([4, 2, 2, 2], dtype=numpy.float32)) ot...
[]
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_object
assert
variable
12
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_object(): s2v = Sense2Vec(shape=(10, 4)) assert s2v.vectors.shape == (10, 4) assert len(s2v) == 10 test_vector = numpy.asarray([4, 2, 2, 2], dtype=numpy.float32) s2v.add("test", test_vector) assert "test" i...
s2v
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_freqs
assert
numeric_literal
12
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_freqs(): s2v = Sense2Vec(shape=(10, 4)) vector = numpy.asarray([4, 2, 2, 2], dtype=numpy.float32) s2v.add("test1", vector, 123) s2v.add("test2", vector, 456) assert len(s2v.freqs) == 2 assert s2v.get_freq("...
123
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_freqs
assert
numeric_literal
13
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_freqs(): s2v = Sense2Vec(shape=(10, 4)) vector = numpy.asarray([4, 2, 2, 2], dtype=numpy.float32) s2v.add("test1", vector, 123) s2v.add("test2", vector, 456) assert len(s2v.freqs) == 2 assert s2v.get_freq("t...
456
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_freqs
assert
numeric_literal
15
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_freqs(): s2v = Sense2Vec(shape=(10, 4)) vector = numpy.asarray([4, 2, 2, 2], dtype=numpy.float32) s2v.add("test1", vector, 123) s2v.add("test2", vector, 456) assert len(s2v.freqs) == 2 assert s2v.get_freq("t...
100
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_freqs
assert
numeric_literal
17
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_freqs(): s2v = Sense2Vec(shape=(10, 4)) vector = numpy.asarray([4, 2, 2, 2], dtype=numpy.float32) s2v.add("test1", vector, 123) s2v.add("test2", vector, 456) assert len(s2v.freqs) == 2 assert s2v.get_freq("t...
200
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_similarity
assert
numeric_literal
13
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_similarity(): s2v = Sense2Vec(shape=(5, 4)) s2v.add("a", numpy.asarray([4, 4, 2, 2], dtype=numpy.float32)) s2v.add("b", numpy.asarray([4, 4, 2, 2], dtype=numpy.float32)) s2v.add("c", numpy.asarray([4, 4, 4, 2], dtyp...
1.0
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_sense2vec.py
test_sense2vec_similarity
assert
numeric_literal
17
import pytest import numpy from sense2vec import Sense2Vec, registry def test_sense2vec_similarity(): s2v = Sense2Vec(shape=(5, 4)) s2v.add("a", numpy.asarray([4, 4, 2, 2], dtype=numpy.float32)) s2v.add("b", numpy.asarray([4, 4, 2, 2], dtype=numpy.float32)) s2v.add("c", numpy.asarray([4, 4, 4, 2], dtyp...
0.8
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_util.py
test_get_true_cased_text
assert
string_literal
27
import pytest from spacy.tokens import Doc, Span from spacy.vocab import Vocab from sense2vec.util import get_true_cased_text, make_key, split_key def get_doc(vocab, words, spaces, pos): doc = Doc(vocab, words=words, spaces=spaces) for i, pos_tag in enumerate(pos): doc[i].pos_ = pos_tag return doc ...
"I"
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_util.py
test_get_true_cased_text
assert
string_literal
35
import pytest from spacy.tokens import Doc, Span from spacy.vocab import Vocab from sense2vec.util import get_true_cased_text, make_key, split_key def get_doc(vocab, words, spaces, pos): doc = Doc(vocab, words=words, spaces=spaces) for i, pos_tag in enumerate(pos): doc[i].pos_ = pos_tag return doc ...
"you"
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_util.py
test_get_true_cased_text
assert
string_literal
20
import pytest from spacy.tokens import Doc, Span from spacy.vocab import Vocab from sense2vec.util import get_true_cased_text, make_key, split_key def get_doc(vocab, words, spaces, pos): doc = Doc(vocab, words=words, spaces=spaces) for i, pos_tag in enumerate(pos): doc[i].pos_ = pos_tag return doc ...
"cool"
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_util.py
test_get_true_cased_text
assert
string_literal
36
import pytest from spacy.tokens import Doc, Span from spacy.vocab import Vocab from sense2vec.util import get_true_cased_text, make_key, split_key def get_doc(vocab, words, spaces, pos): doc = Doc(vocab, words=words, spaces=spaces) for i, pos_tag in enumerate(pos): doc[i].pos_ = pos_tag return doc ...
"Obama"
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_util.py
test_make_split_key
assert
variable
22
import pytest from spacy.tokens import Doc, Span from spacy.vocab import Vocab from sense2vec.util import get_true_cased_text, make_key, split_key def get_doc(vocab, words, spaces, pos): doc = Doc(vocab, words=words, spaces=spaces) for i, pos_tag in enumerate(pos): doc[i].pos_ = pos_tag return doc ...
expected
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/sense2vec
0c0965f18c589a917474df32dae1047489fa6304
15
train
train
tests/test_util.py
test_make_split_key
assert
collection
23
import pytest from spacy.tokens import Doc, Span from spacy.vocab import Vocab from sense2vec.util import get_true_cased_text, make_key, split_key def get_doc(vocab, words, spaces, pos): doc = Doc(vocab, words=words, spaces=spaces) for i, pos_tag in enumerate(pos): doc[i].pos_ = pos_tag return doc ...
(word, sense)
0c0965f18c589a917474df32dae1047489fa6304
15
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_anthropic.py
test_anthropic_api_response_when_error
pytest.raises
complex_expr
16
import re import pytest from spacy_llm.models.rest.anthropic import Anthropic, Endpoints from ..compat import has_anthropic_key @pytest.mark.external @pytest.mark.skipif(has_anthropic_key is False, reason="Anthropic API key unavailable") def test_anthropic_api_response_when_error(): """Check if error message sh...
ValueError, match="Request to Anthropic API failed:")
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_anthropic.py
test_anthropic_error_unsupported_model
pytest.raises
func_call
15
import re import pytest from spacy_llm.models.rest.anthropic import Anthropic, Endpoints from ..compat import has_anthropic_key @pytest.mark.external @pytest.mark.skipif(has_anthropic_key is False, reason="Anthropic API key unavailable") def test_anthropic_error_unsupported_model(): """Ensure graceful handling ...
ValueError, match=re.escape("Model 'x-gpt-3.5-turbo' is not supported"))
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_cohere.py
test_cohere_api_response_when_error
pytest.raises
complex_expr
15
import pytest from spacy_llm.models.rest.cohere import Cohere, Endpoints from ..compat import has_cohere_key @pytest.mark.external @pytest.mark.skipif(has_cohere_key is False, reason="Cohere API key not available") def test_cohere_api_response_when_error(): """Ensure graceful handling of error in the Cohere mode...
ValueError, match="Request to Cohere API failed:")
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_cohere.py
test_cohere_error_unsupported_model
pytest.raises
complex_expr
13
import pytest from spacy_llm.models.rest.cohere import Cohere, Endpoints from ..compat import has_cohere_key @pytest.mark.external @pytest.mark.skipif(has_cohere_key is False, reason="Cohere API key not available") def test_cohere_error_unsupported_model(): """Ensure graceful handling of error when model is not ...
ValueError, match="Model 'x-gpt-3.5-turbo' is not supported")
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_dolly.py
test_init_from_config
assert
collection
46
import copy import pytest import spacy from confection import Config # type: ignore[import] from thinc.compat import has_torch_cuda_gpu from ...compat import torch _PIPE_CFG = { "model": { "@llm_models": "spacy.Dolly.v1", "name": "dolly-v2-3b", }, "task": {"@llm_tasks": "spacy.NoOp.v1"},...
["llm"]
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_dolly.py
test_invalid_model
pytest.raises
complex_expr
47
import copy import pytest import spacy from confection import Config # type: ignore[import] from thinc.compat import has_torch_cuda_gpu from ...compat import torch _PIPE_CFG = { "model": { "@llm_models": "spacy.Dolly.v1", "name": "dolly-v2-3b", }, "task": {"@llm_tasks": "spacy.NoOp.v1"},...
ValueError, match="unexpected value; permitted")
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_falcon.py
test_init_from_config
assert
collection
45
import copy import pytest import spacy from confection import Config # type: ignore[import] from thinc.compat import has_torch_cuda_gpu from ...compat import torch _PIPE_CFG = { "model": { "@llm_models": "spacy.Falcon.v1", "name": "falcon-rw-1b", }, "task": {"@llm_tasks": "spacy.NoOp.v1"...
["llm"]
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_falcon.py
test_invalid_model
pytest.raises
complex_expr
46
import copy import pytest import spacy from confection import Config # type: ignore[import] from thinc.compat import has_torch_cuda_gpu from ...compat import torch _PIPE_CFG = { "model": { "@llm_models": "spacy.Falcon.v1", "name": "falcon-rw-1b", }, "task": {"@llm_tasks": "spacy.NoOp.v1"...
ValueError, match="unexpected value; permitted")
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_llama2.py
test_init_from_config
assert
collection
46
import copy import pytest import spacy from confection import Config # type: ignore[import] from thinc.compat import has_torch_cuda_gpu from ...compat import torch _PIPE_CFG = { "model": { "@llm_models": "spacy.Llama2.v1", "name": "Llama-2-7b-hf", }, "task": {"@llm_tasks": "spacy.NoOp.v1...
["llm"]
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_llama2.py
test_invalid_model
pytest.raises
complex_expr
47
import copy import pytest import spacy from confection import Config # type: ignore[import] from thinc.compat import has_torch_cuda_gpu from ...compat import torch _PIPE_CFG = { "model": { "@llm_models": "spacy.Llama2.v1", "name": "Llama-2-7b-hf", }, "task": {"@llm_tasks": "spacy.NoOp.v1...
ValueError, match="unexpected value; permitted")
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_openllama.py
test_init_from_config
assert
collection
45
import copy import pytest import spacy from confection import Config # type: ignore[import] from thinc.compat import has_torch_cuda_gpu from ...compat import torch _PIPE_CFG = { "model": { "@llm_models": "spacy.OpenLLaMA.v1", "name": "open_llama_3b", }, "task": {"@llm_tasks": "spacy.NoOp...
["llm"]
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_openllama.py
test_invalid_model
pytest.raises
complex_expr
46
import copy import pytest import spacy from confection import Config # type: ignore[import] from thinc.compat import has_torch_cuda_gpu from ...compat import torch _PIPE_CFG = { "model": { "@llm_models": "spacy.OpenLLaMA.v1", "name": "open_llama_3b", }, "task": {"@llm_tasks": "spacy.NoOp...
ValueError, match="unexpected value; permitted")
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_palm.py
test_palm_api_response_is_correct
assert
numeric_literal
19
import pytest from spacy_llm.models.rest.palm import palm_bison from ..compat import has_palm_key @pytest.mark.external @pytest.mark.skipif(has_palm_key is False, reason="PaLM API key not available") @pytest.mark.parametrize("name", ("text-bison-001", "chat-bison-001")) def test_palm_api_response_is_correct(name: st...
3
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_palm.py
test_palm_api_response_when_error
pytest.raises
complex_expr
15
import pytest from spacy_llm.models.rest.palm import palm_bison from ..compat import has_palm_key @pytest.mark.external @pytest.mark.skipif(has_palm_key is False, reason="PaLM API key not available") def test_palm_api_response_when_error(): """Ensure graceful handling of error in the PaLM model.""" # Incorre...
ValueError, match="Request to PaLM API failed:")
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_palm.py
test_palm_error_unsupported_model
pytest.raises
complex_expr
13
import pytest from spacy_llm.models.rest.palm import palm_bison from ..compat import has_palm_key @pytest.mark.external @pytest.mark.skipif(has_palm_key is False, reason="PaLM API key not available") def test_palm_error_unsupported_model(): """Ensure graceful handling of error when model is not supported""" ...
ValueError, match="Model 'x-gpt-3.5-turbo' is not supported")
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_rest.py
test_model_error_handling
pytest.raises
complex_expr
25
import copy import re from typing import Iterable import pytest import spacy from spacy.tokens import Doc from ...registry import registry from ..compat import has_openai_key PIPE_CFG = { "model": { "@llm_models": "spacy.GPT-3-5.v2", }, "task": {"@llm_tasks": "spacy.TextCat.v1", "labels": "POSITI...
ValueError, match="Could not find function 'spacy.gpt-3.5x.v1'")
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_rest.py
test_max_time_error_handling
pytest.raises
complex_expr
25
import copy import re from typing import Iterable import pytest import spacy from spacy.tokens import Doc from ...registry import registry from ..compat import has_openai_key PIPE_CFG = { "model": { "@llm_models": "spacy.GPT-3-5.v2", }, "task": {"@llm_tasks": "spacy.TextCat.v1", "labels": "POSITI...
TimeoutError, match="Request time out. Check your network connection and the API's availability.")
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_rest.py
test_doc_length_error_handling
pytest.raises
func_call
34
import copy import re from typing import Iterable import pytest import spacy from spacy.tokens import Doc from ...registry import registry from ..compat import has_openai_key PIPE_CFG = { "model": { "@llm_models": "spacy.GPT-3-5.v2", }, "task": {"@llm_tasks": "spacy.TextCat.v1", "labels": "POSITI...
ValueError, match=re.escape( "Request to OpenAI API failed: This model's maximum context length is 4097 tokens. However, your messages " "resulted in 5018 tokens. Please reduce the length of the messages." ))
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor
explosion/spacy-llm
fad52532857b425eb2a55aecc09330e1e1d7d727
72
train
train
spacy_llm/tests/models/test_stablelm.py
test_init_from_config
assert
collection
44
import copy import pytest import spacy from confection import Config # type: ignore[import] from thinc.compat import has_torch_cuda_gpu from ...compat import torch _PIPE_CFG = { "model": { "@llm_models": "spacy.StableLM.v1", "name": "stablelm-base-alpha-3b", }, "task": {"@llm_tasks": "sp...
["llm"]
fad52532857b425eb2a55aecc09330e1e1d7d727
72
v2_extractor_at_anchor