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 |
|---|---|---|---|---|---|---|---|---|---|
unionai-oss/pandera | import copy
from collections.abc import Callable
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Union
import numpy as np
import pandas as pd
import pytest
from pandera.api.pandas.array import ArraySchema
from pandera.dtypes import UniqueSettings
from pandera.engines.pan... | x | assert | variable | tests/pandas/test_schemas.py | test_dataframe_schema_str_repr | 951 | null | |
unionai-oss/pandera | from collections.abc import Iterable
from contextlib import nullcontext
from typing import Optional, Union
import ibis
import ibis.expr.datatypes as dt
import pytest
from ibis.common.exceptions import IbisTypeError
import pandera.ibis as pa
from pandera.backends.base import CoreCheckResult
from pandera.backends.ibis.... | 3 | assert | numeric_literal | tests/ibis/test_ibis_components.py | test_check_nullable_regex | 202 | null | |
unionai-oss/pandera | import geopandas as gpd
import pandas as pd
import pytest
from shapely.geometry import Point, Polygon
import pandera.pandas as pa
from pandera.engines.geopandas_engine import Geometry
from pandera.typing import Series
from pandera.typing.geopandas import GeoDataFrame, GeoSeries
def test_schema_multiple_geometry_same_... | data["random"]) | assert_* | complex_expr | tests/geopandas/test_geopandas.py | test_schema_multiple_geometry_same_crs | 205 | null | |
unionai-oss/pandera | import os
import re
import runpy
from collections.abc import Iterable
from copy import deepcopy
from enum import Enum
from typing import Any, Generic, Optional, TypeVar
import numpy as np
import pandas as pd
import pytest
from pandas._testing import assert_frame_equal
import pandera.api.extensions as pax
import pande... | 1 | assert | numeric_literal | tests/pandas/test_model.py | test_check_multiple_columns | 542 | null | |
unionai-oss/pandera | import pickle
from collections.abc import Iterable
import pandas as pd
import pytest
from pandera.backends.pandas.register import register_pandas_backends
register_pandas_backends("pandera.typing.pandas.Series")
from pandera.api.checks import Check
from pandera.api.pandas.array import SeriesSchema
from pandera.api.... | passes | assert | variable | tests/pandas/test_checks_builtin.py | check_values | 34 | null | |
unionai-oss/pandera | import datetime
import operator
import re
from collections.abc import Callable
from typing import Any, Optional
from unittest.mock import MagicMock
from warnings import catch_warnings
import numpy as np
import pandas as pd
import pytest
import pandera.pandas as pa
from pandera.api.checks import Check
from pandera.api... | data.draw(strat) | assert | func_call | tests/strategies/test_strategies.py | test_in_range_strategy | 283 | null | |
unionai-oss/pandera | import geopandas as gpd
import pandas as pd
import pytest
from shapely.geometry import Point, Polygon
import pandera.pandas as pa
from pandera.engines.geopandas_engine import Geometry
from pandera.typing import Series
from pandera.typing.geopandas import GeoDataFrame, GeoSeries
@pytest.mark.parametrize(
"gdf_args... | TypeError) | pytest.raises | variable | tests/geopandas/test_geopandas.py | test_schema_dtype_crs_with_coerce | 158 | null | |
unionai-oss/pandera | import os
import re
import runpy
from collections.abc import Iterable
from copy import deepcopy
from enum import Enum
from typing import Any, Generic, Optional, TypeVar
import numpy as np
import pandas as pd
import pytest
from pandas._testing import assert_frame_equal
import pandera.api.extensions as pax
import pande... | 2 | assert | numeric_literal | tests/pandas/test_model.py | test_check_validate_method_aliased_field | 424 | null | |
unionai-oss/pandera | import polars as pl
import pytest
import pandera.polars as pa
from pandera.api.base.error_handler import ErrorCategory
from pandera.api.polars.utils import get_lazyframe_schema
from pandera.config import (
CONFIG,
ValidationDepth,
config_context,
get_config_context,
get_config_global,
reset_con... | exc.message | assert | complex_expr | tests/polars/test_polars_config.py | test_lazyframe_validation_depth_none | 104 | null | |
unionai-oss/pandera | import io
import sys
from unittest.mock import MagicMock, patch
import polars as pl
import pytest
import pandera.polars as pa
from pandera.engines import PYDANTIC_V2
from pandera.errors import SchemaInitError
from pandera.typing.formats import Formats
from pandera.typing.polars import DataFrame, Series, polars_versio... | df | assert | variable | tests/polars/test_polars_typing.py | test_from_format_callable | TestDataFrame | 148 | null |
unionai-oss/pandera | import multiprocessing
import pickle
from typing import NoReturn, cast
import numpy as np
import pandas as pd
import pytest
from pandera.config import ValidationDepth, config_context
from pandera.engines import numpy_engine, pandas_engine
from pandera.errors import (
ParserError,
ReducedPickleExceptionBase,
... | exc_unpickled.foo_a | assert | complex_expr | tests/pandas/test_errors.py | validate_unpickled | TestReducedPickleException | 85 | null |
unionai-oss/pandera | import io
import sys
from unittest.mock import MagicMock, patch
import ibis
import pytest
import pandera.ibis as pa
from pandera.typing.formats import Formats
from pandera.typing.ibis import Table, ibis_version
def test_type_vars():
"""Test TYPE_CHECKING behavior for TypeVar T."""
# This is a bit tricky to t... | None | assert | none_literal | tests/ibis/test_ibis_typing.py | test_type_vars | 28 | null | |
unionai-oss/pandera | import pandas as pd
from docs.source import conf
def test_sphinx_doctest_setting_global_pandas_conditions() -> None:
"""Checks that no limit is set on the height/width of the __repr__/__str__
print of a pd.DataFrame to ensure doctest performs consistently across
different Operating Systems."""
# pylin... | None | assert | none_literal | tests/pandas/test_docs_setting_column_widths.py | test_sphinx_doctest_setting_global_pandas_conditions | 20 | null | |
unionai-oss/pandera | import copy
import pandas as pd
import pytest
from pandera.backends.pandas import error_formatters
from pandera.pandas import (
Bool,
Check,
Column,
DataFrameSchema,
Float,
Index,
Int,
SeriesSchema,
String,
errors,
)
def test_custom_check_error_is_failure_case(extra_registered... | {"CHECK_ERROR": 1} | assert | collection | tests/pandas/test_checks.py | test_custom_check_error_is_failure_case | 494 | null | |
unionai-oss/pandera | from typing import Optional
import ibis
import ibis.expr.datatypes as dt
import ibis.expr.types as ir
import pandas as pd
import pytest
from ibis import _
from ibis import selectors as s
import pandera as pa
from pandera.api.ibis.types import IbisData
from pandera.dtypes import UniqueSettings
from pandera.ibis import... | pa.errors.SchemaError) | pytest.raises | complex_expr | tests/ibis/test_ibis_container.py | test_different_unique_settings | 237 | null | |
unionai-oss/pandera | import pyspark.sql.types as T
import pytest
from pyspark.sql.types import StringType
import pandera.pyspark as pa
from pandera.api.base import error_handler
from pandera.errors import SchemaError, SchemaErrorReason
from pandera.pyspark import Column, DataFrameModel, DataFrameSchema, Field
from tests.pyspark.conftest i... | expected | assert | variable | tests/pyspark/test_pyspark_error.py | test_pyspark_check_eq | 70 | null | |
unionai-oss/pandera | import asyncio
import pickle
import typing
from contextlib import nullcontext
from copy import deepcopy
import numpy as np
import pandas as pd
import pytest
from pandera.engines.pandas_engine import Engine
from pandera.pandas import (
Check,
Column,
DataFrameModel,
DataFrameSchema,
DateTime,
F... | actual) | assert_* | variable | tests/pandas/test_decorators.py | test_check_types_star_args_kwargs | 1,525 | null | |
unionai-oss/pandera | import polars as pl
import pytest
import pandera.polars as pa
from pandera.api.polars.utils import get_lazyframe_schema
from pandera.constants import CHECK_OUTPUT_KEY
def column_lf():
return pl.LazyFrame({"col": pl.Series([1, 2, 3, 4], dtype=int)})
def lf():
return pl.LazyFrame(
{
"col_1"... | pa.errors.SchemaError) | pytest.raises | complex_expr | tests/polars/test_polars_check.py | test_polars_custom_check | 230 | null | |
unionai-oss/pandera | from typing import Any, Optional, Union
import pandas as pd
import pytest
import pandera.pandas as pa
import pandera.strategies.pandas_strategies as st
from pandera import DataType, extensions
from pandera.api.checks import Check
from pandera.backends.pandas.register import register_pandas_backends
def register_pand... | dir(Check) | assert | func_call | tests/pandas/test_extensions.py | test_custom_checks_in_dir | 24 | null | |
geopy/geopy | import pytest
from geopy.exc import GeocoderQueryError
from geopy.geocoders import IGNFrance
from test.geocoders.util import BaseTestGeocoder
from test.proxy_server import ProxyServerThread
class TestIGNFrance(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return IGNFrance(
timeout=10
... | addresses | assert | variable | test/geocoders/ignfrance.py | test_geocode_position_of_interest | TestIGNFrance | 76 | null |
geopy/geopy | import pytest
from geopy.format import format_degrees
from geopy.point import Point
@pytest.mark.parametrize(
"input, expected",
[
(("12", "30", 0), "12 30' 0\""),
(("12", "30", "30"), "12 30' 30\""),
(("12", "30", 30.4), "12 30' 30.4\""),
],
)
def test_format_simple(input, expecte... | expected | assert | variable | test/test_format.py | test_format_simple | 16 | null | |
geopy/geopy | import base64
from datetime import datetime
from urllib.parse import parse_qs, urlparse
import pytest
from geopy import exc
from geopy.geocoders import GoogleV3
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestGoogleV3(BaseTestGeocoder):
new_york_point = Point(40.7537... | params | assert | variable | test/geocoders/googlev3.py | test_get_signed_url_with_channel | TestGoogleV3 | 95 | null |
geopy/geopy | import pytest
from geopy.exc import GeocoderQueryError
from geopy.geocoders import IGNFrance
from test.geocoders.util import BaseTestGeocoder
from test.proxy_server import ProxyServerThread
class TestIGNFrance(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return IGNFrance(
timeout=10
... | GeocoderQueryError) | pytest.raises | variable | test/geocoders/ignfrance.py | test_invalid_query_type | TestIGNFrance | 18 | null |
geopy/geopy | import importlib
import inspect
import pkgutil
import docutils.core
import docutils.utils
import pytest
import geopy.geocoders
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
skip_modules = [
"geopy.geocoders.base", # doesn't contain actual geocoders
"geopy.geocoders.googlev3", # deprecated
... | documented_types | assert | variable | test/geocoders/__init__.py | assert_rst | 90 | null | |
geopy/geopy | import asyncio
from unittest.mock import MagicMock, patch, sentinel
import pytest
from geopy.exc import GeocoderQuotaExceeded, GeocoderServiceError
from geopy.extra.rate_limiter import AsyncRateLimiter, RateLimiter
def is_async(request):
return request.param
def auto_async(is_async):
if is_async:
as... | sentinel.arg) | assert_* | complex_expr | test/extra/rate_limiter.py | test_min_delay | 78 | null | |
geopy/geopy | import math
import unittest
import warnings
from geopy.distance import (
EARTH_RADIUS,
Distance,
GeodesicDistance,
GreatCircleDistance,
distance,
lonlat,
)
from geopy.point import Point
EARTH_CIRCUMFERENCE = 2 * math.pi * EARTH_RADIUS
NORTH_POLE = Point(90, 0)
SOUTH_POLE = Point(-90, 0)
FIJI =... | 4) | self.assertAlmostEqual | numeric_literal | test/test_distance.py | test_max_longitude | CommonDistanceComputationCases | 44 | null |
geopy/geopy | import importlib
import inspect
import pkgutil
import docutils.core
import docutils.utils
import pytest
import geopy.geocoders
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
skip_modules = [
"geopy.geocoders.base", # doesn't contain actual geocoders
"geopy.geocoders.googlev3", # deprecated
... | sig) | assert_* | variable | test/geocoders/__init__.py | test_init_method_signature | 158 | null | |
geopy/geopy | import asyncio
from unittest.mock import MagicMock, patch, sentinel
import pytest
from geopy.exc import GeocoderQuotaExceeded, GeocoderServiceError
from geopy.extra.rate_limiter import AsyncRateLimiter, RateLimiter
def is_async(request):
return request.param
def auto_async(is_async):
if is_async:
as... | error_wait) | assert_* | variable | test/extra/rate_limiter.py | test_error_wait_seconds | 151 | null | |
geopy/geopy | from geopy.geocoders import BANFrance
from test.geocoders.util import BaseTestGeocoder
class TestBANFrance(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return BANFrance(timeout=10, **kwargs)
async def test_user_agent_custom(self):
geocoder = BANFrance(
user_agent='my_user_... | 'my_user_agent/1.0' | assert | string_literal | test/geocoders/banfrance.py | test_user_agent_custom | TestBANFrance | 15 | null |
geopy/geopy | import asyncio
from unittest.mock import MagicMock, patch, sentinel
import pytest
from geopy.exc import GeocoderQuotaExceeded, GeocoderServiceError
from geopy.extra.rate_limiter import AsyncRateLimiter, RateLimiter
def is_async(request):
return request.param
def auto_async(is_async):
if is_async:
as... | ValueError) | pytest.raises | variable | test/extra/rate_limiter.py | test_max_retries | 106 | null | |
geopy/geopy | import uuid
import pytest
from geopy import Point
from geopy.exc import GeocoderAuthenticationFailure, GeocoderQueryError
from geopy.geocoders import GeoNames
from test.geocoders.util import BaseTestGeocoder, env
class TestGeoNames(BaseTestGeocoder):
delta = 0.04
def make_geocoder(cls, **kwargs):
r... | 'US' | assert | string_literal | test/geocoders/geonames.py | test_reverse_timezone | TestGeoNames | 153 | null |
geopy/geopy | import warnings
from unittest.mock import patch
import pytest
import geopy.geocoders
from geopy.exc import ConfigurationError
from geopy.geocoders import Nominatim
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder
class BaseTestNominatim(BaseTestGeocoder):
delta = 0.04
async de... | "Germany" | assert | string_literal | test/geocoders/nominatim.py | test_geocode_language_parameter | BaseTestNominatim | 118 | null |
geopy/geopy | import math
import unittest
import warnings
from geopy.distance import (
EARTH_RADIUS,
Distance,
GeodesicDistance,
GreatCircleDistance,
distance,
lonlat,
)
from geopy.point import Point
EARTH_CIRCUMFERENCE = 2 * math.pi * EARTH_RADIUS
NORTH_POLE = Point(90, 0)
SOUTH_POLE = Point(-90, 0)
FIJI =... | 1 | assert | numeric_literal | test/test_distance.py | test_distance_hashing | 427 | null | |
geopy/geopy | import contextlib
import json
import os
from abc import ABC, abstractmethod
from unittest.mock import ANY, patch
import pytest
from geopy import exc
from geopy.adapters import BaseAsyncAdapter
from geopy.location import Location
_env = {}
class BaseTestGeocoder(ABC):
geocoder = None
delta = 0.5
async ... | expected | assert | variable | test/geocoders/util.py | _verify_request | BaseTestGeocoder | 215 | null |
geopy/geopy | import datetime
import pickle
import unittest
import pytest
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_create_from_pytz_timezone(s... | pytz_timezone) | self.assertIs | variable | test/test_timezone.py | test_create_from_pytz_timezone | TimezoneTestCase | 46 | null |
geopy/geopy | import datetime
import pickle
import unittest
import pytest
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_string(self):
raw =... | self.timezone_name) | self.assertEqual | complex_expr | test/test_timezone.py | test_string | TimezoneTestCase | 51 | null |
geopy/geopy | import pytest
from geopy.geocoders import MapBox
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestMapBox(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return MapBox(api_key=env['MAPBOX_KEY'], timeout=3, **kwargs)
async def test_geocode_raw(self):
... | (-73.8784155, 40.6930727), abs=delta) | pytest.approx | collection | test/geocoders/mapbox.py | test_geocode_raw | TestMapBox | 76 | null |
geopy/geopy | import math
import pickle
import sys
import unittest
import warnings
from geopy.point import Point
class PointTestCase(unittest.TestCase):
lat = 40.74113
lon = -73.989656
alt = 3
coords = (lat, lon, alt)
def test_point_float(self):
point = Point(self.lat, self.lon, self.alt)
self.... | self.alt) | self.assertEqual | complex_expr | test/test_point.py | test_point_float | PointTestCase | 20 | null |
geopy/geopy | from distutils.version import LooseVersion
from geopy import __version__, __version_info__, get_version
def test_version_info():
expected_version_info = tuple(LooseVersion(__version__).version)
assert expected_version_info == | __version_info__ | assert | variable | test/test_init.py | test_version_info | 12 | null | |
geopy/geopy | import pytest
from geopy import exc
from geopy.geocoders import Woosmap
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestWoosmap(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return Woosmap(api_key=env['WOOSMAP_KEY'], **kwargs)
async def test_user_... | 'my_user_agent/1.0' | assert | string_literal | test/geocoders/woosmap.py | test_user_agent_custom | TestWoosmap | 19 | null |
geopy/geopy | import importlib
import inspect
import pkgutil
import docutils.core
import docutils.utils
import pytest
import geopy.geocoders
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
skip_modules = [
"geopy.geocoders.base", # doesn't contain actual geocoders
"geopy.geocoders.googlev3", # deprecated
... | None | assert | none_literal | test/geocoders/__init__.py | assert_rst | 83 | null | |
geopy/geopy | from geopy.geocoders import BANFrance
from test.geocoders.util import BaseTestGeocoder
class TestBANFrance(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return BANFrance(timeout=10, **kwargs)
async def test_geocode_with_address(self):
location = await self.geocode_run(
{"qu... | location.address | assert | complex_expr | test/geocoders/banfrance.py | test_geocode_with_address | TestBANFrance | 22 | null |
geopy/geopy | import asyncio
import atexit
import contextlib
import importlib
import os
import types
from collections import defaultdict
from functools import partial
from statistics import mean, median
from time import sleep
from timeit import default_timer
from unittest.mock import patch
from urllib.parse import urlparse
import p... | self.adapter | assert | complex_expr | test/conftest.py | __aenter__ | AdapterProxy | 208 | null |
geopy/geopy | import importlib
import inspect
import pkgutil
import docutils.core
import docutils.utils
import pytest
import geopy.geocoders
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
skip_modules = [
"geopy.geocoders.base", # doesn't contain actual geocoders
"geopy.geocoders.googlev3", # deprecated
... | allowed_rtypes | assert | variable | test/geocoders/__init__.py | assert_rst | 112 | null | |
geopy/geopy | import math
import pickle
import sys
import unittest
import warnings
from geopy.point import Point
class PointTestCase(unittest.TestCase):
lat = 40.74113
lon = -73.989656
alt = 3
coords = (lat, lon, alt)
def test_point_slices(self):
point = Point(self.lat, self.lon, self.alt)
self... | point[:]) | self.assertEqual | complex_expr | test/test_point.py | test_point_slices | PointTestCase | 203 | null |
geopy/geopy | import warnings
from geopy.geocoders import Pelias
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class BaseTestPelias(BaseTestGeocoder):
delta = 0.04
known_state_de = "Verwaltungsregion Ionische Inseln"
known_state_en = "Ionian Islands Periphery"
async def test_... | "Austria" | assert | string_literal | test/geocoders/pelias.py | test_geocode_language_parameter | BaseTestPelias | 47 | null |
geopy/geopy | import warnings
from geopy.geocoders import Pelias
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class BaseTestPelias(BaseTestGeocoder):
delta = 0.04
known_state_de = "Verwaltungsregion Ionische Inseln"
known_state_en = "Ionian Islands Periphery"
async def test_... | "Österreich" | assert | string_literal | test/geocoders/pelias.py | test_geocode_language_parameter | BaseTestPelias | 42 | null |
geopy/geopy | import base64
from datetime import datetime
from urllib.parse import parse_qs, urlparse
import pytest
from geopy import exc
from geopy.geocoders import GoogleV3
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestGoogleV3(BaseTestGeocoder):
new_york_point = Point(40.7537... | 'my_user_agent/1.0' | assert | string_literal | test/geocoders/googlev3.py | test_user_agent_custom | TestGoogleV3 | 31 | null |
geopy/geopy | from unittest.mock import patch
import pytest
import geopy.exc
import geopy.geocoders
from geopy.geocoders import What3Words, What3WordsV3
from geopy.geocoders.what3words import _check_query
from test.geocoders.util import BaseTestGeocoder, env
class TestUnitWhat3Words:
dummy_api_key = 'DUMMYKEY1234'
async ... | 'my_user_agent/1.0' | assert | string_literal | test/geocoders/what3words.py | test_user_agent_custom | TestUnitWhat3Words | 20 | null |
geopy/geopy | import pytest
from geopy.geocoders import MapBox
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestMapBox(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return MapBox(api_key=env['MAPBOX_KEY'], timeout=3, **kwargs)
async def test_geocode_language(sel... | res.address | assert | complex_expr | test/geocoders/mapbox.py | test_geocode_language | TestMapBox | 92 | null |
geopy/geopy | import pickle
import unittest
from geopy.location import Location
from geopy.point import Point
GRAND_CENTRAL_STR = "89 E 42nd St New York, NY 10017"
GRAND_CENTRAL_COORDS_STR = "40.752662,-73.9773"
GRAND_CENTRAL_COORDS_TUPLE = (40.752662, -73.9773, 0)
GRAND_CENTRAL_POINT = Point(GRAND_CENTRAL_COORDS_STR)
GRAND_CENT... | ref_latitude) | self.assertEqual | variable | test/test_location.py | _location_iter_test | LocationTestCase | 36 | null |
geopy/geopy | import pickle
import unittest
from geopy.location import Location
from geopy.point import Point
GRAND_CENTRAL_STR = "89 E 42nd St New York, NY 10017"
GRAND_CENTRAL_COORDS_STR = "40.752662,-73.9773"
GRAND_CENTRAL_COORDS_TUPLE = (40.752662, -73.9773, 0)
GRAND_CENTRAL_POINT = Point(GRAND_CENTRAL_COORDS_STR)
GRAND_CENT... | loc2) | self.assertEqual | variable | test/test_location.py | test_location_eq | LocationTestCase | 96 | null |
geopy/geopy | import pytest
from geopy import exc
from geopy.geocoders import Woosmap
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestWoosmap(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return Woosmap(api_key=env['WOOSMAP_KEY'], **kwargs)
async def test_geoco... | "GBR" | assert | string_literal | test/geocoders/woosmap.py | test_geocode_with_country_code_format | TestWoosmap | 115 | null |
geopy/geopy | import pytest
from geopy.geocoders import MapTiler
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestMapTiler(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return MapTiler(api_key=env['MAPTILER_KEY'], timeout=3, **kwargs)
async def test_geocode_raw(... | result.raw['center'] | assert | complex_expr | test/geocoders/maptiler.py | test_geocode_raw | TestMapTiler | 85 | null |
geopy/geopy | import contextlib
import os
import ssl
from unittest.mock import patch
from urllib.parse import urljoin
from urllib.request import getproxies, urlopen
import pytest
import geopy.geocoders
from geopy.adapters import (
AdapterHTTPError,
AioHTTPAdapter,
BaseAsyncAdapter,
RequestsAdapter,
URLLibAdapte... | GeocoderServiceError | assert | variable | test/adapters/each_adapter.py | test_geocoder_https_proxy_auth_error | 243 | null | |
geopy/geopy | import warnings
import pytest
from geopy import exc
from geopy.geocoders import Here, HereV7
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class BaseTestHere(BaseTestGeocoder):
async def test_geocode_with_paging(self):
address_string = "Hauptstr., Berlin, Germany"
... | 12 | assert | numeric_literal | test/geocoders/here.py | test_geocode_with_paging | BaseTestHere | 119 | null |
geopy/geopy | import pickle
import unittest
from geopy.location import Location
from geopy.point import Point
GRAND_CENTRAL_STR = "89 E 42nd St New York, NY 10017"
GRAND_CENTRAL_COORDS_STR = "40.752662,-73.9773"
GRAND_CENTRAL_COORDS_TUPLE = (40.752662, -73.9773, 0)
GRAND_CENTRAL_POINT = Point(GRAND_CENTRAL_COORDS_STR)
GRAND_CENT... | TypeError) | self.assertRaises | variable | test/test_location.py | test_location_none | LocationTestCase | 57 | null |
geopy/geopy | import pytest
from geopy import exc
from geopy.geocoders import Geocodio
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestGeocodio(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return Geocodio(api_key=env['GEOCODIO_KEY'], **kwargs)
async def test_e... | exc.GeocoderQueryError) | pytest.raises | complex_expr | test/geocoders/geocodio.py | test_error_with_only_street | TestGeocodio | 20 | null |
geopy/geopy | import warnings
import pytest
from geopy import exc
from geopy.geocoders import Here, HereV7
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class BaseTestHere(BaseTestGeocoder):
async def test_reverse_point_radius_1000_float(self):
# needs more testing
res = ... | 5 | assert | numeric_literal | test/geocoders/here.py | test_reverse_point_radius_1000_float | BaseTestHere | 142 | null |
geopy/geopy | import pytest
from geopy.exc import (
GeocoderInsufficientPrivileges,
GeocoderQuotaExceeded,
GeocoderRateLimited,
)
from geopy.geocoders import OpenCage
from test.geocoders.util import BaseTestGeocoder, env
class TestOpenCage(BaseTestGeocoder):
testing_tokens = {
# https://opencagedata.com/ap... | GeocoderRateLimited | assert | variable | test/geocoders/opencage.py | test_rate_limited_error | TestOpenCage | 112 | null |
geopy/geopy | import math
import unittest
import warnings
from geopy.distance import (
EARTH_RADIUS,
Distance,
GeodesicDistance,
GreatCircleDistance,
distance,
lonlat,
)
from geopy.point import Point
EARTH_CIRCUMFERENCE = 2 * math.pi * EARTH_RADIUS
NORTH_POLE = Point(90, 0)
SOUTH_POLE = Point(-90, 0)
FIJI =... | 3) | self.assertAlmostEqual | numeric_literal | test/test_distance.py | test_should_compute_destination_across_antimeridian | CommonDistanceComputationCases | 85 | null |
geopy/geopy | import warnings
from unittest.mock import patch
import pytest
import geopy.geocoders
from geopy.exc import ConfigurationError
from geopy.geocoders import Nominatim
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder
class BaseTestNominatim(BaseTestGeocoder):
delta = 0.04
async de... | None | assert | none_literal | test/geocoders/nominatim.py | test_extratags | BaseTestNominatim | 218 | null |
geopy/geopy | import pytest
from geopy.exc import GeocoderQueryError
from geopy.geocoders import DataBC
from test.geocoders.util import BaseTestGeocoder
class TestDataBC(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return DataBC(**kwargs)
async def test_user_agent_custom(self):
geocoder = DataBC(
... | 'my_user_agent/1.0' | assert | string_literal | test/geocoders/databc.py | test_user_agent_custom | TestDataBC | 18 | null |
geopy/geopy | import pytest
from geopy.exc import GeocoderQueryError
from geopy.geocoders import IGNFrance
from test.geocoders.util import BaseTestGeocoder
from test.proxy_server import ProxyServerThread
class TestIGNFranceUsernameAuthProxy(BaseTestGeocoder):
proxy_timeout = 5
def make_geocoder(cls, **kwargs):
ret... | len(self.proxy_server.requests) | assert | func_call | test/geocoders/ignfrance.py | test_proxy_is_respected | TestIGNFranceUsernameAuthProxy | 222 | null |
geopy/geopy | import warnings
from unittest.mock import patch
import pytest
import geopy.geocoders
from geopy.exc import ConfigurationError
from geopy.geocoders import Nominatim
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder
class BaseTestNominatim(BaseTestGeocoder):
delta = 0.04
async de... | location.address | assert | complex_expr | test/geocoders/nominatim.py | test_reverse | BaseTestNominatim | 70 | null |
geopy/geopy | import asyncio
from unittest.mock import MagicMock, patch, sentinel
import pytest
from geopy.exc import GeocoderQuotaExceeded, GeocoderServiceError
from geopy.extra.rate_limiter import AsyncRateLimiter, RateLimiter
def is_async(request):
return request.param
def auto_async(is_async):
if is_async:
as... | mock_func.call_count | assert | complex_expr | test/extra/rate_limiter.py | test_max_retries | 108 | null | |
geopy/geopy | import pytest
from geopy.exc import (
GeocoderInsufficientPrivileges,
GeocoderQuotaExceeded,
GeocoderRateLimited,
)
from geopy.geocoders import OpenCage
from test.geocoders.util import BaseTestGeocoder, env
class TestOpenCage(BaseTestGeocoder):
testing_tokens = {
# https://opencagedata.com/ap... | GeocoderQuotaExceeded | assert | variable | test/geocoders/opencage.py | test_payment_required_error | TestOpenCage | 92 | null |
geopy/geopy | import pytest
from geopy.geocoders import MapTiler
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestMapTiler(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return MapTiler(api_key=env['MAPTILER_KEY'], timeout=3, **kwargs)
async def test_geocode_raw(... | (-73.8784155, 40.6930727), abs=delta) | pytest.approx | collection | test/geocoders/maptiler.py | test_geocode_raw | TestMapTiler | 84 | null |
geopy/geopy | import pytest
from geopy.geocoders import Geokeo
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestUnitGeokeo:
def test_user_agent_custom(self):
geocoder = Geokeo(
api_key='DUMMYKEY1234',
user_agent='my_user_agent/1.0'
)
... | 'my_user_agent/1.0' | assert | string_literal | test/geocoders/geokeo.py | test_user_agent_custom | TestUnitGeokeo | 15 | null |
geopy/geopy | import warnings
from unittest.mock import patch
import pytest
import geopy.geocoders
from geopy.exc import ConfigurationError
from geopy.geocoders import Nominatim
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder
class BaseTestNominatim(BaseTestGeocoder):
delta = 0.04
async de... | 3 | assert | numeric_literal | test/geocoders/nominatim.py | test_limit | BaseTestNominatim | 50 | null |
geopy/geopy | import pickle
import unittest
from geopy.location import Location
from geopy.point import Point
GRAND_CENTRAL_STR = "89 E 42nd St New York, NY 10017"
GRAND_CENTRAL_COORDS_STR = "40.752662,-73.9773"
GRAND_CENTRAL_COORDS_TUPLE = (40.752662, -73.9773, 0)
GRAND_CENTRAL_POINT = Point(GRAND_CENTRAL_COORDS_STR)
GRAND_CENT... | ref_longitude) | self.assertEqual | variable | test/test_location.py | _location_iter_test | LocationTestCase | 35 | null |
geopy/geopy | import warnings
from unittest.mock import patch
import pytest
import geopy.geocoders
from geopy.exc import ConfigurationError
from geopy.geocoders import Nominatim
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder
class BaseTestNominatim(BaseTestGeocoder):
delta = 0.04
async de... | -70 | assert | numeric_literal | test/geocoders/nominatim.py | test_country_codes_moscow | BaseTestNominatim | 245 | null |
geopy/geopy | from geopy.geocoders import Photon
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder
class TestPhoton(BaseTestGeocoder):
known_country_de = "Frankreich"
known_country_fr = "France"
def make_geocoder(cls, **kwargs):
return Photon(**kwargs)
async def test_user_agent... | 'my_user_agent/1.0' | assert | string_literal | test/geocoders/photon.py | test_user_agent_custom | TestPhoton | 18 | null |
geopy/geopy | from unittest.mock import patch
import pytest
import geopy.exc
import geopy.geocoders
from geopy.geocoders import What3Words, What3WordsV3
from geopy.geocoders.what3words import _check_query
from test.geocoders.util import BaseTestGeocoder, env
class BaseTestWhat3Words(BaseTestGeocoder):
async def test_empty_re... | geopy.exc.GeocoderQueryError) | pytest.raises | complex_expr | test/geocoders/what3words.py | test_empty_response | BaseTestWhat3Words | 64 | null |
geopy/geopy | import math
import pickle
import sys
import unittest
import warnings
from geopy.point import Point
class PointTestCase(unittest.TestCase):
lat = 40.74113
lon = -73.989656
alt = 3
coords = (lat, lon, alt)
def test_point_degrees_are_normalized(self):
with warnings.catch_warnings(record=True... | len(w)) | self.assertEqual | func_call | test/test_point.py | test_point_degrees_are_normalized | PointTestCase | 120 | null |
geopy/geopy | import unittest
from contextlib import ExitStack
from unittest.mock import patch, sentinel
import pytest
import geopy.geocoders
import geopy.geocoders.base
from geopy.adapters import BaseAsyncAdapter, BaseSyncAdapter
from geopy.exc import GeocoderNotFound, GeocoderQueryError
from geopy.geocoders import GoogleV3, get_... | [(1, 2)] | assert | collection | test/geocoders/base.py | test_synchronize_decorator_sync_simple | 252 | null | |
geopy/geopy | import uuid
import pytest
from geopy import Point
from geopy.exc import GeocoderAuthenticationFailure, GeocoderQueryError
from geopy.geocoders import GeoNames
from test.geocoders.util import BaseTestGeocoder, env
class TestGeoNames(BaseTestGeocoder):
delta = 0.04
def make_geocoder(cls, **kwargs):
r... | GeocoderQueryError) | pytest.raises | variable | test/geocoders/geonames.py | test_reverse_raises_for_unknown_find_nearby_type | TestGeoNames | 135 | null |
geopy/geopy | import pytest
from geopy.geocoders import MapTiler
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestMapTiler(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return MapTiler(api_key=env['MAPTILER_KEY'], timeout=3, **kwargs)
async def test_geocode_raw(... | 'us' | assert | string_literal | test/geocoders/maptiler.py | test_geocode_raw | TestMapTiler | 86 | null |
geopy/geopy | import base64
from datetime import datetime
from urllib.parse import parse_qs, urlparse
import pytest
from geopy import exc
from geopy.geocoders import GoogleV3
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestGoogleV3(BaseTestGeocoder):
new_york_point = Point(40.7537... | None | assert | none_literal | test/geocoders/googlev3.py | test_check_status | TestGoogleV3 | 53 | null |
geopy/geopy | import math
import unittest
import warnings
from geopy.distance import (
EARTH_RADIUS,
Distance,
GeodesicDistance,
GreatCircleDistance,
distance,
lonlat,
)
from geopy.point import Point
EARTH_CIRCUMFERENCE = 2 * math.pi * EARTH_RADIUS
NORTH_POLE = Point(90, 0)
SOUTH_POLE = Point(-90, 0)
FIJI =... | 1) | self.assertAlmostEqual | numeric_literal | test/test_distance.py | test_should_be_able_to_subtract_distances | CommonMathematicalOperatorCases | 157 | null |
geopy/geopy | import contextlib
import os
import ssl
from unittest.mock import patch
from urllib.parse import urljoin
from urllib.request import getproxies, urlopen
import pytest
import geopy.geocoders
from geopy.adapters import (
AdapterHTTPError,
AioHTTPAdapter,
BaseAsyncAdapter,
RequestsAdapter,
URLLibAdapte... | GeocoderServiceError) | pytest.raises | variable | test/adapters/each_adapter.py | test_geocoder_https_proxy_auth_error | 241 | null | |
geopy/geopy | import importlib
import inspect
import pkgutil
import docutils.core
import docutils.utils
import pytest
import geopy.geocoders
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
skip_modules = [
"geopy.geocoders.base", # doesn't contain actual geocoders
"geopy.geocoders.googlev3", # deprecated
... | "query" | assert | string_literal | test/geocoders/__init__.py | test_geocode_method_signature | 193 | null | |
geopy/geopy | import pytest
from geopy import exc
from geopy.geocoders import Woosmap
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestWoosmap(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return Woosmap(api_key=env['WOOSMAP_KEY'], **kwargs)
async def test_geoco... | "GB" | assert | string_literal | test/geocoders/woosmap.py | test_geocode_with_country_code_format | TestWoosmap | 123 | null |
geopy/geopy | import pytest
from geopy import exc
from geopy.geocoders import Woosmap
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestWoosmap(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return Woosmap(api_key=env['WOOSMAP_KEY'], **kwargs)
async def test_geoco... | 5 | assert | numeric_literal | test/geocoders/woosmap.py | test_geocode_limit | TestWoosmap | 134 | null |
geopy/geopy | import pytest
from geopy.exc import GeocoderQueryError
from geopy.geocoders import IGNFrance
from test.geocoders.util import BaseTestGeocoder
from test.proxy_server import ProxyServerThread
class TestIGNFrance(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return IGNFrance(
timeout=10
... | "38" | assert | string_literal | test/geocoders/ignfrance.py | test_geocode_filter_by_attribute | TestIGNFrance | 93 | null |
geopy/geopy | from geopy.geocoders import MapQuest
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestMapQuest(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return MapQuest(api_key=env['MAPQUEST_KEY'], timeout=3, **kwargs)
async def test_geocode_limit(self):
... | 4 | assert | numeric_literal | test/geocoders/mapquest.py | test_geocode_limit | TestMapQuest | 60 | null |
geopy/geopy | import uuid
import pytest
from geopy import Point
from geopy.exc import GeocoderAuthenticationFailure, GeocoderQueryError
from geopy.geocoders import GeoNames
from test.geocoders.util import BaseTestGeocoder, env
class TestUnitGeoNames:
def test_user_agent_custom(self):
geocoder = GeoNames(
... | 'my_user_agent/1.0' | assert | string_literal | test/geocoders/geonames.py | test_user_agent_custom | TestUnitGeoNames | 24 | null |
geopy/geopy | import math
import unittest
import warnings
from geopy.distance import (
EARTH_RADIUS,
Distance,
GeodesicDistance,
GreatCircleDistance,
distance,
lonlat,
)
from geopy.point import Point
EARTH_CIRCUMFERENCE = 2 * math.pi * EARTH_RADIUS
NORTH_POLE = Point(90, 0)
SOUTH_POLE = Point(-90, 0)
FIJI =... | -2) | self.assertAlmostEqual | numeric_literal | test/test_distance.py | test_should_compute_distance_for_trip_between_poles | CommonDistanceComputationCases | 49 | null |
geopy/geopy | import warnings
import pytest
from geopy import exc
from geopy.geocoders import Here, HereV7
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestUnitHere:
def test_no_warning_with_apikey(self):
with warnings.catch_warnings(record=True) as w:
Here(
... | 0 | assert | numeric_literal | test/geocoders/here.py | test_no_warning_with_apikey | TestUnitHere | 37 | null |
geopy/geopy | import datetime
import pickle
import unittest
import pytest
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_with_unpicklable_raw(self):... | (AttributeError, pickle.PicklingError)) | self.assertRaises | collection | test/test_timezone.py | test_with_unpicklable_raw | TimezoneTestCase | 86 | null |
geopy/geopy | import pytest
from geopy.geocoders import MapTiler
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestMapTiler(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return MapTiler(api_key=env['MAPTILER_KEY'], timeout=3, **kwargs)
async def test_reverse(self... | location.address | assert | complex_expr | test/geocoders/maptiler.py | test_reverse | TestMapTiler | 25 | null |
geopy/geopy | import warnings
from unittest.mock import patch
import pytest
import geopy.geocoders
from geopy.exc import ConfigurationError
from geopy.geocoders import Nominatim
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder
class BaseTestNominatim(BaseTestGeocoder):
delta = 0.04
async de... | 'Polygon' | assert | string_literal | test/geocoders/nominatim.py | test_geocode_geometry_geojson | BaseTestNominatim | 161 | null |
geopy/geopy | import contextlib
import json
import os
from abc import ABC, abstractmethod
from unittest.mock import ANY, patch
import pytest
from geopy import exc
from geopy.adapters import BaseAsyncAdapter
from geopy.location import Location
_env = {}
class BaseTestGeocoder(ABC):
geocoder = None
delta = 0.5
async ... | latitude, abs=delta) | pytest.approx | complex_expr | test/geocoders/util.py | _verify_request | BaseTestGeocoder | 206 | null |
geopy/geopy | import pytest
from geopy.exc import GeocoderAuthenticationFailure
from geopy.geocoders import Baidu, BaiduV3
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestBaidu(BaseTestBaidu):
def make_geocoder(cls, **kwargs):
return Baidu(
api_key=env['BAIDU_K... | 'Invalid AK' | assert | string_literal | test/geocoders/baidu.py | test_invalid_ak | TestBaidu | 59 | null |
geopy/geopy | import base64
from datetime import datetime
from urllib.parse import parse_qs, urlparse
import pytest
from geopy import exc
from geopy.geocoders import GoogleV3
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestGoogleV3(BaseTestGeocoder):
new_york_point = Point(40.7537... | '' | assert | string_literal | test/geocoders/googlev3.py | test_format_components_param | TestGoogleV3 | 101 | null |
geopy/geopy | from geopy.geocoders import Bing
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestBing(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return Bing(
api_key=env['BING_KEY'],
**kwargs
)
async def test_structured_query(sel... | "Broomfield" | assert | string_literal | test/geocoders/bing.py | test_structured_query | TestBing | 86 | null |
geopy/geopy | from geopy.geocoders import Bing
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestUnitBing:
def test_user_agent_custom(self):
geocoder = Bing(
api_key='DUMMYKEY1234',
user_agent='my_user_agent/1.0'
)
assert geocoder.head... | 'my_user_agent/1.0' | assert | string_literal | test/geocoders/bing.py | test_user_agent_custom | TestUnitBing | 13 | null |
geopy/geopy | import pytest
from geopy.geocoders import MapBox
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder, env
class TestMapBox(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return MapBox(api_key=env['MAPBOX_KEY'], timeout=3, **kwargs)
async def test_geocode_exactly_one_... | 3 | assert | numeric_literal | test/geocoders/mapbox.py | test_geocode_exactly_one_false | TestMapBox | 84 | null |
geopy/geopy | import contextlib
import os
import ssl
from unittest.mock import patch
from urllib.parse import urljoin
from urllib.request import getproxies, urlopen
import pytest
import geopy.geocoders
from geopy.adapters import (
AdapterHTTPError,
AioHTTPAdapter,
BaseAsyncAdapter,
RequestsAdapter,
URLLibAdapte... | ImportError) | pytest.raises | variable | test/adapters/each_adapter.py | test_not_available_adapters_raise | 160 | null | |
geopy/geopy | from geopy.geocoders import BANFrance
from test.geocoders.util import BaseTestGeocoder
class TestBANFrance(BaseTestGeocoder):
def make_geocoder(cls, **kwargs):
return BANFrance(timeout=10, **kwargs)
async def test_geocode_limit(self):
result = await self.geocode_run(
{"query": "8 ... | len(result) | assert | func_call | test/geocoders/banfrance.py | test_geocode_limit | TestBANFrance | 36 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.