PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: Azure/WALinuxAgent (python)

Issue:
WALA usage prompt lacks of " waagent -show-configuration"
We can perform "waagent -show-configuration" to get current WALA configuration,but "waagent -help"lacks of this usage prompt.

Pull request:
Add -show-configuration option
Closes #915 

Patch:
diff --git a/azurelinuxagent/agent.py b/azurelinuxagent/agent.py
index e99f7bed..87ab3c14 100644
--- a/azurelinuxagent/agent.py
+++ b/azurelinuxagent/agent.py
@@ -144,7 +144,7 @@ def main(args=[]):
     if command == "version":
         version()
     elif command == "help":
-        usage()
+        print(usage())
     elif command == "start":
         start(conf_file_path=conf_file_path)
     else:
@@ -228,15 +228,16 @@ def version():
 
 def usage():
     """
-    Show agent usage
+    Return agent usage message
     """
-    print("")
-    print((("usage: {0} [-verbose] [-force] [-help] "
+    s  = "\n"
+    s += ("usage: {0} [-verbose] [-force] [-help] "
            "-configuration-path:<path to configuration file>"
            "-deprovision[+user]|-register-service|-version|-daemon|-start|"
-           "-run-exthandlers]"
-           "").format(sys.argv[0])))
-    print("")
+           "-run-exthandlers|-show-configuration]"
+           "").format(sys.argv[0])
+    s += "\n"
+    return s
 
 def start(conf_file_path=None):
     """


Test patch:
diff --git a/tests/test_agent.py b/tests/test_agent.py
index 51b157dd..95994dba 100644
--- a/tests/test_agent.py
+++ b/tests/test_agent.py
@@ -15,9 +15,7 @@
 # Requires Python 2.4+ and Openssl 1.0+
 #
 
-import mock
 import os.path
-import sys
 
 from azurelinuxagent.agent import *
 from azurelinuxagent.common.conf import *
@@ -168,3 +166,22 @@ class TestAgent(AgentTestCase):
         for k in sorted(configuration.keys()):
             actual_configuration.append("{0} = {1}".format(k, configuration[k]))
         self.assertEqual(EXPECTED_CONFIGURATION, actual_configuration)
+
+    def test_agent_usage_message(self):
+        message = usage()
+
+        # Python 2.6 does not have assertIn()
+        self.assertTrue("-verbose" in message)
+        self.assertTrue("-force" in message)
+        self.assertTrue("-help" in message)
+        self.assertTrue("-configuration-path" in message)
+        self.assertTrue("-deprovision" in message)
+        self.assertTrue("-register-service" in message)
+        self.assertTrue("-version" in message)
+        self.assertTrue("-daemon" in message)
+        self.assertTrue("-start" in message)
+        self.assertTrue("-run-exthandlers" in message)
+        self.assertTrue("-show-configuration" in message)
+
+        # sanity check
+        self.assertFalse("-not-a-valid-option" in message)
Repository: jhump/protoreflect (go)

Issue:
protoparse: numbers starting with 0 should be octal
According to protoc "Numbers starting with leading zero must be in octal". The [spec seems to agree](https://developers.google.com/protocol-buffers/docs/reference/proto3-spec#integer_literals):

```
intLit     = decimalLit | octalLit | hexLit
decimalLit = ( "1" … "9" ) { decimalDigit }
octalLit   = "0" { octalDigit }
hexLit     = "0" ( "x" | "X" ) hexDigit { hexDigit } 
```

example:

```protobuf
message o {
  optional bool f=09;
}

// protoc error:
// a.proto:2:26: Numbers starting with leading zero must be in octal.
// a.proto:2:25: Integer out of range.
```



Pull request:
protoparse: Treat all numbers starting with 0 as octal
fixes #458

```protobuf
syntax="proto3";
message o {
  bool f=09;
}

// protoc error:
// a.proto:3:11: Numbers starting with leading zero must be in octal.
// a.proto:3:10: Integer out of range.

// protoparse error:
// a.proto:3:9: invalid syntax in octal integer value: 09
```

Patch:
diff --git a/desc/protoparse/lexer.go b/desc/protoparse/lexer.go
index 155126c..482e6e3 100644
--- a/desc/protoparse/lexer.go
+++ b/desc/protoparse/lexer.go
@@ -289,7 +289,7 @@ func (l *protoLex) Lex(lval *protoSymType) int {
 			}
 			// integer! (decimal or octal)
 			base := 10
-			if token[0] == '0' && len(token) > 1 && token[1] >= '0' && token[1] <= '7' {
+			if token[0] == '0' {
 				base = 8
 			}
 			ui, err := strconv.ParseUint(token, base, 64)


Test patch:
diff --git a/desc/protoparse/lexer_test.go b/desc/protoparse/lexer_test.go
index fdf8538..5f67241 100644
--- a/desc/protoparse/lexer_test.go
+++ b/desc/protoparse/lexer_test.go
@@ -261,6 +261,8 @@ func TestLexerErrors(t *testing.T) {
 		{str: "\U0010FFFF", errMsg: "invalid character"},
 		{str: "// foo \x00", errMsg: "invalid control character"},
 		{str: "/* foo \x00", errMsg: "invalid control character"},
+		{str: "09", errMsg: "invalid syntax in octal integer value: 09"},
+		{str: "0f", errMsg: "invalid syntax in octal integer value: 0f"},
 	}
 	for i, tc := range testCases {
 		l := newTestLexer(strings.NewReader(tc.str))
diff --git a/internal/testprotos/make_protos.sh b/internal/testprotos/make_protos.sh
index b66d229..66b4a95 100755
--- a/internal/testprotos/make_protos.sh
+++ b/internal/testprotos/make_protos.sh
@@ -15,6 +15,12 @@ case "${PROTOC_OS}" in
     exit 1
 esac
 
+# This is for macs with M1 chips. Precompiled binaries for osx/amd64 are not available for download, so for that case
+# we download the x86_64 version instead. This will work as long as rosetta2 is installed.
+if [ "$PROTOC_OS" = "osx" ] && [ "$PROTOC_ARCH" = "arm64" ]; then
+  PROTOC_ARCH="x86_64"
+fi
+
 PROTOC="./protoc/bin/protoc"
 
 if [[ "$(${PROTOC} --version 2>/dev/null)" != "libprotoc ${PROTOC_VERSION}" ]]; then
Repository: ViacomInc/data-point (js)

Issue:
attach entityId to error
to help with debugging attach entityId to the error object

Line where to add code

https://github.com/ViacomInc/data-point/blob/master/lib/entity-types/resolve-entity/resolve-entity.js#L126

Pull request:
feat(entity-types/*): attach entityId to error
closes #20

Patch:
diff --git a/lib/entity-types/resolve-entity/resolve-entity.js b/lib/entity-types/resolve-entity/resolve-entity.js
index ff940ff..95b621a 100644
--- a/lib/entity-types/resolve-entity/resolve-entity.js
+++ b/lib/entity-types/resolve-entity/resolve-entity.js
@@ -123,6 +123,8 @@ function resolveEntity (
       if (error.bypass === true) {
         return error.bypassValue
       }
+      // attach entity information to help debug
+      error.entityId = currentAccumulator.reducer.spec.id
 
       return resolveErrorReducers(error, currentAccumulator, resolveTransform)
     })


Test patch:
diff --git a/lib/entity-types/resolve-entity/resolve-entity.test.js b/lib/entity-types/resolve-entity/resolve-entity.test.js
index ef770bf..8328935 100644
--- a/lib/entity-types/resolve-entity/resolve-entity.test.js
+++ b/lib/entity-types/resolve-entity/resolve-entity.test.js
@@ -132,9 +132,9 @@ describe('ResolveEntity.resolveMiddleware', () => {
 const Resolve = require('../../resolve/reducer')
 
 describe('ResolveEntity.resolveEntity', () => {
-  const resolver = (acc, resolveTransform) => Promise.resolve(acc)
+  const defaultResolver = (acc, resolveTransform) => Promise.resolve(acc)
 
-  const resolveEntity = (entityId, input, options) => {
+  const resolveEntity = (entityId, input, options, resolver) => {
     const racc = helpers.createAccumulator.call(null, input, options)
     const reducer = ReducerEntity.create(entityId)
     return ResolveEntity.resolveEntity(
@@ -142,7 +142,7 @@ describe('ResolveEntity.resolveEntity', () => {
       resolveTransform,
       racc,
       reducer,
-      resolver
+      resolver || defaultResolver
     )
   }
 
@@ -152,6 +152,15 @@ describe('ResolveEntity.resolveEntity', () => {
     })
   })
 
+  test('It should attach entityId to error', () => {
+    const rejectResolver = () => Promise.reject(new Error('test'))
+    return resolveEntity('hash:asIs', undefined, undefined, rejectResolver)
+      .catch(error => error)
+      .then(val => {
+        expect(val).toHaveProperty('entityId', 'hash:asIs')
+      })
+  })
+
   test('It should log trace calls when set to true', () => {
     const consoleTime = console.time
     const consoleTimeEnd = console.timeEnd