nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: react-materialize/react-materialize
Pull request #820 (2019-04-12 14:12:28)

Apply iconClassName to textarea icon
iconClassName was not being applied to Textarea icon


Patch:
diff --git a/src/Textarea.js b/src/Textarea.js
index ce7fd5d..5f67af5 100644
--- a/src/Textarea.js
+++ b/src/Textarea.js
@@ -10,8 +10,10 @@ class Textarea extends Component {
     M.textareaAutoResize(this._textarea);
   }
 
-  renderIcon(icon) {
-    return <Icon className="material-icons prefix">{icon}</Icon>;
+  renderIcon(icon, className) {
+    return (
+      <Icon className={cx('material-icons prefix', className)}>{icon}</Icon>
+    );
   }
 
   render() {
@@ -110,7 +112,11 @@ Textarea.propTypes = {
   /*
   * predefined value
   */
-  value: PropTypes.string
+  value: PropTypes.string,
+  /*
+  * predefined value
+  */
+  className: PropTypes.string
 };
 
 export default Textarea;


Test patch:
diff --git a/test/Textarea.spec.js b/test/Textarea.spec.js
index 7c9b3ab..045da9a 100644
--- a/test/Textarea.spec.js
+++ b/test/Textarea.spec.js
@@ -44,7 +44,7 @@ describe('<Textarea />', () => {
   });
 
   test('Icon', () => {
-    wrapper = shallow(<Textarea icon="mode_edit" />);
+    wrapper = shallow(<Textarea icon="mode_edit" iconClassName="red" />);
     expect(wrapper).toMatchSnapshot();
   });
 });
diff --git a/test/__snapshots__/Textarea.spec.js.snap b/test/__snapshots__/Textarea.spec.js.snap
index ca97ec1..83f3b5f 100644
--- a/test/__snapshots__/Textarea.spec.js.snap
+++ b/test/__snapshots__/Textarea.spec.js.snap
@@ -21,7 +21,7 @@ exports[`<Textarea /> Icon 1`] = `
   className="input-field col"
 >
   <Icon
-    className="material-icons prefix"
+    className="material-icons prefix red"
   >
     mode_edit
   </Icon>
Repository: react-materialize/react-materialize
Pull request #855 (2019-04-30 14:37:17)

Checkbox checked prop now correctly works
# Description

This **P.R** is for #854.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

# How Has This Been Tested?

Added a new test to make sure that when `checked` `prop` is `true`, the relative `input` attribute `checked` is true.

# Checklist:

- [x] I have commented my code, particularly in hard-to-understand areas
- [x] My changes generate no new warnings
- [x] I have not generated a new package version. (the maintainers will handle that)



Patch:
diff --git a/src/Checkbox.js b/src/Checkbox.js
index 66bd7d0..b30d978 100644
--- a/src/Checkbox.js
+++ b/src/Checkbox.js
@@ -11,7 +11,7 @@ class Checkbox extends Component {
   componentDidMount() {
     const { indeterminate } = this.props;
 
-    if (this._input) {
+    if (this._input && indeterminate) {
       this._input.indeterminate = indeterminate;
       this._input.checked = false;
     }
@@ -26,6 +26,7 @@ class Checkbox extends Component {
   render() {
     const {
       id,
+      className,
       indeterminate,
       filledIn,
       disabled,
@@ -45,9 +46,12 @@ class Checkbox extends Component {
       <label htmlFor={computedId}>
         <input
           id={computedId}
-          className={cx({
-            'filled-in': filledIn
-          })}
+          className={cx(
+            {
+              'filled-in': filledIn
+            },
+            className
+          )}
           disabled={disabled}
           onChange={onChange}
           type="checkbox"


Test patch:
diff --git a/test/Checkbox.spec.js b/test/Checkbox.spec.js
index a586e72..e1e6e33 100644
--- a/test/Checkbox.spec.js
+++ b/test/Checkbox.spec.js
@@ -40,6 +40,12 @@ describe('<Checkbox />', () => {
     expect(wrapper.find('input').instance().indeterminate).toBe(true);
   });
 
+  test('checked', () => {
+    wrapper = mount(<Checkbox value="red" label="red" checked />);
+    expect(wrapper.find('input').instance().checked).toBe(true);
+    expect(wrapper.find('input').instance().indeterminate).toBe(false);
+  });
+
   test('does not overwrite materialize-css classnames', () => {
     wrapper = mount(
       <Checkbox value="red" label="red" filledIn className="my-class" />
diff --git a/test/__snapshots__/Checkbox.spec.js.snap b/test/__snapshots__/Checkbox.spec.js.snap
index 82e9564..9c8c154 100644
--- a/test/__snapshots__/Checkbox.spec.js.snap
+++ b/test/__snapshots__/Checkbox.spec.js.snap
@@ -11,7 +11,7 @@ exports[`<Checkbox /> does not overwrite materialize-css classnames 1`] = `
     htmlFor="mockId"
   >
     <input
