nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: PlasmaPy/PlasmaPy
Pull request #95 (2017-08-25 10:12:28)

Stepper: Allowing unequal spatial dimensions grid
Modified the interpolation routine to allow unequal spatial dimension grid (nx,ny,nz) with nx!=ny!=nz. 
Also added a test case. 


Patch:
diff --git a/plasmapy/classes/species.py b/plasmapy/classes/species.py
index 8321ccda..4d686c6b 100644
--- a/plasmapy/classes/species.py
+++ b/plasmapy/classes/species.py
@@ -83,11 +83,16 @@ def __init__(self, plasma, particle_type='p', n_particles=1, scaling=1,
                                          dtype=float) * u.m
         self.velocity_history = np.zeros((self.NT, *self.v.shape),
                                          dtype=float) * (u.m / u.s)
+        # create intermediate array of dimension (nx,ny,nz,3) in order to allow
+        # interpolation on non-equal spatial domain dimensions
+        _B = np.moveaxis(self.plasma.magnetic_field.si.value, 0, -1)
+        _E = np.moveaxis(self.plasma.electric_field.si.value, 0, -1)
+
         self._B_interpolator = RegularGridInterpolator(
             (self.plasma.x.si.value,
              self.plasma.y.si.value,
              self.plasma.z.si.value),
-            self.plasma.magnetic_field.T.si.value,
+            _B,
             method="linear",
             bounds_error=True)
 
@@ -95,7 +100,7 @@ def __init__(self, plasma, particle_type='p', n_particles=1, scaling=1,
             (self.plasma.x.si.value,
              self.plasma.y.si.value,
              self.plasma.z.si.value),
-            self.plasma.electric_field.T.si.value,
+            _E,
             method="linear",
             bounds_error=True)
 
@@ -194,7 +199,7 @@ def __repr__(self, *args, **kwargs):
         return f"Species(q={self.q:.4e},m={self.m:.4e},N={self.N}," \
                f"name=\"{self.name}\",NT={self.NT})"
 
-    def __str__(self): # coveralls: ignore
+    def __str__(self):  # coveralls: ignore
         return f"{self.N} {self.scaling:.2e}-{self.name} with " \
                f"q = {self.q:.2e}, m = {self.m:.2e}, " \
                f"{self.saved_iterations} saved history " \


