prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Support ruby2.7 runtime
  AWS supports the following Ruby runtimes:
  
  <!--StartFragment-->
  Name | Identifier | SDK for Ruby | Operating system
  -- | -- | -- | --
  Ruby 2.7 | ruby2.7 | 3.0.1 | Amazon Linux 2
  Ruby 2.5 | ruby2.5 | 3.0.1 | Amazon Linux
  
  <!--EndFragment-->
  
  Currently, `localstack/lambda` only contains the `ruby2.5` tag. Will the 2.7 runtime be supported in the (near) future?
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `localstack/services/awslambda/lambda_utils.py`
  Content:
  ```
  1 import os
  2 from collections import defaultdict
  3 from localstack.utils.common import to_str
  4 
  5 # Lambda runtime constants
  6 LAMBDA_RUNTIME_PYTHON27 = 'python2.7'
  7 LAMBDA_RUNTIME_PYTHON36 = 'python3.6'
  8 LAMBDA_RUNTIME_PYTHON37 = 'python3.7'
  9 LAMBDA_RUNTIME_PYTHON38 = 'python3.8'
  10 LAMBDA_RUNTIME_NODEJS = 'nodejs'
  11 LAMBDA_RUNTIME_NODEJS43 = 'nodejs4.3'
  12 LAMBDA_RUNTIME_NODEJS610 = 'nodejs6.10'
  13 LAMBDA_RUNTIME_NODEJS810 = 'nodejs8.10'
  14 LAMBDA_RUNTIME_NODEJS10X = 'nodejs10.x'
  15 LAMBDA_RUNTIME_NODEJS12X = 'nodejs12.x'
  16 LAMBDA_RUNTIME_NODEJS14X = 'nodejs14.x'
  17 LAMBDA_RUNTIME_JAVA8 = 'java8'
  18 LAMBDA_RUNTIME_JAVA11 = 'java11'
  19 LAMBDA_RUNTIME_DOTNETCORE2 = 'dotnetcore2.0'
  20 LAMBDA_RUNTIME_DOTNETCORE21 = 'dotnetcore2.1'
  21 LAMBDA_RUNTIME_DOTNETCORE31 = 'dotnetcore3.1'
  22 LAMBDA_RUNTIME_GOLANG = 'go1.x'
  23 LAMBDA_RUNTIME_RUBY = 'ruby'
  24 LAMBDA_RUNTIME_RUBY25 = 'ruby2.5'
  25 LAMBDA_RUNTIME_PROVIDED = 'provided'
  26 
  27 # default handler and runtime
  28 LAMBDA_DEFAULT_HANDLER = 'handler.handler'
  29 LAMBDA_DEFAULT_RUNTIME = 'python3.8'
  30 LAMBDA_DEFAULT_STARTING_POSITION = 'LATEST'
  31 
  32 # List of Dotnet Lambda runtime names
  33 DOTNET_LAMBDA_RUNTIMES = [LAMBDA_RUNTIME_DOTNETCORE2, LAMBDA_RUNTIME_DOTNETCORE21, LAMBDA_RUNTIME_DOTNETCORE31]
  34 
  35 
  36 def multi_value_dict_for_list(elements):
  37     temp_mv_dict = defaultdict(list)
  38     for key in elements:
  39         if isinstance(key, (list, tuple)):
  40             key, value = key
  41         else:
  42             value = elements[key]
  43         key = to_str(key)
  44         temp_mv_dict[key].append(value)
  45 
  46     return dict((k, tuple(v)) for k, v in temp_mv_dict.items())
  47 
  48 
  49 def get_handler_file_from_name(handler_name, runtime=LAMBDA_DEFAULT_RUNTIME):
  50     if runtime.startswith(LAMBDA_RUNTIME_PROVIDED):
  51         return 'bootstrap'
  52     delimiter = '.'
  53     if runtime.startswith(LAMBDA_RUNTIME_NODEJS):
  54         file_ext = '.js'
  55     elif runtime.startswith(LAMBDA_RUNTIME_GOLANG):
  56         file_ext = ''
  57     elif runtime.startswith(tuple(DOTNET_LAMBDA_RUNTIMES)):
  58         file_ext = '.dll'
  59         delimiter = ':'
  60     elif runtime.startswith(LAMBDA_RUNTIME_RUBY):
  61         file_ext = '.rb'
  62     else:
  63         handler_name = handler_name.rpartition(delimiter)[0].replace(delimiter, os.path.sep)
  64         file_ext = '.py'
  65     return '%s%s' % (handler_name.split(delimiter)[0], file_ext)
  66
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/localstack/services/awslambda/lambda_utils.py b/localstack/services/awslambda/lambda_utils.py
  --- a/localstack/services/awslambda/lambda_utils.py
  +++ b/localstack/services/awslambda/lambda_utils.py
  @@ -22,6 +22,7 @@
   LAMBDA_RUNTIME_GOLANG = 'go1.x'
   LAMBDA_RUNTIME_RUBY = 'ruby'
   LAMBDA_RUNTIME_RUBY25 = 'ruby2.5'
  +LAMBDA_RUNTIME_RUBY27 = 'ruby2.7'
   LAMBDA_RUNTIME_PROVIDED = 'provided'
   
   # default handler and runtime
  
verification_info: {"golden_diff": "diff --git a/localstack/services/awslambda/lambda_utils.py b/localstack/services/awslambda/lambda_utils.py\n--- a/localstack/services/awslambda/lambda_utils.py\n+++ b/localstack/services/awslambda/lambda_utils.py\n@@ -22,6 +22,7 @@\n LAMBDA_RUNTIME_GOLANG = 'go1.x'\n LAMBDA_RUNTIME_RUBY = 'ruby'\n LAMBDA_RUNTIME_RUBY25 = 'ruby2.5'\n+LAMBDA_RUNTIME_RUBY27 = 'ruby2.7'\n LAMBDA_RUNTIME_PROVIDED = 'provided'\n \n # default handler and runtime\n", "issue": "Support ruby2.7 runtime\nAWS supports the following Ruby runtimes:\r\n\r\n<!--StartFragment-->\r\nName | Identifier | SDK for Ruby | Operating system\r\n-- | -- | -- | --\r\nRuby 2.7 | ruby2.7 | 3.0.1 | Amazon Linux 2\r\nRuby 2.5 | ruby2.5 | 3.0.1 | Amazon Linux\r\n\r\n<!--EndFragment-->\r\n\r\nCurrently, `localstack/lambda` only contains the `ruby2.5` tag. Will the 2.7 runtime be supported in the (near) future?\n", "before_files": [{"content": "import os\nfrom collections import defaultdict\nfrom localstack.utils.common import to_str\n\n# Lambda runtime constants\nLAMBDA_RUNTIME_PYTHON27 = 'python2.7'\nLAMBDA_RUNTIME_PYTHON36 = 'python3.6'\nLAMBDA_RUNTIME_PYTHON37 = 'python3.7'\nLAMBDA_RUNTIME_PYTHON38 = 'python3.8'\nLAMBDA_RUNTIME_NODEJS = 'nodejs'\nLAMBDA_RUNTIME_NODEJS43 = 'nodejs4.3'\nLAMBDA_RUNTIME_NODEJS610 = 'nodejs6.10'\nLAMBDA_RUNTIME_NODEJS810 = 'nodejs8.10'\nLAMBDA_RUNTIME_NODEJS10X = 'nodejs10.x'\nLAMBDA_RUNTIME_NODEJS12X = 'nodejs12.x'\nLAMBDA_RUNTIME_NODEJS14X = 'nodejs14.x'\nLAMBDA_RUNTIME_JAVA8 = 'java8'\nLAMBDA_RUNTIME_JAVA11 = 'java11'\nLAMBDA_RUNTIME_DOTNETCORE2 = 'dotnetcore2.0'\nLAMBDA_RUNTIME_DOTNETCORE21 = 'dotnetcore2.1'\nLAMBDA_RUNTIME_DOTNETCORE31 = 'dotnetcore3.1'\nLAMBDA_RUNTIME_GOLANG = 'go1.x'\nLAMBDA_RUNTIME_RUBY = 'ruby'\nLAMBDA_RUNTIME_RUBY25 = 'ruby2.5'\nLAMBDA_RUNTIME_PROVIDED = 'provided'\n\n# default handler and runtime\nLAMBDA_DEFAULT_HANDLER = 'handler.handler'\nLAMBDA_DEFAULT_RUNTIME = 'python3.8'\nLAMBDA_DEFAULT_STARTING_POSITION = 'LATEST'\n\n# List of Dotnet Lambda runtime names\nDOTNET_LAMBDA_RUNTIMES = [LAMBDA_RUNTIME_DOTNETCORE2, LAMBDA_RUNTIME_DOTNETCORE21, LAMBDA_RUNTIME_DOTNETCORE31]\n\n\ndef multi_value_dict_for_list(elements):\n    temp_mv_dict = defaultdict(list)\n    for key in elements:\n        if isinstance(key, (list, tuple)):\n            key, value = key\n        else:\n            value = elements[key]\n        key = to_str(key)\n        temp_mv_dict[key].append(value)\n\n    return dict((k, tuple(v)) for k, v in temp_mv_dict.items())\n\n\ndef get_handler_file_from_name(handler_name, runtime=LAMBDA_DEFAULT_RUNTIME):\n    if runtime.startswith(LAMBDA_RUNTIME_PROVIDED):\n        return 'bootstrap'\n    delimiter = '.'\n    if runtime.startswith(LAMBDA_RUNTIME_NODEJS):\n        file_ext = '.js'\n    elif runtime.startswith(LAMBDA_RUNTIME_GOLANG):\n        file_ext = ''\n    elif runtime.startswith(tuple(DOTNET_LAMBDA_RUNTIMES)):\n        file_ext = '.dll'\n        delimiter = ':'\n    elif runtime.startswith(LAMBDA_RUNTIME_RUBY):\n        file_ext = '.rb'\n    else:\n        handler_name = handler_name.rpartition(delimiter)[0].replace(delimiter, os.path.sep)\n        file_ext = '.py'\n    return '%s%s' % (handler_name.split(delimiter)[0], file_ext)\n", "path": "localstack/services/awslambda/lambda_utils.py"}], "after_files": [{"content": "import os\nfrom collections import defaultdict\nfrom localstack.utils.common import to_str\n\n# Lambda runtime constants\nLAMBDA_RUNTIME_PYTHON27 = 'python2.7'\nLAMBDA_RUNTIME_PYTHON36 = 'python3.6'\nLAMBDA_RUNTIME_PYTHON37 = 'python3.7'\nLAMBDA_RUNTIME_PYTHON38 = 'python3.8'\nLAMBDA_RUNTIME_NODEJS = 'nodejs'\nLAMBDA_RUNTIME_NODEJS43 = 'nodejs4.3'\nLAMBDA_RUNTIME_NODEJS610 = 'nodejs6.10'\nLAMBDA_RUNTIME_NODEJS810 = 'nodejs8.10'\nLAMBDA_RUNTIME_NODEJS10X = 'nodejs10.x'\nLAMBDA_RUNTIME_NODEJS12X = 'nodejs12.x'\nLAMBDA_RUNTIME_NODEJS14X = 'nodejs14.x'\nLAMBDA_RUNTIME_JAVA8 = 'java8'\nLAMBDA_RUNTIME_JAVA11 = 'java11'\nLAMBDA_RUNTIME_DOTNETCORE2 = 'dotnetcore2.0'\nLAMBDA_RUNTIME_DOTNETCORE21 = 'dotnetcore2.1'\nLAMBDA_RUNTIME_DOTNETCORE31 = 'dotnetcore3.1'\nLAMBDA_RUNTIME_GOLANG = 'go1.x'\nLAMBDA_RUNTIME_RUBY = 'ruby'\nLAMBDA_RUNTIME_RUBY25 = 'ruby2.5'\nLAMBDA_RUNTIME_RUBY27 = 'ruby2.7'\nLAMBDA_RUNTIME_PROVIDED = 'provided'\n\n# default handler and runtime\nLAMBDA_DEFAULT_HANDLER = 'handler.handler'\nLAMBDA_DEFAULT_RUNTIME = 'python3.8'\nLAMBDA_DEFAULT_STARTING_POSITION = 'LATEST'\n\n# List of Dotnet Lambda runtime names\nDOTNET_LAMBDA_RUNTIMES = [LAMBDA_RUNTIME_DOTNETCORE2, LAMBDA_RUNTIME_DOTNETCORE21, LAMBDA_RUNTIME_DOTNETCORE31]\n\n\ndef multi_value_dict_for_list(elements):\n    temp_mv_dict = defaultdict(list)\n    for key in elements:\n        if isinstance(key, (list, tuple)):\n            key, value = key\n        else:\n            value = elements[key]\n        key = to_str(key)\n        temp_mv_dict[key].append(value)\n\n    return dict((k, tuple(v)) for k, v in temp_mv_dict.items())\n\n\ndef get_handler_file_from_name(handler_name, runtime=LAMBDA_DEFAULT_RUNTIME):\n    if runtime.startswith(LAMBDA_RUNTIME_PROVIDED):\n        return 'bootstrap'\n    delimiter = '.'\n    if runtime.startswith(LAMBDA_RUNTIME_NODEJS):\n        file_ext = '.js'\n    elif runtime.startswith(LAMBDA_RUNTIME_GOLANG):\n        file_ext = ''\n    elif runtime.startswith(tuple(DOTNET_LAMBDA_RUNTIMES)):\n        file_ext = '.dll'\n        delimiter = ':'\n    elif runtime.startswith(LAMBDA_RUNTIME_RUBY):\n        file_ext = '.rb'\n    else:\n        handler_name = handler_name.rpartition(delimiter)[0].replace(delimiter, os.path.sep)\n        file_ext = '.py'\n    return '%s%s' % (handler_name.split(delimiter)[0], file_ext)\n", "path": "localstack/services/awslambda/lambda_utils.py"}]}