anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: microsoft/recommenders
Issue: [BUG] SAR needs to be modified due to a breaking change in spicy

### Description
<!--- Describe your issue/bug/request in detail -->
With scipy 1.10.1, the item similarity matrix is a dense matrix
```
print(type(model.item_similarity))
print(type(model.user_affinity))
print(type(model.item_similarity) == np.ndarray)
print(type(model.item_similarity) == scipy.sparse._csr.csr_matrix)
print(model.item_similarity.shape)
print(model.item_similarity)

<class 'numpy.ndarray'>
<class 'scipy.sparse._csr.csr_matrix'>
True
False
(1646, 1646)
[[1.         0.10650888 0.03076923 ... 0.         0.         0.        ]
 [0.10650888 1.         0.15104167 ... 0.         0.00729927 0.00729927]
 [0.03076923 0.15104167 1.         ... 0.         0.         0.01190476]
 ...
 [0.         0.         0.         ... 1.         0.         0.        ]
 [0.         0.00729927 0.         ... 0.         1.         0.        ]
 [0.         0.00729927 0.01190476 ... 0.         0.         1.        ]]
```

but with scipy 1.11.1 the item similarity matrix is sparse
```
print(type(model.item_similarity))
print(type(model.user_affinity))
type(model.item_similarity) == np.ndarray
type(model.item_similarity) == scipy.sparse._csr.csr_matrix
print(model.item_similarity.shape)
<class 'numpy.ndarray'>
<class 'scipy.sparse._csr.csr_matrix'>
()
```


### In which platform does it happen?
<!--- Describe the platform where the issue is happening (use a list if needed) -->
<!--- For example: -->
<!--- * Azure Data Science Virtual Machine. -->
<!--- * Azure Databricks.  -->
<!--- * Other platforms.  -->
Related to https://github.com/microsoft/recommenders/issues/1951

### How do we replicate the issue?
<!--- Please be specific as possible (use a list if needed). -->
<!--- For example: -->
<!--- * Create a conda environment for pyspark -->
<!--- * Run unit test `test_sar_pyspark.py` with `pytest -m 'spark'` -->
<!--- * ... -->

### Expected behavior (i.e. solution)
<!--- For example:  -->
<!--- * The tests for SAR PySpark should pass successfully. -->

### Other Comments
We found that the issue was that during a division in Jaccard, scipy change the type. We talked to the authors of scipy and they told us that they did a breaking change in 1.11.0 https://github.com/scipy/scipy/issues/18796#issuecomment-1619125257






Changed files:
setup.py