Test patch:
diff --git a/plasmapy/classes/tests/test_Species.py b/plasmapy/classes/tests/test_Species.py
index abe521bb..22e6779b 100644
--- a/plasmapy/classes/tests/test_Species.py
+++ b/plasmapy/classes/tests/test_Species.py
@@ -189,3 +189,17 @@ def test_particle_exb_nonuniform_drift():
     #
     # s.test_kinetic_energy()
 """
+
+
+def test_particle_nonuniform_grid():
+    '''
+        Test the particle stepper when the spatial domain dimensions
+        are unequal
+    '''
+    x = np.linspace(0, 1, 10)*u.m
+    y = np.linspace(0, 1, 20)*u.m
+    z = np.linspace(0, 1, 30)*u.m
+
+    plasma = Plasma(x, y, z)
+
+    Species(plasma, 'e', dt=1e-14*u.s, nt=5).run()
\ No newline at end of file
Repository: google/go-github
Pull request #2771 (2023-04-26 01:26:18)

Change the CreateRequiredWorkflow method from PUT to POST
Fixes: #2770

Changed the method from PUT to POST, by following the github REST API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#create-a-required-workflow

google-cla[bot]: Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this [failed invocation](https://github.com/google/go-github/pull/2771/checks?check_run_id=13024688617) of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Patch:
diff --git a/github/actions_required_workflows.go b/github/actions_required_workflows.go
index 11b96f60..3566eb9d 100644
--- a/github/actions_required_workflows.go
+++ b/github/actions_required_workflows.go
@@ -94,7 +94,7 @@ func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org strin
 // GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#create-a-required-workflow
 func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) {
 	url := fmt.Sprintf("orgs/%v/actions/required_workflows", org)
-	req, err := s.client.NewRequest("PUT", url, createRequiredWorkflowOptions)
+	req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions)
 	if err != nil {
 		return nil, nil, err
 	}


Test patch:
diff --git a/github/actions_required_workflows_test.go b/github/actions_required_workflows_test.go
index 4298caa0..a9d63603 100644
--- a/github/actions_required_workflows_test.go
+++ b/github/actions_required_workflows_test.go
@@ -83,7 +83,7 @@ func TestActionsService_CreateRequiredWorkflow(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()
 	mux.HandleFunc("/orgs/o/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) {
-		testMethod(t, r, "PUT")
+		testMethod(t, r, "POST")
 		testHeader(t, r, "Content-Type", "application/json")
 		testBody(t, r, `{"workflow_file_path":".github/workflows/ci.yaml","repository_id":53,"scope":"selected","selected_repository_ids":[32,91]}`+"\n")
 		fmt.Fprint(w, `{
Repository: google/go-github
Pull request #2799 (2023-06-06 14:38:25)

Add GitHub App event security_advisory
The GitHub App can transmit dependabot events for security_advisory

This PR adds the event, it is based off #2392, so hopefully the mapping is still the same.

Resolves: #2798


Patch:
diff --git a/github/event.go b/github/event.go
index 20907a99..4ee25603 100644
--- a/github/event.go
+++ b/github/event.go
@@ -127,6 +127,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) {
 		payload = &RepositoryVulnerabilityAlertEvent{}
 	case "SecretScanningAlertEvent":
 		payload = &SecretScanningAlertEvent{}
+	case "SecurityAdvisoryEvent":
+		payload = &SecurityAdvisoryEvent{}
 	case "StarEvent":
 		payload = &StarEvent{}
 	case "StatusEvent":
diff --git a/github/messages.go b/github/messages.go
index 8547b881..bb5ae3f3 100644
--- a/github/messages.go
+++ b/github/messages.go
@@ -93,6 +93,7 @@ var (
 		"repository_vulnerability_alert": "RepositoryVulnerabilityAlertEvent",
 		"release":                        "ReleaseEvent",
 		"secret_scanning_alert":          "SecretScanningAlertEvent",
+		"security_advisory":              "SecurityAdvisoryEvent",
 		"star":                           "StarEvent",
 		"status":                         "StatusEvent",
 		"team":                           "TeamEvent",


Test patch:
diff --git a/github/messages_test.go b/github/messages_test.go
index 8dbb0fdf..80fb3e5f 100644
--- a/github/messages_test.go
+++ b/github/messages_test.go
@@ -440,6 +440,10 @@ func TestParseWebHook(t *testing.T) {
 			payload:     &SecretScanningAlertEvent{},
 			messageType: "secret_scanning_alert",
 		},
+		{
+			payload:     &SecurityAdvisoryEvent{},
+			messageType: "security_advisory",
+		},
 		{
 			payload:     &StarEvent{},
 			messageType: "star",
diff --git a/github/repos_hooks_deliveries_test.go b/github/repos_hooks_deliveries_test.go
index ef453996..d1dda365 100644
--- a/github/repos_hooks_deliveries_test.go
+++ b/github/repos_hooks_deliveries_test.go
@@ -189,6 +189,7 @@ var hookDeliveryPayloadTypeToStruct = map[string]interface{}{
 	"repository_import":              &RepositoryImportEvent{},
 	"repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{},
 	"secret_scanning_alert":          &SecretScanningAlertEvent{},
+	"security_advisory":              &SecurityAdvisoryEvent{},
 	"star":                           &StarEvent{},
 	"status":                         &StatusEvent{},
 	"team":                           &TeamEvent{},
Repository: google/go-github
Pull request #2850 (2023-07-28 15:03:46)

Add `OldLogin` field to `AuditEntryData`
When renaming a Github organisation, the audit log entry (with action `org.rename`) will contain `data.old_login` which provides the prior name of the organisation.

This PR builds upon prior work which added support for the `data` field within an Audit Log entry.


Patch:
diff --git a/github/github-accessors.go b/github/github-accessors.go
index 356487e0..3f665ede 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -1598,6 +1598,14 @@ func (a *AuditEntry) GetWorkflowRunID() int64 {
 	return *a.WorkflowRunID
 }
 
+// GetOldLogin returns the OldLogin field if it's non-nil, zero value otherwise.
+func (a *AuditEntryData) GetOldLogin() string {
+	if a == nil || a.OldLogin == nil {
+		return ""
+	}
+	return *a.OldLogin
+}
+
 // GetOldName returns the OldName field if it's non-nil, zero value otherwise.
 func (a *AuditEntryData) GetOldName() string {
 	if a == nil || a.OldName == nil {
diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go
index d7de7712..4c34445f 100644
--- a/github/orgs_audit_log.go
+++ b/github/orgs_audit_log.go
@@ -127,7 +127,8 @@ type AuditEntry struct {
 
 // AuditEntryData represents additional information stuffed into a `data` field.
 type AuditEntryData struct {
-	OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change
+	OldName  *string `json:"old_name,omitempty"`  // The previous name of the repository, for a name change
+	OldLogin *string `json:"old_login,omitempty"` // The previous name of the organization, for a name change
 }
 
 // GetAuditLog gets the audit-log entries for an organization.


Test patch:
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index 40942da4..712d8fc9 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -1911,6 +1911,16 @@ func TestAuditEntry_GetWorkflowRunID(tt *testing.T) {
 	a.GetWorkflowRunID()
 }
 
+func TestAuditEntryData_GetOldLogin(tt *testing.T) {
+	var zeroValue string
+	a := &AuditEntryData{OldLogin: &zeroValue}
+	a.GetOldLogin()
+	a = &AuditEntryData{}
+	a.GetOldLogin()
+	a = nil
+	a.GetOldLogin()
+}
+
 func TestAuditEntryData_GetOldName(tt *testing.T) {
 	var zeroValue string
 	a := &AuditEntryData{OldName: &zeroValue}
diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go
index 2995de50..89cdf462 100644
--- a/github/orgs_audit_log_test.go
+++ b/github/orgs_audit_log_test.go
@@ -300,7 +300,8 @@ func TestAuditEntry_Marshal(t *testing.T) {
 		WorkflowID:            Int64(1),
 		WorkflowRunID:         Int64(1),
 		Data: &AuditEntryData{
-			OldName: String("on"),
+			OldName:  String("on"),
+			OldLogin: String("ol"),
 		},
 	}
 
@@ -396,7 +397,8 @@ func TestAuditEntry_Marshal(t *testing.T) {
 		"workflow_id": 1,
 		"workflow_run_id": 1,
 		"data": {
-			"old_name": "on"
+			"old_name": "on",
+			"old_login": "ol"
 		}
 	}`