repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor import ImageUtilities
from util_funcs import create_sub_folders
def test_initialise_with_ten_images... | len(tmps) | assert | func_call | tests/test_load.py | test_initialise_with_ten_images | 123 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
from PIL import Image
from Augmentor import Operations
import glob
original_dimensions = (800, 800)
larger_dimensions = (1200, 1200)
smaller_dimensions = (400, 400)
def test_resize_save_to_disk():
... | n | assert | variable | tests/test_resize.py | test_resize_save_to_disk | 53 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
from PIL import Image
from Augmentor import Operations
from util_funcs import create_colour_temp_image, create_greyscale_temp_image
def test_in_memory_distortions():
tmp, tmpdir = create_colour_... | (800,800) | assert | collection | tests/test_distortion.py | test_in_memory_distortions | 26 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import pytest
import Augmentor
import Augmentor.Operations
def test_add_rotate_operation():
p = Augmentor.Pipeline()
assert len(p.augmentor_images) == 0
with pytest.raises( | ValueError) | pytest.raises | variable | tests/test_pipeline_add_operations.py | test_add_rotate_operation | 18 | null | |
mdbloice/Augmentor | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
from PIL import Image
import tempfile
import io
import shutil
import glob
import random
import numpy as np
... | None | assert | none_literal | tests/test_datapipeline.py | test_sample_with_masks | 149 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import pytest
import Augmentor
import Augmentor.Operations
def test_add_rotate_operation():
p = Augmentor.Pipeline()
assert len(p.augmentor_images) == | 0 | assert | numeric_literal | tests/test_pipeline_add_operations.py | test_add_rotate_operation | 16 | null | |
mdbloice/Augmentor | import Augmentor
import Augmentor.ImageUtilities
def test_user_param_parsing():
# Scalar input should return itself, as a integer
scalar_input = Augmentor.ImageUtilities.parse_user_parameter(user_param=5)
assert scalar_input == 5
assert type(scalar_input) == int
# A float input should return itse... | 0 | assert | numeric_literal | tests/test_user_operation_parameter_input.py | test_user_param_parsing | 27 | null | |
mdbloice/Augmentor | import Augmentor
import Augmentor.ImageUtilities
def test_user_param_parsing():
# Scalar input should return itself, as a integer
scalar_input = Augmentor.ImageUtilities.parse_user_parameter(user_param=5)
assert scalar_input == 5
assert type(scalar_input) == | int | assert | variable | tests/test_user_operation_parameter_input.py | test_user_param_parsing | 10 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
from Augmentor.Operations import Operation
import tempfile
from PIL import Image
import io
def test_adding_custom_function():
width = 80
height = 80
tmpdir = tempfile.mkdtemp()
tmps = []
for i in range(10):
tm... | len(tmps) | assert | func_call | tests/test_custom_operations.py | test_adding_custom_function | 54 | null | |
mdbloice/Augmentor | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image... | 3 | assert | numeric_literal | tests/test_generators.py | test_generator | 222 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor import ImageUtilities
from util_funcs import create_sub_folders
def run():
p = Augmento... | num_of_im_files | assert | variable | tests/test_load.py | run | 266 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor import ImageUtilities
from util_funcs import create_sub_folders
def run():
p = Augmento... | class_label_strings | assert | variable | tests/test_load.py | run | 247 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor.Operations import ZoomGroundTruth
def test_loading_ground_truth_images():
# Create directories fo... | len(image_names) | assert | func_call | tests/test_ground_truth_augmentation.py | test_loading_ground_truth_images | 53 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import tempfile
import shutil
from PIL import Image
from Augmentor import Operations
from util_funcs import create_colour_temp_image, create_greyscale_temp_image
def test_random_color_in_memory():
tmp, tmpdir = create_colour_temp_image((800, 800), "J... | None | assert | none_literal | tests/test_random_color_brightness_contrast.py | test_random_color_in_memory | 23 | null | |
mdbloice/Augmentor | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image... | 0 | assert | numeric_literal | tests/test_generators.py | test_generator_with_array_data | 147 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor.Operations import ZoomGroundTruth
def test_loading_ground_truth_images():
# Create directories fo... | len(ground_truth_images) | assert | func_call | tests/test_ground_truth_augmentation.py | test_loading_ground_truth_images | 66 | null | |
mdbloice/Augmentor | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image... | width | assert | variable | tests/test_generators.py | test_generator | 220 | null | |
mdbloice/Augmentor | import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import tempfile
import shutil
from PIL import Image
from Augmentor import Operations
def rotate_images(tmpdir, rot):
original_dimensions = (800, 800)
im_tmp = tmpdir.mkdir("subfolder").join('test.JPEG')
im = Image.new('RGB', original_dimension... | original_dimensions | assert | variable | tests/test_rotate.py | rotate_images | 23 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
import tempfile
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
from Augmentor import Operations
def test_create_gaussian_distortion_object():
g = Augmentor.Operations.GaussianDistortion(1, 8, 8, 8, "true", "true", 1.0, 1.0, 1.0, 1.0)
assert g is not | None | assert | none_literal | tests/test_gaussian.py | test_create_gaussian_distortion_object | 15 | null | |
mdbloice/Augmentor | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image... | len(y2) | assert | func_call | tests/test_generators.py | test_keras_generator_from_disk | 114 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor.Operations import ZoomGroundTruth
def test_zoom_ground_truth_temporary_class_without_ground_truth_ima... | 1 | assert | numeric_literal | tests/test_ground_truth_augmentation.py | test_zoom_ground_truth_temporary_class_without_ground_truth_images | 125 | null | |
mdbloice/Augmentor | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image... | batch_size | assert | variable | tests/test_generators.py | test_keras_generator_from_disk | 95 | null | |
mdbloice/Augmentor | import Augmentor
import Augmentor.ImageUtilities
def test_user_param_parsing():
# Scalar input should return itself, as a integer
scalar_input = Augmentor.ImageUtilities.parse_user_parameter(user_param=5)
assert scalar_input == 5
assert type(scalar_input) == int
# A float input should return itse... | 2 | assert | numeric_literal | tests/test_user_operation_parameter_input.py | test_user_param_parsing | 49 | null | |
mdbloice/Augmentor | import pytest
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
import Augmentor
import tempfile
import io
import shutil
import glob
import random
import numpy as np
from PIL import Image
from Augmentor import ImageUtilities
from util_funcs import create_sub_folders
def test_initialise_with_subfolders... | scanned_directories | assert | variable | tests/test_load.py | test_initialise_with_subfolders | 90 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | sample_order | assert | variable | test/core/test_cache.py | test_order_management | 106 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | usdt.free | assert | complex_expr | test/core/test_cache.py | test_cache_apply_balance | 216 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | async_cache.get_symbol_orders(sample_order.symbol) | assert | func_call | test/core/test_cache.py | test_order_management | 108 | null | |
Quantweb3-com/NexusTrader | import pytest
import asyncio
import time
from nexustrader.schema import Order, ExchangeType
from nexustrader.constants import OrderStatus, OrderSide, OrderType
from nexustrader.core.registry import OrderRegistry
def sample_order():
return Order(
id="test-order-1",
uuid="test-uuid-1",
exchan... | sample_order.uuid | assert | complex_expr | test/core/test_registry.py | test_order_registration | 33 | null | |
Quantweb3-com/NexusTrader | import pytest
import asyncio
from nexustrader.core.entity import TaskManager
@pytest.mark.asyncio
async def test_task_creation_and_execution(task_manager: TaskManager) -> None:
result = []
async def sample_task():
await asyncio.sleep(0.1)
result.append(1)
task = task_manager.create_task(s... | [1] | assert | collection | test/core/test_entity.py | test_task_creation_and_execution | 17 | null | |
Quantweb3-com/NexusTrader | import pytest
import types
from decimal import Decimal
from typing import List
from nexustrader.exchange.binance import BinanceExecutionManagementSystem
from nexustrader.schema import BaseMarket
def ems(market, cache, message_bus, task_manager, order_registry):
ems = BinanceExecutionManagementSystem(
marke... | expected_wait | assert | variable | test/base/test_execution_ems.py | test_cal_twap_orders | 87 | null | |
Quantweb3-com/NexusTrader | import pytest
from decimal import Decimal
from typing import Dict
from nexustrader.schema import PositionSide
from nexustrader.constants import OrderStatus, OrderSide, OrderType
from nexustrader.exchange.binance.constants import BinanceAccountType
from nexustrader.base import MockLinearConnector
async def mock_linear_... | 0 | assert | numeric_literal | test/base/test_mock_linear_connector.py | test_position_update_buy_and_sell | 144 | null | |
Quantweb3-com/NexusTrader | import pytest
import asyncio
import time
from nexustrader.schema import Order, ExchangeType
from nexustrader.constants import OrderStatus, OrderSide, OrderType
from nexustrader.core.registry import OrderRegistry
def sample_order():
return Order(
id="test-order-1",
uuid="test-uuid-1",
exchan... | sample_order.id | assert | complex_expr | test/core/test_registry.py | test_order_registration | 32 | null | |
Quantweb3-com/NexusTrader | from fastapi.testclient import TestClient
from nexustrader.web import create_strategy_app
def test_strategy_app_binds_self_method():
app = create_strategy_app()
class DummyStrategy:
calls: list[str] = []
@app.get("/ping")
async def on_web_cb(self):
self.calls.append("ping... | 200 | assert | numeric_literal | test/web/test_strategy_web_app.py | test_strategy_app_binds_self_method | 27 | null | |
Quantweb3-com/NexusTrader | import pytest
import types
from decimal import Decimal
from typing import List
from nexustrader.exchange.binance import BinanceExecutionManagementSystem
from nexustrader.schema import BaseMarket
def ems(market, cache, message_bus, task_manager, order_registry):
ems = BinanceExecutionManagementSystem(
marke... | expected_amounts | assert | variable | test/base/test_execution_ems.py | test_cal_twap_orders | 86 | null | |
Quantweb3-com/NexusTrader | import pytest
import asyncio
import time
from nexustrader.schema import Order, ExchangeType
from nexustrader.constants import OrderStatus, OrderSide, OrderType
from nexustrader.core.registry import OrderRegistry
def sample_order():
return Order(
id="test-order-1",
uuid="test-uuid-1",
exchan... | None | assert | none_literal | test/core/test_registry.py | test_remove_order | 56 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | None | assert | none_literal | test/core/test_cache.py | test_cache_cleanup | 127 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | async_cache.get_open_orders(symbol=sample_order.symbol) | assert | func_call | test/core/test_cache.py | test_order_management | 107 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | async_cache._mem_orders | assert | complex_expr | test/core/test_cache.py | test_cache_cleanup | 138 | null | |
Quantweb3-com/NexusTrader | from fastapi.testclient import TestClient
from nexustrader.web import create_strategy_app
def test_strategy_app_binds_self_method():
app = create_strategy_app()
class DummyStrategy:
calls: list[str] = []
@app.get("/ping")
async def on_web_cb(self):
self.calls.append("ping... | 404 | assert | numeric_literal | test/web/test_strategy_web_app.py | test_strategy_app_binds_self_method | 33 | null | |
Quantweb3-com/NexusTrader | from fastapi.testclient import TestClient
from nexustrader.web import create_strategy_app
def test_strategy_app_binds_self_method():
app = create_strategy_app()
class DummyStrategy:
calls: list[str] = []
@app.get("/ping")
async def on_web_cb(self):
self.calls.append("ping... | {"status": "ok"} | assert | collection | test/web/test_strategy_web_app.py | test_strategy_app_binds_self_method | 28 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | async_cache.get_open_orders( symbol=updated_order.symbol ) | assert | func_call | test/core/test_cache.py | test_order_management | 116 | null | |
Quantweb3-com/NexusTrader | import pytest
from nexustrader.core.entity import is_redis_available, get_redis_client_if_available
def test_redis_client_if_available():
"""Test Redis client getter"""
client = get_redis_client_if_available()
if client is not None:
# If client is returned, Redis should be available
asser... | True | assert | bool_literal | test/core/test_redis_utils.py | test_redis_client_if_available | 19 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | bookl1 | assert | variable | test/core/test_cache.py | test_market_data_cache | 84 | null | |
Quantweb3-com/NexusTrader | from fastapi.testclient import TestClient
from nexustrader.web import create_strategy_app
def test_strategy_app_binds_self_method():
app = create_strategy_app()
class DummyStrategy:
calls: list[str] = []
@app.get("/ping")
async def on_web_cb(self):
self.calls.append("ping... | ["ping"] | assert | collection | test/web/test_strategy_web_app.py | test_strategy_app_binds_self_method | 29 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | btc.locked | assert | complex_expr | test/core/test_cache.py | test_cache_apply_balance | 214 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | usdt.total | assert | complex_expr | test/core/test_cache.py | test_cache_apply_balance | 201 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | trade | assert | variable | test/core/test_cache.py | test_market_data_cache | 95 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | btc.free | assert | complex_expr | test/core/test_cache.py | test_cache_apply_balance | 213 | null | |
Quantweb3-com/NexusTrader | import pytest
import time
from decimal import Decimal
from copy import copy
from nexustrader.schema import (
Order,
ExchangeType,
BookL1,
Kline,
Trade,
Position,
PositionSide,
Balance,
)
from nexustrader.constants import OrderStatus, OrderSide, OrderType, KlineInterval
from nexustrader.c... | updated_order | assert | variable | test/core/test_cache.py | test_order_management | 115 | null | |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch5TestCase(unittest.TestCase):
def setUp(self):
# Import ch5 app specifically
ch5_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch5', 'app.py')
spec = importlib.util.spec_from_file_location("ch5_app", ch5_path)
... | ch5_models.Article) | self.assertIsNotNone | complex_expr | tests/test_ch5.py | test_database_models | Ch5TestCase | 47 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch3TestCase(unittest.TestCase):
def setUp(self):
# Import ch3 app specifically
ch3_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch3')
ch3_path = os.path.join(ch3_dir, 'app.py')
# Change to the ch3 dir... | self.app) | self.assertIsNotNone | complex_expr | tests/test_ch3.py | test_app_exist | Ch3TestCase | 27 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class CkeditorTestCase(unittest.TestCase):
def setUp(self):
# Import ckeditor app specifically
ckeditor_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ckeditor')
ckeditor_path = os.path.join(ckeditor_dir, 'app.py')
... | self.app) | self.assertIsNotNone | complex_expr | tests/test_ckeditor.py | test_app_exist | CkeditorTestCase | 29 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch5TestCase(unittest.TestCase):
def setUp(self):
# Import ch5 app specifically
ch5_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch5', 'app.py')
spec = importlib.util.spec_from_file_location("ch5_app", ch5_path)
... | ch5_models.Country) | self.assertIsNotNone | complex_expr | tests/test_ch5.py | test_database_models | Ch5TestCase | 48 | null |
greyli/helloflask | import unittest
import os
os.environ['DATABASE_URL'] = 'sqlite:///:memory:'
from sqlalchemy import select, func
from app import app, db, Note, lorem_command, init_command
class NotebookTestCase(unittest.TestCase):
def setUp(self):
app.config.update(
TESTING=True,
WTF_CSRF_ENABLED=... | app.config['TESTING']) | self.assertTrue | complex_expr | examples/notebook/test_app.py | test_app_is_testing | NotebookTestCase | 37 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch5TestCase(unittest.TestCase):
def setUp(self):
# Import ch5 app specifically
ch5_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch5', 'app.py')
spec = importlib.util.spec_from_file_location("ch5_app", ch5_path)
... | self.app) | self.assertIsNotNone | complex_expr | tests/test_ch5.py | test_app_exist | Ch5TestCase | 28 | null |
greyli/helloflask | import unittest
import sys
import os
import importlib.util
class Ch4TestCase(unittest.TestCase):
def setUp(self):
# Import ch4 app specifically
ch4_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch4')
ch4_path = os.path.join(ch4_dir, 'app.py')
# Change to ... | self.app) | self.assertIsNotNone | complex_expr | tests/test_ch4.py | test_app_exist | Ch4TestCase | 33 | null |
greyli/helloflask | import unittest
import os
os.environ['DATABASE_URL'] = 'sqlite:///:memory:'
from sqlalchemy import select, func
from app import app, db, Note, lorem_command, init_command
class NotebookTestCase(unittest.TestCase):
def setUp(self):
app.config.update(
TESTING=True,
WTF_CSRF_ENABLED=... | result.output) | self.assertIn | complex_expr | examples/notebook/test_app.py | test_lorem_command | NotebookTestCase | 93 | null |
greyli/helloflask | import unittest
import sys
import os
import importlib.util
class Ch4TestCase(unittest.TestCase):
def setUp(self):
# Import ch4 app specifically
ch4_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch4')
ch4_path = os.path.join(ch4_dir, 'app.py')
# Change to ... | self.app.config['TESTING']) | self.assertTrue | complex_expr | tests/test_ch4.py | test_app_is_testing | Ch4TestCase | 36 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class CkeditorTestCase(unittest.TestCase):
def setUp(self):
# Import ckeditor app specifically
ckeditor_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ckeditor')
ckeditor_path = os.path.join(ckeditor_dir, 'app.py')
... | self.app.config['TESTING']) | self.assertTrue | complex_expr | tests/test_ckeditor.py | test_app_is_testing | CkeditorTestCase | 32 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch5TestCase(unittest.TestCase):
def setUp(self):
# Import ch5 app specifically
ch5_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch5', 'app.py')
spec = importlib.util.spec_from_file_location("ch5_app", ch5_path)
... | result.output) | self.assertIn | complex_expr | tests/test_ch5.py | test_cli_init_command | Ch5TestCase | 35 | null |
greyli/helloflask | import unittest
import os
import importlib.util
from pathlib import Path
class AlbumTestCase(unittest.TestCase):
def setUp(self):
# Import album app specifically
album_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'album')
album_path = os.path.join(album_dir, 'app.py')
... | self.app.config['TESTING']) | self.assertTrue | complex_expr | tests/test_album.py | test_app_is_testing | AlbumTestCase | 43 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class AssetsTestCase(unittest.TestCase):
def setUp(self):
# Import assets app specifically
assets_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'assets')
assets_path = os.path.join(assets_dir, 'app.py')
# Cha... | self.app.config['TESTING']) | self.assertTrue | complex_expr | tests/test_assets.py | test_app_is_testing | AssetsTestCase | 32 | null |
greyli/helloflask | import unittest
import os
os.environ['DATABASE_URL'] = 'sqlite:///:memory:'
from sqlalchemy import select, func
from app import app, db, Note, lorem_command, init_command
class NotebookTestCase(unittest.TestCase):
def setUp(self):
app.config.update(
TESTING=True,
WTF_CSRF_ENABLED=... | data) | self.assertIn | variable | examples/notebook/test_app.py | test_index_page | NotebookTestCase | 43 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class AssetsTestCase(unittest.TestCase):
def setUp(self):
# Import assets app specifically
assets_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'assets')
assets_path = os.path.join(assets_dir, 'app.py')
# Cha... | self.app) | self.assertIsNotNone | complex_expr | tests/test_assets.py | test_app_exist | AssetsTestCase | 29 | null |
greyli/helloflask | import unittest
import sys
import os
import importlib.util
class Ch4TestCase(unittest.TestCase):
def setUp(self):
# Import ch4 app specifically
ch4_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch4')
ch4_path = os.path.join(ch4_dir, 'app.py')
# Change to ... | 200) | self.assertEqual | numeric_literal | tests/test_ch4.py | test_index_page | Ch4TestCase | 41 | null |
greyli/helloflask | import unittest
import os
os.environ['DATABASE_URL'] = 'sqlite:///:memory:'
from sqlalchemy import select, func
from app import app, db, Note, lorem_command, init_command
class NotebookTestCase(unittest.TestCase):
def setUp(self):
app.config.update(
TESTING=True,
WTF_CSRF_ENABLED=... | 50) | self.assertEqual | numeric_literal | examples/notebook/test_app.py | test_lorem_command_with_count | NotebookTestCase | 101 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class LongtalkTestCase(unittest.TestCase):
def setUp(self):
# Import longtalk app specifically
longtalk_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'longtalk')
longtalk_path = os.path.join(longtalk_dir, 'app.py')
... | 200) | self.assertEqual | numeric_literal | tests/test_longtalk.py | test_index_page | LongtalkTestCase | 37 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch2TestCase(unittest.TestCase):
def setUp(self):
# Import ch2 app specifically
ch2_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch2', 'app.py')
spec = importlib.util.spec_from_file_location("ch2_app", ch2_path)
... | 400) | self.assertEqual | numeric_literal | tests/test_ch2.py | test_note_invalid_format | Ch2TestCase | 107 | null |
greyli/helloflask | import unittest
import os
os.environ['DATABASE_URL'] = 'sqlite:///:memory:'
from sqlalchemy import select, func
from app import app, db, Note, lorem_command, init_command
class NotebookTestCase(unittest.TestCase):
def setUp(self):
app.config.update(
TESTING=True,
WTF_CSRF_ENABLED=... | 20) | self.assertEqual | numeric_literal | examples/notebook/test_app.py | test_lorem_command | NotebookTestCase | 95 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch3TestCase(unittest.TestCase):
def setUp(self):
# Import ch3 app specifically
ch3_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch3')
ch3_path = os.path.join(ch3_dir, 'app.py')
# Change to the ch3 dir... | data) | self.assertIn | variable | tests/test_ch3.py | test_watchlist_page | Ch3TestCase | 36 | null |
greyli/helloflask | import unittest
import os
import importlib.util
from pathlib import Path
class AlbumTestCase(unittest.TestCase):
def setUp(self):
# Import album app specifically
album_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'album')
album_path = os.path.join(album_dir, 'app.py')
... | data) | self.assertIn | variable | tests/test_album.py | test_index_page | AlbumTestCase | 49 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch1TestCase(unittest.TestCase):
def setUp(self):
# Import ch1 app specifically
ch1_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch1', 'app.py')
spec = importlib.util.spec_from_file_location("ch1_app", ch1_path)
... | self.app.config['TESTING']) | self.assertTrue | complex_expr | tests/test_ch1.py | test_app_is_testing | Ch1TestCase | 22 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch5TestCase(unittest.TestCase):
def setUp(self):
# Import ch5 app specifically
ch5_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch5', 'app.py')
spec = importlib.util.spec_from_file_location("ch5_app", ch5_path)
... | ch5_models.Author) | self.assertIsNotNone | complex_expr | tests/test_ch5.py | test_database_models | Ch5TestCase | 46 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class CkeditorTestCase(unittest.TestCase):
def setUp(self):
# Import ckeditor app specifically
ckeditor_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ckeditor')
ckeditor_path = os.path.join(ckeditor_dir, 'app.py')
... | 200) | self.assertEqual | numeric_literal | tests/test_ckeditor.py | test_index_page | CkeditorTestCase | 37 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class LongtalkTestCase(unittest.TestCase):
def setUp(self):
# Import longtalk app specifically
longtalk_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'longtalk')
longtalk_path = os.path.join(longtalk_dir, 'app.py')
... | self.app.config['TESTING']) | self.assertTrue | complex_expr | tests/test_longtalk.py | test_app_is_testing | LongtalkTestCase | 32 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch2TestCase(unittest.TestCase):
def setUp(self):
# Import ch2 app specifically
ch2_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch2', 'app.py')
spec = importlib.util.spec_from_file_location("ch2_app", ch2_path)
... | 404) | self.assertEqual | numeric_literal | tests/test_ch2.py | test_404_error | Ch2TestCase | 73 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch1TestCase(unittest.TestCase):
def setUp(self):
# Import ch1 app specifically
ch1_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch1', 'app.py')
spec = importlib.util.spec_from_file_location("ch1_app", ch1_path)
... | self.app) | self.assertIsNotNone | complex_expr | tests/test_ch1.py | test_app_exist | Ch1TestCase | 19 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class AssetsTestCase(unittest.TestCase):
def setUp(self):
# Import assets app specifically
assets_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'assets')
assets_path = os.path.join(assets_dir, 'app.py')
# Cha... | 200) | self.assertEqual | numeric_literal | tests/test_assets.py | test_index_page | AssetsTestCase | 37 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch5TestCase(unittest.TestCase):
def setUp(self):
# Import ch5 app specifically
ch5_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch5', 'app.py')
spec = importlib.util.spec_from_file_location("ch5_app", ch5_path)
... | ch5_models.Capital) | self.assertIsNotNone | complex_expr | tests/test_ch5.py | test_database_models | Ch5TestCase | 49 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch3TestCase(unittest.TestCase):
def setUp(self):
# Import ch3 app specifically
ch3_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch3')
ch3_path = os.path.join(ch3_dir, 'app.py')
# Change to the ch3 dir... | 200) | self.assertEqual | numeric_literal | tests/test_ch3.py | test_watchlist_page | Ch3TestCase | 35 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch5TestCase(unittest.TestCase):
def setUp(self):
# Import ch5 app specifically
ch5_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch5', 'app.py')
spec = importlib.util.spec_from_file_location("ch5_app", ch5_path)
... | self.app.config['TESTING']) | self.assertTrue | complex_expr | tests/test_ch5.py | test_app_is_testing | Ch5TestCase | 31 | null |
greyli/helloflask | import unittest
import os
import importlib.util
from pathlib import Path
class AlbumTestCase(unittest.TestCase):
def setUp(self):
# Import album app specifically
album_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'album')
album_path = os.path.join(album_dir, 'app.py')
... | 200) | self.assertEqual | numeric_literal | tests/test_album.py | test_index_page | AlbumTestCase | 48 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class CacheTestCase(unittest.TestCase):
def setUp(self):
# Import cache app specifically
cache_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'cache')
cache_path = os.path.join(cache_dir, 'app.py')
# Change to... | self.app) | self.assertIsNotNone | complex_expr | tests/test_cache.py | test_app_exist | CacheTestCase | 27 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch1TestCase(unittest.TestCase):
def setUp(self):
# Import ch1 app specifically
ch1_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch1', 'app.py')
spec = importlib.util.spec_from_file_location("ch1_app", ch1_path)
... | data) | self.assertIn | variable | tests/test_ch1.py | test_index_page | Ch1TestCase | 28 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch1TestCase(unittest.TestCase):
def setUp(self):
# Import ch1 app specifically
ch1_path = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch1', 'app.py')
spec = importlib.util.spec_from_file_location("ch1_app", ch1_path)
... | 200) | self.assertEqual | numeric_literal | tests/test_ch1.py | test_index_page | Ch1TestCase | 27 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class LongtalkTestCase(unittest.TestCase):
def setUp(self):
# Import longtalk app specifically
longtalk_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'longtalk')
longtalk_path = os.path.join(longtalk_dir, 'app.py')
... | self.app) | self.assertIsNotNone | complex_expr | tests/test_longtalk.py | test_app_exist | LongtalkTestCase | 29 | null |
greyli/helloflask | import unittest
import sys
import os
import importlib.util
class Ch4TestCase(unittest.TestCase):
def setUp(self):
# Import ch4 app specifically
ch4_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch4')
ch4_path = os.path.join(ch4_dir, 'app.py')
# Change to ... | data) | self.assertIn | variable | tests/test_ch4.py | test_index_page | Ch4TestCase | 42 | null |
greyli/helloflask | import unittest
import os
import importlib.util
class Ch3TestCase(unittest.TestCase):
def setUp(self):
# Import ch3 app specifically
ch3_dir = os.path.join(os.path.dirname(__file__), '..', 'examples', 'ch3')
ch3_path = os.path.join(ch3_dir, 'app.py')
# Change to the ch3 dir... | self.app.config['TESTING']) | self.assertTrue | complex_expr | tests/test_ch3.py | test_app_is_testing | Ch3TestCase | 30 | null |
pyranges/pyranges | import subprocess # nosec
import tempfile
from io import StringIO
from itertools import product
import numpy as np
import pandas as pd
import pytest
from hypothesis import reproduce_failure # noqa: F401
from hypothesis import HealthCheck, given, settings
from tests.helpers import assert_df_equal
from tests.property... | result.FractionOverlaps) | assert_* | complex_expr | tests/property_based/test_binary.py | test_coverage | 231 | null | |
pyranges/pyranges | from io import StringIO
import numpy as np
import pandas as pd
import pytest
import pyranges as pr
def string_to_df(c):
return pd.read_csv(
StringIO(c),
sep=r"\s+",
dtype={
"Chromosome": "category",
"Start": np.int32,
"End": np.int32,
"Start... | result_k_nearest_last) | assert_* | variable | tests/unit/k_nearest.py | test_k_nearest_last | 201 | null | |
pyranges/pyranges | import subprocess # nosec
import tempfile
from io import StringIO
import numpy as np
import pandas as pd
import pytest
from hypothesis import reproduce_failure # noqa: F401
from hypothesis import HealthCheck, given, settings
from natsort import natsorted # type: ignore
import pyranges as pr
from tests.helpers impo... | bedtools_df.drop("Cluster", axis=1)) | assert_* | func_call | tests/property_based/test_unary.py | test_cluster | 155 | null | |
pyranges/pyranges | import pandas as pd
def assert_df_equal(df1, df2):
print("-" * 100)
print("df1")
print(df1)
print("df2")
print(df2)
# df1.loc[:, "Start"] = df1.Start.astype(np.int64)
# df2.loc[:, "Start"] = df1.Start.astype(np.int64)
# df1.loc[:, "End"] = df1.End.astype(np.int64)
# df2.loc[:, "End... | df2) | assert_* | variable | tests/helpers.py | assert_df_equal | 59 | null | |
pyranges/pyranges | from pandas.testing import assert_series_equal
import pyranges as pr
def test_join_without_reordering():
f1 = pr.from_dict(
{
"Chromosome": ["chr1", "chr1", "chr1"],
"Start": [3, 8, 5],
"End": [6, 9, 7],
"Name": ["interval1", "interval3", "interval2"],
... | f2.Name) | assert_* | complex_expr | tests/unit/join/test_join.py | test_join_without_reordering | 32 | null | |
pyranges/pyranges | import pandas as pd
import pyranges as pr
def test_change_chromosomes():
df1 = pd.DataFrame({"Chromosome": ["chr1", "chr2"], "Start": [100, 200], "End": [150, 201]})
py1 = pr.PyRanges(df1)
def modify_chrom_series(df):
df.Chromosome = df.Chromosome.apply(lambda val: val.replace("chr", ""))
... | ["1", "2"] | assert | collection | tests/unit/test_change_chromosome_custom.py | test_change_chromosomes | 21 | null | |
pyranges/pyranges | import subprocess # nosec
import tempfile
from io import StringIO
from itertools import product
import numpy as np
import pandas as pd
import pytest
from hypothesis import reproduce_failure # noqa: F401
from hypothesis import HealthCheck, given, settings
from tests.helpers import assert_df_equal
from tests.property... | result.df.empty | assert | complex_expr | tests/property_based/test_binary.py | compare_results | 78 | null | |
pyranges/pyranges | from pandas.testing import assert_series_equal
import pyranges as pr
def test_join_without_reordering():
f1 = pr.from_dict(
{
"Chromosome": ["chr1", "chr1", "chr1"],
"Start": [3, 8, 5],
"End": [6, 9, 7],
"Name": ["interval1", "interval3", "interval2"],
... | f1.Name) | assert_* | complex_expr | tests/unit/join/test_join.py | test_join_without_reordering | 29 | null | |
pyranges/pyranges | import pytest
def test_getsetattr_fails(chip_10):
with pytest.raises( | Exception) | pytest.raises | variable | tests/unit/test_getset_attr.py | test_getsetattr_fails | 11 | null | |
pyranges/pyranges | import numpy as np
from pandas.testing import assert_frame_equal
import pyranges as pr
ensembl_gtf = "tests/unit/test_data/ensembl.gtf"
def test_read_gtf_multiple_chunks():
skiprows = pr.readers.skiprows(ensembl_gtf)
gr = pr.readers.read_gtf_full(ensembl_gtf, chunksize=2, skiprows=skiprows)
gr2 = pr.read... | df2) | assert_* | variable | tests/unit/test_io.py | test_read_gtf_multiple_chunks | 48 | null | |
pyranges/pyranges | import subprocess # nosec
import tempfile
from io import StringIO
from itertools import product
import numpy as np
import pandas as pd
import pytest
from hypothesis import reproduce_failure # noqa: F401
from hypothesis import HealthCheck, given, settings
from tests.helpers import assert_df_equal
from tests.property... | result | assert | variable | tests/property_based/test_binary.py | test_jaccard | 362 | null | |
pyranges/pyranges | import subprocess # nosec
import tempfile
from io import StringIO
import numpy as np
import pandas as pd
import pytest
from hypothesis import reproduce_failure # noqa: F401
from hypothesis import HealthCheck, given, settings
from natsort import natsorted # type: ignore
import pyranges as pr
from tests.helpers impo... | bedtools_df.sort_values("Chromosome Start".split())) | assert_* | func_call | tests/property_based/test_unary.py | test_merge | 83 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.