-      className="filled-in"
+      className="filled-in my-class"
       id="mockId"
       type="checkbox"
       value="red"
Repository: react-materialize/react-materialize
Pull request #1077 (2020-03-28 13:48:28)

Navbar: fix conflicts after merge
Fix after previous merge


Patch:
diff --git a/src/Navbar.js b/src/Navbar.js
index 189056e..81caee6 100644
--- a/src/Navbar.js
+++ b/src/Navbar.js
@@ -23,6 +23,7 @@ const Navbar = ({
   menuIcon,
   sidenav,
   options,
+  centerChildren,
   ...props
 }) => {
   const _sidenav = useRef(null);
@@ -37,6 +38,7 @@ const Navbar = ({
 
   const brandClasses = cx({
     'brand-logo': true,
+    right: alignLinks === 'left',
     center: centerLogo
   });
 
@@ -63,7 +65,7 @@ const Navbar = ({
 
   let navbar = (
     <nav className={navCSS} {...props}>
-      <div className="nav-wrapper">
+      <div className={cx({ container: centerChildren }, 'nav-wrapper')}>
         {search ? (
           <SearchForm />
         ) : (


Test patch:
diff --git a/test/Navbar.spec.js b/test/Navbar.spec.js
index 6a48e89..e7c446d 100644
--- a/test/Navbar.spec.js
+++ b/test/Navbar.spec.js
@@ -67,7 +67,7 @@ describe('<Navbar />', () => {
       </Navbar>
     );
     expect(wrapper).toMatchSnapshot();
-    expect(wrapper.find('div').hasClass('nav-wrapper container')).toBe(true);
+    expect(wrapper.find('div').hasClass('container')).toBe(true);
   });
 
   test('places brand on right if navbar is left aligned', () => {
diff --git a/test/__snapshots__/Navbar.spec.js.snap b/test/__snapshots__/Navbar.spec.js.snap
index e8bdd60..50b7f39 100644
--- a/test/__snapshots__/Navbar.spec.js.snap
+++ b/test/__snapshots__/Navbar.spec.js.snap
@@ -194,7 +194,7 @@ exports[`<Navbar /> can constrain its children to a container 1`] = `
     className=""
   >
     <div
-      className="nav-wrapper container"
+      className="container nav-wrapper"
     >
       <a
         className="brand-logo"
Repository: react-materialize/react-materialize
Pull request #1105 (2020-04-20 13:12:54)

(re)added onChange and defaultValue to Textarea
# Description

onChange and defaultValue props were missing in rendered <textarea /> since last refactoring of Textarea (about 22 day ago). 

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

# How Has This Been Tested?

Added tests to avoid this bug in future.

# Checklist:

- [x] I have commented my code, particularly in hard-to-understand areas
- [x] My changes generate no new warnings
- [x] I have not generated a new package version. (the maintainers will handle that)



Patch:
diff --git a/src/Textarea.js b/src/Textarea.js
index e92f0d9..da337c0 100644
--- a/src/Textarea.js
+++ b/src/Textarea.js
@@ -55,7 +55,9 @@ const Textarea = ({
         placeholder={placeholder}
         id={id}
         value={value}
+        defaultValue={defaultValue}
         ref={textareaRef}
+        onChange={onChange}
         {...rest}
         className={cx('materialize-textarea', { validate }, className)}
       />


Test patch:
diff --git a/test/Textarea.spec.js b/test/Textarea.spec.js
index 27184a0..0d180f3 100644
--- a/test/Textarea.spec.js
+++ b/test/Textarea.spec.js
@@ -28,6 +28,18 @@ describe('<Textarea />', () => {
     expect(wrapper.hasClass('m6')).toBeFalsy();
   });
 
+  test('Value', () => {
+    wrapper = shallow(<Textarea value="I was here" />);
+    expect(wrapper.find('textarea').prop('value')).toEqual('I was here');
+    expect(wrapper).toMatchSnapshot();
+  });
+
+  test('defaultValue renders as value', () => {
+    wrapper = mount(<Textarea defaultValue="I was here" />);
+    expect(wrapper.find('textarea').prop('defaultValue')).toEqual('I was here');
+    expect(wrapper.find('textarea').instance().value).toEqual('I was here');
+  });
+
   test('Disabled', () => {
     wrapper = shallow(<Textarea value="I was here" disabled />);
     expect(wrapper).toMatchSnapshot();
@@ -54,4 +66,12 @@ describe('<Textarea />', () => {
     expect(textareaElement.hasClass('materialize-textarea')).toBeTruthy();
     expect(textareaElement.hasClass('custom-class')).toBeTruthy();
   });
+
+  test('onChange is fired', () => {
+    const onChangeMock = jest.fn();
+    wrapper = shallow(<Textarea onChange={onChangeMock} />);
+    const textarea = wrapper.find('textarea');
+    textarea.simulate('change');
+    expect(onChangeMock).toHaveBeenCalled();
+  });
 });
diff --git a/test/__snapshots__/Textarea.spec.js.snap b/test/__snapshots__/Textarea.spec.js.snap
index 9f3574e..e7445da 100644
--- a/test/__snapshots__/Textarea.spec.js.snap
+++ b/test/__snapshots__/Textarea.spec.js.snap
@@ -81,3 +81,18 @@ exports[`<Textarea /> Textarea 1`] = `
   />
 </div>
 `;
+
+exports[`<Textarea /> Value 1`] = `
+<div
+  className="input-field col"
+>
+  <textarea
+    className="materialize-textarea"
+    id="Textarea-mockId"
+    value="I was here"
+  />
+  <span
+    className="helper-text"
+  />
+</div>
+`;
Repository: reactiflux/discord-irc
Pull request #81 (2016-06-26 22:44:26)

Fix pings to users with nicknames showing as raw user IDs in IRC
before: `<GinjaNinja32> <@!169859930382270465>`
after: `<GinjaNinja32> @GinjaNinja32`

Both of these show as `@Ginja` on the Discord side; given discord-irc already ignores nicknames for the user that's shown on IRC, I decided against replacing the user's nickname in instead for `<@! ... >` pings.

ekmartin: Great, thanks! I'll publish a new release later today.

Patch:
diff --git a/lib/bot.js b/lib/bot.js
index fecf4ba..4168609 100644
--- a/lib/bot.js
+++ b/lib/bot.js
@@ -111,6 +111,7 @@ class Bot {
   parseText(message) {
     const text = message.mentions.reduce((content, mention) => (
       content.replace(`<@${mention.id}>`, `@${mention.username}`)
+             .replace(`<@!${mention.id}>`, `@${mention.username}`)
     ), message.content);
 
     return text


Test patch:
diff --git a/test/bot.test.js b/test/bot.test.js
index e3861a2..8a0a3f0 100644
--- a/test/bot.test.js
+++ b/test/bot.test.js
@@ -238,6 +238,18 @@ describe('Bot', function() {
     this.bot.parseText(message).should.equal('@testuser hi');
   });
 
+  it('should convert user nickname mentions from discord', function() {
+    const message = {
+      mentions: [{
+        id: 123,
+        username: 'testuser'
+      }],
+      content: '<@!123> hi'
+    };
+
+    this.bot.parseText(message).should.equal('@testuser hi');
+  });
+
   it('should convert user mentions from IRC', function() {
     const testuser = new discord.User({ username: 'testuser', id: '123' }, this.bot.discord);
     this.bot.discord.users.get.withArgs('username', testuser.username).returns(testuser);
Repository: reactiflux/discord-irc
Pull request #123 (2016-09-27 04:51:11)

Display custom emoji's nicely in IRC


Patch:
diff --git a/lib/bot.js b/lib/bot.js
index 6d2c41b..d6c3555 100644
--- a/lib/bot.js
+++ b/lib/bot.js
@@ -119,7 +119,8 @@ class Bot {
       .replace(/<#(\d+)>/g, (match, channelId) => {
         const channel = this.discord.channels.get(channelId);
         return `#${channel.name}`;
-      });
+      })
+      .replace(/<(:\w+:)\d+>/g, (match, emoteName) => emoteName);
   }
 
   isCommandMessage(message) {
diff --git a/package.json b/package.json
index bd36fd3..6bfd2bf 100644
--- a/package.json
+++ b/package.json
@@ -46,14 +46,14 @@
   "devDependencies": {
     "babel-cli": "^6.6.5",
     "babel-core": "^6.7.4",
-    "babel-eslint": "^6.0.2",
+    "babel-eslint": "^7.0.0",
     "babel-preset-node6": "^11.0.0",
     "babel-preset-stage-0": "^6.5.0",
     "chai": "3.5.0",
     "eslint": "^3.6.0",
     "eslint-config-airbnb-base": "^8.0.0",
-    "eslint-plugin-import": "^1.16.0",
-    "mocha": "3.0.2",
+    "eslint-plugin-import": "^2.0.0",
+    "mocha": "3.1.0",
     "nyc": "^8.3.0",
     "sinon": "1.17.6",
     "sinon-chai": "2.8.0"


Test patch:
diff --git a/test/bot.test.js b/test/bot.test.js
index 7807d83..c37e947 100644
--- a/test/bot.test.js
+++ b/test/bot.test.js
@@ -253,6 +253,15 @@ describe('Bot', function () {
     this.bot.parseText(message).should.equal('@testuser hi');
   });
 
+  it('should convert twitch emotes from discord', function () {
+    const message = {
+      mentions: { users: [] },
+      content: '<:SCGWat:230473833046343680>'
+    };
+
+    this.bot.parseText(message).should.equal(':SCGWat:');
+  });
+
   it('should convert user mentions from IRC', function () {
     const testUser = new discord.User(this.bot.discord, { username: 'testuser', id: '123' });
     this.findUserStub.withArgs('username', testUser.username).returns(testUser);
Repository: narwhals-dev/narwhals
Pull request #1867 (2025-01-26 10:41:03)

feat: raise if expression changes length in `.over()`
<!--
# Thanks for contributing a pull request! 
## Please make sure you see our contribution guidelines: https://github.com/narwhals-dev/narwhals/blob/main/CONTRIBUTING.md
-->

## What type of PR is this? (check all applicable)

- [ ] 💾 Refactor
- [ ] ✨ Feature
- [ ] 🐛 Bug Fix
- [ ] 🔧 Optimization
- [ ] 📝 Documentation
- [x] ✅ Test
- [ ] 🐳 Other

## Related issues

- Related issue #\<issue number\>
- Closes #\<issue number\>

## Checklist

- [x] Code follows style guide (ruff)
- [x] Tests added
- [ ] Documented the changes

## If you have comments or can explain your changes, please do so below



Patch:
diff --git a/narwhals/expr.py b/narwhals/expr.py
index 5fbb4336..ea912807 100644
--- a/narwhals/expr.py
+++ b/narwhals/expr.py
@@ -13,6 +13,7 @@ from narwhals._expression_parsing import operation_aggregates
 from narwhals._expression_parsing import operation_changes_length
 from narwhals._expression_parsing import operation_is_order_dependent
 from narwhals.dtypes import _validate_dtype
+from narwhals.exceptions import LengthChangingExprError
 from narwhals.expr_cat import ExprCatNamespace
 from narwhals.expr_dt import ExprDateTimeNamespace
 from narwhals.expr_list import ExprListNamespace
@@ -2702,6 +2703,9 @@ class Expr:
             │ 3   ┆ 2   ┆ 3   │
             └─────┴─────┴─────┘
         """
+        if self._changes_length:
+            msg = "`.over()` can not be used for expressions which change length."
+            raise LengthChangingExprError(msg)
         return self.__class__(
             lambda plx: self._to_compliant_expr(plx).over(flatten(keys)),
             self._is_order_dependent,


Test patch:
diff --git a/tests/expr_and_series/over_test.py b/tests/expr_and_series/over_test.py
index 2ccbe070..ee8a1480 100644
--- a/tests/expr_and_series/over_test.py
+++ b/tests/expr_and_series/over_test.py
@@ -1,9 +1,12 @@
 from __future__ import annotations
 
+import re
+
 import pandas as pd
 import pytest
 
 import narwhals.stable.v1 as nw
+from narwhals.exceptions import LengthChangingExprError
 from tests.utils import PANDAS_VERSION
 from tests.utils import Constructor
 from tests.utils import ConstructorEager
@@ -207,3 +210,13 @@ def test_over_cum_reverse() -> None:
         match=r"Cumulative operation with `reverse=True` is not supported",
     ):
         nw.from_native(df).select(nw.col("b").cum_max(reverse=True).over("a"))
+
+
+def test_over_raise_len_change(constructor: Constructor) -> None:
+    df = nw.from_native(constructor(data))
+
+    with pytest.raises(
+        LengthChangingExprError,
+        match=re.escape("`.over()` can not be used for expressions which change length."),
+    ):
+        nw.from_native(df).select(nw.col("b").drop_nulls().over("a"))
Repository: Versent/saml2aws
Pull request #173 (2018-05-13 02:45:36)

feat(exec) Added the profile ENV vars.
This was requested to enable running of scripts or tools which take an explicit aws profile name.


Patch:
diff --git a/README.md b/README.md
index 2e9aead..6a05fe5 100644
--- a/README.md
+++ b/README.md
@@ -228,6 +228,10 @@ The exec sub command will export the following environment variables.
 * AWS_SESSION_TOKEN
 * AWS_SECURITY_TOKEN
 * EC2_SECURITY_TOKEN
+* AWS_PROFILE
+* AWS_DEFAULT_PROFILE
+
+Note: That profile environment variables enable you to use `exec` with a script or command which requires an explicit profile.
 
 # Dependencies
 
diff --git a/cmd/saml2aws/commands/exec.go b/cmd/saml2aws/commands/exec.go
index 8532ac6..bc56dcd 100644
--- a/cmd/saml2aws/commands/exec.go
+++ b/cmd/saml2aws/commands/exec.go
@@ -62,7 +62,7 @@ func Exec(execFlags *flags.LoginExecFlags, cmdline []string) error {
 		return errors.Wrap(err, "error logging in")
 	}
 
-	return shell.ExecShellCmd(cmdline, shell.BuildEnvVars(awsCreds))
+	return shell.ExecShellCmd(cmdline, shell.BuildEnvVars(awsCreds, account))
 }
 
 func checkToken(profile string) (bool, error) {
diff --git a/pkg/shell/env.go b/pkg/shell/env.go
index 3d6c1e6..264f749 100644
--- a/pkg/shell/env.go
+++ b/pkg/shell/env.go
@@ -4,15 +4,18 @@ import (
 	"fmt"
 
 	"github.com/versent/saml2aws/pkg/awsconfig"
+	"github.com/versent/saml2aws/pkg/cfg"
 )
 
 // BuildEnvVars build an array of env vars in the format required for exec
-func BuildEnvVars(awsCreds *awsconfig.AWSCredentials) []string {
+func BuildEnvVars(awsCreds *awsconfig.AWSCredentials, account *cfg.IDPAccount) []string {
 	return []string{
 		fmt.Sprintf("AWS_ACCESS_KEY_ID=%s", awsCreds.AWSAccessKey),
 		fmt.Sprintf("AWS_SECRET_ACCESS_KEY=%s", awsCreds.AWSSecretKey),
 		fmt.Sprintf("AWS_SESSION_TOKEN=%s", awsCreds.AWSSessionToken),
 		fmt.Sprintf("AWS_SECURITY_TOKEN=%s", awsCreds.AWSSecurityToken),
 		fmt.Sprintf("EC2_SECURITY_TOKEN=%s", awsCreds.AWSSecurityToken),
+		fmt.Sprintf("AWS_PROFILE=%s", account.Profile),
+		fmt.Sprintf("AWS_DEFAULT_PROFILE=%s", account.Profile),
 	}
 }


Test patch:
diff --git a/pkg/shell/env_test.go b/pkg/shell/env_test.go
index b594fa7..dca8108 100644
--- a/pkg/shell/env_test.go
+++ b/pkg/shell/env_test.go
@@ -5,6 +5,7 @@ import (
 
 	"github.com/stretchr/testify/assert"
 	"github.com/versent/saml2aws/pkg/awsconfig"
+	"github.com/versent/saml2aws/pkg/cfg"
 )
 
 func TestBuildEnvVars(t *testing.T) {
@@ -15,6 +16,12 @@ func TestBuildEnvVars(t *testing.T) {
 		"AWS_SESSION_TOKEN=567",
 		"AWS_SECURITY_TOKEN=567",
 		"EC2_SECURITY_TOKEN=567",
+		"AWS_PROFILE=saml",
+		"AWS_DEFAULT_PROFILE=saml",
+	}
+
+	account := &cfg.IDPAccount{
+		Profile: "saml",
 	}
 
 	awsCreds := &awsconfig.AWSCredentials{
@@ -24,5 +31,5 @@ func TestBuildEnvVars(t *testing.T) {
 		AWSSessionToken:  "567",
 	}
 
-	assert.Equal(t, expectedArray, BuildEnvVars(awsCreds))
+	assert.Equal(t, expectedArray, BuildEnvVars(awsCreds, account))
 }
Repository: VictorAvelar/mollie-api-go
Pull request #139 (2021-06-12 13:27:17)

Fix type on list refunds options


Patch:
diff --git a/mollie/refunds.go b/mollie/refunds.go
index 4e3e97c..4b8bb1c 100644
--- a/mollie/refunds.go
+++ b/mollie/refunds.go
@@ -70,7 +70,7 @@ type RefundOptions struct {
 // See: https://docs.mollie.com/reference/v2/refunds-api/list-refunds.
 type ListRefundOptions struct {
 	From      string     `url:"from,omitempty"`
-	Limit     string     `url:"limit,omitempty"`
+	Limit     int        `url:"limit,omitempty"`
 	ProfileID string     `url:"profileId,omitempty"`
 	Embed     EmbedValue `url:"embed,omitempty"`
 }


Test patch:
diff --git a/mollie/refunds_test.go b/mollie/refunds_test.go
index b20af77..e81dd54 100644
--- a/mollie/refunds_test.go
+++ b/mollie/refunds_test.go
@@ -195,7 +195,7 @@ func TestServiceRefunds_ListPayment(t *testing.T) {
 
 	opt := &ListRefundOptions{
 		From:  "re_4qqhO89gsT",
-		Limit: "100",
+		Limit: 100,
 	}
 
 	res, err := tClient.Refunds.ListRefundPayment(paymentID, opt)