PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: jeregrine/jsonapi (elixir)

Issue:
Empty has-many relationship does not appear in relationships
According to [the spec](http://jsonapi.org/format/#document-resource-object-linkage), an empty to-many relationship should be represented as an empty array in `relationships`. So something like this:

```
%{
  id: 1,
  text: "Hello",
  body: "Hello world",
  author: %{id: 2, username: "jason"},
  best_comments: []
}
```

would have a `relationships` field something like this:

```
{
  relationships: %{
    author: %{
      data: %{id: "2", type: "user"},
      links: %{related: "/user/2", self: "/mytype/1/relationships/author"}
    },
    best_comments: %{
      data: [],
      links: %{
        self: "/mytype/1/relationships/best_comments"
      }
    }
  }
}
```

Currently, the serializer omits an empty to-many relationship, so it looks like this:


```
{
  relationships: %{
    author: %{
      data: %{id: "2", type: "user"},
      links: %{related: "/user/2", self: "/mytype/1/relationships/author"
    }
  }
}
```

The [test for handling an empty relationship](https://github.com/jeregrine/jsonapi/blob/master/test/serializer_test.exs#L184), specifies this behavior, but it seems to be at odds with the spec.

Would you accept a PR to serialize empty to-many relationships as empty lists? The change would definitely change responses for users of the library, but in a good way I think, bringing responses more in line with the spec.

Pull request:
Serialize empty relationship
Fixes #112 by serializing relationship arrays that are empty.

Patch:
diff --git a/lib/jsonapi/serializer.ex b/lib/jsonapi/serializer.ex
index 338e827..04574df 100644
--- a/lib/jsonapi/serializer.ex
+++ b/lib/jsonapi/serializer.ex
@@ -125,7 +125,7 @@ defmodule JSONAPI.Serializer do
   defp generate_view_tuple(view) when is_atom(view), do: {view, :include}
 
   def is_data_loaded?(rel_data) do
-    assoc_loaded?(rel_data) && (is_map(rel_data) || (is_list(rel_data) && !Enum.empty?(rel_data)))
+    assoc_loaded?(rel_data) && (is_map(rel_data) || is_list(rel_data))
   end
 
   def encode_relation({rel_view, rel_data, _rel_url, _conn} = info) do


Test patch:
diff --git a/test/serializer_test.exs b/test/serializer_test.exs
index 449a7da..195b2f1 100644
--- a/test/serializer_test.exs
+++ b/test/serializer_test.exs
@@ -181,7 +181,8 @@ defmodule JSONAPISerializerTest do
     assert attributes[:body] == data[:body]
 
     assert encoded_data[:links][:self] == PostView.url_for(data, nil)
-    assert map_size(encoded_data[:relationships]) == 1
+    assert map_size(encoded_data[:relationships]) == 2
+    assert encoded_data[:relationships][:best_comments][:data] == []
 
     assert Enum.count(encoded[:included]) == 1
   end
Repository: JuliaCollections/DataStructures.jl (julia)

Issue:
DataStructures.jl pirates zip()
```
julia> zip()
zip()

julia> using DataStructures

julia> zip()
ERROR: ArgumentError: collection must be non-empty
Stacktrace:
 [1] _findmin(::Tuple{}, ::Colon) at ./array.jl:2201
 [2] findmin(::Tuple{}) at ./array.jl:2195
 [3] DataStructures.ZippedSparseIntSetIterator(; exclude::Tuple{}) at /home/takafumi/.julia/dev/DataStructures/src/sparse_int_set.jl:208
 [4] DataStructures.ZippedSparseIntSetIterator() at /home/takafumi/.julia/dev/DataStructures/src/sparse_int_set.jl:208
 [5] zip(; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/takafumi/.julia/dev/DataStructures/src/sparse_int_set.jl:213
 [6] zip() at /home/takafumi/.julia/dev/DataStructures/src/sparse_int_set.jl:213
 [7] top-level scope at REPL[4]:1

(tmp_y5_3d7e.julia_tmp) pkg> st
Status `/tmp/tmp_y5_3d7e.julia_tmp/Project.toml`
  [864edb3b] DataStructures v0.17.15 `~/.julia/dev/DataStructures`
  [44cfe95a] Pkg
```

Pull request:
close #621

Patch:
diff --git a/Project.toml b/Project.toml
index 902ffb81b..894589b30 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,6 +1,6 @@
 name = "DataStructures"
 uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
-version = "0.17.15"
+version = "0.17.16"
 
 [deps]
 InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
diff --git a/src/sparse_int_set.jl b/src/sparse_int_set.jl
index d964fa94d..b0df38430 100644
--- a/src/sparse_int_set.jl
+++ b/src/sparse_int_set.jl
@@ -210,7 +210,9 @@ struct ZippedSparseIntSetIterator{VT,IT}
     end
 end
 
-Base.zip(s::SparseIntSet...;kwargs...) = ZippedSparseIntSetIterator(s...;kwargs...)
+function Base.zip(s0::SparseIntSet, s::SparseIntSet...; kwargs...)
+    return ZippedSparseIntSetIterator(s0, s...; kwargs...)
+end
 
 length(it::ZippedSparseIntSetIterator) = length(it.shortest_set)
 


Test patch:
diff --git a/test/test_sparse_int_set.jl b/test/test_sparse_int_set.jl
index 9947c2efc..b794a2cfd 100644
--- a/test/test_sparse_int_set.jl
+++ b/test/test_sparse_int_set.jl
@@ -185,5 +185,8 @@ import DataStructures: SparseIntSet
 	    end
 	    @test s1 == 4*24
 	end
+        if VERSION >= v"1.1"
+            @test zip() isa Iterators.Zip  # issue 621
+        end
 
 end