We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Support for ipv6 address format
**Describe the bug**: 

Exception is thrown when python agent is trying to parse url, that contains ipv6 address.
```
ValueError: too many values to unpack (expected 2)
  File "elasticapm/contrib/django/middleware/__init__.py", line 162, in process_response
    "request",
  File "elasticapm/traces.py", line 333, in set_context
    data = data()
  File "elasticapm/contrib/django/middleware/__init__.py", line 160, in <lambda>
    request, capture_body=self.client.config.capture_body in ("all", "transactions")
  File "elasticapm/contrib/django/client.py", line 137, in get_data_from_request
    result["url"] = get_url_dict(url)
  File "elasticapm/utils/__init__.py", line 84, in get_url_dict
    hostname, port = netloc.split(":")
```

**To Reproduce**

Not sure how can I manually replicate it, but below is the request details that is send to our webapp.

```
curl \
 --compressed \
 -H "Accept: */*" \
 -H "Accept-Encoding: gzip, deflate" \
 -H "Connection: close" \
 -H "Host: [::ffff:a9fe:a9fe]:80" \
 -H "User-Agent: AWS Security Scanner" \
 -H "X-Forwarded-For: 44.224.22.196, 10.255.0.2" \
 -H "X-Forwarded-Port: 443" \
 -H "X-Forwarded-Proto: https" \
 -H "X-Real-Ip: 10.255.0.2" \
 "http://[::ffff:a9fe:a9fe]/latest/dynamic/instance-identity/document"
``` 

**Expected behavior**:

The url containing hostname in ipv6 address, should be parsed correctly and python agent should  successfully process request.

**Environment (please complete the following information)**
- OS: Linux
- Python version: 3.5
- Framework and version [e.g. Django 2.1]: 2.1
- APM Server version: 6.7.1
- Agent version: 5.3.0

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `elasticapm/utils/__init__.py`
Content:
```
1 #  BSD 3-Clause License
2 #
3 #  Copyright (c) 2012, the Sentry Team, see AUTHORS for more details
4 #  Copyright (c) 2019, Elasticsearch BV
5 #  All rights reserved.
6 #
7 #  Redistribution and use in source and binary forms, with or without
8 #  modification, are permitted provided that the following conditions are met:
9 #
10 #  * Redistributions of source code must retain the above copyright notice, this
11 #    list of conditions and the following disclaimer.
12 #
13 #  * Redistributions in binary form must reproduce the above copyright notice,
14 #    this list of conditions and the following disclaimer in the documentation
15 #    and/or other materials provided with the distribution.
16 #
17 #  * Neither the name of the copyright holder nor the names of its
18 #    contributors may be used to endorse or promote products derived from
19 #    this software without specific prior written permission.
20 #
21 #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 #  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 #  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 #  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 #  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 #  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 #  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 #  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 #  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 
31 import base64
32 import os
33 import re
34 from functools import partial
35 
36 from elasticapm.conf import constants
37 from elasticapm.utils import compat, encoding
38 
39 try:
40     from functools import partialmethod
41 
42     partial_types = (partial, partialmethod)
43 except ImportError:
44     # Python 2
45     partial_types = (partial,)
46 
47 
48 default_ports = {"https": 443, "http": 80, "postgresql": 5432}
49 
50 
51 def varmap(func, var, context=None, name=None):
52     """
53     Executes ``func(key_name, value)`` on all values,
54     recursively discovering dict and list scoped
55     values.
56     """
57     if context is None:
58         context = set()
59     objid = id(var)
60     if objid in context:
61         return func(name, "<...>")
62     context.add(objid)
63     if isinstance(var, dict):
64         ret = func(name, dict((k, varmap(func, v, context, k)) for k, v in compat.iteritems(var)))
65     elif isinstance(var, (list, tuple)):
66         ret = func(name, [varmap(func, f, context, name) for f in var])
67     else:
68         ret = func(name, var)
69     context.remove(objid)
70     return ret
71 
72 
73 def get_name_from_func(func):
74     # partials don't have `__module__` or `__name__`, so we use the values from the "inner" function
75     if isinstance(func, partial_types):
76         return "partial({})".format(get_name_from_func(func.func))
77     elif hasattr(func, "_partialmethod") and hasattr(func._partialmethod, "func"):
78         return "partial({})".format(get_name_from_func(func._partialmethod.func))
79 
80     module = func.__module__
81 
82     if hasattr(func, "__name__"):
83         view_name = func.__name__
84     else:  # Fall back if there's no __name__
85         view_name = func.__class__.__name__
86 
87     return "{0}.{1}".format(module, view_name)
88 
89 
90 def build_name_with_http_method_prefix(name, request):
91     return " ".join((request.method, name)) if name else name
92 
93 
94 def is_master_process():
95     # currently only recognizes uwsgi master process
96     try:
97         import uwsgi
98 
99         return os.getpid() == uwsgi.masterpid()
100     except ImportError:
101         return False
102 
103 
104 def get_url_dict(url):
105     scheme, netloc, path, params, query, fragment = compat.urlparse.urlparse(url)
106     if ":" in netloc:
107         hostname, port = netloc.split(":")
108     else:
109         hostname, port = (netloc, None)
110     url_dict = {
111         "full": encoding.keyword_field(url),
112         "protocol": scheme + ":",
113         "hostname": encoding.keyword_field(hostname),
114         "pathname": encoding.keyword_field(path),
115     }
116     if port:
117         url_dict["port"] = port
118     if query:
119         url_dict["search"] = encoding.keyword_field("?" + query)
120     return url_dict
121 
122 
123 def sanitize_url(url):
124     if "@" not in url:
125         return url
126     parts = compat.urlparse.urlparse(url)
127     return url.replace("%s:%s" % (parts.username, parts.password), "%s:%s" % (parts.username, constants.MASK))
128 
129 
130 def read_pem_file(file_obj):
131     cert = b""
132     for line in file_obj:
133         if line.startswith(b"-----BEGIN CERTIFICATE-----"):
134             break
135     for line in file_obj:
136         if not line.startswith(b"-----END CERTIFICATE-----"):
137             cert += line.strip()
138     return base64.b64decode(cert)
139 
140 
141 def starmatch_to_regex(pattern):
142     i, n = 0, len(pattern)
143     res = []
144     while i < n:
145         c = pattern[i]
146         i = i + 1
147         if c == "*":
148             res.append(".*")
149         else:
150             res.append(re.escape(c))
151     return re.compile(r"(?:%s)\Z" % "".join(res), re.IGNORECASE | re.DOTALL)
152
```
--- 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()

