internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: microsoft/playwright-python

Issue:
[BUG] Frame is emitted on Page events domcontentloaded/load
**Context:**
- Playwright Version: 1.23
- Operating System: macOS
- Python version: 3.9
- Browser: Chromium

**Code Snippet**

```python
from playwright.sync_api import sync_playwright, Page

with sync_playwright() as playwright:
    with playwright.chromium.launch(channel='chrome') as browser:
        page = browser.new_page()
        with page.expect_event('domcontentloaded') as event:
            page.goto('https://github.com/YusukeIwaki')
        print(event.value)
```


**Describe the bug**

The code above prints `Frame` in 1.23, which was `Page` in 1.22.
The JS version of Playwright still prints Page with the similar code, so I think this is an unexpected change.
The change would be made here: https://github.com/microsoft/playwright-python/pull/1374/files#diff-532b443f553121e300cafcb5964712250d091576e944af3b880ba143e1413c28R103


Discussion:
Oops! Thanks for pointing this out. Let me update and add test coverage here.

Resolving patch:
diff --git a/playwright/_impl/_frame.py b/playwright/_impl/_frame.py
--- a/playwright/_impl/_frame.py
+++ b/playwright/_impl/_frame.py
@@ -100,14 +100,14 @@ def _on_load_state(
             and hasattr(self, "_page")
             and self._page
         ):
-            self._page.emit("load", self)
+            self._page.emit("load", self._page)
         if (
             not self._parent_frame
             and add == "domcontentloaded"
             and hasattr(self, "_page")
             and self._page
         ):
-            self._page.emit("domcontentloaded", self)
+            self._page.emit("domcontentloaded", self._page)
 
     def _on_frame_navigated(self, event: FrameNavigatedEvent) -> None:
         self._url = event["url"]


Test patch:
diff --git a/tests/sync/test_page.py b/tests/sync/test_page.py
--- a/tests/sync/test_page.py
+++ b/tests/sync/test_page.py
@@ -76,3 +76,11 @@ def test_sync_stacks_should_work(page: Page, server: Server) -> None:
         page.goto(server.EMPTY_PAGE)
     assert exc_info.value.stack
     assert __file__ in exc_info.value.stack
+
+
+def test_emitted_for_domcontentloaded_and_load(page: Page, server: Server) -> None:
+    with page.expect_event("domcontentloaded") as dom_info:
+        with page.expect_event("load") as load_info:
+            page.goto(server.EMPTY_PAGE)
+    assert isinstance(dom_info.value, Page)
+    assert isinstance(load_info.value, Page)
Repository: microsoft/playwright-python

Issue:
[BUG] Frame is emitted on Page events domcontentloaded/load
**Context:**
- Playwright Version: 1.23
- Operating System: macOS
- Python version: 3.9
- Browser: Chromium

**Code Snippet**

```python
from playwright.sync_api import sync_playwright, Page

with sync_playwright() as playwright:
    with playwright.chromium.launch(channel='chrome') as browser:
        page = browser.new_page()
        with page.expect_event('domcontentloaded') as event:
            page.goto('https://github.com/YusukeIwaki')
        print(event.value)
```


**Describe the bug**

The code above prints `Frame` in 1.23, which was `Page` in 1.22.
The JS version of Playwright still prints Page with the similar code, so I think this is an unexpected change.
The change would be made here: https://github.com/microsoft/playwright-python/pull/1374/files#diff-532b443f553121e300cafcb5964712250d091576e944af3b880ba143e1413c28R103


Discussion:
Oops! Thanks for pointing this out. Let me update and add test coverage here.
Once https://github.com/microsoft/playwright-python/pull/1400, we'll put it into a patch release of the Python 1.23 version. Thanks!

Resolving patch:
diff --git a/playwright/_impl/_frame.py b/playwright/_impl/_frame.py
--- a/playwright/_impl/_frame.py
+++ b/playwright/_impl/_frame.py
@@ -100,14 +100,14 @@ def _on_load_state(
             and hasattr(self, "_page")
             and self._page
         ):
-            self._page.emit("load", self)
+            self._page.emit("load", self._page)
         if (
             not self._parent_frame
             and add == "domcontentloaded"
             and hasattr(self, "_page")
             and self._page
         ):
-            self._page.emit("domcontentloaded", self)
+            self._page.emit("domcontentloaded", self._page)
 
     def _on_frame_navigated(self, event: FrameNavigatedEvent) -> None:
         self._url = event["url"]


