Returns the specified epoch time (or current time if None or not
  provided) as an ISO 8601 string in zulu time (with millisecond
  precision), e.g. zulu(1362187446.553) => '2013-03-02T01:24:06.553Z'.
  If `ms` is True (the default), milliseconds will be included, otherwise
  truncated.

def zulu(ts=None, ms=True):
  '''
  Returns the specified epoch time (or current time if None or not
  provided) as an ISO 8601 string in zulu time (with millisecond
  precision), e.g. zulu(1362187446.553) => '2013-03-02T01:24:06.553Z'.
  If `ms` is True (the default), milliseconds will be included, otherwise
  truncated.
  '''
  if ts is None:
    ts = time.time()
  ms = '.%03dZ' % (ts * 1000 % 1000,) if ms else 'Z'
  return time.strftime('%Y-%m-%dT%H:%M:%S', time.gmtime(ts)) + ms