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
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api/test_serve.py
test__translate_path
assert
func_call
14
from pathlib import Path import pytest from lightly.api import serve def test__translate_path(tmp_path: Path) -> None: tmp_file = tmp_path / "hello/world.txt" assert serve._translate_path(path="/hello/world.txt", directories=[]) == "" assert serve._translate_path(path="/hello/world.txt", directories=[tmp...
str(tmp_file)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api_workflow/test_api_workflow_datasets.py
test_get_datasets__shared
assert
func_call
49
from typing import List import pytest from pytest_mock import MockerFixture from lightly.api import ApiWorkflowClient, api_workflow_datasets from lightly.openapi_generated.swagger_client.api import DatasetsApi from lightly.openapi_generated.swagger_client.models import ( Creator, DatasetCreateRequest, Dat...
len(datasets)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/data/test_LightlyDataset.py
test_create_lightly_dataset_from_folder
self.assertEqual
func_call
97
import os import shutil import tempfile import unittest from typing import List, Tuple import numpy as np import torchvision from PIL.Image import Image from lightly.data import LightlyDataset from lightly.data._utils import check_images class TestLightlyDataset(unittest.TestCase): def ensure_dir(self, path_to_f...
len(dataset))
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/data/test_VideoDataset.py
_test_video_dataset_non_increasing_timestamps
self.assertEqual
func_call
146
import contextlib import io import os import shutil import tempfile import unittest from fractions import Fraction from typing import List from unittest import mock import cv2 import numpy as np import PIL import torch import torchvision from lightly.data import LightlyDataset, NonIncreasingTimestampError from lightl...
len(dataset))
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/models/modules/test_memory_bank.py
test_forward__dim_first
assert
func_call
21
import re import unittest import pytest import torch from lightly.models.modules.memory_bank import MemoryBankModule class TestMemoryBank: def test_forward__dim_first(self) -> None: torch.manual_seed(0) memory_bank = MemoryBankModule(size=(5, 2), feature_dim_first=True) x0 = torch.randn(...
x0.T.tolist()
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api/test_BitMask.py
assert_difference
self.assertEqual
func_call
18
import unittest from copy import deepcopy from random import randint, random, seed from lightly.api.bitmask import BitMask N = 10 class TestBitMask(unittest.TestCase): def setup(self, psuccess=1.0): pass def assert_difference(self, bistring_1: str, bitstring_2: str, target: str): mask_a = Bi...
int(target, 2))
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/utils/test_io.py
test_save_schema
self.assertListEqual
func_call
39
import csv import json import tempfile import unittest from pathlib import Path import numpy as np from lightly.utils import io from tests.api_workflow.mocked_api_workflow_client import MockedApiWorkflowSetup class TestEmbeddingsIO(unittest.TestCase): def setUp(self) -> None: # correct embedding file as ...
sorted(loaded))
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api/test_download.py
test_download_video_frames_at_timestamps
self.assertEqual
func_call
41
import json import os import sys import tempfile import unittest import warnings from io import BytesIO from unittest import mock import numpy as np import tqdm from PIL import Image class TestDownload(unittest.TestCase): def setUp(self): self._max_retries = lightly.api.utils.RETRY_MAX_RETRIES sel...
len(timestamps))
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/models/modules/test_memory_bank.py
test_forward_easy
self.assertGreater
func_call
33
import re import unittest import pytest import torch from lightly.models.modules.memory_bank import MemoryBankModule class TestNTXentLoss(unittest.TestCase): def test_forward_easy(self) -> None: bsz = 3 dim, size = 2, 9 n = 33 * bsz memory_bank = MemoryBankModule(size=size) ...
next_diff.norm())
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api/test_download.py
test_download_all_video_frame_counts_progress_bar
assert
func_call
42
import json import os import sys import tempfile import unittest import warnings from io import BytesIO from unittest import mock import numpy as np import tqdm from PIL import Image class TestDownload(unittest.TestCase): def setUp(self): self._max_retries = lightly.api.utils.RETRY_MAX_RETRIES sel...
sum(true_n_frames)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api/test_download.py
test_download_all_video_frame_counts_progress_bar
assert
func_call
44
import json import os import sys import tempfile import unittest import warnings from io import BytesIO from unittest import mock import numpy as np import tqdm from PIL import Image class TestDownload(unittest.TestCase): def setUp(self): self._max_retries = lightly.api.utils.RETRY_MAX_RETRIES sel...
len(true_n_frames)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/loss/test_PMSNLoss.py
test__power_law_distribution
assert
func_call
29
import math import unittest import pytest import torch from torch import Tensor from lightly.loss import pmsn_loss from lightly.loss.pmsn_loss import PMSNCustomLoss, PMSNLoss def test__power_law_distribution() -> None: power_dist = pmsn_loss._power_law_distribution( size=4, exponent=0.5, device=torch.dev...
torch.device("cpu")
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/loss/test_SwaVLoss.py
test_forward_pass
self.assertGreater
func_call
28
import unittest import pytest import torch from pytest_mock import MockerFixture from torch import distributed as dist from lightly.loss import SwaVLoss class TestSwaVLossUnitTest(unittest.TestCase): def test_forward_pass(self): n = 32 n_high_res = 2 high_res = [torch.eye(32, 32) for i i...
loss.cpu().numpy())
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/utils/benchmarking/test_knn_classifier.py
test
assert
func_call
52
from typing import Tuple import pytest import torch from pytest_mock import MockerFixture from pytorch_lightning import Trainer from torch import Tensor, nn from torch.utils.data import DataLoader, Dataset from lightly.utils.benchmarking import KNNClassifier from lightly.utils.benchmarking.knn_classifier import F cl...
pytest.approx(1 / 3)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api_workflow/mocked_api_workflow_client.py
delete_dataset_by_id
assert
func_call
189
import csv import io import json import tempfile import unittest from collections import defaultdict from io import IOBase from typing import * import numpy as np import requests from requests import Response import lightly from lightly.api.api_workflow_client import ApiWorkflowClient from lightly.openapi_generated.s...
len(self.datasets) - 1
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/loss/test_MSNLoss.py
test_sinkhorn
self.assertTrue
func_call
23
import unittest from unittest import TestCase import pytest import torch import torch.nn.functional as F from pytest_mock import MockerFixture from torch import distributed as dist from torch import nn from torch.optim import SGD from lightly.loss import msn_loss from lightly.loss.msn_loss import MSNLoss from lightly...
torch.all(prob != out))
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/utils/benchmarking/test_knn_classifier.py
test
pytest.approx
complex_expr
52
from typing import Tuple import pytest import torch from pytest_mock import MockerFixture from pytorch_lightning import Trainer from torch import Tensor, nn from torch.utils.data import DataLoader, Dataset from lightly.utils.benchmarking import KNNClassifier from lightly.utils.benchmarking.knn_classifier import F cl...
1 / 3)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/utils/benchmarking/test_knn_classifier.py
test
pytest.approx
complex_expr
54
from typing import Tuple import pytest import torch from pytest_mock import MockerFixture from pytorch_lightning import Trainer from torch import Tensor, nn from torch.utils.data import DataLoader, Dataset from lightly.utils.benchmarking import KNNClassifier from lightly.utils.benchmarking.knn_classifier import F cl...
2 / 3)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/utils/benchmarking/test_knn_classifier.py
test
pytest.approx
complex_expr
55
from typing import Tuple import pytest import torch from pytest_mock import MockerFixture from pytorch_lightning import Trainer from torch import Tensor, nn from torch.utils.data import DataLoader, Dataset from lightly.utils.benchmarking import KNNClassifier from lightly.utils.benchmarking.knn_classifier import F cl...
3 / 3)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api_workflow/test_api_workflow_export.py
test_export_label_box_data_rows_by_tag_name
assert_*
complex_expr
37
from pytest_mock import MockerFixture from lightly.api import ApiWorkflowClient, api_workflow_export from lightly.api import utils as api_utils from lightly.openapi_generated.swagger_client.models import FileNameFormat, TagData from tests.api_workflow import utils def _get_tag(dataset_id: str, tag_name: str) -> TagDa...
tag.id)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/data/test_data_collate.py
test_msn_collate_forward
self.assertEqual
complex_expr
49
import random import unittest import torch import torchvision import torchvision.transforms as transforms from lightly.data import ( BaseCollateFunction, ImageCollateFunction, MultiCropCollateFunction, PIRLCollateFunction, SimCLRCollateFunction, SwaVCollateFunction, collate, ) from lightly...
2 + 10)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/utils/benchmarking/test_knn_classifier.py
test__features_dtype
assert
complex_expr
127
from typing import Tuple import pytest import torch from pytest_mock import MockerFixture from pytorch_lightning import Trainer from torch import Tensor, nn from torch.utils.data import DataLoader, Dataset from lightly.utils.benchmarking import KNNClassifier from lightly.utils.benchmarking.knn_classifier import F cl...
torch.int
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api_workflow/test_api_workflow_tags.py
test_create_tag_from_filenames
assert
complex_expr
47
from typing import List, Optional import pytest from pytest_mock import MockerFixture from lightly.api import ApiWorkflowClient from lightly.api.api_workflow_tags import TagDoesNotExistError from lightly.openapi_generated.swagger_client.models import TagCreator, TagData from tests.api_workflow import utils def _get_...
tags[0].id
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/loss/test_MMCR_loss.py
test_loss_value
self.assertTrue
complex_expr
22
import unittest import torch from lightly.loss.mmcr_loss import MMCRLoss class testMMCRLoss(unittest.TestCase): def test_loss_value(self) -> None: """If all values are zero, the loss should be zero.""" bs = 3 dim = 128 k = 32 loss_fn = MMCRLoss() online = torch.z...
loss == 0)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api_workflow/test_api_workflow_tags.py
test_get_tag_name
assert_*
complex_expr
37
from typing import List, Optional import pytest from pytest_mock import MockerFixture from lightly.api import ApiWorkflowClient from lightly.api.api_workflow_tags import TagDoesNotExistError from lightly.openapi_generated.swagger_client.models import TagCreator, TagData from tests.api_workflow import utils def _get_...
tags[0].id)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/data/test_VideoDataset.py
test_video_similar_timestamps_for_different_backends
self.assertEqual
complex_expr
106
import contextlib import io import os import shutil import tempfile import unittest from fractions import Fraction from typing import List from unittest import mock import cv2 import numpy as np import PIL import torch import torchvision from lightly.data import LightlyDataset, NonIncreasingTimestampError from lightl...
offsets[1])
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/data/test_VideoDataset.py
test_video_similar_timestamps_for_different_backends
self.assertEqual
complex_expr
113
import contextlib import io import os import shutil import tempfile import unittest from fractions import Fraction from typing import List from unittest import mock import cv2 import numpy as np import PIL import torch import torchvision from lightly.data import LightlyDataset, NonIncreasingTimestampError from lightl...
offsets[0])
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/data/test_data_collate.py
test_multi_crop_collate
self.assertEqual
complex_expr
57
import random import unittest import torch import torchvision import torchvision.transforms as transforms from lightly.data import ( BaseCollateFunction, ImageCollateFunction, MultiCropCollateFunction, PIRLCollateFunction, SimCLRCollateFunction, SwaVCollateFunction, collate, ) from lightly...
low + high)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api_workflow/test_api_workflow_datasets.py
test_dataset_type
assert
complex_expr
40
from typing import List import pytest from pytest_mock import MockerFixture from lightly.api import ApiWorkflowClient, api_workflow_datasets from lightly.openapi_generated.swagger_client.api import DatasetsApi from lightly.openapi_generated.swagger_client.models import ( Creator, DatasetCreateRequest, Dat...
dataset.type
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/data/test_VideoDataset.py
test_video_similar_timestamps_for_different_backends
self.assertNotEqual
complex_expr
102
import contextlib import io import os import shutil import tempfile import unittest from fractions import Fraction from typing import List from unittest import mock import cv2 import numpy as np import PIL import torch import torchvision from lightly.data import LightlyDataset, NonIncreasingTimestampError from lightl...
backends[1])
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/utils/test_scheduler.py
test_CosineWarmupScheduler__warmup
self.assertAlmostEqual
complex_expr
24
import unittest import torch from torch import nn from lightly.utils.scheduler import CosineWarmupScheduler, cosine_schedule class TestScheduler(unittest.TestCase): def test_CosineWarmupScheduler__warmup(self) -> None: model = nn.Linear(10, 1) optimizer = torch.optim.SGD( model.param...
2.0 * 1 / 3)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/utils/test_scheduler.py
test_CosineWarmupScheduler__warmup
self.assertAlmostEqual
complex_expr
25
import unittest import torch from torch import nn from lightly.utils.scheduler import CosineWarmupScheduler, cosine_schedule class TestScheduler(unittest.TestCase): def test_CosineWarmupScheduler__warmup(self) -> None: model = nn.Linear(10, 1) optimizer = torch.optim.SGD( model.param...
2.0 * 2 / 3)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/utils/test_scheduler.py
test_CosineWarmupScheduler__warmup
self.assertAlmostEqual
complex_expr
26
import unittest import torch from torch import nn from lightly.utils.scheduler import CosineWarmupScheduler, cosine_schedule class TestScheduler(unittest.TestCase): def test_CosineWarmupScheduler__warmup(self) -> None: model = nn.Linear(10, 1) optimizer = torch.optim.SGD( model.param...
2.0 * 3 / 3)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api/test_download.py
test_download_video_frame_fps
assert
complex_expr
45
import json import os import sys import tempfile import unittest import warnings from io import BytesIO from unittest import mock import numpy as np import tqdm from PIL import Image class TestDownload(unittest.TestCase): def setUp(self): self._max_retries = lightly.api.utils.RETRY_MAX_RETRIES sel...
true_frame.pts
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api/test_utils.py
test_paginate_endpoint__multiple_of_page_size
self.assertEqual
complex_expr
35
import os import unittest from unittest import mock import pytest from PIL import Image from lightly.api.utils import ( DatasourceType, PIL_to_bytes, get_lightly_server_location_from_env, get_signed_url_destination, getenv, paginate_endpoint, retry, ) class TestUtils(unittest.TestCase): ...
4 * page_size)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/data/test_VideoDataset.py
test_video_similar_timestamps_for_different_backends
self.assertEqual
complex_expr
105
import contextlib import io import os import shutil import tempfile import unittest from fractions import Fraction from typing import List from unittest import mock import cv2 import numpy as np import PIL import torch import torchvision from lightly.data import LightlyDataset, NonIncreasingTimestampError from lightl...
timestamps[1])
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/models/modules/masked_vision_transformer_test.py
test_encode
assert
complex_expr
75
from abc import ABC, abstractmethod from typing import Optional, Tuple import pytest import torch from pytest_mock import MockerFixture from torch import Tensor from torch.nn import Parameter from lightly.models import utils from lightly.models.modules.masked_vision_transformer import MaskedVisionTransformer class M...
tokens.shape[1]
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/data/test_VideoDataset.py
test_video_dataset_tqdm_args
self.assertTrue
complex_expr
90
import contextlib import io import os import shutil import tempfile import unittest from fractions import Fraction from typing import List from unittest import mock import cv2 import numpy as np import PIL import torch import torchvision from lightly.data import LightlyDataset, NonIncreasingTimestampError from lightl...
desc in printed)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/data/test_VideoDataset.py
_test_video_dataset_from_folder
self.assertIsInstance
complex_expr
88
import contextlib import io import os import shutil import tempfile import unittest from fractions import Fraction from typing import List from unittest import mock import cv2 import numpy as np import PIL import torch import torchvision from lightly.data import LightlyDataset, NonIncreasingTimestampError from lightl...
PIL.Image.Image)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api_workflow/test_api_workflow_upload_embeddings.py
test_set_embedding_id_default
self.assertEqual
complex_expr
76
import os import tempfile import numpy as np from lightly.utils import io as io_utils from tests.api_workflow.mocked_api_workflow_client import MockedApiWorkflowSetup class TestApiWorkflowUploadEmbeddings(MockedApiWorkflowSetup): def create_fake_embeddings( self, n_data, n_data_start: int...
embeddings[0].id)
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api_workflow/mocked_api_workflow_client.py
get_list_of_raw_samples_from_datasource_by_dataset_id
assert
none_literal
164
import csv import io import json import tempfile import unittest from collections import defaultdict from io import IOBase from typing import * import numpy as np import requests from requests import Response import lightly from lightly.api.api_workflow_client import ApiWorkflowClient from lightly.openapi_generated.s...
None
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api_workflow/test_api_workflow_compute_worker.py
test_selection_config_from_dict
assert
none_literal
81
import json import random from typing import Any, List from unittest import mock from unittest.mock import MagicMock import pytest from pytest_mock import MockerFixture from lightly.api import ApiWorkflowClient, api_workflow_compute_worker from lightly.api.api_workflow_compute_worker import ( STATE_SCHEDULED_ID_...
None
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api_workflow/test_api_workflow_download_dataset.py
test__get_latest_default_embedding_data__no_default_embedding
assert
none_literal
25
import pytest from pytest_mock import MockerFixture from lightly.api import ApiWorkflowClient, api_workflow_download_dataset from lightly.openapi_generated.swagger_client.models import ( DatasetData, DatasetEmbeddingData, DatasetType, ImageType, TagData, ) from tests.api_workflow import utils def ...
None
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightly-ai/lightly
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
train
train
tests/api_workflow/test_api_workflow_compute_worker.py
test_get_compute_worker_state_and_message_CANCELED
assert
bool_literal
67
import json import random from typing import Any, List from unittest import mock from unittest.mock import MagicMock import pytest from pytest_mock import MockerFixture from lightly.api import ApiWorkflowClient, api_workflow_compute_worker from lightly.api.api_workflow_compute_worker import ( STATE_SCHEDULED_ID_...
True
78f59fc4ed11a92218d9f8ad7b9b10006038092e
255
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_assets/test_asset_access.py
test_assets_directory
assert
variable
20
import os import pytest from node_launcher.assets.asset_access import AssetAccess def asset_access() -> AssetAccess: asset_access = AssetAccess() return asset_access class TestAssetAccess(object): def test_assets_directory(self, asset_access: AssetAccess): test_file_path = os.path.realpath(__fil...
assets_directory
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_gui/test_components/test_copy_button.py
test_copy_button
assert
string_literal
16
import pytest from PySide2.QtCore import Qt from PySide2.QtGui import QClipboard from PySide2.QtTest import QTest from node_launcher.gui.components.copy_button import CopyButton def copy_button() -> CopyButton: copy_button = CopyButton(button_text='Test Me', copy_text='copy_this') return copy_button class Te...
'copy_this'
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_gui/test_network_buttons/test_advanced/test_configuration_files_layout.py
test_show_lnd_conf
assert_*
string_literal
25
from unittest.mock import MagicMock, patch import pytest from PySide2.QtCore import Qt from PySide2.QtTest import QTest from node_launcher.gui.network_buttons.advanced import ConfigurationFilesLayout def actions_layout() -> ConfigurationFilesLayout: node_set = MagicMock() node_set.bitcoin.file.directory = '/...
'/test/lnd')
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_gui/test_network_buttons/test_advanced/test_configuration_files_layout.py
test_show_bitcoin_conf
assert_*
string_literal
24
from unittest.mock import MagicMock, patch import pytest from PySide2.QtCore import Qt from PySide2.QtTest import QTest from node_launcher.gui.network_buttons.advanced import ConfigurationFilesLayout def actions_layout() -> ConfigurationFilesLayout: node_set = MagicMock() node_set.bitcoin.file.directory = '/...
'/test/bitcoin')
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_gui/test_network_buttons/test_joule_layout.py
test_copy_rest
assert
string_literal
21
from unittest.mock import MagicMock, patch import pytest from PySide2.QtCore import Qt from PySide2.QtGui import QClipboard from PySide2.QtTest import QTest from node_launcher.gui.network_buttons.joule_layout import JouleLayout def joule_layout() -> JouleLayout: node_set = MagicMock() node_set.lnd.rest_url =...
'test rest'
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_gui/test_network_buttons/test_joule_layout.py
test_show_macaroons
assert_*
string_literal
24
from unittest.mock import MagicMock, patch import pytest from PySide2.QtCore import Qt from PySide2.QtGui import QClipboard from PySide2.QtTest import QTest from node_launcher.gui.network_buttons.joule_layout import JouleLayout def joule_layout() -> JouleLayout: node_set = MagicMock() node_set.lnd.rest_url =...
'test macaroon')
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_gui/test_seed_dialog.py
test_keyring
assert
string_literal
23
import time from unittest.mock import MagicMock import pytest from PySide2.QtCore import Qt from PySide2.QtTest import QTest from node_launcher.constants import keyring from node_launcher.gui.main_widget import MainWidget from node_launcher.node_set.lnd_client.rpc_pb2 import GenSeedResponse class TestSeedDialog(obje...
'test_password'
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_bitcoin.py
test_file_changed
assert
bool_literal
26
import os from tempfile import TemporaryDirectory from unittest.mock import MagicMock import pytest from node_launcher.node_set.bitcoin import Bitcoin from node_launcher.services.configuration_file import ConfigurationFile from node_launcher.constants import ( IS_WINDOWS, MAINNET_PRUNE, TESTNET_PRUNE ) c...
True
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_bitcoin.py
test_file_changed
assert
bool_literal
24
import os from tempfile import TemporaryDirectory from unittest.mock import MagicMock import pytest from node_launcher.node_set.bitcoin import Bitcoin from node_launcher.services.configuration_file import ConfigurationFile from node_launcher.constants import ( IS_WINDOWS, MAINNET_PRUNE, TESTNET_PRUNE ) c...
False
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_bitcoin.py
test_autoconfigure_datadir
assert
variable
24
import os from tempfile import TemporaryDirectory from unittest.mock import MagicMock import pytest from node_launcher.node_set.bitcoin import Bitcoin from node_launcher.services.configuration_file import ConfigurationFile from node_launcher.constants import ( IS_WINDOWS, MAINNET_PRUNE, TESTNET_PRUNE ) c...
txindex
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_bitcoin.py
test_set_rpcuser
assert
string_literal
22
import os from tempfile import TemporaryDirectory from unittest.mock import MagicMock import pytest from node_launcher.node_set.bitcoin import Bitcoin from node_launcher.services.configuration_file import ConfigurationFile from node_launcher.constants import ( IS_WINDOWS, MAINNET_PRUNE, TESTNET_PRUNE ) c...
'test_user'
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_bitcoin.py
test_set_rpcuser
assert
string_literal
25
import os from tempfile import TemporaryDirectory from unittest.mock import MagicMock import pytest from node_launcher.node_set.bitcoin import Bitcoin from node_launcher.services.configuration_file import ConfigurationFile from node_launcher.constants import ( IS_WINDOWS, MAINNET_PRUNE, TESTNET_PRUNE ) c...
'test_user_2'
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_bitcoin.py
test_file_changed
assert
complex_expr
31
import os from tempfile import TemporaryDirectory from unittest.mock import MagicMock import pytest from node_launcher.node_set.bitcoin import Bitcoin from node_launcher.services.configuration_file import ConfigurationFile from node_launcher.constants import ( IS_WINDOWS, MAINNET_PRUNE, TESTNET_PRUNE ) c...
new_config['port']
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_bitcoin.py
test_detect_zmq_ports
assert
complex_expr
20
import os from tempfile import TemporaryDirectory from unittest.mock import MagicMock import pytest from node_launcher.node_set.bitcoin import Bitcoin from node_launcher.services.configuration_file import ConfigurationFile from node_launcher.constants import ( IS_WINDOWS, MAINNET_PRUNE, TESTNET_PRUNE ) c...
bitcoin.zmq_tx_port
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_bitcoin.py
test_datadir
assert
func_call
21
import os from tempfile import TemporaryDirectory from unittest.mock import MagicMock import pytest from node_launcher.node_set.bitcoin import Bitcoin from node_launcher.services.configuration_file import ConfigurationFile from node_launcher.constants import ( IS_WINDOWS, MAINNET_PRUNE, TESTNET_PRUNE ) c...
os.listdir(bitcoin.file['datadir'])
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_hard_drives.py
test_get_big_drive
assert
numeric_literal
12
import pytest from node_launcher.services.hard_drives import HardDrives def hard_drives(): hard_drives = HardDrives() return hard_drives class TestHardDrives(object): def test_get_big_drive(self, hard_drives: HardDrives): assert hard_drives.get_big_drive().gb_free >
0
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_lnd.py
test_multi_property
assert
numeric_literal
20
import os from unittest.mock import MagicMock import pytest from node_launcher.constants import IS_WINDOWS from node_launcher.node_set.lnd import ( Lnd ) from node_launcher.utilities.utilities import is_port_in_use class TestDirectoryConfiguration(object): def test_multi_property(self, lnd: Lnd): ln...
2
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_lnd.py
test_bitcoin_file_changed
assert
numeric_literal
26
import os from unittest.mock import MagicMock import pytest from node_launcher.constants import IS_WINDOWS from node_launcher.node_set.lnd import ( Lnd ) from node_launcher.utilities.utilities import is_port_in_use class TestDirectoryConfiguration(object): def test_bitcoin_file_changed(self, lnd: Lnd): ...
8338
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_lnd.py
test_bitcoin_file_changed
assert
bool_literal
34
import os from unittest.mock import MagicMock import pytest from node_launcher.constants import IS_WINDOWS from node_launcher.node_set.lnd import ( Lnd ) from node_launcher.utilities.utilities import is_port_in_use class TestDirectoryConfiguration(object): def test_bitcoin_file_changed(self, lnd: Lnd): ...
True
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_lnd.py
test_bitcoin_file_changed
assert
bool_literal
23
import os from unittest.mock import MagicMock import pytest from node_launcher.constants import IS_WINDOWS from node_launcher.node_set.lnd import ( Lnd ) from node_launcher.utilities.utilities import is_port_in_use class TestDirectoryConfiguration(object): def test_bitcoin_file_changed(self, lnd: Lnd): ...
False
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_lnd.py
test_multi_listen
assert
string_literal
20
import os from unittest.mock import MagicMock import pytest from node_launcher.constants import IS_WINDOWS from node_launcher.node_set.lnd import ( Lnd ) from node_launcher.utilities.utilities import is_port_in_use class TestDirectoryConfiguration(object): def test_multi_listen(self, lnd: Lnd): lnd....
'9835'
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_set/test_lnd.py
test_file_changed
assert
func_call
20
import os from unittest.mock import MagicMock import pytest from node_launcher.constants import IS_WINDOWS from node_launcher.node_set.lnd import ( Lnd ) from node_launcher.utilities.utilities import is_port_in_use class TestDirectoryConfiguration(object): def test_file_changed(self, lnd: Lnd): lnd....
new_config['listen'].split(':')[-1]
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_software/test_bitcoin_software.py
test_get_latest_release_version
assert
variable
25
import os from tempfile import TemporaryDirectory import pytest from node_launcher.constants import TARGET_BITCOIN_RELEASE, OPERATING_SYSTEM, WINDOWS from node_launcher.services.bitcoin_software import BitcoinSoftware def mock_get_latest_release_version(*args): return TARGET_BITCOIN_RELEASE def bitcoin_software...
TARGET_BITCOIN_RELEASE
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_software/test_bitcoin_software.py
test_release_version
assert
func_call
22
import os from tempfile import TemporaryDirectory import pytest from node_launcher.constants import TARGET_BITCOIN_RELEASE, OPERATING_SYSTEM, WINDOWS from node_launcher.services.bitcoin_software import BitcoinSoftware def mock_get_latest_release_version(*args): return TARGET_BITCOIN_RELEASE def bitcoin_software...
TARGET_BITCOIN_RELEASE.replace('v', '')
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_software/test_bitcoin_software.py
test_download_url
assert
string_literal
24
import os from tempfile import TemporaryDirectory import pytest from node_launcher.constants import TARGET_BITCOIN_RELEASE, OPERATING_SYSTEM, WINDOWS from node_launcher.services.bitcoin_software import BitcoinSoftware def mock_get_latest_release_version(*args): return TARGET_BITCOIN_RELEASE def bitcoin_software...
'https://bitcoincore.org/bin/bitcoin-core-0.17.1/bitcoin-0.17.1-win64.zip'
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_software/test_launcher_software.py
test_get_latest_release_version
assert
variable
17
import pytest from node_launcher.constants import NODE_LAUNCHER_RELEASE from node_launcher.services.launcher_software import LauncherSoftware def launcher_software() -> LauncherSoftware: launcher_software = LauncherSoftware() return launcher_software class TestLauncherSoftware(object): @pytest.mark.slow...
NODE_LAUNCHER_RELEASE
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_software/test_lnd_software.py
test_release_version
assert
variable
22
import os from tempfile import TemporaryDirectory import pytest from node_launcher.constants import TARGET_LND_RELEASE from node_launcher.services.lnd_software import LndSoftware def mock_get_latest_release_version(*args): return TARGET_LND_RELEASE def lnd_software(): with TemporaryDirectory() as tmpdirname...
TARGET_LND_RELEASE
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_node_software/test_node_software.py
test_launcher_data_path
assert
complex_expr
15
import os import pytest from node_launcher.constants import NODE_LAUNCHER_DATA_PATH, OPERATING_SYSTEM from node_launcher.services.node_software import NodeSoftware def node_software(): return NodeSoftware() class TestNodeSoftware(object): def test_launcher_data_path(self, node_software: NodeSoftware): ...
NODE_LAUNCHER_DATA_PATH[OPERATING_SYSTEM]
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_services/test_configuration_file.py
test_setattr
assert
variable
21
from os.path import isfile from tempfile import NamedTemporaryFile import pytest from node_launcher.services.configuration_file import ConfigurationFile def configuration_file(): with NamedTemporaryFile(suffix='.conf', delete=True) as f: name = f.name configuration_file = ConfigurationFile(name) ...
text
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
lightning-power-users/node-launcher
cc0273855703aac8497f11da59f1d5f7f59161f6
62
train
train
tests/test_services/test_configuration_file.py
test_getattr
assert
variable
20
from os.path import isfile from tempfile import NamedTemporaryFile import pytest from node_launcher.services.configuration_file import ConfigurationFile def configuration_file(): with NamedTemporaryFile(suffix='.conf', delete=True) as f: name = f.name configuration_file = ConfigurationFile(name) ...
test_value
cc0273855703aac8497f11da59f1d5f7f59161f6
62
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gitter.py
test_gitter_rooms_negative_2
assert
numeric_literal
17
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "gitter" class TestGitterResources: resource = "rooms" def test_gitter_rooms_negative_2(self, resource): with pytest.raises(Resourc...
401
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gitter.py
test_gitter_rooms_attribs
assert
variable
23
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "gitter" class TestGitterResources: resource = "rooms" def test_gitter_rooms_attribs(self, resource): assert resource.schema == { ...
provider
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gitter.py
test_missing_required
pytest.raises
variable
22
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "gitter" class TestGitter: @pytest.mark.parametrize( "data, message", [ ({}, "message"), ({"message": "...
BadArguments)
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gitter.py
test_gitter_rooms_positive
assert
complex_expr
17
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "gitter" class TestGitterCLI: @pytest.mark.online def test_gitter_rooms_positive(self, cli_runner): cmd = "gitter rooms".split() ...
result.output
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gitter.py
test_gitter_rooms_negative_2
pytest.raises
variable
14
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "gitter" class TestGitterResources: resource = "rooms" def test_gitter_rooms_negative_2(self, resource): with pytest.raises(
ResourceError)
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gitter.py
test_missing_required
assert
complex_expr
24
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "gitter" class TestGitter: @pytest.mark.parametrize( "data, message", [ ({}, "message"), ({"message": "...
e.value.message
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gitter.py
test_gitter_rooms_negative_2
assert
collection
16
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "gitter" class TestGitterResources: resource = "rooms" def test_gitter_rooms_negative_2(self, resource): with pytest.raises(Resourc...
["Unauthorized"]
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gitter.py
test_bad_request
pytest.raises
variable
14
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "gitter" class TestGitter: def test_bad_request(self, provider): data = {"token": "foo", "room_id": "baz", "message": "bar"} w...
NotificationError)
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gitter.py
test_gitter_resources
assert
complex_expr
16
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "gitter" class TestGitter: def test_gitter_resources(self, provider): assert provider.resources for resource in provider.resour...
provider.resources
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gitter.py
test_gitter_rooms_attribs
assert
collection
24
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "gitter" class TestGitterResources: resource = "rooms" def test_gitter_rooms_attribs(self, resource): assert resource.schema == { ...
{"required": ["token"]}
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gitter.py
test_metadata
assert
collection
12
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "gitter" class TestGitter: def test_metadata(self, provider): assert provider.metadata ==
{ "base_url": "https://api.gitter.im/v1/rooms", "message_url": "/{room_id}/chatMessages", "name": "gitter", "site_url": "https://gitter.im", }
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gitter.py
test_gitter_rooms_attribs
assert
collection
14
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "gitter" class TestGitterResources: resource = "rooms" def test_gitter_rooms_attribs(self, resource): assert resource.schema ==
{ "type": "object", "properties": { "token": {"type": "string", "title": "access token"}, "filter": {"type": "string", "title": "Filter results"}, }, "required": ["token"], "additionalProperties": False, }
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gmail.py
test_multiple_to
assert
string_literal
13
import pytest from notifiers.exceptions import BadArguments, NotificationError provider = "gmail" class TestGmail: def test_multiple_to(self, provider): to = ["foo@foo.com", "bar@foo.com"] rsp = provider.notify(to=to, message="foo", host="goo", username="ding", password="dong") assert r...
",".join(to)
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gmail.py
test_gmail_missing_required
pytest.raises
variable
15
import pytest from notifiers.exceptions import BadArguments, NotificationError provider = "gmail" class TestGmail: @pytest.mark.parametrize( "data, message", [({}, "message"), ({"message": "foo"}, "to")] ) def test_gmail_missing_required(self, data, message, provider): data["env_prefix"]...
BadArguments)
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gmail.py
test_email_from_key
assert
string_literal
16
import pytest from notifiers.exceptions import BadArguments, NotificationError provider = "gmail" class TestGmail: def test_email_from_key(self, provider): rsp = provider.notify( to="foo@foo.com", from_="bla@foo.com", message="foo", host="goo", username="ding", password="dong" ) ...
"bla@foo.com"
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gmail.py
test_gmail_missing_required
assert
complex_expr
17
import pytest from notifiers.exceptions import BadArguments, NotificationError provider = "gmail" class TestGmail: @pytest.mark.parametrize( "data, message", [({}, "message"), ({"message": "foo"}, "to")] ) def test_gmail_missing_required(self, data, message, provider): data["env_prefix"]...
e.value.message
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gmail.py
test_gmail_negative
assert
complex_expr
21
import pytest from notifiers.exceptions import BadArguments, NotificationError provider = "gmail" class TestGmail: def test_gmail_negative(self, provider): data = { "username": "foo", "password": "foo", "to": "foo@foo.com", "message": "bar", } ...
e.value.errors[0]
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gmail.py
test_gmail_negative
pytest.raises
variable
18
import pytest from notifiers.exceptions import BadArguments, NotificationError provider = "gmail" class TestGmail: def test_gmail_negative(self, provider): data = { "username": "foo", "password": "foo", "to": "foo@foo.com", "message": "bar", } ...
NotificationError)
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_gmail.py
test_gmail_metadata
assert
collection
11
import pytest from notifiers.exceptions import BadArguments, NotificationError provider = "gmail" class TestGmail: def test_gmail_metadata(self, provider): assert provider.metadata ==
{ "base_url": "smtp.gmail.com", "name": "gmail", "site_url": "https://www.google.com/gmail/about/", }
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_hipchat.py
test_hipchat_resources
assert
numeric_literal
14
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "hipchat" class TestHipchat: def test_hipchat_resources(self, provider): assert provider.resources assert len(provider.resourc...
2
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_hipchat.py
test_hipchat_rooms_attribs
assert
variable
44
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "hipchat" class TestHipChatRooms: resource = "rooms" def test_hipchat_rooms_attribs(self, resource): assert resource.schema == { ...
provider
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_hipchat.py
test_missing_required
pytest.raises
variable
40
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "hipchat" class TestHipchat: @pytest.mark.parametrize( "data, message", [ ( { "...
BadArguments)
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_hipchat.py
test_hipchat_rooms_negative_2
pytest.raises
variable
14
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "hipchat" class TestHipChatRooms: resource = "rooms" def test_hipchat_rooms_negative_2(self, resource): with pytest.raises(
ResourceError)
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_hipchat.py
test_missing_required
assert
complex_expr
42
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "hipchat" class TestHipchat: @pytest.mark.parametrize( "data, message", [ ( { "...
e.value.message
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_hipchat.py
test_hipchat_rooms_negative_2
assert
complex_expr
17
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "hipchat" class TestHipChatRooms: resource = "rooms" def test_hipchat_rooms_negative_2(self, resource): with pytest.raises(Resource...
e.value.errors[0]
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor
liiight/notifiers
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
train
train
tests/providers/test_hipchat.py
test_bad_request
pytest.raises
variable
20
import pytest from notifiers.exceptions import BadArguments from notifiers.exceptions import NotificationError from notifiers.exceptions import ResourceError provider = "hipchat" class TestHipchat: def test_bad_request(self, provider): data = { "token": "foo", "room": "baz", ...
NotificationError)
227dfad9107dce0a4f6b57f8fc827c43f6d70b38
72
v2_extractor_at_anchor