
import datetime


def list_to_csv(item_list):
    if item_list:
        return ','.join(map(str, item_list))


def parse_datetime(datetime_string):
    return datetime.datetime.strptime(
        datetime_string, "%Y-%m-%dT%H:%M:%S.%fZ"
    ).replace(tzinfo=datetime.timezone.utc)
    # Use %z when support for Python 3.6 is dropped


import datetime


def list_to_csv(item_list):
    if item_list:
        return ','.join(map(str, item_list))


def parse_datetime(datetime_string):
    return datetime.datetime.strptime(
        datetime_string, "%Y-%m-%dT%H:%M:%S.%f%z"
    ).replace(tzinfo=datetime.timezone.utc)

Use %z directive in parse_datetime
Use %z directive in parse_datetime


  
  import datetime
  
  
  def list_to_csv(item_list):
      if item_list:
          return ','.join(map(str, item_list))
  
  
  def parse_datetime(datetime_string):
      return datetime.datetime.strptime(
-         datetime_string, "%Y-%m-%dT%H:%M:%S.%fZ"
+         datetime_string, "%Y-%m-%dT%H:%M:%S.%f%z"
      ).replace(tzinfo=datetime.timezone.utc)
-     # Use %z when support for Python 3.6 is dropped
  
Use %z directive in parse_datetime
## Code Before:

import datetime


def list_to_csv(item_list):
    if item_list:
        return ','.join(map(str, item_list))


def parse_datetime(datetime_string):
    return datetime.datetime.strptime(
        datetime_string, "%Y-%m-%dT%H:%M:%S.%fZ"
    ).replace(tzinfo=datetime.timezone.utc)
    # Use %z when support for Python 3.6 is dropped

## Instruction:
Use %z directive in parse_datetime
## Code After:

import datetime


def list_to_csv(item_list):
    if item_list:
        return ','.join(map(str, item_list))


def parse_datetime(datetime_string):
    return datetime.datetime.strptime(
        datetime_string, "%Y-%m-%dT%H:%M:%S.%f%z"
    ).replace(tzinfo=datetime.timezone.utc)
