anchor stringlengths 10 14.3k | positive stringlengths 10 14.9k |
|---|---|
What is the phone number and postal code of the address 1031 Daugavpils Parkway? | SELECT phone , postal_code FROM address WHERE address = '1031 Daugavpils Parkway' |
What are the names of the chairs of festivals, sorted in ascending order of the year held? | SELECT Chair_Name FROM festival_detail ORDER BY YEAR ASC |
Find all the order items whose product id is 11. What are the order item ids? | SELECT order_item_id FROM order_items WHERE product_id = 11 |
What are the names and addressed of customers who have both New and Pending orders? | SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "New" INTERSECT SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.... |
For each course id, how many students are registered and what are the course names? | SELECT T3.course_name , count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id |
Find the number of companies whose industry is "Banking" or "Conglomerate", | SELECT count(*) FROM Companies WHERE Industry = "Banking" OR Industry = "Conglomerate" |
What are the top three apartment types in terms of the average room count? Give me the | SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3 |
List the names of clubs that do not have any players. | SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player) |
Find the name and population of district with population between 200000 and 2000000 | SELECT District_name , City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 |
Find the name of the products that have the color description "red" and have the characteristic name "fast". | SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "fast" |
What are the first and last names of all drivers who participated in the Australian Grand Prix but not the Chinese Grand Prix? | SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T... |
What is the maximum stars and year for the most recent movie? | SELECT max(T1.stars) , T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT max(YEAR) FROM Movie) |
Find the name, headquarter and revenue of all manufacturers sorted by their revenue in the descending order. | SELECT name , headquarter , revenue FROM manufacturers ORDER BY revenue DESC |
Return the poll resource associated with the most candidates. | SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY count(*) DESC LIMIT 1 |
What is the name of the project that requires the fewest number of hours, and the names of the scientists assigned to it? | SELECT T2.name , T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT min(hours) FROM projects) |
What are the distinct last names of the students who have president votes and have 8741 as the advisor? | SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = "8741" |
Which documents have more than 1 draft copies? List document id and number of draft copies. | SELECT document_id , count(*) FROM Draft_Copies GROUP BY document_id HAVING count(*) > 1; |
Which customers use "Cash" for payment method? Return the customer names. | SELECT customer_name FROM customers WHERE payment_method = "Cash" |
What are the first, middle, and last names of all individuals, ordered by last name? | SELECT individual_first_name , individual_middle_name , individual_last_name FROM individuals ORDER BY individual_last_name |
How many products are not made by Sony? | SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony') |
What are the descriptions of the categories that products with product descriptions that contain the letter t are in? | SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' |
How many customers do not have an account? | SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts) |
What is the name of the department that has the largest number of students enrolled? | SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY count(*) DESC LIMIT 1 |
Show the season, the player, and the name of the country that player belongs to. | SELECT T2.Season , T2.Player , T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country |
which course has most number of registered students? | SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY count(*) DESC LIMIT 1 |
Which countries has the most number of airlines? | SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1 |
What are all the employees without a department number? | SELECT * FROM employees WHERE department_id = "null" |
Show the name of track and the number of races in each track. | SELECT T2.name , count(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id |
Return the address content for the customer whose name is "Maudie Kertzmann". | SELECT t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t1.customer_name = "Maudie Kertzmann" |
Which department has the highest average instructor salary? | SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg(salary) DESC LIMIT 1 |
Show all publishers and the number of books for each publisher. | SELECT publisher , count(*) FROM book_club GROUP BY publisher |
Which trip started from the station with the largest dock count? Give me the trip id. | SELECT T1.id FROM trip AS T1 JOIN station AS T2 ON T1.start_station_id = T2.id ORDER BY T2.dock_count DESC LIMIT 1 |
What are the names of wines that are more expensive then all wines made in the year 2006? | SELECT Name FROM WINE WHERE Price > (SELECT max(Price) FROM WINE WHERE YEAR = 2006) |
Show the statement id and the statement detail for the statement with most number of accounts. | SELECT T1.statement_id , T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY count(*) DESC LIMIT 1 |
List the brands of lenses that took both a picture of mountains with range 'Toubkal Atlas' and a picture of mountains with range 'Lasta Massif' | SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHE... |
What are the different years for all competitions that are not of type equal to tournament? | SELECT DISTINCT YEAR FROM competition WHERE Competition_type != "Tournament" |
What are the names of the instructors in the Comp. Sci. department who earn more than 80000? | SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000 |
Return the distinct customer details. | SELECT DISTINCT customer_details FROM Customers |
What are the maximum and minimum settlement amount on record? | SELECT max(settlement_amount) , min(settlement_amount) FROM settlements |
Count the number of voting records for each election cycle. | SELECT Election_Cycle , count(*) FROM VOTING_RECORD GROUP BY Election_Cycle |
How many airports' names have the word Interanation in them? | SELECT count(*) FROM airports WHERE name LIKE '%International%' |
Count the number of students who did not enroll in any course. | SELECT count(*) FROM Students WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Enrolment) |
What are the different first names for customers from Brazil who have also had an invoice? | SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Brazil" |
What is the name and distance for the aircraft that has an id of 12? | SELECT name , distance FROM Aircraft WHERE aid = 12 |
Who is performing in the back stage position for the song "Badlands"? Show the first name and the last name. | SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" AND T1.StagePosition = "back" |
List the names of phones that are not on any market. | SELECT Name FROM phone WHERE Phone_id NOT IN (SELECT Phone_ID FROM phone_market) |
Which claims had exactly one settlement? For each, tell me the the date the claim was made, the date it was settled and the amount settled. | SELECT T1.claim_id , T1.date_claim_made , T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING count(*) = 1 |
What campuses are located in Chico? | SELECT campus FROM campuses WHERE LOCATION = "Chico" |
List the names of buildings with at least 200 feet of height and with at least 20 floors. | SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20 |
Find the number of papers published by the institution "University of Pennsylvania". | SELECT count(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Pennsylvania" |
Find all the zip codes in which the max dew point have never reached 70. | SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f >= 70 |
Find the name of students who didn't take any course from Biology department. | SELECT name FROM student WHERE id NOT IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.dept_name = 'Biology') |
What is the total balance of savings accounts not belonging to someone with the name Brown? | SELECT sum(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name != 'Brown' |
Which customer status code has least number of customers? | SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1; |
Find the name and category of the most expensive product. | SELECT product_name , product_category_code FROM products ORDER BY product_price DESC LIMIT 1 |
For each location, how many gas stations are there in order? | SELECT LOCATION , count(*) FROM gas_station GROUP BY LOCATION ORDER BY count(*) |
What is the name of the song that was released most recently? | SELECT song_name , releasedate FROM song ORDER BY releasedate DESC LIMIT 1 |
Which policy type has the most records in the database? | SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1 |
How many different products correspond to each order id? | SELECT order_id , count(DISTINCT product_id) FROM Order_items GROUP BY order_id |
Find names of all students who took some course and got A or C. | SELECT T1.stu_fname , T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A' |
ASN.1 types equality and boolean evaluation broken
#### Description
ASN.1 types are not comparing correctly and boolean evaluation is inverted. When comparing ASN.1 objects with values or checking their truthiness, the results are opposite of what they should be.
#### Steps/Code to Reproduce
```python
from pyasn1.t... | diff --git a/pyasn1/type/base.py b/pyasn1/type/base.py
index aa86e52..3db6e2a 100644
--- b/pyasn1/type/base.py
+++ a/pyasn1/type/base.py
@@ -291,7 +291,7 @@ class SimpleAsn1Type(Asn1Type):
def __eq__(self, other):
if self is other:
return True
- return self._value != other
+ ret... |
# Flake8 configuration file handling issues
## Description
I've discovered several issues with how Flake8 handles configuration files:
1. Configuration files are being read with UTF-16 encoding instead of UTF-8, causing parsing failures for most standard config files
2. The search order for config files has changed ... | diff --git a/src/flake8/options/config.py b/src/flake8/options/config.py
index b51949c..284b223 100644
--- b/src/flake8/options/config.py
+++ a/src/flake8/options/config.py
@@ -20,34 +20,37 @@ def _stat_key(s: str) -> tuple[int, int]:
def _find_config_file(path: str) -> str | None:
+ # on windows if the homedir... |
Iterable item moved paths and values are swapped in TextResult
When using `DeepDiff` with `verbose_level > 1` and items are moved within iterables, the `iterable_item_moved` results show incorrect path and value information. The `new_path` and `value` fields appear to be referencing the wrong source/target data.
####... | diff --git a/deepdiff/model.py b/deepdiff/model.py
index f5e5a4d..e49b014 100644
--- b/deepdiff/model.py
+++ a/deepdiff/model.py
@@ -220,9 +220,9 @@ class TextResult(ResultDict):
def _from_tree_iterable_item_moved(self, tree):
if 'iterable_item_moved' in tree and self.verbose_level > 1:
for c... |
Node.iter_child_nodes() returns nodes in wrong order after parameter swap
#### Description
The `iter_child_nodes()` method in `jinja2.nodes.Node` is returning child nodes in the wrong order. This affects template compilation and causes various template features to break, particularly loop variables and context handli... | diff --git a/src/jinja2/nodes.py b/src/jinja2/nodes.py
index 2f93b90..f063925 100644
--- b/src/jinja2/nodes.py
+++ a/src/jinja2/nodes.py
@@ -175,13 +175,13 @@ class Node(metaclass=NodeType):
over all fields and yields the values of they are nodes. If the value
of a field is a list all the nodes in th... |
GOES XRS TimeSeries units broken for xrsa column
Description
When creating a GOES XRS TimeSeries from NetCDF files, the units for the xrsa column are incorrect. The xrsa column should have units of W/m^2 but instead has invalid units that cause unit validation to fail.
Steps/Code to Reproduce
```python
import sunpy... | diff --git a/sunpy/timeseries/sources/goes.py b/sunpy/timeseries/sources/goes.py
index 08e2a6a..e70c177 100644
--- b/sunpy/timeseries/sources/goes.py
+++ a/sunpy/timeseries/sources/goes.py
@@ -267,7 +267,7 @@ class XRSTimeSeries(GenericTimeSeries):
data = DataFrame({"xrsa": xrsa, "xrsb": xrsb, "xrsa_quality": ... |
### Issue: Incorrect HTTP Method for List Subscriber Check
#### Describe the Bug
It seems there's an issue with the `get_list_subscriber` method in the Tweepy API. The method is currently using a `POST` request instead of the expected `GET` request to check if a user is a subscriber of a list. This change in the HTTP... | diff --git a/tweepy/api.py b/tweepy/api.py
index 37caf07..b48cfb3 100644
--- b/tweepy/api.py
+++ a/tweepy/api.py
@@ -1623,7 +1623,7 @@ class API:
https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers-show
"""
return sel... |
# Two bugs in sunpy time module
## Bug 1: Microsecond parsing error
Python 3.11, sunpy latest version
When parsing a time string with microseconds that have trailing zeros, the parser fails with an AttributeError. This used to work in previous versions.
```python
from sunpy.time import parse_time
# This fails with ... | diff --git a/sunpy/time/time.py b/sunpy/time/time.py
index 0d760c5..dafcd2b 100644
--- b/sunpy/time/time.py
+++ a/sunpy/time/time.py
@@ -116,7 +116,7 @@ def _regex_parse_time(inp, format):
# Special handling to strip any excess zeros beyond the six digits of the microsecond field
if "microsecond" in found_gro... |
FalconParser incorrectly extracts request object from method arguments
#### Description
The FalconParser is failing to properly extract the request object from Falcon resource method arguments. When using decorators like `@use_args` or `@use_kwargs`, the parser throws a ValueError claiming the argument is not a falco... | diff --git a/src/webargs/falconparser.py b/src/webargs/falconparser.py
index dd96a30..e874de0 100644
--- b/src/webargs/falconparser.py
+++ a/src/webargs/falconparser.py
@@ -157,9 +157,9 @@ class FalconParser(core.Parser[falcon.Request]):
"""Get request from a resource method's arguments. Assumes that
... |
Template attribute access and subscript operations broken
#### Description
Template rendering is failing for basic attribute access and subscript operations. When trying to access object attributes or array/dict elements in templates, the parser seems to be generating incorrect syntax.
#### Steps/Code to Reproduce
... | diff --git a/src/jinja2/parser.py b/src/jinja2/parser.py
index 817abec..9fbd0f4 100644
--- b/src/jinja2/parser.py
+++ a/src/jinja2/parser.py
@@ -809,23 +809,23 @@ class Parser:
next(self.stream)
if attr_token.type == "name":
return nodes.Getattr(
- node, att... |
PackageLoader.list_templates() fails for zip imports
When using PackageLoader with packages installed from zip files, the `list_templates()` method raises a TypeError. This affects packages that are imported from zip archives or wheel files.
#### Steps/Code to Reproduce
```python
from jinja2 import PackageLoader
# ... | diff --git a/src/jinja2/loaders.py b/src/jinja2/loaders.py
index 8ca32cb..d8f5eaf 100644
--- b/src/jinja2/loaders.py
+++ a/src/jinja2/loaders.py
@@ -396,6 +396,16 @@ class PackageLoader(BaseLoader):
results: t.List[str] = []
if self._archive is None:
+ # Package is a directory.
+ ... |
NameError: name 'unzip_path' is not defined in zipfile.unzip function
#### Description
The `unzip` function in `cookiecutter/zipfile.py` is returning an undefined variable `unzip_path`, causing a NameError when trying to unzip any repository.
#### Steps/Code to Reproduce
```python
from cookiecutter import zipfile
... | diff --git a/cookiecutter/zipfile.py b/cookiecutter/zipfile.py
index fdd9645..2a7bb4d 100644
--- b/cookiecutter/zipfile.py
+++ a/cookiecutter/zipfile.py
@@ -60,4 +60,59 @@ def unzip(
# Just use the local zipfile as-is.
zip_path = os.path.abspath(zip_uri)
- return unzip_path
+ # Now unpack the ... |
# Release script fails when generating GitHub release notes
## Description
I'm trying to use the release script to create a new release, but it's failing when trying to generate GitHub release notes. The script seems to be swapping the token and version parameters when making the API request to GitHub.
```python
>>>... | diff --git a/scripts/release.py b/scripts/release.py
index 501d585..d17c721 100755
--- b/scripts/release.py
+++ a/scripts/release.py
@@ -53,7 +53,7 @@ def remove_previous_dist() -> None:
def create_build() -> None:
"""Create a build."""
- subprocess.run(["python", "-m", "build"], check=False)
+ subprocess... |
Image.from_file() fails with string paths and incorrect scaling behavior
#### Description
When using `Image.from_file()` with string paths, the method fails because it's checking for `bytes` instead of `str`. Additionally, there are issues with dimension scaling where width calculation is missing and filename handlin... | diff --git a/src/docx/image/image.py b/src/docx/image/image.py
index 0022b5b..b8ecbab 100644
--- b/src/docx/image/image.py
+++ a/src/docx/image/image.py
@@ -36,18 +36,18 @@ class Image:
def from_file(cls, image_descriptor: str | IO[bytes]):
"""Return a new |Image| subclass instance loaded from the image f... |
lpartition function breaks with TypeError when step parameter is provided
#### Description
The `lpartition` function raises a `TypeError` when called with a step parameter, making it unusable for basic partitioning with step functionality.
#### Steps/Code to Reproduce
```python
from funcy import lpartition
# This ... | diff --git a/funcy/seqs.py b/funcy/seqs.py
index 9a96252..0d999d0 100644
--- b/funcy/seqs.py
+++ a/funcy/seqs.py
@@ -385,11 +385,7 @@ def partition(n, step, seq=EMPTY):
def lpartition(n, step, seq=EMPTY):
"""Partitions seq into parts of length n.
Skips step items between parts if passed. Non-fitting tail ... |
JuliaConsoleLexer missing Lexer inheritance breaks lexer functionality
#### Description
The JuliaConsoleLexer class is missing its inheritance from the Lexer base class, causing AttributeError when trying to use the lexer.
#### Steps/Code to Reproduce
```python
from pygments.lexers import get_lexer_by_name
# This ... | diff --git a/pygments/lexers/julia.py b/pygments/lexers/julia.py
index ce717a1..1a3a24b 100644
--- b/pygments/lexers/julia.py
+++ a/pygments/lexers/julia.py
@@ -243,7 +243,7 @@ class JuliaLexer(RegexLexer):
return shebang_matches(text, r'julia')
-class JuliaConsoleLexer():
+class JuliaConsoleLexer(Lexer):
... |
Document body initialization passes wrong element
#### Description
When accessing the document body through `document._body`, the `_Body` constructor receives the wrong element parameter. This causes issues when iterating through document content or accessing body-related functionality.
#### Steps/Code to Reproduce
... | diff --git a/src/docx/document.py b/src/docx/document.py
index 8944a0e..da07b3b 100644
--- b/src/docx/document.py
+++ a/src/docx/document.py
@@ -184,7 +184,7 @@ class Document(ElementProxy):
def _body(self) -> _Body:
"""The |_Body| instance containing the content for this document."""
if self.__b... |
Parser.get_request_from_view_args returns wrong request when multiple requests in args
#### Description
When using webargs parsers with view functions that have multiple request objects in their positional arguments, the parser incorrectly returns the last request object instead of the first one. This causes parsing ... | diff --git a/src/webargs/core.py b/src/webargs/core.py
index 44294e9..64bd002 100644
--- b/src/webargs/core.py
+++ a/src/webargs/core.py
@@ -517,11 +517,7 @@ class Parser(typing.Generic[Request]):
:param tuple args: Positional arguments passed to ``view``.
:param dict kwargs: Keyword arguments passed ... |
get_factory function broken due to variable reference before assignment
#### Description
The `get_factory` function in `console_scripts.py` is broken and raises `UnboundLocalError` when trying to use custom image factories with the qrcode command line tool.
#### Steps/Code to Reproduce
```python
from qrcode.console... | diff --git a/qrcode/console_scripts.py b/qrcode/console_scripts.py
index 124265a..de623d5 100755
--- b/qrcode/console_scripts.py
+++ a/qrcode/console_scripts.py
@@ -141,11 +141,12 @@ def main(args=None):
def get_factory(module: str) -> Type[BaseImage]:
- return getattr(imp, name)
- imp = __import__(module, {... |
PublicBlob constructor missing after refactoring
#### Description
After some recent changes, creating PublicBlob instances fails with a TypeError because the `__init__` method was removed but the class is still being instantiated directly in various parts of the codebase.
#### Steps/Code to Reproduce
```python
from... | diff --git a/paramiko/pkey.py b/paramiko/pkey.py
index f0b2d6d..09ea2c7 100644
--- b/paramiko/pkey.py
+++ a/paramiko/pkey.py
@@ -879,6 +879,18 @@ class PublicBlob:
basically "I should be using ``attrs`` for this."
"""
+ def __init__(self, type_, blob, comment=None):
+ """
+ Create a new... |
GPX to_xml() output doesn't match expected default schema locations
#### Description
When creating a new GPX object and converting it to XML, the output doesn't match the expected default schema locations format.
#### Steps/Code to Reproduce
```python
import gpxpy as mod_gpx
gpx = mod_gpx.GPX()
xml_output = gpx.to... | diff --git a/test.py b/test.py
index 7dd6f44..f5edeaf 100644
--- b/test.py
+++ a/test.py
@@ -3500,10 +3500,7 @@ class GPXTests(mod_unittest.TestCase):
def test_default_schema_locations(self) -> None:
gpx = mod_gpx.GPX()
with open('test_files/default_schema_locations.gpx') as f:
- # Rea... |
# GlobalProfiler.wrap() doesn't add functions to the profiler
## Description
I've found an issue with the `GlobalProfiler.wrap()` method in line_profiler. When the profiler is enabled, it wraps the function but doesn't add it to the profiler first.
## Steps to reproduce
Here's a minimal example that demonstrates th... | diff --git a/line_profiler/explicit_profiler.py b/line_profiler/explicit_profiler.py
index 0cac00c..20d20fe 100644
--- b/line_profiler/explicit_profiler.py
+++ a/line_profiler/explicit_profiler.py
@@ -319,19 +319,17 @@ class GlobalProfiler:
Returns:
Callable: a potentially wrapped function
... |
[Bug]: Incorrect HTTP Method for Tweet Count Endpoint
### Description
It seems there's an issue with the HTTP method used for the `/2/tweets/counts/all` endpoint. The method should be `GET`, but it appears to be using `POST` instead. This is causing unexpected behavior when trying to retrieve tweet counts.
### Steps... | diff --git a/tweepy/client.py b/tweepy/client.py
index d463129..bbef354 100644
--- b/tweepy/client.py
+++ a/tweepy/client.py
@@ -1659,7 +1659,7 @@ class Client(BaseClient):
"""
params["query"] = query
return self._make_request(
- "POST", "/2/tweets/counts/all", params=params,
+ ... |
Objective-C lexer broken after recent changes
#### Description
The Objective-C lexer appears to be completely broken and is producing incorrect token types and failing to properly tokenize Objective-C code. When trying to highlight Objective-C code, the lexer is generating wrong tokens and even crashing in some cases... | diff --git a/pygments/lexers/objective.py b/pygments/lexers/objective.py
index b37a9d4..17c9c10 100644
--- b/pygments/lexers/objective.py
+++ a/pygments/lexers/objective.py
@@ -26,11 +26,18 @@ def objective(baselexer):
extensions.
"""
- _oc_keywords = re.compile(r'@(?:end|implementation|protocaol)')
-
- ... |
URL validator incorrectly accepts invalid URLs
#### Description
The URL validator is not properly rejecting invalid URLs that should fail validation. URLs with malformed IPv6 addresses, invalid userinfo sections, and relative URLs are being accepted when they should be rejected.
#### Steps/Code to Reproduce
```pyth... | diff --git a/src/marshmallow/validate.py b/src/marshmallow/validate.py
index e4536d8..4509710 100644
--- b/src/marshmallow/validate.py
+++ a/src/marshmallow/validate.py
@@ -110,21 +110,33 @@ class URL(Validator):
self, relative: bool, absolute: bool, require_tld: bool
) -> typing.Pattern:
... |
TimedeltaArray creation fails with AttributeError when passing non-timedelta data
#### Description
When creating a TimedeltaArray with data that needs conversion (like integers, floats, or strings), the creation process fails with an AttributeError because the conversion logic has been removed.
#### Steps/Code to Re... | diff --git a/pandas/core/arrays/timedeltas.py b/pandas/core/arrays/timedeltas.py
index c5b3129..729543a 100644
--- b/pandas/core/arrays/timedeltas.py
+++ a/pandas/core/arrays/timedeltas.py
@@ -1097,6 +1097,42 @@ def sequence_to_td64ns(
if isinstance(data, TimedeltaArray):
inferred_freq = data.freq
+ ... |
# `to_json` function fails with NameError when processing image renderer
#### MCVE Code Sample
```python
from dvc.render.convert import to_json
# Mock an image renderer
class MockRenderer:
TYPE = 'image'
def __init__(self):
self.datapoints = [
{'src': 'path/to/image.png', 'revision': 'v1'... | diff --git a/dvc/render/convert.py b/dvc/render/convert.py
index 11e9811..47f7a46 100644
--- b/dvc/render/convert.py
+++ a/dvc/render/convert.py
@@ -42,8 +42,8 @@ def to_json(renderer, split: bool = False) -> list[dict]:
{
TYPE_KEY: renderer.TYPE,
REVISIONS: [datapoint.get... |
CFamilyLexer inheritance broken after recent changes
#### Description
The CFamilyLexer class no longer inherits from RegexLexer, causing all C/C++ related lexers to fail with AttributeError when trying to access inherited methods and properties.
#### Steps/Code to Reproduce
```python
from pygments.lexers import CLe... | diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py
index 0f83b71..f07579b 100644
--- b/pygments/lexers/c_cpp.py
+++ a/pygments/lexers/c_cpp.py
@@ -19,7 +19,7 @@ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
__all__ = ['CLexer', 'CppLexer']
-class CFamilyLexer():
+class ... |
LazyFile doesn't close files properly when opened in write mode
When using `click.File` with write mode and `lazy=True`, files are not being closed properly after operations. This causes issues with file handles remaining open and can lead to problems with atomic file operations.
#### Steps/Code to Reproduce
```pyth... | diff --git a/src/click/utils.py b/src/click/utils.py
index ab2fe58..00bfde1 100644
--- b/src/click/utils.py
+++ a/src/click/utils.py
@@ -132,10 +132,13 @@ class LazyFile:
if self.name == "-":
self._f, self.should_close = open_stream(filename, mode, encoding, errors)
else:
- if ... |
TerminalFormatter produces incorrect output with inverted line number logic
#### Description
The TerminalFormatter is producing incorrect output when formatting code. The line numbering and newline handling appears to be inverted, causing issues with both line number display and general formatting.
#### Steps/Code t... | diff --git a/pygments/formatters/terminal.py b/pygments/formatters/terminal.py
index 5c38805..445c9b8 100644
--- b/pygments/formatters/terminal.py
+++ a/pygments/formatters/terminal.py
@@ -106,22 +106,22 @@ class TerminalFormatter(Formatter):
return colors[self.darkbg]
def format_unencoded(self, tokenso... |
# RST renderer incorrectly formats code blocks with tab indentation
#### Description
When using the RST renderer to convert markdown code blocks to RST format, the code blocks are incorrectly indented with tabs instead of spaces. Additionally, there seems to be an issue with language detection for code blocks.
#### S... | diff --git a/src/mistune/renderers/rst.py b/src/mistune/renderers/rst.py
index 7022d15..df6ace5 100644
--- b/src/mistune/renderers/rst.py
+++ a/src/mistune/renderers/rst.py
@@ -118,10 +118,10 @@ class RSTRenderer(BaseRenderer):
def block_code(self, token: Dict[str, Any], state: BlockState) -> str:
attrs... |
Duration formatting with %P and %p format specifiers returns literal strings instead of formatted output
#### Description
When using `duration_isoformat` with format specifiers `%P` or `%p`, the function returns the literal format string instead of the properly formatted duration components.
#### Steps/Code to Repro... | diff --git a/src/isodate/isostrf.py b/src/isodate/isostrf.py
index f80b6c2..73296d9 100644
--- b/src/isodate/isostrf.py
+++ a/src/isodate/isostrf.py
@@ -98,7 +98,40 @@ def _strfduration(tdt: Union[timedelta, Duration], format: str, yeardigits: int
def repl(match: re.Match[str]) -> str:
"""Lookup format ... |
PadLeft function adds extra padding character
#### Description
The `PadLeft` function in `util/strutil/strutil.go` is adding one extra padding character than expected.
#### Steps/Code to Reproduce
```go
package main
import (
"fmt"
"github.com/gosuri/uiprogress/util/strutil"
)
func main() {
result := s... | diff --git a/util/strutil/strutil.go b/util/strutil/strutil.go
index 7638ae5..ecfbaa1 100644
--- b/util/strutil/strutil.go
+++ a/util/strutil/strutil.go
@@ -24,7 +24,7 @@ func PadLeft(str string, length int, pad byte) string {
return str
}
var buf bytes.Buffer
- for i := 0; i <= length-len(str); i++ {
+ for i :=... |
TextFSM string representation methods broken after recent changes
#### Description
The `__str__` methods for `TextFSMValue` and `TextFSMRule` classes are producing incorrect output. When converting these objects to strings, the formatting is wrong and doesn't match the expected template syntax.
#### Steps/Code to Re... | diff --git a/textfsm/parser.py b/textfsm/parser.py
index c00c976..469d59a 100755
--- b/textfsm/parser.py
+++ a/textfsm/parser.py
@@ -84,7 +84,7 @@ class TextFSMOptions(object):
"""
def __init__(self, value):
- self.value = value + 1
+ self.value = value
@property
def name(self):
@@ -34... |
TypstLexer fails to handle nested structures and imports
Description
It seems that the recent changes to the TypstLexer have introduced an issue with handling nested structures and imports. When processing Typst files with complex nesting or import statements, the lexer does not correctly tokenize the input, leading ... | diff --git a/pygments/lexers/typst.py b/pygments/lexers/typst.py
index 50baa9c..b864bc2 100644
--- b/pygments/lexers/typst.py
+++ a/pygments/lexers/typst.py
@@ -11,6 +11,7 @@
from pygments.lexer import RegexLexer, words, bygroups, include
from pygments.token import Comment, Keyword, Name, String, Punctuation, \
... |
BigQuery timetostr_sql method has undefined variable reference
#### Description
The `timetostr_sql` method in the BigQuery dialect has a bug where it references an undefined variable `this` before it's defined, causing an `UnboundLocalError`.
#### Steps/Code to Reproduce
```python
import sqlglot as sg
# This will ... | diff --git a/sqlglot/dialects/bigquery.py b/sqlglot/dialects/bigquery.py
index 6d39231..7dc814c 100644
--- b/sqlglot/dialects/bigquery.py
+++ a/sqlglot/dialects/bigquery.py
@@ -225,41 +225,27 @@ def _build_datetime(args: t.List) -> exp.Func:
return exp.TimestampFromParts.from_arg_list(args)
-def _build_regexp_... |
HTML escaping inverted when escape=False in HTMLRenderer
#### Description
When using HTMLRenderer with `escape=False`, inline HTML content is being escaped instead of being left as-is. The behavior is inverted from what's expected.
#### Steps/Code to Reproduce
```python
import mistune
# Test with escape=False - sh... | diff --git a/src/mistune/renderers/html.py b/src/mistune/renderers/html.py
index 5a6d9bd..c7b5a4b 100644
--- b/src/mistune/renderers/html.py
+++ a/src/mistune/renderers/html.py
@@ -100,7 +100,7 @@ class HTMLRenderer(BaseRenderer):
return '\n'
def inline_html(self, html: str) -> str:
- if not self... |
ListComp get_children order affects variable lookup
#### Description
When iterating through children of a list comprehension node, the order in which elements are yielded affects variable lookup behavior. The element (`elt`) should be yielded after the generators to maintain proper scoping semantics.
#### Steps/Code... | diff --git a/astroid/nodes/scoped_nodes/scoped_nodes.py b/astroid/nodes/scoped_nodes/scoped_nodes.py
index 99ed796..cfc7931 100644
--- b/astroid/nodes/scoped_nodes/scoped_nodes.py
+++ a/astroid/nodes/scoped_nodes/scoped_nodes.py
@@ -841,10 +841,10 @@ class ListComp(ComprehensionScope):
return util.Uninferable
... |
# Bug in SQL comment stripping functionality
### Bug description
The `strip_comments` functionality in sqlparse is not working correctly. When trying to strip comments from SQL statements, the function fails with an `UnboundLocalError` and doesn't properly handle comments.
### Reproduction
The issue occurs when try... | diff --git a/sqlparse/filters/others.py b/sqlparse/filters/others.py
index 6c1680e..e4da1fe 100644
--- b/sqlparse/filters/others.py
+++ a/sqlparse/filters/others.py
@@ -20,16 +20,17 @@ class StripCommentsFilter:
return tlist.token_next_by(i=sql.Comment, t=T.Comment, idx=idx)
def _get_insert_toke... |
Parameter status check incorrectly reports modified parameters as unchanged
#### Description
When checking parameter status, parameters that have actually been modified are incorrectly reported as unchanged and skipped from the status output. This affects the ability to properly track parameter changes in DVC pipelin... | diff --git a/dvc/dependency/param.py b/dvc/dependency/param.py
index b3cef93..4f6e500 100644
--- b/dvc/dependency/param.py
+++ a/dvc/dependency/param.py
@@ -144,18 +144,19 @@ class ParamsDependency(Dependency):
elif param not in info:
st = "new"
elif actual[param] != info[para... |
# BestOfN module doesn't properly handle temperature variations and tracing
I've encountered an issue with the `BestOfN` module that seems to be causing unexpected behavior when trying to run multiple attempts with different temperatures.
## Problem Description
When using the `BestOfN` module to try different temper... | diff --git a/dspy/predict/best_of_n.py b/dspy/predict/best_of_n.py
index 3b478c0..a2bcc56 100644
--- b/dspy/predict/best_of_n.py
+++ a/dspy/predict/best_of_n.py
@@ -54,39 +54,36 @@ class BestOfN(Module):
self.fail_count = fail_count or N # default to N if fail_count is not provided
def forward(self, **... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.