nebius/SWE-bench-extra huggingface dataset:
Repository: graphql-python/graphene

Issue:
Fields with numbers in names do not capitalize correctly
I noticed that the field with names containing numbers (e.g. `field_i18n`) doesn't capitalize correctly.

For example:
`correct_field` becomes `correctField`, but `field_i18n` becomes `field_I18N` and `t1e2s3t` becomes `t1E2S3T` which is obvious incorrect.

This caused by using `.title` method in `str_converter.py` instead of `.capitalize`. Title method is suitable for use with words, but field names are single word.

Comments:

Patch:
diff --git a/graphene/utils/str_converters.py b/graphene/utils/str_converters.py
index ae8ceff..6fcdfb7 100644
--- a/graphene/utils/str_converters.py
+++ b/graphene/utils/str_converters.py
@@ -1,13 +1,13 @@
 import re
 
 
-# From this response in Stackoverflow
+# Adapted from this response in Stackoverflow
 # http://stackoverflow.com/a/19053800/1072990
 def to_camel_case(snake_str):
     components = snake_str.split('_')
     # We capitalize the first letter of each component except the first one
-    # with the 'title' method and join them together.
-    return components[0] + "".join(x.title() if x else '_' for x in components[1:])
+    # with the 'capitalize' method and join them together.
+    return components[0] + ''.join(x.capitalize() if x else '_' for x in components[1:])
 
 
 # From this response in Stackoverflow


Test patch:
diff --git a/graphene/utils/tests/test_str_converters.py b/graphene/utils/tests/test_str_converters.py
index 2ee7d7a..11f7e15 100644
--- a/graphene/utils/tests/test_str_converters.py
+++ b/graphene/utils/tests/test_str_converters.py
@@ -16,6 +16,7 @@ def test_camel_case():
     assert to_camel_case('snakes_on_a_plane') == 'snakesOnAPlane'
     assert to_camel_case('snakes_on_a__plane') == 'snakesOnA_Plane'
     assert to_camel_case('i_phone_hysteria') == 'iPhoneHysteria'
+    assert to_camel_case('field_i18n') == 'fieldI18n'
 
 
 def test_to_const():
Repository: graphql-python/graphene

Issue:
Incorrectly formatted error message.
The error message generated here is incorrect. It should be `only_type._meta.name` instead of `graphene_type._meta.name`. This way the expected value will be reported, which is what the message says it is.

https://github.com/graphql-python/graphene/blob/7bd77a0817677656e2ed8e8ac235ab5e8d557487/graphene/relay/node.py#L105

Also, it's better to use "a" instead of "an" as a default preposition in messages. https://github.com/graphql-python/graphene/blob/7bd77a0817677656e2ed8e8ac235ab5e8d557487/graphene/relay/node.py#L104

Comments:

Patch:
diff --git a/graphene/relay/node.py b/graphene/relay/node.py
index 6596757..5c787ff 100644
--- a/graphene/relay/node.py
+++ b/graphene/relay/node.py
@@ -101,8 +101,8 @@ class Node(AbstractNode):
 
         if only_type:
             assert graphene_type == only_type, (
-                'Must receive an {} id.'
-            ).format(graphene_type._meta.name)
+                'Must receive a {} id.'
+            ).format(only_type._meta.name)
 
         # We make sure the ObjectType implements the "Node" interface
         if cls not in graphene_type._meta.interfaces:


Test patch:
diff --git a/graphene/relay/tests/test_node.py b/graphene/relay/tests/test_node.py
index 10dc5d9..df44fcb 100644
--- a/graphene/relay/tests/test_node.py
+++ b/graphene/relay/tests/test_node.py
@@ -115,7 +115,7 @@ def test_node_field_only_type_wrong():
         '{ onlyNode(id:"%s") { __typename, name } } ' % Node.to_global_id("MyOtherNode", 1)
     )
     assert len(executed.errors) == 1
-    assert str(executed.errors[0]) == 'Must receive an MyOtherNode id.'
+    assert str(executed.errors[0]) == 'Must receive a MyNode id.'
     assert executed.data == {'onlyNode': None}
 
 
@@ -132,7 +132,7 @@ def test_node_field_only_lazy_type_wrong():
         '{ onlyNodeLazy(id:"%s") { __typename, name } } ' % Node.to_global_id("MyOtherNode", 1)
     )
     assert len(executed.errors) == 1
-    assert str(executed.errors[0]) == 'Must receive an MyOtherNode id.'
+    assert str(executed.errors[0]) == 'Must receive a MyNode id.'
     assert executed.data == {'onlyNodeLazy': None}
Repository: graphql-python/graphene

