prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  bug: aws scalar type for AWSDateTime should include milliseconds
  **What were you trying to accomplish?**
  
  ## Expected Behavior
  
  AWSDateTime - An extended ISO 8601 date and time string in the format YYYY-MM-DDThh:mm:ss.sssZ.
  
  ## Current Behavior
  
  AWSDateTime is not including the millisecond part `sss`.
  
  ## Possible Solution
  
  Generate timestamps to include the milliseconds
  
  ## Steps to Reproduce (for bugs)
  
  ```python3
  > print(aws_datetime())
  2021-07-02T17:09:47Z
  ````
  
  ## Environment
  
  * **Powertools version used**: 1.17.0
  * **Packaging format (Layers, PyPi)**: PyPi
  * **AWS Lambda function runtime:** Python 3.8
  
  
  </issue>
  <code>
  [start of aws_lambda_powertools/utilities/data_classes/appsync/scalar_types_utils.py]
  1 import datetime
  2 import time
  3 import uuid
  4 
  5 
  6 def _formatted_time(now: datetime.date, fmt: str, timezone_offset: int) -> str:
  7     """String formatted time with optional timezone offset
  8 
  9     Parameters
  10     ----------
  11     now : datetime.date
  12         Current datetime with zero timezone offset
  13     fmt : str
  14         Data format before adding timezone offset
  15     timezone_offset : int
  16         Timezone offset in hours, defaults to 0
  17     Returns
  18     -------
  19     str
  20         Returns string formatted time with optional timezone offset
  21     """
  22     if timezone_offset == 0:
  23         return now.strftime(fmt + "Z")
  24 
  25     now = now + datetime.timedelta(hours=timezone_offset)
  26     fmt += "+" if timezone_offset > 0 else "-"
  27     fmt += str(abs(timezone_offset)).zfill(2)
  28     fmt += ":00:00"
  29 
  30     return now.strftime(fmt)
  31 
  32 
  33 def make_id() -> str:
  34     """ID - A unique identifier for an object. This scalar is serialized like a String but isn't meant to be
  35     human-readable."""
  36     return str(uuid.uuid4())
  37 
  38 
  39 def aws_date(timezone_offset: int = 0) -> str:
  40     """AWSDate - An extended ISO 8601 date string in the format YYYY-MM-DD.
  41 
  42     Parameters
  43     ----------
  44     timezone_offset : int
  45         Timezone offset, defaults to 0
  46 
  47     Returns
  48     -------
  49     str
  50         Returns current time as AWSDate scalar string with optional timezone offset
  51     """
  52     return _formatted_time(datetime.datetime.utcnow(), "%Y-%m-%d", timezone_offset)
  53 
  54 
  55 def aws_time(timezone_offset: int = 0) -> str:
  56     """AWSTime - An extended ISO 8601 time string in the format hh:mm:ss.sss.
  57 
  58     Parameters
  59     ----------
  60     timezone_offset : int
  61         Timezone offset, defaults to 0
  62 
  63     Returns
  64     -------
  65     str
  66         Returns current time as AWSTime scalar string with optional timezone offset
  67     """
  68     return _formatted_time(datetime.datetime.utcnow(), "%H:%M:%S", timezone_offset)
  69 
  70 
  71 def aws_datetime(timezone_offset: int = 0) -> str:
  72     """AWSDateTime - An extended ISO 8601 date and time string in the format YYYY-MM-DDThh:mm:ss.sssZ.
  73 
  74     Parameters
  75     ----------
  76     timezone_offset : int
  77         Timezone offset, defaults to 0
  78 
  79     Returns
  80     -------
  81     str
  82         Returns current time as AWSDateTime scalar string with optional timezone offset
  83     """
  84     return _formatted_time(datetime.datetime.utcnow(), "%Y-%m-%dT%H:%M:%S", timezone_offset)
  85 
  86 
  87 def aws_timestamp() -> int:
  88     """AWSTimestamp - An integer value representing the number of seconds before or after 1970-01-01-T00:00Z."""
  89     return int(time.time())
  90
  [end of aws_lambda_powertools/utilities/data_classes/appsync/scalar_types_utils.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/aws_lambda_powertools/utilities/data_classes/appsync/scalar_types_utils.py b/aws_lambda_powertools/utilities/data_classes/appsync/scalar_types_utils.py
  --- a/aws_lambda_powertools/utilities/data_classes/appsync/scalar_types_utils.py
  +++ b/aws_lambda_powertools/utilities/data_classes/appsync/scalar_types_utils.py
  @@ -19,15 +19,21 @@
       str
           Returns string formatted time with optional timezone offset
       """
  -    if timezone_offset == 0:
  -        return now.strftime(fmt + "Z")
  +    if timezone_offset != 0:
  +        now = now + datetime.timedelta(hours=timezone_offset)
  +
  +    datetime_str = now.strftime(fmt)
  +    if fmt.endswith(".%f"):
  +        datetime_str = datetime_str[:-3]
   
  -    now = now + datetime.timedelta(hours=timezone_offset)
  -    fmt += "+" if timezone_offset > 0 else "-"
  -    fmt += str(abs(timezone_offset)).zfill(2)
  -    fmt += ":00:00"
  +    if timezone_offset == 0:
  +        postfix = "Z"
  +    else:
  +        postfix = "+" if timezone_offset > 0 else "-"
  +        postfix += str(abs(timezone_offset)).zfill(2)
  +        postfix += ":00:00"
   
  -    return now.strftime(fmt)
  +    return datetime_str + postfix
   
   
   def make_id() -> str:
  @@ -65,7 +71,7 @@
       str
           Returns current time as AWSTime scalar string with optional timezone offset
       """
  -    return _formatted_time(datetime.datetime.utcnow(), "%H:%M:%S", timezone_offset)
  +    return _formatted_time(datetime.datetime.utcnow(), "%H:%M:%S.%f", timezone_offset)
   
   
   def aws_datetime(timezone_offset: int = 0) -> str:
  @@ -81,7 +87,7 @@
       str
           Returns current time as AWSDateTime scalar string with optional timezone offset
       """
  -    return _formatted_time(datetime.datetime.utcnow(), "%Y-%m-%dT%H:%M:%S", timezone_offset)
  +    return _formatted_time(datetime.datetime.utcnow(), "%Y-%m-%dT%H:%M:%S.%f", timezone_offset)
   
   
   def aws_timestamp() -> int:
  
verification_info: {"golden_diff": "diff --git a/aws_lambda_powertools/utilities/data_classes/appsync/scalar_types_utils.py b/aws_lambda_powertools/utilities/data_classes/appsync/scalar_types_utils.py\n--- a/aws_lambda_powertools/utilities/data_classes/appsync/scalar_types_utils.py\n+++ b/aws_lambda_powertools/utilities/data_classes/appsync/scalar_types_utils.py\n@@ -19,15 +19,21 @@\n     str\n         Returns string formatted time with optional timezone offset\n     \"\"\"\n-    if timezone_offset == 0:\n-        return now.strftime(fmt + \"Z\")\n+    if timezone_offset != 0:\n+        now = now + datetime.timedelta(hours=timezone_offset)\n+\n+    datetime_str = now.strftime(fmt)\n+    if fmt.endswith(\".%f\"):\n+        datetime_str = datetime_str[:-3]\n \n-    now = now + datetime.timedelta(hours=timezone_offset)\n-    fmt += \"+\" if timezone_offset > 0 else \"-\"\n-    fmt += str(abs(timezone_offset)).zfill(2)\n-    fmt += \":00:00\"\n+    if timezone_offset == 0:\n+        postfix = \"Z\"\n+    else:\n+        postfix = \"+\" if timezone_offset > 0 else \"-\"\n+        postfix += str(abs(timezone_offset)).zfill(2)\n+        postfix += \":00:00\"\n \n-    return now.strftime(fmt)\n+    return datetime_str + postfix\n \n \n def make_id() -> str:\n@@ -65,7 +71,7 @@\n     str\n         Returns current time as AWSTime scalar string with optional timezone offset\n     \"\"\"\n-    return _formatted_time(datetime.datetime.utcnow(), \"%H:%M:%S\", timezone_offset)\n+    return _formatted_time(datetime.datetime.utcnow(), \"%H:%M:%S.%f\", timezone_offset)\n \n \n def aws_datetime(timezone_offset: int = 0) -> str:\n@@ -81,7 +87,7 @@\n     str\n         Returns current time as AWSDateTime scalar string with optional timezone offset\n     \"\"\"\n-    return _formatted_time(datetime.datetime.utcnow(), \"%Y-%m-%dT%H:%M:%S\", timezone_offset)\n+    return _formatted_time(datetime.datetime.utcnow(), \"%Y-%m-%dT%H:%M:%S.%f\", timezone_offset)\n \n \n def aws_timestamp() -> int:\n", "issue": "bug: aws scalar type for AWSDateTime should include milliseconds\n**What were you trying to accomplish?**\r\n\r\n## Expected Behavior\r\n\r\nAWSDateTime - An extended ISO 8601 date and time string in the format YYYY-MM-DDThh:mm:ss.sssZ.\r\n\r\n## Current Behavior\r\n\r\nAWSDateTime is not including the millisecond part `sss`.\r\n\r\n## Possible Solution\r\n\r\nGenerate timestamps to include the milliseconds\r\n\r\n## Steps to Reproduce (for bugs)\r\n\r\n```python3\r\n> print(aws_datetime())\r\n2021-07-02T17:09:47Z\r\n````\r\n\r\n## Environment\r\n\r\n* **Powertools version used**: 1.17.0\r\n* **Packaging format (Layers, PyPi)**: PyPi\r\n* **AWS Lambda function runtime:** Python 3.8\r\n\n", "before_files": [{"content": "import datetime\nimport time\nimport uuid\n\n\ndef _formatted_time(now: datetime.date, fmt: str, timezone_offset: int) -> str:\n    \"\"\"String formatted time with optional timezone offset\n\n    Parameters\n    ----------\n    now : datetime.date\n        Current datetime with zero timezone offset\n    fmt : str\n        Data format before adding timezone offset\n    timezone_offset : int\n        Timezone offset in hours, defaults to 0\n    Returns\n    -------\n    str\n        Returns string formatted time with optional timezone offset\n    \"\"\"\n    if timezone_offset == 0:\n        return now.strftime(fmt + \"Z\")\n\n    now = now + datetime.timedelta(hours=timezone_offset)\n    fmt += \"+\" if timezone_offset > 0 else \"-\"\n    fmt += str(abs(timezone_offset)).zfill(2)\n    fmt += \":00:00\"\n\n    return now.strftime(fmt)\n\n\ndef make_id() -> str:\n    \"\"\"ID - A unique identifier for an object. This scalar is serialized like a String but isn't meant to be\n    human-readable.\"\"\"\n    return str(uuid.uuid4())\n\n\ndef aws_date(timezone_offset: int = 0) -> str:\n    \"\"\"AWSDate - An extended ISO 8601 date string in the format YYYY-MM-DD.\n\n    Parameters\n    ----------\n    timezone_offset : int\n        Timezone offset, defaults to 0\n\n    Returns\n    -------\n    str\n        Returns current time as AWSDate scalar string with optional timezone offset\n    \"\"\"\n    return _formatted_time(datetime.datetime.utcnow(), \"%Y-%m-%d\", timezone_offset)\n\n\ndef aws_time(timezone_offset: int = 0) -> str:\n    \"\"\"AWSTime - An extended ISO 8601 time string in the format hh:mm:ss.sss.\n\n    Parameters\n    ----------\n    timezone_offset : int\n        Timezone offset, defaults to 0\n\n    Returns\n    -------\n    str\n        Returns current time as AWSTime scalar string with optional timezone offset\n    \"\"\"\n    return _formatted_time(datetime.datetime.utcnow(), \"%H:%M:%S\", timezone_offset)\n\n\ndef aws_datetime(timezone_offset: int = 0) -> str:\n    \"\"\"AWSDateTime - An extended ISO 8601 date and time string in the format YYYY-MM-DDThh:mm:ss.sssZ.\n\n    Parameters\n    ----------\n    timezone_offset : int\n        Timezone offset, defaults to 0\n\n    Returns\n    -------\n    str\n        Returns current time as AWSDateTime scalar string with optional timezone offset\n    \"\"\"\n    return _formatted_time(datetime.datetime.utcnow(), \"%Y-%m-%dT%H:%M:%S\", timezone_offset)\n\n\ndef aws_timestamp() -> int:\n    \"\"\"AWSTimestamp - An integer value representing the number of seconds before or after 1970-01-01-T00:00Z.\"\"\"\n    return int(time.time())\n", "path": "aws_lambda_powertools/utilities/data_classes/appsync/scalar_types_utils.py"}]}