nebius/SWE-bench-extra huggingface dataset:
Repository: rr-/docstring_parser

Issue:
Parameter description parsing captures less indented text of another section
Expected behavior: Parameter description ends when there parser encounters less indented line.

Actual behavior: The parameter description capturing does not seem to stop when less indented line is encountered and captures it as well.

```python
def foo():
    '''Converts Keras HDF5 model to Tensorflow SavedModel format.

    Args:
        model_path: Keras model in HDF5 format.
        converted_model_path: Keras model in Tensorflow SavedModel format.

    Annotations:
        author: Alexey Volkov <alexey.volkov@ark-kun.com>
    '''
```

The description for `converted_model_path` becomes:
```
Keras model in Tensorflow SavedModel format.
Annotations:
```

P.S. It would be really great if it was possible to parse additional sections that are not currently recognized by the docstring_parser.

Comments:

Patch:
diff --git a/docstring_parser/google.py b/docstring_parser/google.py
index 5a817c1..1be8972 100644
--- a/docstring_parser/google.py
+++ b/docstring_parser/google.py
@@ -222,12 +222,20 @@ class GoogleParser:
             splits.append((matches[j].end(), matches[j + 1].start()))
         splits.append((matches[-1].end(), len(meta_chunk)))
 
-        chunks = OrderedDict()
+        chunks = OrderedDict()  # type: T.Mapping[str,str]
         for j, (start, end) in enumerate(splits):
             title = matches[j].group(1)
             if title not in self.sections:
                 continue
-            chunks[title] = meta_chunk[start:end].strip("\n")
+
+            # Clear Any Unknown Meta
+            # Ref: https://github.com/rr-/docstring_parser/issues/29
+            meta_details = meta_chunk[start:end]
+            unknown_meta = re.search(r"\n\S", meta_details)
+            if unknown_meta is not None:
+                meta_details = meta_details[: unknown_meta.start()]
+
+            chunks[title] = meta_details.strip("\n")
         if not chunks:
             return ret
 


Test patch:
diff --git a/docstring_parser/tests/test_google.py b/docstring_parser/tests/test_google.py
index d49544f..a725b7f 100644
--- a/docstring_parser/tests/test_google.py
+++ b/docstring_parser/tests/test_google.py
@@ -591,3 +591,28 @@ def test_broken_meta() -> None:
 
     with pytest.raises(ParseError):
         parse("Args:\n    herp derp")
+
+
+def test_unknown_meta() -> None:
+    docstring = parse(
+        """Short desc
+        
+        Unknown 0:
+            title0: content0
+
+        Args:
+            arg0: desc0
+            arg1: desc1
+
+        Unknown1:
+            title1: content1
+
+        Unknown2:
+            title2: content2
+        """
+    )
+
+    assert docstring.params[0].arg_name == "arg0"
+    assert docstring.params[0].description == "desc0"
+    assert docstring.params[1].arg_name == "arg1"
+    assert docstring.params[1].description == "desc1"
Repository: rust-lang/homu

Issue:
[feature request] Replace `@<name>` in PR description with only `<name>`
Otherwise the reviewer will be pinged when the PR is rollupped or bor try, 
or even after the PR merged, the reviewer will be pinged by forks pulling the changes on github.

_Originally posted by @lzutao in https://github.com/rust-lang/rust/pull/76161#issuecomment-683807588_

cc @matklad as he is also asking for this.

Comments:

Patch:
diff --git a/homu/main.py b/homu/main.py
index 6b3b4b6..a86529d 100644
--- a/homu/main.py
+++ b/homu/main.py
@@ -42,6 +42,12 @@ DEFAULT_TEST_TIMEOUT = 3600 * 10
 global_cfg = {}
 
 
+# Replace @mention with `@mention` to suppress pings in merge commits.
+# Note: Don't replace non-mentions like "email@gmail.com".
+def suppress_pings(text):
+    return re.sub(r'\B(@\S+)', r'`\g<1>`', text)  # noqa
+
+
 @contextmanager
 def buildbot_sess(repo_cfg):
     sess = requests.Session()
@@ -347,7 +353,7 @@ class PullReqState:
         issue = self.get_repo().issue(self.num)
 
         self.title = issue.title
-        self.body = issue.body
+        self.body = suppress_pings(issue.body)
 
     def fake_merge(self, repo_cfg):
         if not repo_cfg.get('linear', False):
@@ -1533,7 +1539,7 @@ def synchronize(repo_label, repo_cfg, logger, gh, states, repos, db, mergeable_q
 
         state = PullReqState(pull.number, pull.head.sha, status, db, repo_label, mergeable_que, gh, repo_cfg['owner'], repo_cfg['name'], repo_cfg.get('labels', {}), repos, repo_cfg.get('test-on-fork'))  # noqa
         state.title = pull.title
-        state.body = pull.body
+        state.body = suppress_pings(pull.body)
         state.head_ref = pull.head.repo[0] + ':' + pull.head.ref
         state.base_ref = pull.base.ref
         state.set_mergeable(None)


Test patch:
diff --git a/homu/tests/test_pr_body.py b/homu/tests/test_pr_body.py
new file mode 100644
index 0000000..06a5287
--- /dev/null
+++ b/homu/tests/test_pr_body.py
@@ -0,0 +1,17 @@
+from homu.main import suppress_pings
+
+
+def test_suppress_pings_in_PR_body():
+    body = (
+        "r? @matklad\n"         # should escape
+        "@bors r+\n"            # shouldn't
+        "mail@example.com"      # shouldn't
+    )
+
+    expect = (
+        "r? `@matklad`\n"
+        "`@bors` r+\n"
+        "mail@example.com"
+    )
+
+    assert suppress_pings(body) == expect
Repository: rust-lang/homu

Issue:
Ignore commands in quotes
There is another edge case in homu command handling: when an user replies to a comment via email by default the parent command is quoted, and the old parser code tried to handle it. We should ignore commands when the line starts with `>`, to hopefully catch quoted emails, or if the new parser already handles this a test should be added.

Example: https://github.com/rust-lang/rust/pull/61540#issuecomment-504549595

Comments:

Patch:
diff --git a/homu/parse_issue_comment.py b/homu/parse_issue_comment.py
index ce64c1b..108fbcb 100644
--- a/homu/parse_issue_comment.py
+++ b/homu/parse_issue_comment.py
@@ -158,7 +158,7 @@ def parse_issue_comment(username, body, sha, botname, hooks=[]):
                      re.findall(r'\S+', re.sub(botname_regex, '', x))
                  for x
                  in body.splitlines()
-                 if '@' + botname in x))  # noqa
+                 if '@' + botname in x and not x.lstrip().startswith('>')))  # noqa
 
     commands = []
 
diff --git a/homu/server.py b/homu/server.py
index e383117..ce40fd3 100644
--- a/homu/server.py
+++ b/homu/server.py
@@ -574,6 +574,7 @@ def github():
                 state.save()
 
     elif event_type == 'issue_comment':
+        action = info['action']
         body = info['comment']['body']
         username = info['comment']['user']['login']
         user_id = info['comment']['user']['id']
@@ -581,7 +582,7 @@ def github():
 
         state = g.states[repo_label].get(pull_num)
 
-        if 'pull_request' in info['issue'] and state:
+        if action == 'created' and 'pull_request' in info['issue'] and state:
             state.title = info['issue']['title']
             state.body = info['issue']['body']
 


Test patch:
diff --git a/homu/tests/test_parse_issue_comment.py b/homu/tests/test_parse_issue_comment.py
index 34da29f..71a1468 100644
--- a/homu/tests/test_parse_issue_comment.py
+++ b/homu/tests/test_parse_issue_comment.py
@@ -604,3 +604,18 @@ def test_ignore_commands_after_bors_line():
     command = commands[0]
     assert command.action == 'approve'
     assert command.actor == 'jack'
+
+
+def test_in_quote():
+    """
+    Test that a command in a quote (e.g. when replying by e-mail) doesn't
+    trigger.
+    """
+
+    author = "jack"
+    body = """
+    > @bors r+
+    """
+    commands = parse_issue_comment(author, body, commit, "bors")
+
+    assert len(commands) == 0