Issue:
InputObjectType.__init_sublcass_with_meta__ overwrites passed _meta.fields
In  `InputObjectType.__init_subclass_with_meta__`, the`fields` of the `_meta` arg are overwritten, which can cause complications for subclassing.


    @classmethod
    def __init_subclass_with_meta__(cls, container=None, _meta=None, **options):
        if not _meta:
            _meta = InputObjectTypeOptions(cls)

        fields = OrderedDict()
        for base in reversed(cls.__mro__):
            fields.update(
                yank_fields_from_attrs(base.__dict__, _as=InputField)
            )

        _meta.fields = fields

        # should this be:
        # if _meta.fields:
        #     _meta.fields.update(fields)
        # else:
        #     _meta.fields = fields


Comments:

Patch:
diff --git a/graphene/types/inputobjecttype.py b/graphene/types/inputobjecttype.py
index dbfccc4..b84fc0f 100644
--- a/graphene/types/inputobjecttype.py
+++ b/graphene/types/inputobjecttype.py
@@ -50,7 +50,10 @@ class InputObjectType(UnmountedType, BaseType):
                 yank_fields_from_attrs(base.__dict__, _as=InputField)
             )
 
-        _meta.fields = fields
+        if _meta.fields:
+            _meta.fields.update(fields)
+        else:
+            _meta.fields = fields
         if container is None:
             container = type(cls.__name__, (InputObjectTypeContainer, cls), {})
         _meta.container = container


Test patch:
diff --git a/graphene/tests/issues/test_720.py b/graphene/tests/issues/test_720.py
new file mode 100644
index 0000000..8cd99bd
--- /dev/null
+++ b/graphene/tests/issues/test_720.py
@@ -0,0 +1,44 @@
+# https://github.com/graphql-python/graphene/issues/720
+# InputObjectTypes overwrite the "fields" attribute of the provided
+# _meta object, so even if dynamic fields are provided with a standard
+# InputObjectTypeOptions, they are ignored.
+
+import graphene
+
+
+class MyInputClass(graphene.InputObjectType):
+
+    @classmethod
+    def __init_subclass_with_meta__(
+            cls, container=None, _meta=None, fields=None, **options):
+        if _meta is None:
+            _meta = graphene.types.inputobjecttype.InputObjectTypeOptions(cls)
+        _meta.fields = fields
+        super(MyInputClass, cls).__init_subclass_with_meta__(
+            container=container, _meta=_meta, **options)
+
+
+class MyInput(MyInputClass):
+
+    class Meta:
+        fields = dict(x=graphene.Field(graphene.Int))
+
+
+class Query(graphene.ObjectType):
+    myField = graphene.Field(graphene.String, input=graphene.Argument(MyInput))
+
+    def resolve_myField(parent, info, input):
+        return 'ok'
+
+
+def test_issue():
+    query_string = '''
+    query myQuery {
+      myField(input: {x: 1})
+    }
+    '''
+
+    schema = graphene.Schema(query=Query)
+    result = schema.execute(query_string)
+
+    assert not result.errors
Repository: graphql-python/graphene

Issue:
Cannot create a enum with a deprecation reason supplied
## How to reproduce
```python
options = {
    'description': 'This my enum',
    'deprecation_reason': 'For the funs'}
graphene.Enum('MyEnum', [('some', 'data')], **options)
```

## What happened
```
  File "/Users/Development/saleor/saleor/graphql/core/enums.py", line 35, in to_enum
    return graphene.Enum(type_name, enum_data, **options)
  File "/Users/Development/saleor-venv/lib/python3.7/site-packages/graphene/types/enum.py", line 49, in __call__
    return cls.from_enum(PyEnum(*args, **kwargs), description=description)
TypeError: __call__() got an unexpected keyword argument 'deprecation_reason'
```

Comments:

Patch:
diff --git a/graphene/types/enum.py b/graphene/types/enum.py
index 6e6bab8..7b8e71f 100644
--- a/graphene/types/enum.py
+++ b/graphene/types/enum.py
@@ -46,7 +46,12 @@ class EnumMeta(SubclassWithMeta_Meta):
     def __call__(cls, *args, **kwargs):  # noqa: N805
         if cls is Enum:
             description = kwargs.pop("description", None)
-            return cls.from_enum(PyEnum(*args, **kwargs), description=description)
+            deprecation_reason = kwargs.pop("deprecation_reason", None)
+            return cls.from_enum(
+                PyEnum(*args, **kwargs),
+                description=description,
+                deprecation_reason=deprecation_reason,
+            )
         return super(EnumMeta, cls).__call__(*args, **kwargs)
         # return cls._meta.enum(*args, **kwargs)
 


