PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: google/google-api-python-client (python)

Issue:
BatchError is unprintable using default constructor (one string)
This one should be pretty simple, I hope.

Here's the constructor signature: `def __init__(self, reason, resp=None, content=None):`, which doesn't require `resp` to be defined, and I can see it is not defined most of the time, for example, in googleapiclient/http.py.

Then, given the representation method:

```
def __repr__(self):
      return '<BatchError %s "%s">' % (self.resp.status, self.reason)
```

Which is also the string method:

```
__str__ = __repr__
```

This results in unprintable exceptions where `resp` is undefined, which is not very helpful when attempting to understand the error (e.g. #164).


Pull request:
BatchError is unprintable using default constructor (#165)
Fix #165 


Patch:
diff --git a/googleapiclient/errors.py b/googleapiclient/errors.py
index e6f1f9d45..6a741f86d 100644
--- a/googleapiclient/errors.py
+++ b/googleapiclient/errors.py
@@ -126,6 +126,9 @@ class BatchError(HttpError):
     self.reason = reason
 
   def __repr__(self):
+    if getattr(self.resp, 'status', None) is None:
+      return '<BatchError "%s">' % (self.reason)
+    else:
       return '<BatchError %s "%s">' % (self.resp.status, self.reason)
 
   __str__ = __repr__


Test patch:
diff --git a/tests/test_http.py b/tests/test_http.py
index 865d84703..36b43bf16 100644
--- a/tests/test_http.py
+++ b/tests/test_http.py
@@ -1053,7 +1053,9 @@ class TestBatch(unittest.TestCase):
     upload = MediaFileUpload(
         datafile('small.png'), chunksize=500, resumable=True)
     self.request1.resumable = upload
-    self.assertRaises(BatchError, batch.add, self.request1, request_id='1')
+    with self.assertRaises(BatchError) as batch_error:
+      batch.add(self.request1, request_id='1')
+    str(batch_error.exception)
 
   def test_execute_empty_batch_no_http(self):
     batch = BatchHttpRequest()
Repository: prometheus/procfs (go)

Issue:
Improve CPU information for physical s390x platforms
The [current code](url) for s390x CPU doesn't provide full information for physical Z machines (as opposed to virtual Z machines). In particular `CPUInfo.CoreID` and `CPUInfo.PhysicalID` are missing (but other fields could probably be added too).

See https://bugzilla.redhat.com/show_bug.cgi?id=1882730 which has a copy of `/proc/cpuinfo` from a physical machine.

Pull request:
cpuinfo: add parsing of physical id, core id, siblings, and cpus cores to s390x arch
Fix #333

Signed-off-by: paulfantom <pawel@krupa.net.pl>

/cc @SuperQ @simonpasquier 

Patch:
diff --git a/cpuinfo.go b/cpuinfo.go
index b9fb589..1711d73 100644
--- a/cpuinfo.go
+++ b/cpuinfo.go
@@ -313,6 +313,22 @@ func parseCPUInfoS390X(info []byte) ([]CPUInfo, error) {
 				return nil, err
 			}
 			cpuinfo[i].CPUMHz = v
+		case "physical id":
+			cpuinfo[i].PhysicalID = field[1]
+		case "core id":
+			cpuinfo[i].CoreID = field[1]
+		case "cpu cores":
+			v, err := strconv.ParseUint(field[1], 0, 32)
+			if err != nil {
+				return nil, err
+			}
+			cpuinfo[i].CPUCores = uint(v)
+		case "siblings":
+			v, err := strconv.ParseUint(field[1], 0, 32)
+			if err != nil {
+				return nil, err
+			}
+			cpuinfo[i].Siblings = uint(v)
 		}
 	}
 


Test patch:
diff --git a/cpuinfo_test.go b/cpuinfo_test.go
index bfec15d..9a00d69 100644
--- a/cpuinfo_test.go
+++ b/cpuinfo_test.go
@@ -115,18 +115,34 @@ processor 2: version = FF,  identification = 2733E8,  machine = 2964
 processor 3: version = FF,  identification = 2733E8,  machine = 2964
 
 cpu number      : 0
+physical id     : 2
+core id         : 0
+siblings        : 8
+cpu cores       : 4
 cpu MHz dynamic : 5000
 cpu MHz static  : 5000
 
 cpu number      : 1
+physical id     : 2
+core id         : 0
+siblings        : 8
+cpu cores       : 4
 cpu MHz dynamic : 5000
 cpu MHz static  : 5000
 
 cpu number      : 2
+physical id     : 2
+core id         : 1
+siblings        : 8
+cpu cores       : 4
 cpu MHz dynamic : 5000
 cpu MHz static  : 5000
 
 cpu number      : 3
+physical id     : 2
+core id         : 1
+siblings        : 8
+cpu cores       : 4
 cpu MHz dynamic : 5000
 cpu MHz static  : 5000
 `
@@ -327,6 +343,18 @@ func TestCPUInfoParseS390X(t *testing.T) {
 	if want, have := 5000.0, cpuinfo[2].CPUMHz; want != have {
 		t.Errorf("want cpu MHz %v, have %v", want, have)
 	}
+	if want, have := uint(8), cpuinfo[3].Siblings; want != have {
+		t.Errorf("want siblings %v, have %v", want, have)
+	}
+	if want, have := "1", cpuinfo[3].CoreID; want != have {
+		t.Errorf("want core id %v, have %v", want, have)
+	}
+	if want, have := uint(4), cpuinfo[2].CPUCores; want != have {
+		t.Errorf("want cpu cores %v, have %v", want, have)
+	}
+	if want, have := "2", cpuinfo[2].PhysicalID; want != have {
+		t.Errorf("want physical id %v, have %v", want, have)
+	}
 }
 
 func TestCPUInfoParseMips(t *testing.T) {