id
stringlengths
10
18
content
stringlengths
4
768k
max_stars_repo_path
stringlengths
115
237
pandas-bug-104
BugsInPy/BugsInPy/temp/projects/pandas/bug-104-fixed/pandas/pandas/core/groupby/groupby.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-104-buggy/pandas/pandas/core/groupby/groupby.py
pandas-bug-97
BugsInPy/BugsInPy/temp/projects/pandas/bug-97-fixed/pandas/pandas/core/indexes/timedeltas.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-97-buggy/pandas/pandas/core/indexes/timedeltas.py
pandas-bug-76
BugsInPy/BugsInPy/temp/projects/pandas/bug-76-fixed/pandas/pandas/io/json/_json.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-76-buggy/pandas/pandas/io/json/_json.py
pandas-bug-165
BugsInPy/BugsInPy/temp/projects/pandas/bug-165-fixed/pandas/pandas/core/arrays/datetimelike.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-165-buggy/pandas/pandas/core/arrays/datetimelike.py
pandas-bug-115
BugsInPy/BugsInPy/temp/projects/pandas/bug-115-fixed/pandas/pandas/core/missing.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-115-buggy/pandas/pandas/core/missing.py
pandas-bug-148
BugsInPy/BugsInPy/temp/projects/pandas/bug-148-fixed/pandas/pandas/core/apply.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-148-buggy/pandas/pandas/core/apply.py
pandas-bug-99
BugsInPy/BugsInPy/temp/projects/pandas/bug-99-fixed/pandas/pandas/core/tools/datetimes.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-99-buggy/pandas/pandas/core/tools/datetimes.py
pandas-bug-30
BugsInPy/BugsInPy/temp/projects/pandas/bug-30-fixed/pandas/pandas/io/json/_json.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-30-buggy/pandas/pandas/io/json/_json.py
pandas-bug-81
BugsInPy/BugsInPy/temp/projects/pandas/bug-81-fixed/pandas/pandas/core/arrays/integer.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-81-buggy/pandas/pandas/core/arrays/integer.py
pandas-bug-8
BugsInPy/BugsInPy/temp/projects/pandas/bug-8-fixed/pandas/pandas/core/internals/blocks.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-8-buggy/pandas/pandas/core/internals/blocks.py
pandas-bug-105
BugsInPy/BugsInPy/temp/projects/pandas/bug-105-fixed/pandas/pandas/core/frame.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-105-buggy/pandas/pandas/core/frame.py
pandas-bug-27
BugsInPy/BugsInPy/temp/projects/pandas/bug-27-fixed/pandas/pandas/core/arrays/datetimes.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-27-buggy/pandas/pandas/core/arrays/datetimes.py
pandas-bug-70
BugsInPy/BugsInPy/temp/projects/pandas/bug-70-fixed/pandas/pandas/core/groupby/groupby.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-70-buggy/pandas/pandas/core/groupby/groupby.py
pandas-bug-40
BugsInPy/BugsInPy/temp/projects/pandas/bug-40-fixed/pandas/pandas/core/reshape/merge.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-40-buggy/pandas/pandas/core/reshape/merge.py
pandas-bug-160
BugsInPy/BugsInPy/temp/projects/pandas/bug-160-fixed/pandas/pandas/core/computation/expressions.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-160-buggy/pandas/pandas/core/computation/expressions.py
pandas-bug-85
BugsInPy/BugsInPy/temp/projects/pandas/bug-85-fixed/pandas/pandas/core/indexes/multi.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-85-buggy/pandas/pandas/core/indexes/multi.py
pandas-bug-22
BugsInPy/BugsInPy/temp/projects/pandas/bug-22-fixed/pandas/pandas/core/window/common.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-22-buggy/pandas/pandas/core/window/common.py
pandas-bug-84
BugsInPy/BugsInPy/temp/projects/pandas/bug-84-fixed/pandas/pandas/core/reshape/reshape.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-84-buggy/pandas/pandas/core/reshape/reshape.py
pandas-bug-102
BugsInPy/BugsInPy/temp/projects/pandas/bug-102-fixed/pandas/pandas/core/internals/construction.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-102-buggy/pandas/pandas/core/internals/construction.py
pandas-bug-74
BugsInPy/BugsInPy/temp/projects/pandas/bug-74-fixed/pandas/pandas/core/indexes/timedeltas.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-74-buggy/pandas/pandas/core/indexes/timedeltas.py
pandas-bug-34
BugsInPy/BugsInPy/temp/projects/pandas/bug-34-fixed/pandas/pandas/core/resample.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-34-buggy/pandas/pandas/core/resample.py
pandas-bug-162
BugsInPy/BugsInPy/temp/projects/pandas/bug-162-fixed/pandas/pandas/core/reshape/pivot.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-162-buggy/pandas/pandas/core/reshape/pivot.py
pandas-bug-29
BugsInPy/BugsInPy/temp/projects/pandas/bug-29-fixed/pandas/pandas/core/arrays/interval.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-29-buggy/pandas/pandas/core/arrays/interval.py
pandas-bug-149
BugsInPy/BugsInPy/temp/projects/pandas/bug-149-fixed/pandas/pandas/io/parquet.py,BugsInPy/BugsInPy/temp/projects/pandas/bug-149-buggy/pandas/pandas/io/parquet.py
fastapi-bug-5
import re from dataclasses import is_dataclass from typing import Any, Dict, List, Sequence, Set, Type, cast from fastapi import routing from fastapi.logger import logger from fastapi.openapi.constants import REF_PREFIX from pydantic import BaseConfig, BaseModel, create_model from pydantic.schema import get_flat_model...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-5-fixed/fastapi/fastapi/utils.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-5-buggy/fastapi/fastapi/utils.py
fastapi-bug-12
import binascii from base64 import b64decode from typing import Optional from fastapi.exceptions import HTTPException from fastapi.openapi.models import ( HTTPBase as HTTPBaseModel, HTTPBearer as HTTPBearerModel, ) from fastapi.security.base import SecurityBase from fastapi.security.utils import get_authorizat...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-12-fixed/fastapi/fastapi/security/http.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-12-buggy/fastapi/fastapi/security/http.py
fastapi-bug-3
import asyncio import inspect from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Type, Union from fastapi import params from fastapi.dependencies.models import Dependant from fastapi.dependencies.utils import ( get_body_field, get_dependant, get_parameterless_sub_dependant, solve_de...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-3-fixed/fastapi/fastapi/routing.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-3-buggy/fastapi/fastapi/routing.py
fastapi-bug-15
import asyncio import inspect import logging from typing import Any, Callable, List, Optional, Type from fastapi import params from fastapi.dependencies.models import Dependant from fastapi.dependencies.utils import get_body_field, get_dependant, solve_dependencies from fastapi.encoders import jsonable_encoder from fa...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-15-fixed/fastapi/fastapi/routing.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-15-buggy/fastapi/fastapi/routing.py
fastapi-bug-11
import asyncio import inspect from copy import deepcopy from typing import ( Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Type, Union, cast, ) from fastapi import params from fastapi.dependencies.models import Dependant, SecurityRequirement from fastapi.sec...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-11-fixed/fastapi/fastapi/dependencies/utils.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-11-buggy/fastapi/fastapi/dependencies/utils.py
fastapi-bug-6
import asyncio import inspect from contextlib import contextmanager from copy import deepcopy from typing import ( Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Type, Union, cast, ) from fastapi import params from fastapi.concurrency import ( AsyncExitSt...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-6-fixed/fastapi/fastapi/dependencies/utils.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-6-buggy/fastapi/fastapi/dependencies/utils.py
fastapi-bug-16
from enum import Enum from types import GeneratorType from typing import Any, Set from pydantic import BaseModel from pydantic.json import ENCODERS_BY_TYPE def jsonable_encoder( obj: Any, include: Set[str] = None, exclude: Set[str] = set(), by_alias: bool = False, include_none: bool = True, c...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-16-fixed/fastapi/fastapi/encoders.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-16-buggy/fastapi/fastapi/encoders.py
fastapi-bug-14
import logging from enum import Enum from typing import Any, Dict, List, Optional, Union from pydantic import BaseModel, Schema as PSchema from pydantic.types import UrlStr try: import email_validator assert email_validator # make autoflake ignore the unused import from pydantic.types import EmailStr #...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-14-fixed/fastapi/fastapi/openapi/models.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-14-buggy/fastapi/fastapi/openapi/models.py
fastapi-bug-9
import asyncio import inspect from copy import deepcopy from typing import ( Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Type, Union, cast, ) from fastapi import params from fastapi.dependencies.models import Dependant, SecurityRequirement from fastapi.sec...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-9-fixed/fastapi/fastapi/dependencies/utils.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-9-buggy/fastapi/fastapi/dependencies/utils.py
fastapi-bug-10
import asyncio import inspect import logging from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Type, Union from fastapi import params from fastapi.dependencies.models import Dependant from fastapi.dependencies.utils import ( get_body_field, get_dependant, get_parameterless_sub_dependan...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-10-fixed/fastapi/fastapi/routing.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-10-buggy/fastapi/fastapi/routing.py
fastapi-bug-1
from typing import Any, Callable, Dict, List, Optional, Sequence, Type, Union from fastapi import routing from fastapi.concurrency import AsyncExitStack from fastapi.encoders import DictIntStrAny, SetIntStr from fastapi.exception_handlers import ( http_exception_handler, request_validation_exception_handler, )...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-1-fixed/fastapi/fastapi/applications.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-1-buggy/fastapi/fastapi/applications.py
fastapi-bug-7
from fastapi.exceptions import RequestValidationError from starlette.exceptions import HTTPException from starlette.requests import Request from starlette.responses import JSONResponse from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY async def http_exception_handler(request: Request, exc: HTTPException) -> ...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-7-fixed/fastapi/fastapi/exception_handlers.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-7-buggy/fastapi/fastapi/exception_handlers.py
fastapi-bug-13
import asyncio import inspect import logging from typing import Any, Callable, Dict, List, Optional, Type, Union from fastapi import params from fastapi.dependencies.models import Dependant from fastapi.dependencies.utils import get_body_field, get_dependant, solve_dependencies from fastapi.encoders import jsonable_en...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-13-fixed/fastapi/fastapi/routing.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-13-buggy/fastapi/fastapi/routing.py
fastapi-bug-2
import asyncio import inspect from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Type, Union from fastapi import params from fastapi.dependencies.models import Dependant from fastapi.dependencies.utils import ( get_body_field, get_dependant, get_parameterless_sub_dependant, solve_de...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-2-fixed/fastapi/fastapi/routing.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-2-buggy/fastapi/fastapi/routing.py
fastapi-bug-4
import http.client from typing import Any, Dict, List, Optional, Sequence, Tuple, Type, cast from fastapi import routing from fastapi.dependencies.models import Dependant from fastapi.dependencies.utils import get_flat_dependant from fastapi.encoders import jsonable_encoder from fastapi.openapi.constants import ( ...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-4-fixed/fastapi/fastapi/openapi/utils.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-4-buggy/fastapi/fastapi/openapi/utils.py
fastapi-bug-8
import asyncio import inspect import logging from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Type, Union from fastapi import params from fastapi.dependencies.models import Dependant from fastapi.dependencies.utils import ( get_body_field, get_dependant, get_parameterless_sub_dependan...
BugsInPy/BugsInPy/temp/projects/fastapi/bug-8-fixed/fastapi/fastapi/routing.py,BugsInPy/BugsInPy/temp/projects/fastapi/bug-8-buggy/fastapi/fastapi/routing.py
scrapy-bug-5
""" This module implements the Response class which is used to represent HTTP responses in Scrapy. See documentation in docs/topics/request-response.rst """ from six.moves.urllib.parse import urljoin from scrapy.http.request import Request from scrapy.http.headers import Headers from scrapy.link import Link from scra...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-5-fixed/scrapy/scrapy/http/response/__init__.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-5-buggy/scrapy/scrapy/http/response/__init__.py
scrapy-bug-12
""" XPath selectors based on lxml """ import warnings from parsel import Selector as _ParselSelector from scrapy.utils.trackref import object_ref from scrapy.utils.python import to_bytes from scrapy.http import HtmlResponse, XmlResponse from scrapy.utils.decorators import deprecated from scrapy.exceptions import Scrap...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-12-fixed/scrapy/scrapy/selector/unified.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-12-buggy/scrapy/scrapy/selector/unified.py
scrapy-bug-32
import six import signal import logging import warnings from twisted.internet import reactor, defer from zope.interface.verify import verifyClass, DoesNotImplement from scrapy.core.engine import ExecutionEngine from scrapy.resolver import CachingThreadedResolver from scrapy.interfaces import ISpiderLoader from scrapy...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-32-fixed/scrapy/scrapy/crawler.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-32-buggy/scrapy/scrapy/crawler.py
scrapy-bug-28
from __future__ import print_function import os import logging from scrapy.utils.job import job_dir from scrapy.utils.request import request_fingerprint class BaseDupeFilter(object): @classmethod def from_settings(cls, settings): return cls() def request_seen(self, request): return Fals...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-28-fixed/scrapy/scrapy/dupefilters.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-28-buggy/scrapy/scrapy/dupefilters.py
scrapy-bug-24
"""Download handlers for http and https schemes""" import re import logging from io import BytesIO from time import time from six.moves.urllib.parse import urldefrag from zope.interface import implementer from twisted.internet import defer, reactor, protocol from twisted.web.http_headers import Headers as TxHeaders f...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-24-fixed/scrapy/scrapy/core/downloader/handlers/http11.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-24-buggy/scrapy/scrapy/core/downloader/handlers/http11.py
scrapy-bug-35
import six import signal import warnings from twisted.internet import reactor, defer from zope.interface.verify import verifyClass from scrapy.core.engine import ExecutionEngine from scrapy.resolver import CachingThreadedResolver from scrapy.interfaces import ISpiderLoader from scrapy.extension import ExtensionManage...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-35-fixed/scrapy/scrapy/crawler.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-35-buggy/scrapy/scrapy/crawler.py
scrapy-bug-3
import logging from six.moves.urllib.parse import urljoin from w3lib.url import safe_url_string from scrapy.http import HtmlResponse from scrapy.utils.response import get_meta_refresh from scrapy.exceptions import IgnoreRequest, NotConfigured logger = logging.getLogger(__name__) class BaseRedirectMiddleware(object...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-3-fixed/scrapy/scrapy/downloadermiddlewares/redirect.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-3-buggy/scrapy/scrapy/downloadermiddlewares/redirect.py
scrapy-bug-15
""" This module contains general purpose URL functions not found in the standard library. Some of the functions that used to be imported from this module have been moved to the w3lib.url module. Always import those from there instead. """ import posixpath import re import six from six.moves.urllib.parse import (ParseR...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-15-fixed/scrapy/scrapy/utils/url.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-15-buggy/scrapy/scrapy/utils/url.py
scrapy-bug-31
import time from six.moves.http_cookiejar import ( CookieJar as _CookieJar, DefaultCookiePolicy, IPV4_RE ) from scrapy.utils.httpobj import urlparse_cached from scrapy.utils.python import to_native_str class CookieJar(object): def __init__(self, policy=None, check_expired_frequency=10000): self.policy...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-31-fixed/scrapy/scrapy/http/cookies.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-31-buggy/scrapy/scrapy/http/cookies.py
scrapy-bug-11
import struct try: from cStringIO import StringIO as BytesIO except ImportError: from io import BytesIO from gzip import GzipFile import six import re # - Python>=3.5 GzipFile's read() has issues returning leftover # uncompressed data when input is corrupted # (regression or bug-fix compared to Python 3....
BugsInPy/BugsInPy/temp/projects/scrapy/bug-11-fixed/scrapy/scrapy/utils/gz.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-11-buggy/scrapy/scrapy/utils/gz.py
scrapy-bug-6
""" Images Pipeline See documentation in topics/media-pipeline.rst """ import functools import hashlib import six try: from cStringIO import StringIO as BytesIO except ImportError: from io import BytesIO from PIL import Image from scrapy.utils.misc import md5sum from scrapy.utils.python import to_bytes from...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-6-fixed/scrapy/scrapy/pipelines/images.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-6-buggy/scrapy/scrapy/pipelines/images.py
scrapy-bug-16
""" This module contains general purpose URL functions not found in the standard library. Some of the functions that used to be imported from this module have been moved to the w3lib.url module. Always import those from there instead. """ import posixpath import re from six.moves.urllib.parse import (ParseResult, urlu...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-16-fixed/scrapy/scrapy/utils/url.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-16-buggy/scrapy/scrapy/utils/url.py
scrapy-bug-39
""" Base class for Scrapy spiders See documentation in docs/topics/spiders.rst """ import logging import warnings from scrapy import signals from scrapy.http import Request from scrapy.utils.trackref import object_ref from scrapy.utils.url import url_is_from_spider from scrapy.utils.deprecate import create_deprecated...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-39-fixed/scrapy/scrapy/spiders/__init__.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-39-buggy/scrapy/scrapy/spiders/__init__.py
scrapy-bug-14
import struct try: from cStringIO import StringIO as BytesIO except ImportError: from io import BytesIO from gzip import GzipFile import six # - Python>=3.5 GzipFile's read() has issues returning leftover # uncompressed data when input is corrupted # (regression or bug-fix compared to Python 3.4) # - re...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-14-fixed/scrapy/scrapy/utils/gz.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-14-buggy/scrapy/scrapy/utils/gz.py
scrapy-bug-9
""" Mail sending helpers See documentation in docs/topics/email.rst """ import logging from six.moves import cStringIO as StringIO import six from email.utils import COMMASPACE, formatdate from six.moves.email_mime_multipart import MIMEMultipart from six.moves.email_mime_text import MIMEText from six.moves.email_mim...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-9-fixed/scrapy/scrapy/mail.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-9-buggy/scrapy/scrapy/mail.py
scrapy-bug-26
import six import json import copy import warnings from collections import MutableMapping from importlib import import_module from scrapy.utils.deprecate import create_deprecated_class from scrapy.exceptions import ScrapyDeprecationWarning from . import default_settings SETTINGS_PRIORITIES = { 'default': 0, ...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-26-fixed/scrapy/scrapy/settings/__init__.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-26-buggy/scrapy/scrapy/settings/__init__.py
scrapy-bug-33
""" This is the Scrapy engine which controls the Scheduler, Downloader and Spiders. For more information see docs/topics/architecture.rst """ import logging from time import time from twisted.internet import defer from twisted.python.failure import Failure from scrapy import signals from scrapy.core.scraper import ...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-33-fixed/scrapy/scrapy/core/engine.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-33-buggy/scrapy/scrapy/core/engine.py
scrapy-bug-17
""" This module provides some useful functions for working with scrapy.http.Response objects """ import os import re import weakref import webbrowser import tempfile from twisted.web import http from scrapy.utils.python import to_bytes, to_native_str from w3lib import html from scrapy.utils.decorators import deprecat...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-17-fixed/scrapy/scrapy/utils/response.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-17-buggy/scrapy/scrapy/utils/response.py
scrapy-bug-21
""" This is a middleware to respect robots.txt policies. To activate it you must enable this middleware and enable the ROBOTSTXT_OBEY setting. """ import logging from six.moves.urllib import robotparser from twisted.internet.defer import Deferred, maybeDeferred from scrapy.exceptions import NotConfigured, IgnoreReq...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-21-fixed/scrapy/scrapy/downloadermiddlewares/robotstxt.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-21-buggy/scrapy/scrapy/downloadermiddlewares/robotstxt.py
scrapy-bug-19
import time from six.moves.http_cookiejar import ( CookieJar as _CookieJar, DefaultCookiePolicy, IPV4_RE ) from scrapy.utils.httpobj import urlparse_cached from scrapy.utils.python import to_native_str class CookieJar(object): def __init__(self, policy=None, check_expired_frequency=10000): self.policy...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-19-fixed/scrapy/scrapy/http/cookies.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-19-buggy/scrapy/scrapy/http/cookies.py
scrapy-bug-37
""" This module implements the Request class which is used to represent HTTP requests in Scrapy. See documentation in docs/topics/request-response.rst """ import six from w3lib.url import safe_url_string from scrapy.http.headers import Headers from scrapy.utils.python import to_bytes from scrapy.utils.trackref import...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-37-fixed/scrapy/scrapy/http/request/__init__.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-37-buggy/scrapy/scrapy/http/request/__init__.py
scrapy-bug-10
import logging from six.moves.urllib.parse import urljoin from scrapy.http import HtmlResponse from scrapy.utils.response import get_meta_refresh from scrapy.utils.python import to_native_str from scrapy.exceptions import IgnoreRequest, NotConfigured logger = logging.getLogger(__name__) class BaseRedirectMiddleware...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-10-fixed/scrapy/scrapy/downloadermiddlewares/redirect.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-10-buggy/scrapy/scrapy/downloadermiddlewares/redirect.py
scrapy-bug-23
import base64 from six.moves.urllib.request import getproxies, proxy_bypass from six.moves.urllib.parse import unquote try: from urllib2 import _parse_proxy except ImportError: from urllib.request import _parse_proxy from six.moves.urllib.parse import urlunparse from scrapy.utils.httpobj import urlparse_cached...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-23-fixed/scrapy/scrapy/downloadermiddlewares/httpproxy.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-23-buggy/scrapy/scrapy/downloadermiddlewares/httpproxy.py
scrapy-bug-1
""" Offsite Spider Middleware See documentation in docs/topics/spider-middleware.rst """ import re import logging import warnings from scrapy import signals from scrapy.http import Request from scrapy.utils.httpobj import urlparse_cached logger = logging.getLogger(__name__) class OffsiteMiddleware(object): de...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-1-fixed/scrapy/scrapy/spidermiddlewares/offsite.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-1-buggy/scrapy/scrapy/spidermiddlewares/offsite.py
scrapy-bug-7
""" This module implements the FormRequest class which is a more convenient class (than Request) to generate Requests based on form data. See documentation in docs/topics/request-response.rst """ from six.moves.urllib.parse import urljoin, urlencode import lxml.html from parsel.selector import create_root_node import...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-7-fixed/scrapy/scrapy/http/request/form.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-7-buggy/scrapy/scrapy/http/request/form.py
scrapy-bug-18
""" This module implements a class which returns the appropriate Response class based on different criteria. """ from __future__ import absolute_import from mimetypes import MimeTypes from pkgutil import get_data from io import StringIO import six from scrapy.http import Response from scrapy.utils.misc import load_obj...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-18-fixed/scrapy/scrapy/responsetypes.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-18-buggy/scrapy/scrapy/responsetypes.py
scrapy-bug-13
""" Images Pipeline See documentation in topics/media-pipeline.rst """ import functools import hashlib import six try: from cStringIO import StringIO as BytesIO except ImportError: from io import BytesIO from PIL import Image from scrapy.utils.misc import md5sum from scrapy.utils.python import to_bytes from...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-13-fixed/scrapy/scrapy/pipelines/images.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-13-buggy/scrapy/scrapy/pipelines/images.py
scrapy-bug-20
import re import logging import six from scrapy.spiders import Spider from scrapy.http import Request, XmlResponse from scrapy.utils.sitemap import Sitemap, sitemap_urls_from_robots from scrapy.utils.gz import gunzip, is_gzipped logger = logging.getLogger(__name__) class SitemapSpider(Spider): sitemap_urls = (...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-20-fixed/scrapy/scrapy/spiders/sitemap.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-20-buggy/scrapy/scrapy/spiders/sitemap.py
scrapy-bug-2
""" This module contains data types used by Scrapy which are not included in the Python Standard Library. This module must not depend on any module outside the Standard Library. """ import copy import collections import warnings import six from scrapy.exceptions import ScrapyDeprecationWarning if six.PY2: Map...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-2-fixed/scrapy/scrapy/utils/datatypes.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-2-buggy/scrapy/scrapy/utils/datatypes.py
scrapy-bug-25
""" This module implements the FormRequest class which is a more convenient class (than Request) to generate Requests based on form data. See documentation in docs/topics/request-response.rst """ from six.moves.urllib.parse import urljoin, urlencode import lxml.html from parsel.selector import create_root_node import...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-25-fixed/scrapy/scrapy/http/request/form.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-25-buggy/scrapy/scrapy/http/request/form.py
scrapy-bug-4
import sys import re from functools import wraps from unittest import TestCase from scrapy.http import Request from scrapy.utils.spider import iterate_spider_output from scrapy.utils.python import get_spec class ContractsManager(object): contracts = {} def __init__(self, contracts): for contract in ...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-4-fixed/scrapy/scrapy/contracts/__init__.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-4-buggy/scrapy/scrapy/contracts/__init__.py
scrapy-bug-38
""" This module implements the FormRequest class which is a more convenient class (than Request) to generate Requests based on form data. See documentation in docs/topics/request-response.rst """ import six from six.moves.urllib.parse import urljoin, urlencode import lxml.html from parsel.selector import create_root...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-38-fixed/scrapy/scrapy/http/request/form.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-38-buggy/scrapy/scrapy/http/request/form.py
scrapy-bug-36
"""Helper functions which don't fit anywhere else""" import ast import inspect import os import re import hashlib import warnings from contextlib import contextmanager from importlib import import_module from pkgutil import iter_modules from textwrap import dedent from w3lib.html import replace_entities from scrapy.u...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-36-fixed/scrapy/scrapy/utils/misc.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-36-buggy/scrapy/scrapy/utils/misc.py
scrapy-bug-30
from __future__ import print_function import sys import optparse import cProfile import inspect import pkg_resources import scrapy from scrapy.crawler import CrawlerProcess from scrapy.xlib import lsprofcalltree from scrapy.commands import ScrapyCommand from scrapy.exceptions import UsageError from scrapy.utils.misc i...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-30-fixed/scrapy/scrapy/cmdline.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-30-buggy/scrapy/scrapy/cmdline.py
scrapy-bug-8
""" Scrapy Item See documentation in docs/topics/item.rst """ from pprint import pformat from collections import MutableMapping from abc import ABCMeta import six from scrapy.utils.trackref import object_ref class BaseItem(object_ref): """Base class for all scraped items.""" pass class Field(dict): ...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-8-fixed/scrapy/scrapy/item.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-8-buggy/scrapy/scrapy/item.py
scrapy-bug-27
import logging from six.moves.urllib.parse import urljoin from scrapy.http import HtmlResponse from scrapy.utils.response import get_meta_refresh from scrapy.exceptions import IgnoreRequest, NotConfigured logger = logging.getLogger(__name__) class BaseRedirectMiddleware(object): enabled_setting = 'REDIRECT_ENA...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-27-fixed/scrapy/scrapy/downloadermiddlewares/redirect.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-27-buggy/scrapy/scrapy/downloadermiddlewares/redirect.py
scrapy-bug-40
""" Item Exporters are used to export/serialize items into different formats. """ import csv import io import sys import pprint import marshal import six from six.moves import cPickle as pickle from xml.sax.saxutils import XMLGenerator from scrapy.utils.serialize import ScrapyJSONEncoder from scrapy.utils.python impo...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-40-fixed/scrapy/scrapy/exporters.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-40-buggy/scrapy/scrapy/exporters.py
scrapy-bug-22
""" Item Exporters are used to export/serialize items into different formats. """ import csv import io import sys import pprint import marshal import six from six.moves import cPickle as pickle from xml.sax.saxutils import XMLGenerator from scrapy.utils.serialize import ScrapyJSONEncoder from scrapy.utils.python impo...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-22-fixed/scrapy/scrapy/exporters.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-22-buggy/scrapy/scrapy/exporters.py
scrapy-bug-34
""" Scrapy Item See documentation in docs/topics/item.rst """ from pprint import pformat from collections import MutableMapping from abc import ABCMeta import six from scrapy.utils.trackref import object_ref class BaseItem(object_ref): """Base class for all scraped items.""" pass class Field(dict): "...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-34-fixed/scrapy/scrapy/item.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-34-buggy/scrapy/scrapy/item.py
scrapy-bug-29
""" This module provides some useful functions for working with scrapy.http.Request objects """ from __future__ import print_function import hashlib import weakref from six.moves.urllib.parse import urlunparse from twisted.internet.defer import Deferred from w3lib.http import basic_auth_header from scrapy.utils.pytho...
BugsInPy/BugsInPy/temp/projects/scrapy/bug-29-fixed/scrapy/scrapy/utils/request.py,BugsInPy/BugsInPy/temp/projects/scrapy/bug-29-buggy/scrapy/scrapy/utils/request.py
tqdm-bug-5
""" Customisable progressbar decorator for iterators. Includes a default (x)range iterator printing to stderr. Usage: >>> from tqdm import trange[, tqdm] >>> for i in trange(10): #same as: for i in tqdm(xrange(10)) ... ... """ from __future__ import absolute_import # integer division / : float, // : int from...
BugsInPy/BugsInPy/temp/projects/tqdm/bug-5-fixed/tqdm/tqdm/_tqdm.py,BugsInPy/BugsInPy/temp/projects/tqdm/bug-5-buggy/tqdm/tqdm/_tqdm.py
tqdm-bug-3
""" Customisable progressbar decorator for iterators. Includes a default (x)range iterator printing to stderr. Usage: >>> from tqdm import trange[, tqdm] >>> for i in trange(10): #same as: for i in tqdm(xrange(10)) ... ... """ from __future__ import absolute_import # integer division / : float, // : int from...
BugsInPy/BugsInPy/temp/projects/tqdm/bug-3-fixed/tqdm/tqdm/_tqdm.py,BugsInPy/BugsInPy/temp/projects/tqdm/bug-3-buggy/tqdm/tqdm/_tqdm.py
tqdm-bug-6
""" Customisable progressbar decorator for iterators. Includes a default (x)range iterator printing to stderr. Usage: >>> from tqdm import trange[, tqdm] >>> for i in trange(10): #same as: for i in tqdm(xrange(10)) ... ... """ from __future__ import absolute_import # integer division / : float, // : int from...
BugsInPy/BugsInPy/temp/projects/tqdm/bug-6-fixed/tqdm/tqdm/_tqdm.py,BugsInPy/BugsInPy/temp/projects/tqdm/bug-6-buggy/tqdm/tqdm/_tqdm.py
tqdm-bug-9
""" Customisable progressbar decorator for iterators. Includes a default (x)range iterator printing to stderr. Usage: >>> from tqdm import trange[, tqdm] >>> for i in trange(10): #same as: for i in tqdm(xrange(10)) ... ... """ # future division is important to divide integers and get as # a result precise fl...
BugsInPy/BugsInPy/temp/projects/tqdm/bug-9-fixed/tqdm/tqdm/_tqdm.py,BugsInPy/BugsInPy/temp/projects/tqdm/bug-9-buggy/tqdm/tqdm/_tqdm.py
tqdm-bug-1
""" Thin wrappers around common functions. Subpackages contain potentially unstable extensions. """ from tqdm import tqdm from tqdm.auto import tqdm as tqdm_auto from tqdm.utils import ObjectWrapper from copy import deepcopy import functools import sys __author__ = {"github.com/": ["casperdcl"]} __all__ = ['tenumerate...
BugsInPy/BugsInPy/temp/projects/tqdm/bug-1-fixed/tqdm/tqdm/contrib/__init__.py,BugsInPy/BugsInPy/temp/projects/tqdm/bug-1-buggy/tqdm/tqdm/contrib/__init__.py
tqdm-bug-7
from ._tqdm import tqdm, TqdmTypeError, TqdmKeyError from ._version import __version__ # NOQA import sys import re import logging __all__ = ["main"] def cast(val, typ): log = logging.getLogger(__name__) log.debug((val, typ)) if " or " in typ: for t in typ.split(" or "): try: ...
BugsInPy/BugsInPy/temp/projects/tqdm/bug-7-fixed/tqdm/tqdm/_main.py,BugsInPy/BugsInPy/temp/projects/tqdm/bug-7-buggy/tqdm/tqdm/_main.py
tqdm-bug-2
""" Customisable progressbar decorator for iterators. Includes a default (x)range iterator printing to stderr. Usage: >>> from tqdm import trange[, tqdm] >>> for i in trange(10): #same as: for i in tqdm(xrange(10)) ... ... """ from __future__ import absolute_import, division # compatibility functions and uti...
BugsInPy/BugsInPy/temp/projects/tqdm/bug-2-fixed/tqdm/tqdm/std.py,BugsInPy/BugsInPy/temp/projects/tqdm/bug-2-buggy/tqdm/tqdm/std.py
tqdm-bug-4
""" Customisable progressbar decorator for iterators. Includes a default (x)range iterator printing to stderr. Usage: >>> from tqdm import trange[, tqdm] >>> for i in trange(10): #same as: for i in tqdm(xrange(10)) ... ... """ from __future__ import absolute_import # integer division / : float, // : int from...
BugsInPy/BugsInPy/temp/projects/tqdm/bug-4-fixed/tqdm/tqdm/_tqdm.py,BugsInPy/BugsInPy/temp/projects/tqdm/bug-4-buggy/tqdm/tqdm/_tqdm.py
tqdm-bug-8
""" Customisable progressbar decorator for iterators. Includes a default (x)range iterator printing to stderr. Usage: >>> from tqdm import trange[, tqdm] >>> for i in trange(10): #same as: for i in tqdm(xrange(10)) ... ... """ # future division is important to divide integers and get as # a result precise fl...
BugsInPy/BugsInPy/temp/projects/tqdm/bug-8-fixed/tqdm/tqdm/_tqdm.py,BugsInPy/BugsInPy/temp/projects/tqdm/bug-8-buggy/tqdm/tqdm/_tqdm.py
tornado-bug-5
# # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
BugsInPy/BugsInPy/temp/projects/tornado/bug-5-fixed/tornado/tornado/ioloop.py,BugsInPy/BugsInPy/temp/projects/tornado/bug-5-buggy/tornado/tornado/ioloop.py
tornado-bug-12
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
BugsInPy/BugsInPy/temp/projects/tornado/bug-12-fixed/tornado/tornado/auth.py,BugsInPy/BugsInPy/temp/projects/tornado/bug-12-buggy/tornado/tornado/auth.py
tornado-bug-3
"""Blocking and non-blocking HTTP client interfaces. This module defines a common interface shared by two implementations, ``simple_httpclient`` and ``curl_httpclient``. Applications may either instantiate their chosen implementation class directly or use the `AsyncHTTPClient` class from this module, which selects an...
BugsInPy/BugsInPy/temp/projects/tornado/bug-3-fixed/tornado/tornado/httpclient.py,BugsInPy/BugsInPy/temp/projects/tornado/bug-3-buggy/tornado/tornado/httpclient.py
tornado-bug-15
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
BugsInPy/BugsInPy/temp/projects/tornado/bug-15-fixed/tornado/setup.py,BugsInPy/BugsInPy/temp/projects/tornado/bug-15-buggy/tornado/setup.py
tornado-bug-11
#!/usr/bin/env python # # Copyright 2014 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
BugsInPy/BugsInPy/temp/projects/tornado/bug-11-fixed/tornado/tornado/http1connection.py,BugsInPy/BugsInPy/temp/projects/tornado/bug-11-buggy/tornado/tornado/http1connection.py
tornado-bug-6
# # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
BugsInPy/BugsInPy/temp/projects/tornado/bug-6-fixed/tornado/tornado/ioloop.py,BugsInPy/BugsInPy/temp/projects/tornado/bug-6-buggy/tornado/tornado/ioloop.py
tornado-bug-16
"""``tornado.gen`` is a generator-based interface to make it easier to work in an asynchronous environment. Code using the ``gen`` module is technically asynchronous, but it is written as a single generator instead of a collection of separate functions. For example, the following asynchronous handler: .. testcode:: ...
BugsInPy/BugsInPy/temp/projects/tornado/bug-16-fixed/tornado/tornado/gen.py,BugsInPy/BugsInPy/temp/projects/tornado/bug-16-buggy/tornado/tornado/gen.py
tornado-bug-14
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
BugsInPy/BugsInPy/temp/projects/tornado/bug-14-fixed/tornado/tornado/ioloop.py,BugsInPy/BugsInPy/temp/projects/tornado/bug-14-buggy/tornado/tornado/ioloop.py
tornado-bug-9
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
BugsInPy/BugsInPy/temp/projects/tornado/bug-9-fixed/tornado/tornado/httputil.py,BugsInPy/BugsInPy/temp/projects/tornado/bug-9-buggy/tornado/tornado/httputil.py
tornado-bug-10
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
BugsInPy/BugsInPy/temp/projects/tornado/bug-10-fixed/tornado/tornado/web.py,BugsInPy/BugsInPy/temp/projects/tornado/bug-10-buggy/tornado/tornado/web.py
tornado-bug-1
"""Implementation of the WebSocket protocol. `WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional communication between the browser and server. WebSockets are supported in the current versions of all major browsers, although older versions that do not support WebSockets are still in use (refer ...
BugsInPy/BugsInPy/temp/projects/tornado/bug-1-fixed/tornado/tornado/websocket.py,BugsInPy/BugsInPy/temp/projects/tornado/bug-1-buggy/tornado/tornado/websocket.py