Test patch:
diff --git a/graphene/tests/issues/test_956.py b/graphene/tests/issues/test_956.py
new file mode 100644
index 0000000..72ff971
--- /dev/null
+++ b/graphene/tests/issues/test_956.py
@@ -0,0 +1,8 @@
+import graphene
+
+
+def test_issue():
+    options = {"description": "This my enum", "deprecation_reason": "For the funs"}
+    new_enum = graphene.Enum("MyEnum", [("some", "data")], **options)
+    assert new_enum._meta.description == options["description"]
+    assert new_enum._meta.deprecation_reason == options["deprecation_reason"]
Repository: grappa-py/grappa

Issue:
Assertion Errors
Love the library. It is super useful! 

I am trying to figure out how to see if a function raises an exception when called with a certain set of parameters. 

Here is an example (a bit contrived as I am trying to raise my own Exception based on valid inputs). 

```python
t = [0,1,2]
t.index(3) | should.raise_error(ValueError)
```

Right now the should.raise_error expects a function to be passed into it. 

Eg.
```python
t.index | should.raise_error(ValueError)
```

Right now I have to compose the test this way. 

```python
err = ""
try:
    self.index(3)
except Exception as err:
   error = err

error | should.be.an.instance.of(ValueError)
```

Am I missing Something?


Comments:

Patch:
diff --git a/grappa/operators/raises.py b/grappa/operators/raises.py
index 48dcea9..763f2a5 100644
--- a/grappa/operators/raises.py
+++ b/grappa/operators/raises.py
@@ -1,5 +1,4 @@
 # -*- coding: utf-8 -*-
-import inspect
 from ..operator import Operator
 
 
@@ -57,7 +56,7 @@ class RaisesOperator(Operator):
     )
 
     def match(self, fn, *errors):
-        if not any([inspect.isfunction(fn) or inspect.ismethod(fn)]):
+        if not callable(fn):
             return False, ['subject must be a function or method']
 
         try:


Test patch:
diff --git a/tests/operators/raises_test.py b/tests/operators/raises_test.py
index 33f4277..a3acdfa 100644
--- a/tests/operators/raises_test.py
+++ b/tests/operators/raises_test.py
@@ -1,13 +1,21 @@
 import pytest
+from functools import partial
 
 
 def test_raises(should):
     def error():
         raise AssertionError('foo')
 
+    def error_with_params(foo_param):
+        raise AssertionError(foo_param)
+
     error | should.raise_error(AssertionError)
     error | should.do_not.raise_error(NotImplementedError)
 
+    partial(error_with_params, "Foobar") | should.raise_error(AssertionError)
+    partial(error_with_params, "Foobar") | should.to_not\
+        .raise_error(NotImplementedError)
+
     with pytest.raises(AssertionError):
         error | should.raise_error(NotImplementedError)
Repository: griffithlab/VAtools

Issue:
Inaccurate warning message when running vcf-expression-annotator
very minor, but if a gene is not found when running vcf-expression-annotator the warning message still says:
```WARNING:root:12 of 382 transcripts did not have an expression entry for their gene id.```
from
```vcf-expression-annotator SCLC20_R_LN.vatools_anno_6.vcf /storage1/fs1/rgovindan/Active/rnaAnalysis/phase0/expression/SCLC20_R_LN.kallisto_gene_abundance.tsv kallisto gene -s TUMOR -o SCLC20_R_LN.vatools_anno_7.vcf```

Comments:

Patch:
diff --git a/vatools/vcf_expression_annotator.py b/vatools/vcf_expression_annotator.py
index a094bad..29d7b6f 100644
--- a/vatools/vcf_expression_annotator.py
+++ b/vatools/vcf_expression_annotator.py
@@ -225,7 +225,7 @@ def main(args_input = sys.argv[1:]):
     vcf_writer.close()
 
     if missing_expressions_count > 0:
-        logging.warning("{} of {} transcripts did not have an expression entry for their {} id.".format(missing_expressions_count, entry_count, args.mode))
+        logging.warning("{} of {} {}s did not have an expression entry for their {} id.".format(missing_expressions_count, entry_count, args.mode, args.mode))
 
 if __name__ == '__main__':
     main()


Test patch:
diff --git a/tests/test_vcf_expression_annotator.py b/tests/test_vcf_expression_annotator.py
index 21a037c..276ba10 100644
--- a/tests/test_vcf_expression_annotator.py
+++ b/tests/test_vcf_expression_annotator.py
@@ -165,7 +165,7 @@ class VcfExpressionEncoderTests(unittest.TestCase):
             ]
             vcf_expression_annotator.main(command)
             temp_path.cleanup()
-            l.check_present(('root', 'WARNING', "1 of 1 transcripts did not have an expression entry for their gene id."))
+            l.check_present(('root', 'WARNING', "1 of 1 genes did not have an expression entry for their gene id."))
 
     def test_multi_sample_vcf(self):
         temp_path = tempfile.TemporaryDirectory()