diff --git a/setup.py b/setup.py
index 2be2b53f..3d5510b0 100644
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,7 @@ if HASH is not None:
 install_requires = [
     "numpy>=1.19",  # 1.19 required by tensorflow 2.6
     "pandas>1.0.3,<2",
-    "scipy>=1.0.0,<2,!=1.11.0,!=1.11.1",
+    "scipy>=1.0.0,<1.11.0", #FIXME: We limit <1.11.0 until #1954 is fixed
     "tqdm>=4.31.1,<5",
     "matplotlib>=2.2.2,<4",
     "scikit-learn>=0.22.1,<1.0.3",
Repository: microsoft/recommenders
Issue: [BUG] ValueError: numpy.ufunc size changed, may indicate binary incompatibility

### Description
<!--- Describe your issue/bug/request in detail -->
In the nightly windows pipelines, there is a problem with numpy and sklearn
```
##[command]"C:\\windows\\system32\\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "C:\\Users\\recocat\\agent\\_work\\_temp\\b3a22118-20dc-4f27-837f-8c6b33419a25.cmd""
"Smoke tests"
ImportError while loading conftest 'C:\\Users\\recocat\\agent\\_work\\27\\s\\tests\\conftest.py'.
tests\\conftest.py:16: in <module>
    from sklearn.model_selection import train_test_split
C:\\Anaconda\\envs\\nightly_reco_pyspark\\lib\\site-packages\\sklearn\\__init__.py:74: in <module>
    from .base import clone
C:\\Anaconda\\envs\\nightly_reco_pyspark\\lib\\site-packages\\sklearn\\base.py:20: in <module>
    from .utils import _IS_32BIT
C:\\Anaconda\\envs\\nightly_reco_pyspark\\lib\\site-packages\\sklearn\\utils\\__init__.py:20: in <module>
    from .murmurhash import murmurhash3_32
__init__.pxd:918: in init sklearn.utils.murmurhash
    ???
E   ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192
```

### In which platform does it happen?
<!--- Describe the platform where the issue is happening (use a list if needed) -->
<!--- For example: -->
<!--- * Azure Data Science Virtual Machine. -->
<!--- * Azure Databricks.  -->
<!--- * Other platforms.  -->
DSVM windows

### How do we replicate the issue?
<!--- Please be specific as possible (use a list if needed). -->
<!--- For example: -->
<!--- * Create a conda environment for pyspark -->
<!--- * Run unit test `test_sar_pyspark.py` with `pytest -m 'spark'` -->
<!--- * ... -->
run the integration tests in windows

### Expected behavior (i.e. solution)
<!--- For example:  -->
<!--- * The tests for SAR PySpark should pass successfully. -->

### Other Comments


Changed files:
scripts/generate_conda_file.py

diff --git a/scripts/generate_conda_file.py b/scripts/generate_conda_file.py
index 40215cc5..76d1a4d8 100644
--- a/scripts/generate_conda_file.py
+++ b/scripts/generate_conda_file.py
@@ -49,7 +49,7 @@ CONDA_BASE = {
     "pytest": "pytest>=3.6.4",
     "pytorch": "pytorch-cpu>=1.0.0",
     "seaborn": "seaborn>=0.8.1",
-    "scikit-learn": "scikit-learn==0.19.1",
+    "scikit-learn": "scikit-learn>=0.19.1",
     "scipy": "scipy>=1.0.0",
     "scikit-surprise": "scikit-surprise>=1.0.6",
     "swig": "swig==3.0.12",
@@ -58,6 +58,7 @@ CONDA_BASE = {
     "cmake": "cmake==3.14.0",
     "cornac": "cornac>=1.1.2",
     "papermill": "papermill==0.19.1",
+    "tqdm": "tqdm>=4.31.1",
 }
 
 CONDA_PYSPARK = {"pyarrow": "pyarrow>=0.8.0", "pyspark": "pyspark==2.3.1"}
@@ -82,7 +83,6 @@ PIP_BASE = {
     "nbconvert": "nbconvert==5.5.0",
     "pydocumentdb": "pydocumentdb>=2.3.3",
     "pymanopt": "pymanopt==0.2.3",
-    "tqdm": "tqdm==4.31.1",
     "xlearn": "xlearn==0.40a1"
 }
Repository: microsoft/recommenders
Issue: SAR single node implementation header has pySpark implementation info 

SAR single node implementation header has pySpark implementation info instead of python implementation docstring.

Changed files:
reco_utils/recommender/sar/sar_singlenode.py

diff --git a/reco_utils/recommender/sar/sar_singlenode.py b/reco_utils/recommender/sar/sar_singlenode.py
index 94ce927e..22d16601 100644
--- a/reco_utils/recommender/sar/sar_singlenode.py
+++ b/reco_utils/recommender/sar/sar_singlenode.py
@@ -1,13 +1,9 @@
 """
-Reference implementation of SAR in pySpark using Spark-SQL and some dataframe operations.
-This is supposed to be a super-performant implementation of SAR on Spark using pySpark.
+Reference implementation of SAR in python/numpy/pandas.
 
-PS: there is plenty of room for improvement, especially around the very last step of making a partial sort:
-1) Can be done using UDAFs
-2) UDAFs can be transformed into: pivot, series of UDF operations, pivot
-3) other DF operations.
+This is not meant to be particularly performant or scalable, just
+as a simple and readable implementation.
 """
-
 import numpy as np
 import pandas as pd
 import logging
Repository: microsoft/recommenders
Issue: [BUG] Issue with Glove data from Stanford

### Description
<!--- Describe your issue/bug/request in detail -->
We get the error:
```
HTTPError: 404 Client Error: Not Found for url: https://cs.stanford.edu/srcf_404data/glove.6B.zip
```


### In which platform does it happen?
<!--- Describe the platform where the issue is happening (use a list if needed) -->
<!--- For example: -->
<!--- * Azure Data Science Virtual Machine. -->
<!--- * Azure Databricks.  -->
<!--- * Other platforms.  -->

### How do we replicate the issue?
<!--- Please be specific as possible (use a list if needed). -->
<!--- For example: -->
<!--- * Create a conda environment for pyspark -->
<!--- * Run unit test `test_sar_pyspark.py` with `pytest -m 'spark'` -->
<!--- * ... -->
See https://github.com/microsoft/recommenders/actions/runs/5372464738/jobs/9745878510


### Expected behavior (i.e. solution)
<!--- For example:  -->
<!--- * The tests for SAR PySpark should pass successfully. -->

### Other Comments


Changed files:
recommenders/datasets/mind.py

diff --git a/recommenders/datasets/mind.py b/recommenders/datasets/mind.py
index 8f23dce2..a7bd588e 100644
--- a/recommenders/datasets/mind.py
+++ b/recommenders/datasets/mind.py
@@ -252,7 +252,8 @@ def download_and_extract_glove(dest_path):
     Returns:
         str: File path where Glove was extracted.
     """
-    url = "http://nlp.stanford.edu/data/glove.6B.zip"
+    # url = "http://nlp.stanford.edu/data/glove.6B.zip"
+    url = "https://huggingface.co/stanfordnlp/glove/resolve/main/glove.6B.zip"
     filepath = maybe_download(url=url, work_directory=dest_path)
     glove_path = os.path.join(dest_path, "glove")
     unzip_file(filepath, glove_path, clean_zip_file=False)
Repository: joke2k/faker
Issue: Credit card numbers' validity is not enforced

Credit card numbers generated by `credit_card_number()` are not always valid.

### Steps to reproduce

```python
fake = Faker()
fake.credit_card_number()
```

### Expected behavior

The credit card numbers generated should always be valid ones.

### Actual behavior

Some returned numbers are invalid. For example: "3337083863794024", "3337957986872777", "3088184514627042". You can verify it with http://www.validcreditcardnumber.com/

The problem is that the issuer identification is not always correct. You can check that by performing a RegEx, see as an example https://www.regular-expressions.info/creditcard.html

Could the generator be modified to ensure that credit card numbers are always valid?

Changed files:
faker/providers/credit_card/__init__.py

diff --git a/faker/providers/credit_card/__init__.py b/faker/providers/credit_card/__init__.py
index 25767c19..4bcb499a 100644
--- a/faker/providers/credit_card/__init__.py
+++ b/faker/providers/credit_card/__init__.py
@@ -23,16 +23,19 @@ class CreditCard(object):
 
 class Provider(BaseProvider):
 
-    prefix_maestro = ['5018', '5020', '5038', '5612', '5893',
+    # Prefixes from:
+    # * https://en.wikipedia.org/wiki/Payment_card_number#Issuer_identification_number_.28IIN.29
+    # * https://www.regular-expressions.info/creditcard.html
+    # * https://creditcardjs.com/credit-card-type-detection
+    prefix_maestro = ['5018', '5020', '5038', '56##', '57##', '58##',
                       '6304', '6759', '6761', '6762', '6763', '0604', '6390']
-    prefix_mastercard = ['51', '52', '53', '54', '55']
+    prefix_mastercard = ['51', '52', '53', '54', '55', '222%']
     prefix_visa = ['4']
     prefix_amex = ['34', '37']
-    prefix_discover = ['6011']
-    prefix_diners = ['300', '301', '302', '303', '304', '305']
-    prefix_jcb16 = ['3088', '3096', '3112', '3158', '3337', '3528']
-    prefix_jcb15 = ['2100', '1800']
-    prefix_voyager = ['8699']
+    prefix_discover = ['6011', '65']
+    prefix_diners = ['300', '301', '302', '303', '304', '305', '36', '38']
+    prefix_jcb16 = ['35']
+    prefix_jcb15 = ['2131', '1800']
 
     credit_card_types = OrderedDict((
         ('maestro', CreditCard('Maestro',
@@ -47,7 +50,6 @@ class Provider(BaseProvider):
         ('diners', CreditCard('Diners Club / Carte Blanche', prefix_diners, 14)),
         ('jcb15', CreditCard('JCB 15 digit', prefix_jcb15, 15)),
         ('jcb16', CreditCard('JCB 16 digit', prefix_jcb16)),
-        ('voyager', CreditCard('Voyager', prefix_voyager, 15)),
     ))
     credit_card_types['visa'] = credit_card_types['visa16']
     credit_card_types['jcb'] = credit_card_types['jcb16']
@@ -65,7 +67,7 @@ class Provider(BaseProvider):
         """ Returns a valid credit card number. """
         card = self._credit_card_type(card_type)
         prefix = self.random_element(card.prefixes)
-        number = self._generate_number(prefix, card.length)
+        number = self._generate_number(self.numerify(prefix), card.length)
         return number
 
     def credit_card_expire(self, start='now', end='+10y', date_format='%m/%y'):
Repository: joke2k/faker
Issue: timezone() randomly throws an exception

fake.timezone() sometimes throws an exception, possibly when a country doesn't have any timezones defined:

``` python
>>> from faker import Faker
>>> f = Faker()
>>> f.timezone()
'Africa/Mogadishu'
>>> f.timezone()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vagrant/.python/lib/python3.3/site-packages/faker/providers/date_time.py", line 378, in timezone
    return cls.random_element(cls.countries)['timezones'].pop(0)
```

This is with Python 3.3 using fake-factory 0.4.0 from pypi.


Changed files:
faker/providers/date_time.py

diff --git a/faker/providers/date_time.py b/faker/providers/date_time.py
index 7d122d40..b91b3346 100644
--- a/faker/providers/date_time.py
+++ b/faker/providers/date_time.py
@@ -382,7 +382,4 @@ class Provider(BaseProvider):
 
     @classmethod
     def timezone(cls):
-        return cls.random_element(cls.countries)['timezones'].pop(0)
-
-
-
+        return random.choice(cls.random_element(cls.countries)['timezones'])
Repository: joke2k/faker
Issue: past_datetime() crashes when start_date is within one second of now

I ran into a problem while generating a bunch of fake dates where I was calling `fake.past_datetime()` with the start date using the result of a previous `fake.past_datetime()` call (simulating a bunch of files being created as part of a collection). The first call could randomly return a value which is within one second of the current time, causing the second call to trigger an exception from `random.randint()` because the `a` and `b` values were the same.

This was pretty easy to solve simply by using `fake.date_time_between(start_date=previous_created_date)` but it might be useful if `past_datetime()` was safe to call like this.

Changed files:
tests/providers/test_date_time.py, faker/providers/date_time/__init__.py

diff --git a/faker/providers/date_time/__init__.py b/faker/providers/date_time/__init__.py
index 8d1d8ff6..5df3c699 100644
--- a/faker/providers/date_time/__init__.py
+++ b/faker/providers/date_time/__init__.py
@@ -1342,7 +1342,10 @@ class Provider(BaseProvider):
         """
         start_date = self._parse_date_time(start_date, tzinfo=tzinfo)
         end_date = self._parse_date_time(end_date, tzinfo=tzinfo)
-        ts = self.generator.random.randint(start_date, end_date)
+        if end_date - start_date <= 1:
+            ts = start_date + self.generator.random.random()
+        else:
+            ts = self.generator.random.randint(start_date, end_date)
         return datetime(1970, 1, 1, tzinfo=tzinfo) + timedelta(seconds=ts)
 
     def date_between(self, start_date='-30y', end_date='today'):
diff --git a/tests/providers/test_date_time.py b/tests/providers/test_date_time.py
index f34250e6..1c81f7c3 100644
--- a/tests/providers/test_date_time.py
+++ b/tests/providers/test_date_time.py
@@ -191,6 +191,10 @@ class TestDateTime(unittest.TestCase):
         self.assertTrue(datetime_start <= random_date)
         self.assertTrue(datetime_end >= random_date)
 
+    def test_past_datetime_within_second(self):
+        # Should not raise a ``ValueError``
+        self.factory.past_datetime(start_date='+1s')
+
     def test_date_between_dates(self):
         date_end = date.today()
         date_start = date_end - timedelta(days=10)
Repository: manimcommunity/manim
Issue: A small Bug in setup.py

In `install_requires` of `setup.py` the library `colour` is mentioned twice. This needed to be changed.

Changed files:
setup.py

diff --git a/setup.py b/setup.py
index 51b82798..4552d4c3 100755
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,6 @@ setup(
         ]
     },
     install_requires=[
-        "colour",
         "argparse",
         "colour",
         "numpy",
Repository: plotly/plotly.py
Issue: add `packaging` to setup.py file?

After installing plotly==5.13.1, `import plotly.io` failed with the below error due to `packaging` not being installed in my python 3.6 env by default:

```
      import plotly.io as pio
    File "/app/.heroku/python/lib/python3.6/site-packages/plotly/__init__.py", line 35, in <module>
      from plotly import (
    File "/app/.heroku/python/lib/python3.6/site-packages/plotly/io/__init__.py", line 12, in <module>
      from ._renderers import renderers, show
    File "/app/.heroku/python/lib/python3.6/site-packages/plotly/io/_renderers.py", line 7, in <module>
      from packaging.version import Version
ModuleNotFoundError: No module named 'packaging'```


Changed files:
packages/python/plotly/setup.py

diff --git a/packages/python/plotly/setup.py b/packages/python/plotly/setup.py
index 1a8f20573..3614cb970 100644
--- a/packages/python/plotly/setup.py
+++ b/packages/python/plotly/setup.py
@@ -556,7 +556,7 @@ setup(
     data_files=[
         ("etc/jupyter/nbconfig/notebook.d", ["jupyterlab-plotly.json"]),
     ],
-    install_requires=["tenacity>=6.2.0"],
+    install_requires=["tenacity>=6.2.0", "packaging"],
     zip_safe=False,
     cmdclass=dict(
         build_py=js_prerelease(versioneer_cmds["build_py"]),
Repository: plotly/plotly.py
Issue: px.defaults too permissive

`px.defaults.whatever = "whatever"` should raise an exception: only the specific keys in the object should be settable.

Changed files:
packages/python/plotly/plotly/tests/test_core/test_px/test_px.py, packages/python/plotly/plotly/express/_core.py

diff --git a/packages/python/plotly/plotly/express/_core.py b/packages/python/plotly/plotly/express/_core.py
index db8f002c2..1f9e2706a 100644
--- a/packages/python/plotly/plotly/express/_core.py
+++ b/packages/python/plotly/plotly/express/_core.py
@@ -16,6 +16,17 @@ from plotly.subplots import (
 
 
 class PxDefaults(object):
+    __slots__ = [
+        "template",
+        "width",
+        "height",
+        "color_discrete_sequence",
+        "color_continuous_scale",
+        "symbol_sequence",
+        "line_dash_sequence",
+        "size_max",
+    ]
+
     def __init__(self):
         self.template = None
         self.width = None
diff --git a/packages/python/plotly/plotly/tests/test_core/test_px/test_px.py b/packages/python/plotly/plotly/tests/test_core/test_px/test_px.py
index 9ace6a7b4..b4880899e 100644
--- a/packages/python/plotly/plotly/tests/test_core/test_px/test_px.py
+++ b/packages/python/plotly/plotly/tests/test_core/test_px/test_px.py
@@ -1,5 +1,6 @@
 import plotly.express as px
 import numpy as np
+import pytest
 
 
 def test_scatter():
@@ -232,3 +233,9 @@ def test_orthogonal_orderings():
     for days in permutations(df["day"].unique()):
         for times in permutations(df["time"].unique()):
             assert_orderings(days, days, times, times)
+
+
+def test_permissive_defaults():
+    msg = "'PxDefaults' object has no attribute 'should_not_work'"
+    with pytest.raises(AttributeError, match=msg):
+        px.defaults.should_not_work = "test"
Repository: rapptz/discord.py
Issue: escape_markdown does not escape masked links

### Summary

Using escape_markdown to remove masked links from content before sending it with a webhook does not escape them as expected.

### Reproduction Steps

Call `utils.escape_markdown` on a piece of text with a masked link:

```python3
>>> import discord
>>>
>>> discord.utils.escape_markdown('[Hello World](https://example.com)')
'[Hello World](https://example.com)'
>>>
```

### Expected Results

I expected the returned text to be `\\[Hello World\\](https://example.com)` or similar.

### Actual Results

The text is unchanged, and will display a masked link in chat.

### Checklist

<!-- Put an x inside [ ] to check it, like so: [x] -->

- [x] I have searched the open issues for duplicates.
- [x] I have shown the entire traceback, if possible.
- [x] I have removed my token from display, if visible.

### System Information

- Python v3.8.1-final
- discord.py v1.4.0-alpha
    - discord.py pkg_resources: v1.4.0a2301+g98515ca
- aiohttp v3.6.2
- system info: Windows 10 10.0.19645


Changed files:
discord/utils.py

diff --git a/discord/utils.py b/discord/utils.py
index e32ee7fd..510096dd 100644
--- a/discord/utils.py
+++ b/discord/utils.py
@@ -440,7 +440,9 @@ def resolve_invite(invite):
 _MARKDOWN_ESCAPE_SUBREGEX = '|'.join(r'\\{0}(?=([\\s\\S]*((?<!\\{0})\\{0})))'.format(c)
                                      for c in ('*', '`', '_', '~', '|'))
 
-_MARKDOWN_ESCAPE_REGEX = re.compile(r'(?P<markdown>%s)' % _MARKDOWN_ESCAPE_SUBREGEX)
+_MARKDOWN_ESCAPE_COMMON = r'^>(?:>>)?\\s|\\[.+\\]\\(.+\\)'
+
+_MARKDOWN_ESCAPE_REGEX = re.compile(r'(?P<markdown>%s|%s)' % (_MARKDOWN_ESCAPE_SUBREGEX, _MARKDOWN_ESCAPE_COMMON))
 
 def escape_markdown(text, *, as_needed=False, ignore_links=True):
     r"""A helper function that escapes Discord's markdown.
@@ -476,7 +478,7 @@ def escape_markdown(text, *, as_needed=False, ignore_links=True):
                 return is_url
             return '\\\\' + groupdict['markdown']
 
-        regex = r'(?P<markdown>[_\\\\~|\\*`]|>(?:>>)?\\s)'
+        regex = r'(?P<markdown>[_\\\\~|\\*`]|%s)' % _MARKDOWN_ESCAPE_COMMON
         if ignore_links:
             regex = '(?:%s|%s)' % (url_regex, regex)
         return re.sub(regex, replacement, text)
Repository: rapptz/discord.py
Issue: Unclosed Client Session... have yet to find this answer

I know this has been asked about before... I've looked and looked and looked. So many people having this issue are simply bad at OOP but I've stripped it down to the bare essentials to see what is causing this issue and I just cannot figure it out. Some more experienced guidance would be HIGHLY appreciated!

File to run: **mybot.py**
```python
import discord
from discord.ext import commands
from discord.ext.commands import Bot
import asyncio

client = commands.Bot(command_prefix="?")

class MyBot():
  def __init__(self, bot):
    bot.load_extension("mycog")
    bot.run(TOKEN, bot=True, reconnect=True)

  @client.event
  async def on_ready():
    print("Bot is listening...")

  @client.event
  async def on_message(message):
    await client.process_commands(message)

if __name__ == "__main__": MyBot(client)
```

File to load: **mycog.py**
```python
from discord.ext import commands
import asyncio

class MyCog:
  def __init__(self, bot):
    self.bot = bot

  @commands.command()
  async def shutdown(self, ctx):
    await self.bot.close()
    return None

def setup(client): client.add_cog(MyCog(client))
```
Bot runs fine, I input command `?shutdown` and while it does shut down I get this error...
```
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001BDA9A55EF0>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x000001BDA9BED1C8>, 181630.39)]']
connector: <aiohttp.connector.TCPConnector object at 0x000001BDA9A55F60>
```
But why? I thought using client.close() or .logout() would properly shut everything down. Is there any way to have everything gracefully exit?

Changed files:
discord/client.py

diff --git a/discord/client.py b/discord/client.py
index 26e22df9..7f9e2c30 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -440,6 +440,7 @@ class Client:
         if self.is_closed():
             return
 
+        await self.http.close()
         self._closed.set()
 
         for voice in self.voice_clients:
@@ -452,8 +453,6 @@ class Client:
         if self.ws is not None and self.ws.open:
             await self.ws.close()
 
-
-        await self.http.close()
         self._ready.clear()
 
     def clear(self):
Repository: rapptz/discord.py
Issue: Using wait=True in webhook.execute raises AttributeError

Title.

Here's the code (using eval command) and traceback in case.
```py
webhook = (await ctx.channel.webhooks())[0]
msg = await webhook.execute("test", wait=True)
```
```
Traceback (most recent call last):
  File "/home/nguuuquaaa/bot/Belphegor/belphegor/admin.py", line 131, in _eval
    await func()
  File "<string>", line 3, in func
  File "/usr/local/lib/python3.6/dist-packages/discord/webhook.py", line 197, in handle_execution_response
    return Message(data=data, state=self, channel=self.webhook.channel)
  File "/usr/local/lib/python3.6/dist-packages/discord/message.py", line 213, in __init__
    self._update(channel, data)
  File "/usr/local/lib/python3.6/dist-packages/discord/message.py", line 278, in _update
    getattr(self, '_handle_%s' % handler)(data[handler])
  File "/usr/local/lib/python3.6/dist-packages/discord/message.py", line 291, in _handle_author
    self.author = self._state.store_user(author)
AttributeError: 'AsyncWebhookAdapter' object has no attribute 'store_user'
```

Changed files:
discord/webhook.py

diff --git a/discord/webhook.py b/discord/webhook.py
index 0dfe6ba6..a4f84632 100644
--- a/discord/webhook.py
+++ b/discord/webhook.py
@@ -100,7 +100,7 @@ class WebhookAdapter:
         """
         raise NotImplementedError()
 
-    def _store_user(self, data):
+    def store_user(self, data):
         # mocks a ConnectionState for appropriate use for Message
         return BaseUser(state=self, data=data)
Repository: microsoft/nni
Issue: Is StackedLSTMCell correct implementation?

For enas, StackedLSTMCell is implemented as below
 https://github.com/microsoft/nni/blob/bf8be1e705cdc0c153d6f38d1a83bd3fe55d7a1e/src/sdk/pynni/nni/nas/pytorch/enas/mutator.py#L23-L28

nn.LSTMCell outputs (hidden state, cell state) but the order of output is changed in the implementation.
As a result, the cell state is used for output of LSTM.

Is this an intention or wrong implementation?

Changed files:
src/sdk/pynni/nni/nas/pytorch/enas/mutator.py

diff --git a/src/sdk/pynni/nni/nas/pytorch/enas/mutator.py b/src/sdk/pynni/nni/nas/pytorch/enas/mutator.py
index 7763622a..7fdba26b 100644
--- a/src/sdk/pynni/nni/nas/pytorch/enas/mutator.py
+++ b/src/sdk/pynni/nni/nas/pytorch/enas/mutator.py
@@ -17,16 +17,16 @@ class StackedLSTMCell(nn.Module):
                                            for _ in range(self.lstm_num_layers)])
 
     def forward(self, inputs, hidden):
-        prev_c, prev_h = hidden
-        next_c, next_h = [], []
+        prev_h, prev_c = hidden
+        next_h, next_c = [], []
         for i, m in enumerate(self.lstm_modules):
-            curr_c, curr_h = m(inputs, (prev_c[i], prev_h[i]))
+            curr_h, curr_c = m(inputs, (prev_h[i], prev_c[i]))
             next_c.append(curr_c)
             next_h.append(curr_h)
             # current implementation only supports batch size equals 1,
             # but the algorithm does not necessarily have this limitation
             inputs = curr_h[-1].view(1, -1)
-        return next_c, next_h
+        return next_h, next_c
 
 
 class EnasMutator(Mutator):
@@ -136,7 +136,7 @@ class EnasMutator(Mutator):
         self.sample_skip_penalty = 0
 
     def _lstm_next_step(self):
-        self._c, self._h = self.lstm(self._inputs, (self._c, self._h))
+        self._h, self._c = self.lstm(self._inputs, (self._h, self._c))
 
     def _mark_anchor(self, key):
         self._anchors_hid[key] = self._h[-1]