Test patch:
diff --git a/tests/sync/test_page.py b/tests/sync/test_page.py
--- a/tests/sync/test_page.py
+++ b/tests/sync/test_page.py
@@ -76,3 +76,11 @@ def test_sync_stacks_should_work(page: Page, server: Server) -> None:
         page.goto(server.EMPTY_PAGE)
     assert exc_info.value.stack
     assert __file__ in exc_info.value.stack
+
+
+def test_emitted_for_domcontentloaded_and_load(page: Page, server: Server) -> None:
+    with page.expect_event("domcontentloaded") as dom_info:
+        with page.expect_event("load") as load_info:
+            page.goto(server.EMPTY_PAGE)
+    assert isinstance(dom_info.value, Page)
+    assert isinstance(load_info.value, Page)
Repository: ocf/ocfweb

Issue:
Links in headings are broken on docs
For example:
https://dev.ocf.berkeley.edu/docs/faq/
![](http://i.fluffy.cc/RDF2Pq9B402fmfJp1ghVd3p9pzvKSlmc.png)

I think this is a side-effect of overreaching CSS rules intended for the link icons.



Discussion:

Resolving patch:
diff --git a/ocfweb/component/markdown.py b/ocfweb/component/markdown.py
--- a/ocfweb/component/markdown.py
+++ b/ocfweb/component/markdown.py
@@ -127,7 +127,7 @@ def header(self, text, level, raw=None):
 
         self.toc.append((level, text, id))
         self.toc_ids.add(id)
-        return '<h{level} id="{id}">{text} <a class="" href="#{id}"><span></span></a></h{level}>\n'.format(
+        return '<h{level} id="{id}">{text} <a class="anchor" href="#{id}"><span></span></a></h{level}>\n'.format(
             level=level,
             id=id,
             text=text,


Test patch:
Repository: ocf/ocfweb

Issue:
Table of contents doesn't handle links inside headings properly
http://supernova.ocf.berkeley.edu:8460/docs/faq/
![](http://i.fluffy.cc/ZRnhh1F0QMXZrhP6Ztx4SrF1hSDJ8lpH.png)

It should probably just strip HTML tags.



Discussion:

Resolving patch:
diff --git a/ocfweb/component/markdown.py b/ocfweb/component/markdown.py
--- a/ocfweb/component/markdown.py
+++ b/ocfweb/component/markdown.py
@@ -2,6 +2,7 @@
 
 import mistune
 from django.core.urlresolvers import reverse
+from django.utils.html import strip_tags
 
 from ocfweb.caching import lru_cache
 
@@ -118,7 +119,7 @@ def header(self, text, level, raw=None):
         else:
             id = 'h{level}_{title}'.format(
                 level=level,
-                title=re.sub('[^a-z0-9\-_ ]', '', text.lower()).strip().replace(' ', '-'),
+                title=re.sub('[^a-z0-9\-_ ]', '', strip_tags(text).lower()).strip().replace(' ', '-'),
             )
 
             # dumb collision avoidance
diff --git a/ocfweb/docs/templatetags/docs.py b/ocfweb/docs/templatetags/docs.py
--- a/ocfweb/docs/templatetags/docs.py
+++ b/ocfweb/docs/templatetags/docs.py
@@ -3,6 +3,7 @@
 from operator import attrgetter
 
 from django import template
+from django.utils.html import strip_tags
 
 from ocfweb.docs.urls import DOCS
 
@@ -69,7 +70,7 @@ def doc_toc(toc):
                 cur += 1
             html += '<li><a href="#{fragment}">{text}</a></li>'.format(
                 fragment=id,
-                text=text,
+                text=strip_tags(text),
             )
 
         while cur > levels[0]:


Test patch:
Repository: ocf/ocfweb

Issue:
Have next 7 days in hours sidebar
This means all our normal hours are visible on a normal week.



Discussion:
The reasoning behind not just showing a full week is that it's really the _next_ 4 days (currently, anyway) and takes into account holidays and such. If it just showed Sunday through Saturday it would be less intuitive what's happening ("It's Christmas every Tuesday?").

If we show the next 7 and make it clear that's what it is, it's probably ok.

Tagging this as blocking and self-owning since I already started it but didn't finish and it looks even worse right now.

![](http://i.fluffy.cc/N6h7KZwgZLznDq8rrkM0JBcGQQkRBtnX.png)


Resolving patch:
diff --git a/ocfweb/main/home.py b/ocfweb/main/home.py
--- a/ocfweb/main/home.py
+++ b/ocfweb/main/home.py
@@ -13,7 +13,7 @@
 
 def home(request):
     hours = [
-        get_hours(date.today() + timedelta(days=i)) for i in range(7)
+        get_hours(date.today() + timedelta(days=i)) for i in range(5)
     ]
 
     blog_posts = [


Test patch:
Repository: ocf/ocfweb

Issue:
Home page should have a link to password reset, check print quota, view print queue



Discussion:

Resolving patch:
diff --git a/ocfweb/context_processors.py b/ocfweb/context_processors.py
--- a/ocfweb/context_processors.py
+++ b/ocfweb/context_processors.py
@@ -1,12 +1,20 @@
 import re
 from datetime import date
 from datetime import datetime
+from ipaddress import ip_address
+from ipaddress import ip_network
 
+from ipware.ip import get_real_ip
 from ocflib.lab.hours import DayHours
 
 from ocfweb.component.lab_status import get_lab_status
 
 
+def is_ocf_ip(ip):
+    # TODO: move this to ocflib when it drops Python 3.2 support
+    return ip_address(ip) in ip_network('169.229.10.0/24')
+
+
 def ocf_template_processor(request):
     now = datetime.now()
     today = date.today()
@@ -21,9 +29,12 @@ def ocf_template_processor(request):
             page_class += '-' + re.sub('[^a-zA-Z_\-]', '-', arg)
             base_css_classes.append(page_class)
 
+    real_ip = get_real_ip(request)
+
     return {
         'lab_is_open': hours.is_open(now),
         'current_lab_hours': hours,
         'lab_status': get_lab_status(),
         'base_css_classes': ' '.join(base_css_classes),
+        'is_ocf_ip': is_ocf_ip(real_ip) if real_ip else True,
     }
diff --git a/ocfweb/main/home.py b/ocfweb/main/home.py
--- a/ocfweb/main/home.py
+++ b/ocfweb/main/home.py
@@ -13,7 +13,7 @@
 
 def home(request):
     hours = [
-        get_hours(date.today() + timedelta(days=i)) for i in range(5)
+        get_hours(date.today() + timedelta(days=i)) for i in range(3)
     ]
 
     blog_posts = [
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -18,6 +18,7 @@
     install_requires=[
         'cachetools',
         'django>=1.8,<1.8.999',
+        'django-ipware',
         'gunicorn',
         'libsass',
         'lxml',


Test patch:
Repository: ocf/ocfweb

Issue:
Add "edit this page" link on docs?
It would link to the GitHub editor page.



Discussion:

Resolving patch:
diff --git a/ocfweb/docs/doc.py b/ocfweb/docs/doc.py
--- a/ocfweb/docs/doc.py
+++ b/ocfweb/docs/doc.py
@@ -25,3 +25,12 @@ def category_for_sidebar(self):
             return self.name + '/'
         else:
             return self.category
+
+    @property
+    def edit_url(self):
+        """Return a GitHub edit URL for this page."""
+        return (
+            'https://github.com/ocf/ocfweb/edit/master/ocfweb/docs/docs' +
+            self.name +
+            '.md'
+        )


Test patch:
Repository: ocf/ocfweb

Issue:
Docs don't auto-reload in dev
Because we only read docs once, changes to the Markdown files require manually killing and restarting the server.



Discussion:

Resolving patch:
diff --git a/ocfweb/docs/markdown_based.py b/ocfweb/docs/markdown_based.py
--- a/ocfweb/docs/markdown_based.py
+++ b/ocfweb/docs/markdown_based.py
@@ -1,6 +1,6 @@
 """Documents backed by Markdown.
 
-This is the most common type of doc. It reads a Markdown fil and renders it in
+This is the most common type of doc. It reads a Markdown file and renders it in
 a standard template.
 
 Markdown documents can specify the meta attributes:
@@ -16,6 +16,7 @@
 from functools import partial
 from pathlib import Path
 
+from django.conf import settings
 from django.shortcuts import render
 
 from ocfweb.component.markdown import markdown_and_toc
@@ -26,13 +27,20 @@
 DOCS_DIR = Path(__file__).parent.joinpath('docs')
 
 
-def render_markdown_doc(meta, text, doc, request):
+def render_markdown_doc(path, meta, text, doc, request):
+
+    # Reload markdown docs if in development
+    if settings.DEBUG:
+        with path.open() as f:
+            text, meta = text_and_meta(f)
+
     html, toc = markdown_and_toc(text)
+
     return render(
         request,
         meta.get('template', 'doc.html'),
         {
-            'title': doc.title,
+            'title': meta['title'],
             'doc': doc,
             'html': html,
             'toc': toc,
@@ -56,5 +64,5 @@ def get_markdown_docs():
         yield Document(
             name='/' + name,
             title=meta['title'],
-            render=partial(render_markdown_doc, meta, text)
+            render=partial(render_markdown_doc, path, meta, text),
         )


Test patch:
Repository: ocf/ocfweb

Issue:
Misleading error message when trying to register an account and you already have one
"This CalNet account has already submitted a request for approval. If you believe this is an error, please contact us with your CalNet UID: xxx.”



Discussion:

Resolving patch:
diff --git a/ocfweb/account/register.py b/ocfweb/account/register.py
--- a/ocfweb/account/register.py
+++ b/ocfweb/account/register.py
@@ -35,6 +35,7 @@ def request_account(request):
             request,
             'account/register/already-has-account.html',
             {
+                'account': ', '.join(existing_accounts),
                 'calnet_uid': calnet_uid,
                 'calnet_url': settings.LOGOUT_URL,
                 'title': 'You already have an account',


Test patch:
Repository: ocf/ocfweb

Issue:
versioned caching is broken
On [this line](https://github.com/ocf/ocfweb/blob/e0ca5b9053abf4908fd6dd3ff344724e61c38b53/ocfweb/environment.py#L15) we use a marathon environment variable to determine the cache version. We need to change this to use a Kubernetes things, a la 
https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/.


Discussion:

Resolving patch:
diff --git a/ocfweb/environment.py b/ocfweb/environment.py
--- a/ocfweb/environment.py
+++ b/ocfweb/environment.py
@@ -8,12 +8,11 @@ def ocfweb_version():
     """Return string representing ocfweb version.
 
     In dev, returns 'dev'. In prod, returns a version
-    similar to '2015.12.06.02.25-gitb98c8cb6'.
+    similar to '2019-08-20-T21-10-57-gite0ca5b9'.
     """
-    # On Marathon, read it out of environ
+    # On Kubernetes, read it out of environ
     try:
-        docker_image, tag = os.environ['MARATHON_APP_DOCKER_IMAGE'].split(':', 1)
-        return tag
+        return os.environ['OCFWEB_PROD_VERSION']
     except KeyError:
         pass
 


Test patch:
Repository: ocf/ocfweb

Issue:
fix histogram on printing page
The user histogram is broken on ocf.io/stats/printing. The culprit is https://github.com/ocf/ocfweb/blob/ed143b8f1c59e58157780007fe5fd104ee18d944/ocfweb/stats/printing.py#L58
We should use `SEMESTERLY_QUOTA + 5` instead of 105.


Discussion:
is this as simple as just updating that hard-coded value? I think I'll grab this one rn 

Resolving patch:
diff --git a/ocfweb/stats/printing.py b/ocfweb/stats/printing.py
--- a/ocfweb/stats/printing.py
+++ b/ocfweb/stats/printing.py
@@ -55,7 +55,7 @@ def _semester_histogram():
     fig = Figure(figsize=(10, 5))
     ax = fig.add_subplot(1, 1, 1)
     ax.locator_params(nbins=20)
-    ax.hist(users, bins=list(range(0, 105, 5)))
+    ax.hist(users, bins=list(range(0, SEMESTERLY_QUOTA + 5, 5)))
     ax.grid(True)
     ax.set_xlim(SEMESTERLY_QUOTA, 0)
     ax.set_ylabel('Number of users')


Test patch:
Repository: ocf/ocfweb

Issue:
disk quota on Account commands page errors
When trying to check disk quota usage on the commands page (https://www.ocf.berkeley.edu/account/commands/)
this error appears

`quota: Bad output format units for human readable output: vQ`

![image](https://user-images.githubusercontent.com/50010165/212457900-d267910d-2452-4483-9a05-291ee91a08f8.png)



Discussion:

Resolving patch:
diff --git a/ocfweb/account/commands.py b/ocfweb/account/commands.py
--- a/ocfweb/account/commands.py
+++ b/ocfweb/account/commands.py
@@ -82,7 +82,7 @@ class CommandForm(Form):
             'paper quota -- how many pages you have remaining this semester',
         ),
         (
-            '/usr/bin/quota -svQ',
+            '/usr/bin/quota -vQs',
             'disk quota -- how much disk space you have used and how much you ' +
             'have left',
         ),


Test patch:
Repository: magenta/magenta

Issue:
documentation: missing dependencies
I installed magenta from scratch on a clean Mac using the README and some tests from`bazel test //magenta/...` were failing because of the missing dependencies:

```
pip install IPython
pip install intervaltree
```

The other failures are related to https://github.com/tensorflow/magenta/issues/529 and apparently should be fixed with the upcoming version of Bazel

This issue might be related to the fact that I wasn't using conda, which could totally be a user error.


Discussion:

Resolving patch:
diff --git a/magenta/tools/pip/setup.py b/magenta/tools/pip/setup.py
--- a/magenta/tools/pip/setup.py
+++ b/magenta/tools/pip/setup.py
@@ -24,13 +24,14 @@
 
 
 REQUIRED_PACKAGES = [
+    'IPython',
+    'Pillow >= 3.4.2',
     'intervaltree >= 2.1.0',
+    'matplotlib >= 1.5.3',
     'mido >= 1.1.17',
-    'Pillow >= 3.4.2',
     'pretty_midi >= 0.2.6',
     'scipy >= 0.18.1',
     'tensorflow >= 1.0.0',
-    'matplotlib >= 1.5.3',
     'wheel',
 ]
 


Test patch:
Repository: magenta/magenta

Issue:
ValueError: Cell returns tuple of states, but the flag state_is_tuple is not set. State size is: (LSTMStateTuple(c=128, h=128), LSTMStateTuple(c=128, h=128))
Hey guys,

I've just set up my conda environment and packages. When I running the bazel test //magenta/... command, the test //magenta/models/shared:events_rnn_graph_test  failed. I am new to this project so hopefully someone could point me to the right direction! For your info, I have installed all the required packages according to setup.py, and confirmed installation with 'pip freeze' and 'conda list' command. 

Thanks in advance!
Simon 

Bellow is the error message in the log file:

`ERROR: testBuildGraphWithAttention (__main__.EventSequenceRNNGraphTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_simonttk/2d57163c72209284de52b06652358cc7/execroot/magenta/bazel-out/local-opt/bin/magenta/models/shared/events_rnn_graph_test.runfiles/__main__/magenta/models/shared/events_rnn_graph_test.py", line 58, in testBuildGraphWithAttention
    'train', self.config, sequence_example_file_paths=['test'])
  File "/private/var/tmp/_bazel_simonttk/2d57163c72209284de52b06652358cc7/execroot/magenta/bazel-out/local-opt/bin/magenta/models/shared/events_rnn_graph_test.runfiles/__main__/magenta/models/shared/events_rnn_graph.py", line 98, in build_graph
    attn_length=hparams.attn_length)
  File "/private/var/tmp/_bazel_simonttk/2d57163c72209284de52b06652358cc7/execroot/magenta/bazel-out/local-opt/bin/magenta/models/shared/events_rnn_graph_test.runfiles/__main__/magenta/models/shared/events_rnn_graph.py", line 47, in make_rnn_cell
    cell = tf.contrib.rnn.AttentionCellWrapper(cell, attn_length)
  File "/Users/simonttk/anaconda2/envs/magenta/lib/python2.7/site-packages/tensorflow/contrib/rnn/python/ops/rnn_cell.py", line 1077, in __init__
    % str(cell.state_size))
ValueError: Cell returns tuple of states, but the flag state_is_tuple is not set. State size is: (LSTMStateTuple(c=128, h=128), LSTMStateTuple(c=128, h=128))`





Discussion:

Resolving patch:
diff --git a/magenta/models/shared/events_rnn_graph.py b/magenta/models/shared/events_rnn_graph.py
--- a/magenta/models/shared/events_rnn_graph.py
+++ b/magenta/models/shared/events_rnn_graph.py
@@ -44,7 +44,8 @@ def make_rnn_cell(rnn_layer_sizes,
 
   cell = tf.contrib.rnn.MultiRNNCell(cells)
   if attn_length:
-    cell = tf.contrib.rnn.AttentionCellWrapper(cell, attn_length)
+    cell = tf.contrib.rnn.AttentionCellWrapper(
+        cell, attn_length, state_is_tuple=True)
 
   return cell
 


Test patch:
Repository: magenta/magenta

Issue:
error while running bash magenta_melody.sh

Hi,

I have this error "AttributeError: 'module' object has no attribute 'get_spec'" while running bash magenta_melody.sh. Is there an easy fix for this? Thanks in advance.

File "/Users/cristinachecalama/anaconda/envs/magenta/bin/magenta_midi", line 11, in <module>
    sys.exit(console_entry_point())
  File "/Users/cristinachecalama/anaconda/envs/magenta/lib/python2.7/site-packages/magenta/interfaces/midi/magenta_midi.py", line 376, in console_entry_point
    tf.app.run(main)
  File "/Users/cristinachecalama/anaconda/envs/magenta/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/Users/cristinachecalama/anaconda/envs/magenta/lib/python2.7/site-packages/magenta/interfaces/midi/magenta_midi.py", line 331, in main
    control=control_map['clock'], value=127)
  File "/Users/cristinachecalama/anaconda/envs/magenta/lib/python2.7/site-packages/magenta/interfaces/midi/midi_hub.py", line 135, in __init__
    for name in mido.messages.get_spec(inferred_types[0]).arguments:
AttributeError: 'module' object has no attribute 'get_spec'




Discussion:
It looks like mido has changed things a bit. Can you try installing the older version to see if it works:

pip install mido==1.1.17 --force-reinstall

Resolving patch:
diff --git a/magenta/interfaces/midi/midi_hub.py b/magenta/interfaces/midi/midi_hub.py
--- a/magenta/interfaces/midi/midi_hub.py
+++ b/magenta/interfaces/midi/midi_hub.py
@@ -132,7 +132,8 @@ def __init__(self, msg=None, **kwargs):
     else:
       # Generate regex pattern.
       parts = ['.*' if type_ is None else type_]
-      for name in mido.messages.get_spec(inferred_types[0]).arguments:
+      for name in mido.messages.SPEC_BY_TYPE[inferred_types[0]][
+          'value_names']:
         if name in kwargs:
           parts.append('%s=%d' % (name, kwargs[name]))
         else:
diff --git a/magenta/tools/pip/setup.py b/magenta/tools/pip/setup.py
--- a/magenta/tools/pip/setup.py
+++ b/magenta/tools/pip/setup.py
@@ -29,7 +29,7 @@
     'bokeh >= 0.12.0',
     'intervaltree >= 2.1.0',
     'matplotlib >= 1.5.3',
-    'mido >= 1.1.17',
+    'mido == 1.2.6',
     'pandas >= 0.18.1',
     'pretty_midi >= 0.2.6',
     'scipy >= 0.18.1',


Test patch:
diff --git a/magenta/interfaces/midi/midi_hub_test.py b/magenta/interfaces/midi/midi_hub_test.py
--- a/magenta/interfaces/midi/midi_hub_test.py
+++ b/magenta/interfaces/midi/midi_hub_test.py
@@ -704,7 +704,8 @@ def testSendControlChange(self):
 
     self.assertListEqual(
         sent_messages,
-        [mido.Message(type='control_change', control=0, value=1)])
+        [mido.Message(type='control_change', control=0, value=1,
+                      time=sent_messages[0].time)])
 
 
 if __name__ == '__main__':
Repository: magenta/magenta

Issue:
numpy dependency missing?
magenta/models/sketch_rnn/utils.py has ```import numpy as np```, but magenta/tools/pip/setup.py doesn't list it as a dependency.


Discussion:
Yeah, we should probably add that. It hasn't been a problem because we depend on tensorflow, which depends on numpy, but we should list our dependency explicitly.

Resolving patch:
diff --git a/magenta/tools/pip/setup.py b/magenta/tools/pip/setup.py
--- a/magenta/tools/pip/setup.py
+++ b/magenta/tools/pip/setup.py
@@ -31,6 +31,7 @@
     'intervaltree >= 2.1.0',
     'matplotlib >= 1.5.3',
     'mido == 1.2.6',
+    'numpy >= 1.11.0',
     'pandas >= 0.18.1',
     'pretty_midi >= 0.2.6',
     'python-rtmidi',


Test patch: