PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: opencontainers/runc (go)

Issue:
There is no cpuacct.usage_all file in CentOS 7
There is no cpuacct.usage_all file in CentOS 7. Reading of cpuacct.usage_all was introduced in #2271. 
Issue observed on:
Operating System: CentOS Linux 7 (Core)
Kernel: Linux 3.10.0-1062.18.1.el7.x86_64

I provide a fix for this issue in next week.


Pull request:
Fix #2440 omit cpuacct.usage_all when not available
Signed-off-by: Katarzyna Kujawa <katarzyna.kujawa@intel.com>

Patch:
diff --git a/libcontainer/cgroups/fs/cpuacct.go b/libcontainer/cgroups/fs/cpuacct.go
index 008bc529..dd8aea0c 100644
--- a/libcontainer/cgroups/fs/cpuacct.go
+++ b/libcontainer/cgroups/fs/cpuacct.go
@@ -144,7 +144,9 @@ func getPercpuUsageInModes(path string) ([]uint64, []uint64, error) {
 	usageUserMode := []uint64{}
 
 	file, err := os.Open(filepath.Join(path, cgroupCpuacctUsageAll))
-	if err != nil {
+	if os.IsNotExist(err) {
+		return usageKernelMode, usageUserMode, nil
+	} else if err != nil {
 		return nil, nil, err
 	}
 	defer file.Close()


Test patch:
diff --git a/libcontainer/cgroups/fs/cpuacct_test.go b/libcontainer/cgroups/fs/cpuacct_test.go
index 73623311..bb69d9be 100644
--- a/libcontainer/cgroups/fs/cpuacct_test.go
+++ b/libcontainer/cgroups/fs/cpuacct_test.go
@@ -59,3 +59,35 @@ func TestCpuacctStats(t *testing.T) {
 			expectedStats, actualStats.CpuStats.CpuUsage)
 	}
 }
+
+func TestCpuacctStatsWithoutUsageAll(t *testing.T) {
+	helper := NewCgroupTestUtil("cpuacct.", t)
+	defer helper.cleanup()
+	helper.writeFileContents(map[string]string{
+		"cpuacct.usage":        cpuAcctUsageContents,
+		"cpuacct.usage_percpu": cpuAcctUsagePerCPUContents,
+		"cpuacct.stat":         cpuAcctStatContents,
+	})
+
+	cpuacct := &CpuacctGroup{}
+	actualStats := *cgroups.NewStats()
+	err := cpuacct.GetStats(helper.CgroupPath, &actualStats)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	expectedStats := cgroups.CpuUsage{
+		TotalUsage: uint64(12262454190222160),
+		PercpuUsage: []uint64{1564936537989058, 1583937096487821, 1604195415465681, 1596445226820187,
+			1481069084155629, 1478735613864327, 1477610593414743, 1476362015778086},
+		PercpuUsageInKernelmode: []uint64{},
+		PercpuUsageInUsermode:   []uint64{},
+		UsageInKernelmode:       (uint64(291429664) * nanosecondsInSecond) / clockTicks,
+		UsageInUsermode:         (uint64(452278264) * nanosecondsInSecond) / clockTicks,
+	}
+
+	if !reflect.DeepEqual(expectedStats, actualStats.CpuStats.CpuUsage) {
+		t.Errorf("Expected CPU usage %#v but found %#v\n",
+			expectedStats, actualStats.CpuStats.CpuUsage)
+	}
+}
Repository: google/google-api-python-client (python)

Issue:
v1.6.1 HttpError 403 "Insufficient Permission"
I happened to try updating google-api-python-client from 1.5.5 to 1.6.1. It causes my YouTube Data API v3 code to always fail with a HttpError. An example to reproduce is:

    from apiclient.discovery import build
    DEVELOPER_KEY = "<Insert key>"
    youtube = build("youtube", "v3", developerKey=DEVELOPER_KEY)
    youtube.videos().list(id="xGG56MWgbOA", part="id").execute()

This returns a successful response on 1.5.5, but raises a HttpError on 1.6.1:

    HttpError: <HttpError 403 when requesting https://www.googleapis.com/youtube/v3/videos?alt=json&part=id&id=xGG56MWgbOA&key=<Insert key> returned "Insufficient Permission">

Visiting the specified link in a browser returns a valid response. Is there some usage change I am not aware of?

Pull request:
Don't invoke application default credentials logic when developerKey is provided
Resolves #346

Patch:
diff --git a/googleapiclient/discovery.py b/googleapiclient/discovery.py
index 6291f34e8..12668832d 100644
--- a/googleapiclient/discovery.py
+++ b/googleapiclient/discovery.py
@@ -355,8 +355,9 @@ def build_from_document(
     scopes = list(
       service.get('auth', {}).get('oauth2', {}).get('scopes', {}).keys())
 
-    # If so, then the we need to setup authentication.
-    if scopes:
+    # If so, then the we need to setup authentication if no developerKey is
+    # specified.
+    if scopes and not developerKey:
       # If the user didn't pass in credentials, attempt to acquire application
       # default credentials.
       if credentials is None:


Test patch:
diff --git a/tests/test_discovery.py b/tests/test_discovery.py
index 47adeb794..ec66bc6d3 100644
--- a/tests/test_discovery.py
+++ b/tests/test_discovery.py
@@ -437,6 +437,16 @@ class DiscoveryFromDocument(unittest.TestCase):
       discovery, base="https://www.googleapis.com/", http=http)
     self.assertEquals(plus._http, http)
 
+  def test_building_with_developer_key_skips_adc(self):
+    discovery = open(datafile('plus.json')).read()
+    plus = build_from_document(
+      discovery, base="https://www.googleapis.com/", developerKey='123')
+    self.assertIsInstance(plus._http, httplib2.Http)
+    # It should not be an AuthorizedHttp, because that would indicate that
+    # application default credentials were used.
+    self.assertNotIsInstance(plus._http, google_auth_httplib2.AuthorizedHttp)
+
+
 class DiscoveryFromHttp(unittest.TestCase):
   def setUp(self):
     self.old_environ = os.environ.copy()