internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: localstack/localstack

Issue:
bug: KMS_PROVIDER=local-kms not honored
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

When updating from 0.14.1 to 0.14.2 it appears that the `KMS_PROVIDER` environment variable is no longer honored, and `local-kms` is not used.

### Expected Behavior

Setting `KMS_PROVIDER=local-kms` and using the KMS service should launch `local-kms` as it did previously.

### How are you starting LocalStack?

With a `docker run` command

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

    docker run -e KMS_PROVIDER=local-kms localstack/localstack:0.14.1

    docker run -e KMS_PROVIDER=local-kms localstack/localstack:0.14.2

#### Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

##### 0.14.1

    awslocal kms list-keys
    # {
    #     "Keys": []
    # }

    ps x|grep kms
    #   164 ?        Ss     0:00 /bin/sh -c /opt/code/localstack/localstack/infra/kms/local-kms.linux-arm64.bin
    #   165 ?        Sl     0:00 /opt/code/localstack/localstack/infra/kms/local-kms.linux-arm64.bin
    #   179 pts/0    S+     0:00 grep kms

##### 0.14.2

    awslocal kms list-keys
    # {
    #     "Keys": []
    # }

    ps x|grep kms
    #   151 pts/0    S+     0:00 grep kms


### Environment

```markdown
- OS: macOS 12.3
- LocalStack: 0.14.2
- Docker: 20.10.13, build a224086
```


### Anything else?

_No response_


Discussion:

Resolving patch:
diff --git a/localstack/services/providers.py b/localstack/services/providers.py
--- a/localstack/services/providers.py
+++ b/localstack/services/providers.py
@@ -140,7 +140,7 @@ def kinesis():
 
 @aws_provider()
 def kms():
-    if config.KMS_PROVIDER == "kms-local":
+    if config.KMS_PROVIDER == "local-kms":
         from localstack.services.kms import kms_starter
 
         return Service("kms", start=kms_starter.start_kms_local)


Test patch:
Repository: localstack/localstack

Issue:
DYNAMODB_SHARE_DB is not passed to container when LocalStack started with CLI
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

The documentation states that when setting DYNAMODB_SHARE_DB=1 DynamodDB will use a single database for each credential and region. This doesn't work when LocalStack is started from CLI. For example:

`DYNAMODB_SHARE_DB=1 localstack start -d`

In Docker logs you can find:
INFO:localstack.services.dynamodb.server: SharedDb:     false

At least it seems that the environment variable is missing from CONFIG_ENV_VARS which is used for passing the environment variables to container.

Tried the following fix and at least after brief testing it solves the issue:
https://github.com/jvuori/localstack/commit/6bb4a3c68c8675b9548e0f5eb8028397d9ee5a47
Feel free to pull if the fix is appropriate. (Sorry, no unit test...)

### Expected Behavior

`DYNAMODB_SHARE_DB=1 localstack start -d`
should start DynamoDB with:

INFO:localstack.services.dynamodb.server: SharedDb:     true

### How are you starting LocalStack?

With the `localstack` script

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

DYNAMODB_SHARE_DB=1 localstack start -d


### Environment

```markdown
- OS: Windows + WSL2 + Docker CE running inside WSL2
- LocalStack: 0.14.1
```


### Anything else?

_No response_


Discussion:
Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our [Slack Community](https://localstack.cloud/contact/) for real-time help and drop a message to LocalStack Pro Support if you are a Pro user! If you are willing to contribute towards fixing this issue, please have a look at our [contributing guidelines](https://github.com/localstack/.github/blob/main/CONTRIBUTING.md) and our [developer guide](https://docs.localstack.cloud/developer-guide/).

Resolving patch:
diff --git a/localstack/config.py b/localstack/config.py
--- a/localstack/config.py
+++ b/localstack/config.py
@@ -489,6 +489,9 @@ def in_docker():
 # JAVA EE heap size for dynamodb
 DYNAMODB_HEAP_SIZE = os.environ.get("DYNAMODB_HEAP_SIZE", "").strip() or "256m"
 
+# single DB instance across multiple credentials are regions
+DYNAMODB_SHARE_DB = int(os.environ.get("DYNAMODB_SHARE_DB") or 0)
+
 # expose SQS on a specific port externally
 SQS_PORT_EXTERNAL = int(os.environ.get("SQS_PORT_EXTERNAL") or 0)
 
@@ -612,6 +615,7 @@ def in_docker():
     "DOCKER_BRIDGE_IP",
     "DYNAMODB_ERROR_PROBABILITY",
     "DYNAMODB_HEAP_SIZE",
+    "DYNAMODB_SHARE_DB",
     "DYNAMODB_READ_ERROR_PROBABILITY",
     "DYNAMODB_WRITE_ERROR_PROBABILITY",
     "EAGER_SERVICE_LOADING",


Test patch:
Repository: localstack/localstack

Issue:
After Install: ImportError: cannot import name 'Literal' from 'typing'
I followed the instructions for installing localstack running the following command:
`python3 -m pip install localstack`

Then, I ran localstack:
`python3 -m localstack.cli.main`

Which throws the following error:
`ImportError: cannot import name 'Literal' from 'typing' (/usr/lib64/python3.7/typing.py)`


Discussion:
Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our [Slack Community](https://localstack.cloud/contact/) for real-time help and drop a message to LocalStack Pro Support if you are a Pro user! If you are willing to contribute towards fixing this issue, please have a look at our [contributing guidelines](https://github.com/localstack/.github/blob/main/CONTRIBUTING.md) and our [developer guide](https://docs.localstack.cloud/developer-guide/).

Resolving patch:
diff --git a/localstack/config.py b/localstack/config.py
--- a/localstack/config.py
+++ b/localstack/config.py
@@ -6,7 +6,7 @@
 import subprocess
 import tempfile
 import time
-from typing import Any, Dict, List, Literal, Mapping, Tuple
+from typing import Any, Dict, List, Mapping, Tuple
 
 from localstack.constants import (
     AWS_REGION_US_EAST_1,
@@ -509,9 +509,7 @@ def in_docker():
 SQS_PORT_EXTERNAL = int(os.environ.get("SQS_PORT_EXTERNAL") or 0)
 
 # Strategy used when creating SQS queue urls. can be "off", "domain", or "path"
-SQS_ENDPOINT_STRATEGY: Literal["off", "domain", "path"] = (
-    os.environ.get("SQS_ENDPOINT_STRATEGY", "") or "off"
-)
+SQS_ENDPOINT_STRATEGY = os.environ.get("SQS_ENDPOINT_STRATEGY", "") or "off"
 
 # host under which the LocalStack services are available from Lambda Docker containers
 HOSTNAME_FROM_LAMBDA = os.environ.get("HOSTNAME_FROM_LAMBDA", "").strip()


Test patch:
Repository: localstack/localstack

Issue:
New localstack is not comaptible with python < 3.10
https://github.com/localstack/localstack/blob/e7efc768a20e75feafe3702a5a6e477a233feff2/localstack/utils/aws/aws_stack.py#L904

```
File "/usr/local/lib/python3.8/site-packages/localstack/services/generic_proxy.py", line 50, in <module>
from localstack.utils.aws import aws_stack
File "/usr/local/lib/python3.8/site-packages/localstack/utils/aws/aws_stack.py", line 904, in <module>
) -> dict[str, str]:
TypeError: 'type' object is not subscriptable
```

Please fix to `Dict[str, str]`


Discussion:

Resolving patch:
diff --git a/localstack/utils/aws/aws_stack.py b/localstack/utils/aws/aws_stack.py
--- a/localstack/utils/aws/aws_stack.py
+++ b/localstack/utils/aws/aws_stack.py
@@ -901,7 +901,7 @@ def kinesis_stream_name(kinesis_arn):
 
 def mock_aws_request_headers(
     service="dynamodb", region_name=None, access_key=None, internal=False
-) -> dict[str, str]:
+) -> Dict[str, str]:
     ctype = APPLICATION_AMZ_JSON_1_0
     if service == "kinesis":
         ctype = APPLICATION_AMZ_JSON_1_1


Test patch:
Repository: localstack/localstack

Issue:
feature request: LocalStack CLI Update, flag all, should ignore dangling images
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Feature description

Command `localstack update all` should ignore the dangling `localstack/localstack:<none>` images in the `docker images` list. 
I.e, images with tag `<none>`.

![image](https://user-images.githubusercontent.com/97876429/201023229-d9e9548f-8de0-4c25-a28e-bbf6eabf557b.png)


### 🧑‍💻 Implementation

_No response_

### Anything else?

_No response_


Discussion:

Resolving patch:
diff --git a/localstack/cli/localstack.py b/localstack/cli/localstack.py
--- a/localstack/cli/localstack.py
+++ b/localstack/cli/localstack.py
@@ -359,7 +359,12 @@ def cmd_update_docker_images():
     console.rule("Updating docker images")
 
     all_images = DOCKER_CLIENT.get_docker_image_names(strip_latest=False)
-    image_prefixes = ["localstack/", "lambci/lambda:", "mlupin/docker-lambda:"]
+    image_prefixes = [
+        "localstack/",
+        "lambci/lambda:",
+        "mlupin/docker-lambda:",
+        "public.ecr.aws/lambda",
+    ]
     localstack_images = [
         image
         for image in all_images
@@ -367,6 +372,7 @@ def cmd_update_docker_images():
             image.startswith(image_prefix) or image.startswith(f"docker.io/{image_prefix}")
             for image_prefix in image_prefixes
         )
+        and not image.endswith(":<none>")  # ignore dangling images
     ]
     update_images(localstack_images)
 


Test patch:
Repository: localstack/localstack

Issue:
bug: LAMBDA_KEEPALIVE_MS is not set in LocalStack container
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

There appears to be an issue with this variable `export LAMBDA_KEEPALIVE_MS=1337`.
It's not picked up when you start `localstack start -d`

```shell
$ export LAMBDA_KEEPALIVE_MS=1000
$ env | grep LAMBDA_KEEPALIVE_MS
LAMBDA_KEEPALIVE_MS=1000
$ localstack start -d
$ docker inspect localstack_main -f '{{json .Config.Env}}' | grep LAMBDA_KEEPALIVE_MS
```

### Expected Behavior

It should be set in the container environment.

### How are you starting LocalStack?

With the `localstack` script

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

    docker run localstack/localstack

#### Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

    awslocal s3 mb s3://mybucket


### Environment

```markdown
- OS: Windows (WSL)
- LocalStack: 2.2.1.dev20230731233910
```


### Anything else?

_No response_


Discussion:

Resolving patch:
diff --git a/localstack/config.py b/localstack/config.py
--- a/localstack/config.py
+++ b/localstack/config.py
@@ -1113,6 +1113,7 @@ def get_gateway_listen(gateway_listen: str) -> List[HostAndPort]:
     "LAMBDA_INIT_POST_INVOKE_WAIT",
     "LAMBDA_INIT_USER",
     "LAMBDA_INIT_RELEASE_VERSION",
+    "LAMBDA_KEEPALIVE_MS",
     "LAMBDA_RUNTIME_IMAGE_MAPPING",
     "LAMBDA_JAVA_OPTS",
     "LAMBDA_REMOTE_DOCKER",


Test patch:
Repository: localstack/localstack

Issue:
bug: S3 multipart upload erroneously rejects part number 10000
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

When performing a multipart upload, sending part number 10000, because [this check](https://github.com/localstack/localstack/blob/d23f0717cc66c0cc8a61b6b85e7531a6f4a03f96/localstack/services/s3/provider.py#L792C88-L792C88) in s3/provider.py is wrong.

### Expected Behavior

Part number 10000 is accepted

### How are you starting LocalStack?

With a docker-compose file

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

    docker run localstack/localstack

#### Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

I'm using AWS .NET SDK:

        using var inputStream = new MemoryStream(buffer, 0, readBytes, false);

        var uploadRequest = new UploadPartRequest
        {
            BucketName = bucketName,
            InputStream = inputStream,
            Key = key,
            PartNumber = partNumber,
            PartSize = readBytes,
            UploadId = uploadId,
        };

        await _client.UploadPartAsync(uploadRequest);


### Environment

```markdown
- OS: Ubuntu 22.04
- LocalStack: 2.2
```


### Anything else?

As referenced above, the bug is in [this line](https://github.com/localstack/localstack/blob/d23f0717cc66c0cc8a61b6b85e7531a6f4a03f96/localstack/services/s3/provider.py#L792C88-L792C88). It should read

    elif (part_number := request.get("PartNumber", 0)) < 1 or part_number > 10000:


Discussion:
Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our [Slack Community](https://localstack.cloud/contact/) for real-time help and drop a message to LocalStack Pro Support if you are a Pro user! If you are willing to contribute towards fixing this issue, please have a look at our [contributing guidelines](https://github.com/localstack/.github/blob/main/CONTRIBUTING.md) and our [contributing guide](https://docs.localstack.cloud/contributing/).

Resolving patch:
diff --git a/localstack/services/s3/provider.py b/localstack/services/s3/provider.py
--- a/localstack/services/s3/provider.py
+++ b/localstack/services/s3/provider.py
@@ -789,7 +789,7 @@ def upload_part(self, context: RequestContext, request: UploadPartRequest) -> Up
                 "The specified upload does not exist. The upload ID may be invalid, or the upload may have been aborted or completed.",
                 UploadId=upload_id,
             )
-        elif (part_number := request.get("PartNumber", 0)) < 1 or part_number >= 10000:
+        elif (part_number := request.get("PartNumber", 0)) < 1 or part_number > 10000:
             raise InvalidArgument(
                 "Part number must be an integer between 1 and 10000, inclusive",
                 ArgumentName="partNumber",


Test patch:
Repository: dmlc/dgl

Issue:
Fixing random seeds does not yield deterministic results
- [Related discussion thread](https://discuss.dgl.ai/t/how-to-fix-random-seeds-in-dgl-in-training/65/3)

It has been observed by Erutan-pku, @hbsun2113 , me and @yzh119 that after fixing NumPy random seed, PyTorch random seed and `cudnn.deterministic=True` we still get different results across runs. There can be two possibilities:
1. This is a bug.
2. Some system optimization involves randomness, in which case we should provide APIs for users to fix results.


Discussion:
In the case of SGC, the function `python/dgl/data/citation_graph.py:_encode_onehot` does *not* necessarily return the same output from the same input, since it is `enumerat`ing a `set`.

Changing from `classes = set(labels)` to `classes = list(sorted(set(labels)))` solves the problem.

Resolving patch:
diff --git a/python/dgl/data/citation_graph.py b/python/dgl/data/citation_graph.py
--- a/python/dgl/data/citation_graph.py
+++ b/python/dgl/data/citation_graph.py
@@ -389,7 +389,7 @@ def _normalize(mx):
     return mx
 
 def _encode_onehot(labels):
-    classes = set(labels)
+    classes = list(sorted(set(labels)))
     classes_dict = {c: np.identity(len(classes))[i, :] for i, c in
                     enumerate(classes)}
     labels_onehot = np.array(list(map(classes_dict.get, labels)),


Test patch:
Repository: dmlc/dgl

Issue:
Data missing for JTNN
## ❓ Questions and Help

   Hello,I come across the problem that the website you put your jtnn.zip is missing.Can you offer me a new website?
  thanks!



Discussion:

Resolving patch:
diff --git a/examples/pytorch/jtnn/jtnn/datautils.py b/examples/pytorch/jtnn/jtnn/datautils.py
--- a/examples/pytorch/jtnn/jtnn/datautils.py
+++ b/examples/pytorch/jtnn/jtnn/datautils.py
@@ -12,7 +12,7 @@
 from .jtmpn import ATOM_FDIM as ATOM_FDIM_DEC
 from .jtmpn import BOND_FDIM as BOND_FDIM_DEC
 
-_url = 'https://www.dropbox.com/s/4ypr0e0abcbsvoh/jtnn.zip?dl=1'
+_url = 'https://s3-ap-southeast-1.amazonaws.com/dgl-data-cn/dataset/jtnn.zip'
 
 def _unpack_field(examples, field):
     return [e[field] for e in examples]


Test patch:
Repository: dmlc/dgl

Issue:
[Bug] dgl.to_homo fails on given example in pytorch 1.3.1
## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->

## To Reproduce

Simply run the `to_homo` example 

```
import dgl 

follows_g = dgl.graph([(0, 1), (1, 2)], 'user', 'follows')
devs_g = dgl.bipartite([(0, 0), (1, 1)], 'developer', 'develops', 'game')
hetero_g = dgl.hetero_from_relations([follows_g, devs_g])
homo_g = dgl.to_homo(hetero_g)
```

and it fails with 

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dmodesitt/Dev/playground/virt/venv/lib/python3.7/site-packages/dgl/convert.py", line 598, in to_homo
    retg = graph((F.cat(srcs, 0), F.cat(dsts, 0)), card=total_num_nodes)
  File "/Users/dmodesitt/Dev/playground/virt/venv/lib/python3.7/site-packages/dgl/convert.py", line 111, in graph
    return create_from_edges(u, v, ntype, etype, ntype, urange, vrange)
  File "/Users/dmodesitt/Dev/playground/virt/venv/lib/python3.7/site-packages/dgl/convert.py", line 646, in create_from_edges
    u = utils.toindex(u)
  File "/Users/dmodesitt/Dev/playground/virt/venv/lib/python3.7/site-packages/dgl/utils.py", line 242, in toindex
    return data if isinstance(data, Index) else Index(data)
  File "/Users/dmodesitt/Dev/playground/virt/venv/lib/python3.7/site-packages/dgl/utils.py", line 15, in __init__
    self._initialize_data(data)
  File "/Users/dmodesitt/Dev/playground/virt/venv/lib/python3.7/site-packages/dgl/utils.py", line 22, in _initialize_data
    self._dispatch(data)
  File "/Users/dmodesitt/Dev/playground/virt/venv/lib/python3.7/site-packages/dgl/utils.py", line 47, in _dispatch
    raise DGLError('Index data must be an int64 vector, but got: %s' % str(data))
dgl._ffi.base.DGLError: Index data must be an int64 vector, but got: tensor([0., 1., 3., 4.])
```

## Expected Behavior 

This is not expected to crash it is a given [example](https://docs.dgl.ai/generated/dgl.to_homo.html#dgl.to_homo)

## Environment

 - DGL Version (e.g., 1.0):
      dgl==0.4.1
 - Backend Library & Version (e.g., PyTorch 0.4.1, MXNet/Gluon 1.3):
      pytorch==1.3.1
 - OS (e.g., Linux):
     macos
 - How you installed DGL (`conda`, `pip`, source):
     pip
 - Python version: 3.7.4




Discussion:
Verified the report. This seems to be related to the latest PyTorch version as our CI tests with PyTorch 1.1 can be successfully passed.

Resolving patch:
diff --git a/python/dgl/convert.py b/python/dgl/convert.py
--- a/python/dgl/convert.py
+++ b/python/dgl/convert.py
@@ -590,8 +590,8 @@ def to_homo(G):
         srctype, _, dsttype = etype
         src, dst = G.all_edges(etype=etype, order='eid')
         num_edges = len(src)
-        srcs.append(src + offset_per_ntype[G.get_ntype_id(srctype)])
-        dsts.append(dst + offset_per_ntype[G.get_ntype_id(dsttype)])
+        srcs.append(src + int(offset_per_ntype[G.get_ntype_id(srctype)]))
+        dsts.append(dst + int(offset_per_ntype[G.get_ntype_id(dsttype)]))
         etype_ids.append(F.full_1d(num_edges, etype_id, F.int64, F.cpu()))
         eids.append(F.arange(0, num_edges))
 


Test patch:
Repository: dmlc/dgl

Issue:
AmazonCoBuy dataset typo in API document
## 📚 Documentation

In API reference of `dgl.data.AmazonCoBuy` at https://docs.dgl.ai/en/latest/api/python/data.html#dgl.data.AmazonCoBuy,  parameter `name` has to be ‘computer’ or ‘photo’. However, it should be ‘computer**s**’ or ‘photo’ according to the code:

https://github.com/dmlc/dgl/blob/fa0ee46a0146d21f46427fd9288dfe18074d6109/python/dgl/data/gnn_benckmark.py#L107-L125




Discussion:

Resolving patch:
diff --git a/python/dgl/data/gnn_benckmark.py b/python/dgl/data/gnn_benckmark.py
--- a/python/dgl/data/gnn_benckmark.py
+++ b/python/dgl/data/gnn_benckmark.py
@@ -30,7 +30,7 @@ def __init__(self, name):
 
     @staticmethod
     def load_npz(file_name):
-        with np.load(file_name) as loader:
+        with np.load(file_name, allow_pickle=True) as loader:
             loader = dict(loader)
             num_nodes = loader['adj_shape'][0]
             adj_matrix = sp.csr_matrix((loader['adj_data'], loader['adj_indices'], loader['adj_indptr']),
@@ -116,7 +116,7 @@ class AmazonCoBuy(GNNBenchmarkDataset):
     Parameters
     ---------------
     name: str
-      Name of the dataset, has to be 'computer' or 'photo'
+      Name of the dataset, has to be 'computers' or 'photo'
 
     """
     _url = {


Test patch:
Repository: dmlc/dgl

Issue:
build_graph in MovieLens class 
## ❓ Questions and Help

Dear Quan (Andy) Gan,

i have a question about the method build_graph in the MovieLens class.
I see that the dataset is processed and you consider all the User and Movie features in generating the node features of the graph. In particular, you assign id of the node with this scheme: 

from [  0 : Length(Users)  ]  ->  Features of User (encoded) 
from [ Length(Users) : Length(Users)  + Length(Movies) ] -> Features of Movies (encoded) 

The problem comes out when you consider the Title of the movies because in the code there is the following (line 158): 

        for i, tw in enumerate(tqdm.tqdm(title_words)):
            g.ndata['title'][i, [vocab_invmap[w] for w in tw]] = 1

which would mean that the encoded title would be assigned to the nodes related to the Users
[0 : Len(Movies)]
Maybe i didn't understand the logic behind this, is this correct ? or am i missing something? 

Thank you,
Best regards
Francesco








Discussion:
You're absolutely right 🤦‍♂ 

Resolving patch:
diff --git a/examples/pytorch/recommendation/rec/datasets/movielens.py b/examples/pytorch/recommendation/rec/datasets/movielens.py
--- a/examples/pytorch/recommendation/rec/datasets/movielens.py
+++ b/examples/pytorch/recommendation/rec/datasets/movielens.py
@@ -155,7 +155,7 @@ def build_graph(self):
         # bag-of-words
         g.ndata['title'] = torch.zeros(g.number_of_nodes(), len(vocab))
         for i, tw in enumerate(tqdm.tqdm(title_words)):
-            g.ndata['title'][i, [vocab_invmap[w] for w in tw]] = 1
+            g.ndata['title'][len(user_ids) + i, [vocab_invmap[w] for w in tw]] = 1
         self.vocab = vocab
         self.vocab_invmap = vocab_invmap
 


Test patch: