PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 269
Good morning! Here's your coding interview problem for today.

This problem was asked by Microsoft.

You are given an string representing the initial conditions of some dominoes. Each element can take one of three values:

`L`, meaning the domino has just been pushed to the left,
`R`, meaning the domino has just been pushed to the right, or
`.`, meaning the domino is standing still.
Determine the orientation of each tile when the dominoes stop falling. Note that if a domino receives a force from the left and right side simultaneously, it will remain upright.

For example, given the string `.L.R....L`, you should return `LL.RRRLLL`.

Given the string `..R...L.L`, you should return `..RR.LLLL`.

Pull request:
Day269
Resolves #547 .

Patch:
diff --git a/README.md b/README.md
index 4c5f142..287c8ae 100644
--- a/README.md
+++ b/README.md
@@ -273,3 +273,4 @@ problems from
 * [Day 260](https://github.com/vaskoz/dailycodingproblem-go/issues/533)
 * [Day 266](https://github.com/vaskoz/dailycodingproblem-go/issues/542)
 * [Day 268](https://github.com/vaskoz/dailycodingproblem-go/issues/544)
+* [Day 269](https://github.com/vaskoz/dailycodingproblem-go/issues/547)
diff --git a/day269/problem.go b/day269/problem.go
new file mode 100644
index 0000000..bc74ffe
--- /dev/null
+++ b/day269/problem.go
@@ -0,0 +1,33 @@
+package day269
+
+// SimulateDominoes runs a simulation of dominoes falling
+// based on an initial state. It returns the end state.
+func SimulateDominoes(initial string) string {
+	start := make([]rune, len([]rune(initial)))
+	copy(start, []rune(initial))
+	result := make([]rune, len(start))
+	changed := true
+	for changed {
+		changed = false
+		for i, domino := range start {
+			if domino == '.' {
+				switch {
+				case i != 0 && i != len(start)-1 && start[i-1] == 'R' && start[i+1] == 'L':
+					result[i] = start[i]
+				case i != 0 && start[i-1] == 'R':
+					result[i] = 'R'
+					changed = true
+				case i != len(start)-1 && start[i+1] == 'L':
+					result[i] = 'L'
+					changed = true
+				default:
+					result[i] = start[i]
+				}
+			} else {
+				result[i] = start[i]
+			}
+		}
+		copy(start, result)
+	}
+	return string(result)
+}


Test patch:
diff --git a/day269/problem_test.go b/day269/problem_test.go
new file mode 100644
index 0000000..5bc445d
--- /dev/null
+++ b/day269/problem_test.go
@@ -0,0 +1,28 @@
+package day269
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	start, end string
+}{
+	{".L.R....L", "LL.RRRLLL"},
+	{"..R...L.L", "..RR.LLLL"},
+}
+
+func TestSimulateDominoes(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := SimulateDominoes(tc.start); result != tc.end {
+			t.Errorf("Given %s, expected %s, got %s", tc.start, tc.end, result)
+		}
+	}
+}
+
+func BenchmarkSimulateDominoes(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			SimulateDominoes(tc.start)
+		}
+	}
+}
Repository: Scille/umongo (python)

Issue:
ValueError: microsecond must be in 0..999999
Hello, all

I've got a new error after the v2.0.0 milestone, likely relating to #172. Here's the error text:

```python
  File "/Users/space/Documents/Programming/dt-blog-platform/api-server/db/objs.py", line 268, in commit
    self.updatedon = datetime.datetime.utcnow()
  File "/var/root/.local/share/virtualenvs/api-server-DI-zCP9m/lib/python3.6/site-packages/umongo/document.py", line 295, in __setattr__
    self._data.set(name, value, to_raise=AttributeError)
  File "/var/root/.local/share/virtualenvs/api-server-DI-zCP9m/lib/python3.6/site-packages/umongo/data_proxy.py", line 152, in set
    value = field._deserialize(value, name, None)
  File "/var/root/.local/share/virtualenvs/api-server-DI-zCP9m/lib/python3.6/site-packages/umongo/fields.py", line 245, in _deserialize
    return ret.replace(microsecond=round(ret.microsecond, -3))
ValueError: microsecond must be in 0..999999
```

My guess is something funky is going on either with my system, or maybe the round isn't working properly? Not too sure, but this should be a simple one.

The way I did this is set a `StrictDateTimeField` equal to `datetime.datetime.utcnow()` in an overriden `commit` method. Ex:

```python
@instance.register
class Foo(Document):
    name = fields.StringField()
    updatedon = fields.StrictDateTimeField()

    def commit(self, *args, **kwargs):
        self.updatedon = datetime.datetime.utcnow()
        return super(Foo, self).commit(*args, **kwargs)
```

This error happens when calling the commit method on the object.

Thanks in advance!

Pull request:
Fix millisecond overflow issue in StrictDateTimeField
Actually fixes #189...

Patch:
diff --git a/umongo/fields.py b/umongo/fields.py
index 2cb87e3..c2ba09a 100644
--- a/umongo/fields.py
+++ b/umongo/fields.py
@@ -248,9 +248,7 @@ class StrictDateTimeField(BaseField, ma_bonus_fields.StrictDateTime):
             ret = self._set_tz_awareness(value)
         else:
             ret = super()._deserialize(value, attr, data)
-        # MongoDB stores datetimes with a millisecond precision.
-        # Don't keep more precision in the object than in the database.
-        return ret.replace(microsecond=round(ret.microsecond, -3))
+        return _round_to_millisecond(ret)
 
     def _deserialize_from_mongo(self, value):
         return self._set_tz_awareness(value)


Test patch:
diff --git a/tests/test_fields.py b/tests/test_fields.py
index d4d2133..9b90b05 100644
--- a/tests/test_fields.py
+++ b/tests/test_fields.py
@@ -243,6 +243,11 @@ class TestFields(BaseTest):
         s = MySchema()
         data, _ = s.load({'a': dt.datetime(2016, 8, 6, 12, 30, 30, 123456)})
         assert data['a'].microsecond == 123000
+        data, _ = s.load({'a': dt.datetime(2016, 8, 6, 12, 59, 59, 999876)})
+        assert data['a'].hour == 13
+        assert data['a'].minute == 0
+        assert data['a'].second == 0
+        assert data['a'].microsecond == 0
 
     def test_date(self):
Repository: tannerlinsley/react-query (ts)

Issue:
queryInstance.clearInterval() is not called on Unmount
When a component unmounts `queryInstance.unsubscribe()` tries to clear intervals here:
https://github.com/tannerlinsley/react-query/blob/master/src/core/queryInstance.js#L73
Note that `query.instances.length===0`

BUG:
`query.clearIntervals()` does no clear any intervals because the array it iterates over is empty.
https://github.com/tannerlinsley/react-query/blob/master/src/core/query.js#L138

Pull request:
fix: (queryInstance.clearInterval) is not called on unmount
Fix #711 

Patch:
diff --git a/src/core/queryInstance.js b/src/core/queryInstance.js
index 22ce7ee9d..6e3d92529 100644
--- a/src/core/queryInstance.js
+++ b/src/core/queryInstance.js
@@ -70,7 +70,7 @@ export function makeQueryInstance(query, onStateUpdate) {
     query.instances = query.instances.filter(d => d.id !== instance.id)
 
     if (!query.instances.length) {
-      query.clearIntervals()
+      instance.clearInterval()
       query.cancel()
 
       if (!isServer) {


Test patch:
diff --git a/src/core/tests/queryCache.test.js b/src/core/tests/queryCache.test.js
index a379aa94d..9868fef23 100644
--- a/src/core/tests/queryCache.test.js
+++ b/src/core/tests/queryCache.test.js
@@ -72,7 +72,7 @@ describe('queryCache', () => {
     expect(callback).toHaveBeenCalled()
   })
 
-  test('should notify subsribers when new query with initialData is added', async () => {
+  test('should notify subscribers when new query with initialData is added', async () => {
     const callback = jest.fn()
 
     queryCache.subscribe(callback)
@@ -156,6 +156,20 @@ describe('queryCache', () => {
     expect(query.state.isStale).toBe(false)
   })
 
+  test('query interval is cleared when unsubscribed to a refetchInterval query', async () => {
+    const queryKey = 'key'
+    const fetchData = () => Promise.resolve('data')
+    await queryCache.prefetchQuery(queryKey, fetchData, { cacheTime: 0, refetchInterval: 1 })
+    const query = queryCache.getQuery(queryKey)
+    const instance = query.subscribe()
+    instance.updateConfig(query.config)
+    expect(instance.refetchIntervalId).not.toBeUndefined()
+    instance.unsubscribe()
+    expect(instance.refetchIntervalId).toBeUndefined()
+    await sleep(10)
+    expect(queryCache.getQuery(queryKey)).toBeUndefined()
+  })
+
   test('query is garbage collected when unsubscribed to', async () => {
     const queryKey = 'key'
     const fetchData = () => Promise.resolve('data')
Repository: GitLabPHP/Client (php)

Issue:
Cannot upload project avatar: 'avatar is invalid'
[Our project calls `uploadAvatar()`](https://github.com/acquia/cli/blob/fae9193756f42a2b873b573327a6747067e96b66/src/Command/CodeStudio/CodeStudioCommandTrait.php#L253) after creating a GitLab project. I'm pretty sure this has worked in the past, but recently stopped working, throwing an `avatar is invalid` exception: https://github.com/acquia/cli/issues/1377

I did some debugging and it looks like a problem with this library. A curl request with the same avatar to the same API endpoint works fine:

`curl --location --request PUT 'https://code.acquia.com/api/v4/projects/1092' --header 'Authorization: Bearer [snip]' --form 'avatar=@drupal_icon.png'`

I suspect GitLab changed something in the expected file or PUT format that's breaking this call.

Pull request:
[11.9] Correct upload avatar endpoint
Closes #739, #745.

Patch:
diff --git a/src/Api/Projects.php b/src/Api/Projects.php
index 1ca253c..43773b1 100644
--- a/src/Api/Projects.php
+++ b/src/Api/Projects.php
@@ -1207,7 +1207,7 @@ class Projects extends AbstractApi
      */
     public function uploadAvatar($project_id, string $file)
     {
-        return $this->put($this->getProjectPath($project_id, ''), [], [], ['avatar' => $file]);
+        return $this->put('projects/'.self::encodePath($project_id), [], [], ['avatar' => $file]);
     }
 
     /**


Test patch:
diff --git a/tests/Api/ProjectsTest.php b/tests/Api/ProjectsTest.php
index bc7e64e..6def3b0 100644
--- a/tests/Api/ProjectsTest.php
+++ b/tests/Api/ProjectsTest.php
@@ -2780,7 +2780,7 @@ class ProjectsTest extends TestCase
         $api = $this->getApiMock();
         $api->expects($this->once())
             ->method('put')
-            ->with('projects/1/', [], [], ['avatar' => $fileName])
+            ->with('projects/1', [], [], ['avatar' => $fileName])
             ->will($this->returnValue($expectedArray));
         $this->assertEquals($expectedArray, $api->uploadAvatar(1, $fileName));
         \unlink($fileName);
Repository: genjidb/genji (go)

Issue:
Define and filter forbidden characters on identifiers
A few packages (`index`, `engine/*`, ...) use special characters as separators when they build keys (example: https://github.com/asdine/genji/blob/master/index/index.go#L98-L106).
Currently, we don't prevent users to use these separators in their documents, which can cause problems.
Define these characters somewhere and make sure to return an error if they are used

Pull request:
Add prefix to table stores
This PR adds a prefix to every created table store. It also fixes a panic when decoding a tableInfo.
Fixes #73

Patch:
diff --git a/database/config.go b/database/config.go
index fc58dea2..d1e451e3 100644
--- a/database/config.go
+++ b/database/config.go
@@ -14,6 +14,8 @@ import (
 	"github.com/genjidb/genji/index"
 )
 
+const storePrefix = 't'
+
 // FieldConstraint describes constraints on a particular field.
 type FieldConstraint struct {
 	Path         document.ValuePath
@@ -134,7 +136,7 @@ func (ti *TableInfo) ScanDocument(d document.Document) error {
 	ti.FieldConstraints = make([]FieldConstraint, l)
 
 	err = ar.Iterate(func(i int, value document.Value) error {
-		return ti.FieldConstraints[i].ScanDocument(v.V.(document.Document))
+		return ti.FieldConstraints[i].ScanDocument(value.V.(document.Document))
 	})
 	if err != nil {
 		return err
@@ -333,17 +335,19 @@ func (t *tableInfoStore) GetTableInfo() map[string]TableInfo {
 }
 
 // generateStoreID generates an ID used as a key to reference a table.
-// The first 4 bytes represent the timestamp in second and the last-2 bytes are
+// The first byte contains the prefix used for table stores.
+// The next 4 bytes represent the timestamp in second and the last 2 bytes are
 // randomly generated.
 func (t *tableInfoStore) generateStoreID() []byte {
 	t.mu.RLock()
 	defer t.mu.RUnlock()
 
 	var found bool = true
-	var id [6]byte
+	var id [7]byte
 	for found {
-		binary.BigEndian.PutUint32(id[:], uint32(time.Now().Unix()))
-		if _, err := rand.Reader.Read(id[4:]); err != nil {
+		id[0] = storePrefix
+		binary.BigEndian.PutUint32(id[1:], uint32(time.Now().Unix()))
+		if _, err := rand.Reader.Read(id[5:]); err != nil {
 			panic(fmt.Errorf("cannot generate random number: %v;", err))
 		}
 


Test patch:
diff --git a/database/config_test.go b/database/config_test.go
index f2744c46..393266b4 100644
--- a/database/config_test.go
+++ b/database/config_test.go
@@ -8,6 +8,20 @@ import (
 	"github.com/stretchr/testify/require"
 )
 
+func TestTableInfo(t *testing.T) {
+	info := &TableInfo{
+		FieldConstraints: []FieldConstraint{
+			{Path: []string{"k"}, Type: document.DoubleValue, IsPrimaryKey: true},
+		},
+	}
+
+	doc := info.ToDocument()
+
+	var res TableInfo
+	err := res.ScanDocument(doc)
+	require.NoError(t, err)
+}
+
 func TestTableInfoStore(t *testing.T) {
 	t.Run("ok", func(t *testing.T) {
 		ng := memoryengine.NewEngine()
Repository: pinojs/pino (js)

Issue:
When an Error is the first parameter, the second and third parameters are not being passed to pino-pretty
Originally thought this was a pretty-pino [issue](https://github.com/pinojs/pino-pretty/issues/27) but it is in-fact a pino issue.

In `prettyPrint` mode when the first argument is an `Error`, pino does not pass the second and/or third arguments to pino-pretty.

Code to re-produce is:

`try { throw new Error('foo') } catch(error) { logger.info(error, 'something went wrong') }`
`try { throw new Error('bar') } catch(error) { logger.info(error, 'something broke', 'test string') }`

Pino only passes the `Error` for the first argument to pretty-pino but not the second or third arguments:

`[1535020164640] INFO (94172 on macbook-pro-2.internal.local): foo
    Error: foo
        at Object.<anonymous>...
`
`[1535020164642] INFO (94172 on macbook-pro-2.internal.local): bar
    Error: bar
        at Object.<anonymous>... 
`

I would expect the second and/or third arguments to be passed along with the first `Error` argument in `prettyPrint` mode.

Versions used were `pino@5.3.0` and `pino-pretty@2.0.1`




Pull request:
Correctly assemble the message when errors are present
Fixes #500

Patch:
diff --git a/example.js b/example.js
index 19228f2..5e39692 100644
--- a/example.js
+++ b/example.js
@@ -31,3 +31,5 @@ pino.trace('this is a trace statement')
 pino.debug('this is a "debug" statement with "')
 
 pino.info(new Error('kaboom'))
+
+pino.info(new Error('kaboom'), 'with', 'a', 'message')
diff --git a/lib/tools.js b/lib/tools.js
index e0776bd..6d3c400 100644
--- a/lib/tools.js
+++ b/lib/tools.js
@@ -197,7 +197,7 @@ function prettifierMetaWrapper (pretty, dest) {
       var msg = this.lastMsg
 
       if (lastObj instanceof Error) {
-        msg = lastObj.message
+        msg = msg || lastObj.message
         lastObj = {
           type: 'Error',
           stack: lastObj.stack


Test patch:
diff --git a/test/fixtures/pretty/error.js b/test/fixtures/pretty/error.js
index 12be861..7f336b7 100644
--- a/test/fixtures/pretty/error.js
+++ b/test/fixtures/pretty/error.js
@@ -4,3 +4,4 @@ require('os').hostname = function () { return 'abcdefghijklmnopqr' }
 var pino = require(require.resolve('./../../../'))
 var log = pino({prettyPrint: true})
 log.error(new Error('kaboom'))
+log.error(new Error('kaboom'), 'with', 'a', 'message')
diff --git a/test/pretty.test.js b/test/pretty.test.js
index 6c9f8b9..0371028 100644
--- a/test/pretty.test.js
+++ b/test/pretty.test.js
@@ -184,5 +184,6 @@ test('errors', async ({isNot}) => {
   }))
   await once(child, 'close')
   isNot(actual.match(/\(123456 on abcdefghijklmnopqr\): kaboom/), null)
+  isNot(actual.match(/\(123456 on abcdefghijklmnopqr\): with a message/), null)
   isNot(actual.match(/.*error\.js.*/), null)
 })
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 315
Good morning! Here's your coding interview problem for today.

This problem was asked by Google.

In linear algebra, a Toeplitz matrix is one in which the elements on any given diagonal from top left to bottom right are identical.

Here is an example:
```
1 2 3 4 8
5 1 2 3 4
4 5 1 2 3
7 4 5 1 2
```
Write a program to determine whether a given input is a Toeplitz matrix.

Pull request:
Day315
Resolves #642.

Patch:
diff --git a/README.md b/README.md
index 74a3081..0b12102 100644
--- a/README.md
+++ b/README.md
@@ -321,3 +321,4 @@ problems from
 * [Day 311](https://github.com/vaskoz/dailycodingproblem-go/issues/635)
 * [Day 312](https://github.com/vaskoz/dailycodingproblem-go/issues/637)
 * [Day 314](https://github.com/vaskoz/dailycodingproblem-go/issues/640)
+* [Day 315](https://github.com/vaskoz/dailycodingproblem-go/issues/642)
diff --git a/day315/problem.go b/day315/problem.go
new file mode 100644
index 0000000..4ae30c3
--- /dev/null
+++ b/day315/problem.go
@@ -0,0 +1,32 @@
+package day315
+
+// IsToeplitzMatrix answers if a given matrix is a Toeplitz Matrix.
+// https://en.wikipedia.org/wiki/Toeplitz_matrix
+// Runs in O(N) time and O(1) extra space.
+func IsToeplitzMatrix(mat [][]int) bool {
+	for row := 0; row < len(mat)-1; row++ {
+		r := row
+		c := 0
+		num := mat[r][c]
+		for r < len(mat) && c < len(mat[r]) {
+			if mat[r][c] != num {
+				return false
+			}
+			r++
+			c++
+		}
+	}
+	for col := 1; col < len(mat[0])-1; col++ {
+		r := 0
+		c := col
+		num := mat[r][c]
+		for r < len(mat) && c < len(mat[r]) {
+			if mat[r][c] != num {
+				return false
+			}
+			r++
+			c++
+		}
+	}
+	return true
+}


Test patch:
diff --git a/day315/problem_test.go b/day315/problem_test.go
new file mode 100644
index 0000000..2bf900a
--- /dev/null
+++ b/day315/problem_test.go
@@ -0,0 +1,51 @@
+package day315
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	mat      [][]int
+	expected bool
+}{
+	{[][]int{
+		{1, 2, 3, 4, 8},
+		{5, 1, 2, 3, 4},
+		{4, 5, 1, 2, 3},
+		{7, 4, 5, 1, 2},
+	},
+		true,
+	},
+	{[][]int{
+		{1, 2, 3, 4, 8},
+		{5, 1, 2, 3, 4},
+		{4, 5, 1, 2, 3},
+		{7, 4, 5, 9, 2},
+	},
+		false,
+	},
+	{[][]int{
+		{1, 2, 3, 4, 8},
+		{5, 1, 2, 3, 4},
+		{4, 5, 1, 2, 3},
+		{7, 4, 5, 1, 9},
+	},
+		false,
+	},
+}
+
+func TestIsToeplitzMatrix(t *testing.T) {
+	t.Parallel()
+	for tcid, tc := range testcases {
+		if result := IsToeplitzMatrix(tc.mat); result != tc.expected {
+			t.Errorf("Expected %v, got %v for TCID %d", tc.expected, result, tcid)
+		}
+	}
+}
+
+func BenchmarkIsToeplitzMatrix(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			IsToeplitzMatrix(tc.mat)
+		}
+	}
+}
Repository: gabriel-vasile/mimetype (go)

Issue:
pzstd file is not detected as zstd
**Attach the file for which the detection is inaccurate**
[test.zip](https://github.com/user-attachments/files/18141160/test.zip)
test.txt.zst uses zstd
test2.txt.zst uses pzstd

**Expected MIME type**
`application/zstd`

**Returned MIME type**
`application/octet-stream`

**Version of the library you are using**
`v1.4.7`

**Output of `go version`**
`go version go1.23.4 linux/amd64`

**Additional context**
https://github.com/facebook/zstd
Files created using pzstd are not detection correctly, if use `file` command both will be detected as `application/zstd`

Pull request:
zstd: check for skippable frames as well; fix #619
Previous detection was not working for skippable frames: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#skippable-frames

Patch:
diff --git a/internal/magic/archive.go b/internal/magic/archive.go
index b59042c..068d00f 100644
--- a/internal/magic/archive.go
+++ b/internal/magic/archive.go
@@ -52,10 +52,15 @@ func InstallShieldCab(raw []byte, _ uint32) bool {
 }
 
 // Zstd matches a Zstandard archive file.
+// https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md
 func Zstd(raw []byte, limit uint32) bool {
-	return len(raw) >= 4 &&
-		(0x22 <= raw[0] && raw[0] <= 0x28 || raw[0] == 0x1E) && // Different Zstandard versions.
-		bytes.HasPrefix(raw[1:], []byte{0xB5, 0x2F, 0xFD})
+	if len(raw) < 4 {
+		return false
+	}
+	sig := binary.LittleEndian.Uint32(raw)
+	// Check for Zstandard frames and skippable frames.
+	return (sig >= 0xFD2FB522 && sig <= 0xFD2FB528) ||
+		(sig >= 0x184D2A50 && sig <= 0x184D2A5F)
 }
 
 // CRX matches a Chrome extension file: a zip archive prepended by a package header.


Test patch:
diff --git a/mimetype_test.go b/mimetype_test.go
index 75d777f..32a26a2 100644
--- a/mimetype_test.go
+++ b/mimetype_test.go
@@ -262,6 +262,7 @@ var testcases = []testcase{
 	{"xz", "\xfd7zXZ\x00", "application/x-xz", true},
 	{"zip", "PK\x03\x04", "application/zip", true},
 	{"zst", "(\xb5/\xfd", "application/zstd", true},
+	{"zst skippable frame", "\x50\x2A\x4D\x18", "application/zstd", false},
 }
 
 func TestDetect(t *testing.T) {
Repository: mila-udem/fuel (python)

Issue:
Built-in datasets: Convert still fails
I get this result when I try to convert the celeba dataset


```
fuel-convert celeba 64

Traceback (most recent call last):
  File "/usr/local/bin/fuel-convert", line 11, in <module>
    load_entry_point('fuel==0.2.0', 'console_scripts', 'fuel-convert')()
  File "/usr/local/lib/python2.7/dist-packages/fuel/bin/fuel_convert.py", line 79, in main
    output_paths = convert_function(**args_dict)
  File "/usr/local/lib/python2.7/dist-packages/fuel/converters/celeba.py", line 198, in convert_celeba
    directory, output_directory, output_filename)
  File "/usr/local/lib/python2.7/dist-packages/fuel/converters/base.py", line 45, in wrapped
    return f(directory, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/fuel/converters/celeba.py", line 139, in convert_celeba_64
    h5file = _initialize_conversion(directory, output_path, (64, 64))
  File "/usr/local/lib/python2.7/dist-packages/fuel/converters/celeba.py", line 41, in _initialize_conversion
    skiprows=2, usecols=tuple(range(1, 41))) +
  File "/usr/local/lib/python2.7/dist-packages/numpy/lib/npyio.py", line 923, in loadtxt
    vals = [vals[i] for i in usecols]
IndexError: list index out of range
```

This is with the latest versions of Theano, Blocks and Fuel

Pull request:
Update download links for CelebA files
Fixes #377.

Patch:
diff --git a/fuel/downloaders/celeba.py b/fuel/downloaders/celeba.py
index 81123c4..cbb0aac 100644
--- a/fuel/downloaders/celeba.py
+++ b/fuel/downloaders/celeba.py
@@ -11,9 +11,9 @@ def fill_subparser(subparser):
 
     """
     urls = ['https://www.dropbox.com/sh/8oqt9vytwxb3s4r/'
-            'AAB7G69NLjRNqv_tyiULHSVUa/list_attr_celeba.txt?dl=1',
+            'AAC7-uCaJkmPmvLX2_P5qy0ga/Anno/list_attr_celeba.txt?dl=1',
             'https://www.dropbox.com/sh/8oqt9vytwxb3s4r/'
-            'AADVdnYbokd7TXhpvfWLL3sga/img_align_celeba.zip?dl=1']
+            'AADIKlz8PR9zr6Y20qbkunrba/Img/img_align_celeba.zip?dl=1']
     filenames = ['list_attr_celeba.txt', 'img_align_celeba.zip']
     subparser.set_defaults(urls=urls, filenames=filenames)
     return default_downloader


Test patch:
diff --git a/tests/test_downloaders.py b/tests/test_downloaders.py
index bae89cd..664c915 100644
--- a/tests/test_downloaders.py
+++ b/tests/test_downloaders.py
@@ -166,9 +166,9 @@ def test_celeba():
     args = parser.parse_args(['celeba'])
     filenames = ['list_attr_celeba.txt', 'img_align_celeba.zip']
     urls = ['https://www.dropbox.com/sh/8oqt9vytwxb3s4r/'
-            'AAB7G69NLjRNqv_tyiULHSVUa/list_attr_celeba.txt?dl=1',
+            'AAC7-uCaJkmPmvLX2_P5qy0ga/Anno/list_attr_celeba.txt?dl=1',
             'https://www.dropbox.com/sh/8oqt9vytwxb3s4r/'
-            'AADVdnYbokd7TXhpvfWLL3sga/img_align_celeba.zip?dl=1']
+            'AADIKlz8PR9zr6Y20qbkunrba/Img/img_align_celeba.zip?dl=1']
     assert_equal(args.filenames, filenames)
     assert_equal(args.urls, urls)
     assert download_function is default_downloader