old_contents: from st2common.util import isotime
  
  __all__ = [
      'issue_to_dict',
      'label_to_dict',
      'user_to_dict'
  ]
  
  
  def issue_to_dict(issue):
      result = {}
  
      author = user_to_dict(issue.user)
      assignee = user_to_dict(issue.assignee)
      closed_by = user_to_dict(issue.closed_by)
  
      if issue.pull_request:
          is_pull_request = True
      else:
          is_pull_request = False
  
      result['id'] = issue.id
      result['repository'] = issue.repository.name
      result['author'] = author
      result['assign'] = assignee
      result['title'] = issue.title
      result['body'] = issue.body
      result['url'] = issue.html_url
      result['state'] = issue.state
      result['is_pull_request'] = is_pull_request
  
      if issue.labels:
          labels = [label_to_dict(label) for label in issue.labels]
      else:
          labels = []
  
      result['labels'] = labels
  
      # Note: We convert it to a serialize type (string)
      if issue.created_at:
          created_at = isotime.format(issue.created_at)
      else:
          created_at = None
  
      if issue.closed_at:
          closed_at = isotime.format(issue.closed_at)
      else:
          closed_at = None
  
      result['created_at'] = created_at
      result['closed_at'] = closed_at
      result['closed_by'] = closed_by
      return result
  
  
  def label_to_dict(label):
      result = {}
  
      result['name'] = label.name
      result['color'] = label.color
      result['url'] = label.url
  
      return result
  
  
  def user_to_dict(user):
      if not user:
          return None
  
      result = {}
      result['name'] = user.name
      result['login'] = user.login
      return result
  
  def team_to_dict(team):
      if not team:
          return None
  
      result = {}
      result['id'] = team.id
      result['name'] = team.name
      result['members_count'] = team.members_count
      return result
  
new_contents: from st2common.util import isotime
  
  __all__ = [
      'issue_to_dict',
      'label_to_dict',
      'user_to_dict'
  ]
  
  
  def issue_to_dict(issue):
      result = {}
  
      author = user_to_dict(issue.user)
      assignee = user_to_dict(issue.assignee)
      closed_by = user_to_dict(issue.closed_by)
  
      if issue.pull_request:
          is_pull_request = True
      else:
          is_pull_request = False
  
      result['id'] = issue.id
      result['repository'] = issue.repository.name
      result['author'] = author
      result['assign'] = assignee
      result['title'] = issue.title
      result['body'] = issue.body
      result['url'] = issue.html_url
      result['state'] = issue.state
      result['is_pull_request'] = is_pull_request
  
      if issue.labels:
          labels = [label_to_dict(label) for label in issue.labels]
      else:
          labels = []
  
      result['labels'] = labels
  
      # Note: We convert it to a serialize type (string)
      if issue.created_at:
          created_at = isotime.format(issue.created_at)
      else:
          created_at = None
  
      if issue.closed_at:
          closed_at = isotime.format(issue.closed_at)
      else:
          closed_at = None
  
      result['created_at'] = created_at
      result['closed_at'] = closed_at
      result['closed_by'] = closed_by
      return result
  
  
  def label_to_dict(label):
      result = {}
  
      result['name'] = label.name
      result['color'] = label.color
      result['url'] = label.url
  
      return result
  
  
  def user_to_dict(user):
      if not user:
          return None
  
      result = {}
      result['name'] = user.name
      result['login'] = user.login
      return result
  
  
  def team_to_dict(team):
      if not team:
          return None
  
      result = {}
      result['id'] = team.id
      result['name'] = team.name
      result['members_count'] = team.members_count
      return result
  
subject: Fix lint issue.