code
stringlengths
3
6.57k
test_can_load_documents_v2(tmpdir)
tmpdir.join("tiny.dataset")
dataset_fio.write(dataset_str)
load_documents(dataset_fio)
pytest.fixture()
tiny_dataset_fio(tmpdir)
tmpdir.join("dataset.txt")
dataset_fio.write(DATASET_TINY_STR)
test_can_load_documents(tiny_dataset_fio)
load_documents(tiny_dataset_fio)
pytest.param(["A_word"], [123, 37], id="A_word")
pytest.param(["B_word"], [2, 37], id="B_word")
pytest.param(["A_word", "B_word"], [37], id="both_words")
pytest.param(["word_does_not_exist"], [], id="word does not exist")
test_query_inverted_index_intersect_results(tiny_dataset_fio, query, etalon_answer)
load_documents(tiny_dataset_fio)
build_inverted_index(documents)
tiny_inverted_index.query(query)
sorted(answer)
sorted(etalon_answer)
test_can_load_wikipedia_sample()
load_documents(DATASET_BIG_FPATH)
len(documents)
pytest.fixture()
wikipedia_documents()
load_documents(DATASET_BIG_FPATH)
load_documents(DATASET_SMALL_FPATH)
load_documents(DATASET_TINY_FPATH)
pytest.fixture()
small_sample_wikipedia_documents()
load_documents(DATASET_SMALL_FPATH)
test_can_build_and_query_inverted_index(wikipedia_documents)
build_inverted_index(wikipedia_documents)
wikipedia_inverted_index.query(["wikipedia"])
isinstance(doc_ids, list)
pytest.fixture()
wikipedia_inverted_index(wikipedia_documents)
build_inverted_index(wikipedia_documents)
pytest.fixture()
small_wikipedia_inverted_index(small_sample_wikipedia_documents)
build_inverted_index(small_sample_wikipedia_documents)
test_can_dump_and_load_inverted_index(tmpdir, wikipedia_inverted_index)
tmpdir.join("index.dump")
wikipedia_inverted_index.dump(index_fio)
InvertedIndex.load(index_fio)
pytest.param(DATASET_SMALL_FPATH, id="small dataset")
pytest.param(DATASET_BIG_FPATH, marks=[pytest.mark.slow], id="big dataset")
test_can_dump_and_load_inverted_index_with_array_policy_parametrized(filepath, tmpdir)
tmpdir.join("index.dump")
load_documents(filepath)
build_inverted_index(documents)
dump(word_to_docs_mapping, filepath)
load(filepath)
etalon_inverted_index.dump(index_fio, storage_policy=ArrayStoragePolicy)
InvertedIndex.load(index_fio, storage_policy=ArrayStoragePolicy)
pytest.param(DATASET_BIG_FPATH, marks=[pytest.mark.slow])
test_process_build_can_load_documents(dataset_filepath)
process_build(dataset_filepath, "inverted.index")
pytest.param(DATASET_BIG_FPATH, marks=[pytest.mark.slow])
test_callback_build_can_build_inverted_index_from_provided_file(dataset_filepath)
callback_build(build_arguments)
test_process_queries_can_process_queries_from_provided_file(capsys)
open("queries-utf8.txt")
capsys.readouterr()
test_callback_query_can_process_queries_from_provided_file()
open("queries-utf8.txt")
callback_query(query_arguments)
ObjectResponse(object)
swagger_types (dict)
attribute_map (dict)
__init__(self, pagination_info=None)
pagination_info(self)
pagination_info(self, pagination_info)
to_dict(self)
iteritems(self.swagger_types)
getattr(self, attr)
isinstance(value, list)
x.to_dict()
hasattr(x, "to_dict")
hasattr(value, "to_dict")
value.to_dict()
isinstance(value, dict)
to_dict()
hasattr(item[1], "to_dict")
value.items()
to_str(self)
pformat(self.to_dict()
__repr__(self)
self.to_str()
__eq__(self, other)
isinstance(other, ObjectResponse)
__ne__(self, other)
normalize_path(path)
re.sub(r'[\/]{2,}', '/', path)
reverse('deeppages:{}'.format(get_deeppages_path()
new_path.startswith(deeppages_path)
new_path.replace(deeppages_path, '')
new_path.startswith('/')
format(new_path)
new_path.endswith('/')