
import json
import re


def camelcase(value):
    """
    Convert a module name or string with underscores and periods to camel case.
    :param value: the string to convert
    :type value: str
    :returns: the value converted to camel case.
    """
    return ''.join(x.capitalize() if x else '_' for x in
                   re.split("[._]+", value))


class JsonEncoder(json.JSONEncoder):
    """
    This extends the standard json.JSONEncoder to allow for more types to be
    sensibly serialized. This is used in Girder's REST layer to serialize
    route return values when JSON is requested.
    """
    def default(self, obj):
        if isinstance(obj, set):
            return tuple(obj)
        return str(obj)


import datetime
import json
import re


def camelcase(value):
    """
    Convert a module name or string with underscores and periods to camel case.
    :param value: the string to convert
    :type value: str
    :returns: the value converted to camel case.
    """
    return ''.join(x.capitalize() if x else '_' for x in
                   re.split("[._]+", value))


class JsonEncoder(json.JSONEncoder):
    """
    This extends the standard json.JSONEncoder to allow for more types to be
    sensibly serialized. This is used in Girder's REST layer to serialize
    route return values when JSON is requested.
    """
    def default(self, obj):
        if isinstance(obj, set):
            return tuple(obj)
        elif isinstance(obj, datetime.datetime):
            return obj.isoformat()
        return str(obj)

Send timestamps as ISO8601 format
Send timestamps as ISO8601 format

  
+ import datetime
  import json
  import re
  
  
  def camelcase(value):
      """
      Convert a module name or string with underscores and periods to camel case.
      :param value: the string to convert
      :type value: str
      :returns: the value converted to camel case.
      """
      return ''.join(x.capitalize() if x else '_' for x in
                     re.split("[._]+", value))
  
  
  class JsonEncoder(json.JSONEncoder):
      """
      This extends the standard json.JSONEncoder to allow for more types to be
      sensibly serialized. This is used in Girder's REST layer to serialize
      route return values when JSON is requested.
      """
      def default(self, obj):
          if isinstance(obj, set):
              return tuple(obj)
+         elif isinstance(obj, datetime.datetime):
+             return obj.isoformat()
          return str(obj)
  
Send timestamps as ISO8601 format
## Code Before:

import json
import re


def camelcase(value):
    """
    Convert a module name or string with underscores and periods to camel case.
    :param value: the string to convert
    :type value: str
    :returns: the value converted to camel case.
    """
    return ''.join(x.capitalize() if x else '_' for x in
                   re.split("[._]+", value))


class JsonEncoder(json.JSONEncoder):
    """
    This extends the standard json.JSONEncoder to allow for more types to be
    sensibly serialized. This is used in Girder's REST layer to serialize
    route return values when JSON is requested.
    """
    def default(self, obj):
        if isinstance(obj, set):
            return tuple(obj)
        return str(obj)

## Instruction:
Send timestamps as ISO8601 format
## Code After:

import datetime
import json
import re


def camelcase(value):
    """
    Convert a module name or string with underscores and periods to camel case.
    :param value: the string to convert
    :type value: str
    :returns: the value converted to camel case.
    """
    return ''.join(x.capitalize() if x else '_' for x in
                   re.split("[._]+", value))


class JsonEncoder(json.JSONEncoder):
    """
    This extends the standard json.JSONEncoder to allow for more types to be
    sensibly serialized. This is used in Girder's REST layer to serialize
    route return values when JSON is requested.
    """
    def default(self, obj):
        if isinstance(obj, set):
            return tuple(obj)
        elif isinstance(obj, datetime.datetime):
            return obj.isoformat()
        return str(obj)