```

diff --git a/elasticapm/utils/__init__.py b/elasticapm/utils/__init__.py
--- a/elasticapm/utils/__init__.py
+++ b/elasticapm/utils/__init__.py
@@ -102,21 +102,21 @@
 
 
 def get_url_dict(url):
-    scheme, netloc, path, params, query, fragment = compat.urlparse.urlparse(url)
-    if ":" in netloc:
-        hostname, port = netloc.split(":")
-    else:
-        hostname, port = (netloc, None)
+    parse_result = compat.urlparse.urlparse(url)
+
     url_dict = {
         "full": encoding.keyword_field(url),
-        "protocol": scheme + ":",
-        "hostname": encoding.keyword_field(hostname),
-        "pathname": encoding.keyword_field(path),
+        "protocol": parse_result.scheme + ":",
+        "hostname": encoding.keyword_field(parse_result.hostname),
+        "pathname": encoding.keyword_field(parse_result.path),
     }
+
+    port = None if parse_result.port is None else str(parse_result.port)
+
     if port:
         url_dict["port"] = port
-    if query:
-        url_dict["search"] = encoding.keyword_field("?" + query)
+    if parse_result.query:
+        url_dict["search"] = encoding.keyword_field("?" + parse_result.query)
     return url_dict

{"golden_diff": "diff --git a/elasticapm/utils/__init__.py b/elasticapm/utils/__init__.py\n--- a/elasticapm/utils/__init__.py\n+++ b/elasticapm/utils/__init__.py\n@@ -102,21 +102,21 @@\n \n \n def get_url_dict(url):\n-    scheme, netloc, path, params, query, fragment = compat.urlparse.urlparse(url)\n-    if \":\" in netloc:\n-        hostname, port = netloc.split(\":\")\n-    else:\n-        hostname, port = (netloc, None)\n+    parse_result = compat.urlparse.urlparse(url)\n+\n     url_dict = {\n         \"full\": encoding.keyword_field(url),\n-        \"protocol\": scheme + \":\",\n-        \"hostname\": encoding.keyword_field(hostname),\n-        \"pathname\": encoding.keyword_field(path),\n+        \"protocol\": parse_result.scheme + \":\",\n+        \"hostname\": encoding.keyword_field(parse_result.hostname),\n+        \"pathname\": encoding.keyword_field(parse_result.path),\n     }\n+\n+    port = None if parse_result.port is None else str(parse_result.port)\n+\n     if port:\n         url_dict[\"port\"] = port\n-    if query:\n-        url_dict[\"search\"] = encoding.keyword_field(\"?\" + query)\n+    if parse_result.query:\n+        url_dict[\"search\"] = encoding.keyword_field(\"?\" + parse_result.query)\n     return url_dict\n", "issue": "Support for ipv6 address format\n**Describe the bug**: \r\n\r\nException is thrown when python agent is trying to parse url, that contains ipv6 address.\r\n```\r\nValueError: too many values to unpack (expected 2)\r\n  File \"elasticapm/contrib/django/middleware/__init__.py\", line 162, in process_response\r\n    \"request\",\r\n  File \"elasticapm/traces.py\", line 333, in set_context\r\n    data = data()\r\n  File \"elasticapm/contrib/django/middleware/__init__.py\", line 160, in <lambda>\r\n    request, capture_body=self.client.config.capture_body in (\"all\", \"transactions\")\r\n  File \"elasticapm/contrib/django/client.py\", line 137, in get_data_from_request\r\n    result[\"url\"] = get_url_dict(url)\r\n  File \"elasticapm/utils/__init__.py\", line 84, in get_url_dict\r\n    hostname, port = netloc.split(\":\")\r\n```\r\n\r\n**To Reproduce**\r\n\r\nNot sure how can I manually replicate it, but below is the request details that is send to our webapp.\r\n\r\n```\r\ncurl \\\r\n --compressed \\\r\n -H \"Accept: */*\" \\\r\n -H \"Accept-Encoding: gzip, deflate\" \\\r\n -H \"Connection: close\" \\\r\n -H \"Host: [::ffff:a9fe:a9fe]:80\" \\\r\n -H \"User-Agent: AWS Security Scanner\" \\\r\n -H \"X-Forwarded-For: 44.224.22.196, 10.255.0.2\" \\\r\n -H \"X-Forwarded-Port: 443\" \\\r\n -H \"X-Forwarded-Proto: https\" \\\r\n -H \"X-Real-Ip: 10.255.0.2\" \\\r\n \"http://[::ffff:a9fe:a9fe]/latest/dynamic/instance-identity/document\"\r\n``` \r\n\r\n**Expected behavior**:\r\n\r\nThe url containing hostname in ipv6 address, should be parsed correctly and python agent should  successfully process request.\r\n\r\n**Environment (please complete the following information)**\r\n- OS: Linux\r\n- Python version: 3.5\r\n- Framework and version [e.g. Django 2.1]: 2.1\r\n- APM Server version: 6.7.1\r\n- Agent version: 5.3.0\n", "before_files": [{"content": "#  BSD 3-Clause License\n#\n#  Copyright (c) 2012, the Sentry Team, see AUTHORS for more details\n#  Copyright (c) 2019, Elasticsearch BV\n#  All rights reserved.\n#\n#  Redistribution and use in source and binary forms, with or without\n#  modification, are permitted provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this\n#    list of conditions and the following disclaimer.\n#\n#  * Redistributions in binary form must reproduce the above copyright notice,\n#    this list of conditions and the following disclaimer in the documentation\n#    and/or other materials provided with the distribution.\n#\n#  * Neither the name of the copyright holder nor the names of its\n#    contributors may be used to endorse or promote products derived from\n#    this software without specific prior written permission.\n#\n#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n#  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n#  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n#  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n#  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n#  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n#  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\nimport base64\nimport os\nimport re\nfrom functools import partial\n\nfrom elasticapm.conf import constants\nfrom elasticapm.utils import compat, encoding\n\ntry:\n    from functools import partialmethod\n\n    partial_types = (partial, partialmethod)\nexcept ImportError:\n    # Python 2\n    partial_types = (partial,)\n\n\ndefault_ports = {\"https\": 443, \"http\": 80, \"postgresql\": 5432}\n\n\ndef varmap(func, var, context=None, name=None):\n    \"\"\"\n    Executes ``func(key_name, value)`` on all values,\n    recursively discovering dict and list scoped\n    values.\n    \"\"\"\n    if context is None:\n        context = set()\n    objid = id(var)\n    if objid in context:\n        return func(name, \"<...>\")\n    context.add(objid)\n    if isinstance(var, dict):\n        ret = func(name, dict((k, varmap(func, v, context, k)) for k, v in compat.iteritems(var)))\n    elif isinstance(var, (list, tuple)):\n        ret = func(name, [varmap(func, f, context, name) for f in var])\n    else:\n        ret = func(name, var)\n    context.remove(objid)\n    return ret\n\n\ndef get_name_from_func(func):\n    # partials don't have `__module__` or `__name__`, so we use the values from the \"inner\" function\n    if isinstance(func, partial_types):\n        return \"partial({})\".format(get_name_from_func(func.func))\n    elif hasattr(func, \"_partialmethod\") and hasattr(func._partialmethod, \"func\"):\n        return \"partial({})\".format(get_name_from_func(func._partialmethod.func))\n\n    module = func.__module__\n\n    if hasattr(func, \"__name__\"):\n        view_name = func.__name__\n    else:  # Fall back if there's no __name__\n        view_name = func.__class__.__name__\n\n    return \"{0}.{1}\".format(module, view_name)\n\n\ndef build_name_with_http_method_prefix(name, request):\n    return \" \".join((request.method, name)) if name else name\n\n\ndef is_master_process():\n    # currently only recognizes uwsgi master process\n    try:\n        import uwsgi\n\n        return os.getpid() == uwsgi.masterpid()\n    except ImportError:\n        return False\n\n\ndef get_url_dict(url):\n    scheme, netloc, path, params, query, fragment = compat.urlparse.urlparse(url)\n    if \":\" in netloc:\n        hostname, port = netloc.split(\":\")\n    else:\n        hostname, port = (netloc, None)\n    url_dict = {\n        \"full\": encoding.keyword_field(url),\n        \"protocol\": scheme + \":\",\n        \"hostname\": encoding.keyword_field(hostname),\n        \"pathname\": encoding.keyword_field(path),\n    }\n    if port:\n        url_dict[\"port\"] = port\n    if query:\n        url_dict[\"search\"] = encoding.keyword_field(\"?\" + query)\n    return url_dict\n\n\ndef sanitize_url(url):\n    if \"@\" not in url:\n        return url\n    parts = compat.urlparse.urlparse(url)\n    return url.replace(\"%s:%s\" % (parts.username, parts.password), \"%s:%s\" % (parts.username, constants.MASK))\n\n\ndef read_pem_file(file_obj):\n    cert = b\"\"\n    for line in file_obj:\n        if line.startswith(b\"-----BEGIN CERTIFICATE-----\"):\n            break\n    for line in file_obj:\n        if not line.startswith(b\"-----END CERTIFICATE-----\"):\n            cert += line.strip()\n    return base64.b64decode(cert)\n\n\ndef starmatch_to_regex(pattern):\n    i, n = 0, len(pattern)\n    res = []\n    while i < n:\n        c = pattern[i]\n        i = i + 1\n        if c == \"*\":\n            res.append(\".*\")\n        else:\n            res.append(re.escape(c))\n    return re.compile(r\"(?:%s)\\Z\" % \"\".join(res), re.IGNORECASE | re.DOTALL)\n", "path": "elasticapm/utils/__init__.py"}], "after_files": [{"content": "#  BSD 3-Clause License\n#\n#  Copyright (c) 2012, the Sentry Team, see AUTHORS for more details\n#  Copyright (c) 2019, Elasticsearch BV\n#  All rights reserved.\n#\n#  Redistribution and use in source and binary forms, with or without\n#  modification, are permitted provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this\n#    list of conditions and the following disclaimer.\n#\n#  * Redistributions in binary form must reproduce the above copyright notice,\n#    this list of conditions and the following disclaimer in the documentation\n#    and/or other materials provided with the distribution.\n#\n#  * Neither the name of the copyright holder nor the names of its\n#    contributors may be used to endorse or promote products derived from\n#    this software without specific prior written permission.\n#\n#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n#  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n#  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n#  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n#  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n#  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n#  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\nimport base64\nimport os\nimport re\nfrom functools import partial\n\nfrom elasticapm.conf import constants\nfrom elasticapm.utils import compat, encoding\n\ntry:\n    from functools import partialmethod\n\n    partial_types = (partial, partialmethod)\nexcept ImportError:\n    # Python 2\n    partial_types = (partial,)\n\n\ndefault_ports = {\"https\": 443, \"http\": 80, \"postgresql\": 5432}\n\n\ndef varmap(func, var, context=None, name=None):\n    \"\"\"\n    Executes ``func(key_name, value)`` on all values,\n    recursively discovering dict and list scoped\n    values.\n    \"\"\"\n    if context is None:\n        context = set()\n    objid = id(var)\n    if objid in context:\n        return func(name, \"<...>\")\n    context.add(objid)\n    if isinstance(var, dict):\n        ret = func(name, dict((k, varmap(func, v, context, k)) for k, v in compat.iteritems(var)))\n    elif isinstance(var, (list, tuple)):\n        ret = func(name, [varmap(func, f, context, name) for f in var])\n    else:\n        ret = func(name, var)\n    context.remove(objid)\n    return ret\n\n\ndef get_name_from_func(func):\n    # partials don't have `__module__` or `__name__`, so we use the values from the \"inner\" function\n    if isinstance(func, partial_types):\n        return \"partial({})\".format(get_name_from_func(func.func))\n    elif hasattr(func, \"_partialmethod\") and hasattr(func._partialmethod, \"func\"):\n        return \"partial({})\".format(get_name_from_func(func._partialmethod.func))\n\n    module = func.__module__\n\n    if hasattr(func, \"__name__\"):\n        view_name = func.__name__\n    else:  # Fall back if there's no __name__\n        view_name = func.__class__.__name__\n\n    return \"{0}.{1}\".format(module, view_name)\n\n\ndef build_name_with_http_method_prefix(name, request):\n    return \" \".join((request.method, name)) if name else name\n\n\ndef is_master_process():\n    # currently only recognizes uwsgi master process\n    try:\n        import uwsgi\n\n        return os.getpid() == uwsgi.masterpid()\n    except ImportError:\n        return False\n\n\ndef get_url_dict(url):\n    parse_result = compat.urlparse.urlparse(url)\n\n    url_dict = {\n        \"full\": encoding.keyword_field(url),\n        \"protocol\": parse_result.scheme + \":\",\n        \"hostname\": encoding.keyword_field(parse_result.hostname),\n        \"pathname\": encoding.keyword_field(parse_result.path),\n    }\n\n    port = None if parse_result.port is None else str(parse_result.port)\n\n    if port:\n        url_dict[\"port\"] = port\n    if parse_result.query:\n        url_dict[\"search\"] = encoding.keyword_field(\"?\" + parse_result.query)\n    return url_dict\n\n\ndef sanitize_url(url):\n    if \"@\" not in url:\n        return url\n    parts = compat.urlparse.urlparse(url)\n    return url.replace(\"%s:%s\" % (parts.username, parts.password), \"%s:%s\" % (parts.username, constants.MASK))\n\n\ndef read_pem_file(file_obj):\n    cert = b\"\"\n    for line in file_obj:\n        if line.startswith(b\"-----BEGIN CERTIFICATE-----\"):\n            break\n    for line in file_obj:\n        if not line.startswith(b\"-----END CERTIFICATE-----\"):\n            cert += line.strip()\n    return base64.b64decode(cert)\n\n\ndef starmatch_to_regex(pattern):\n    i, n = 0, len(pattern)\n    res = []\n    while i < n:\n        c = pattern[i]\n        i = i + 1\n        if c == \"*\":\n            res.append(\".*\")\n        else:\n            res.append(re.escape(c))\n    return re.compile(r\"(?:%s)\\Z\" % \"\".join(res), re.IGNORECASE | re.DOTALL)\n", "path": "elasticapm/utils/__init__.py"}]}