def _DisplayHost(self, computer, self_report):
    """Displays the report for a single host.

    Args:
      computer: models.Computer object to display.
      self_report: if True, display as self report.
    """

    uuid = computer.uuid

    popup = self.request.get('format', None) == 'popup'
    if popup:
      limit = 1
    else:
      limit = SINGLE_HOST_DATA_FETCH_LIMIT
    client_log_files = models.ClientLogFile.all().filter('uuid =', uuid).order(
        '-mtime').fetch(limit)
    msu_log = models.ComputerMSULog.all().filter('uuid =', uuid).order(
        '-mtime').fetch(limit)
    applesus_installs = models.InstallLog.all().filter('uuid =', uuid).filter(
        'applesus =', True).order('-mtime').fetch(limit)
    installs = models.InstallLog.all().filter('uuid =', uuid).filter(
        'applesus =', False).order('-mtime').fetch(limit)
    exits = models.PreflightExitLog.all().filter('uuid =', uuid).order(
        '-mtime').fetch(limit)
    install_problems = models.ClientLog.all().filter(
        'action =', 'install_problem').filter('uuid =', uuid).order(
            '-mtime').fetch(limit)

    tags = {}
    tags_list = []
    if computer:
      # Generate tags data.
      tags_list = models.Tag.GetAllTagNamesForEntity(computer)
      for tag in tags_list:
        tags[tag] = True
      for tag in models.Tag.GetAllTagNames():
        if tag not in tags:
          tags[tag] = False
      tags = json.dumps(tags, sort_keys=True)

      admin.AddTimezoneToComputerDatetimes(computer)
      computer.connection_dates.reverse()
      computer.connection_datetimes.reverse()

    try:
      uuid_lookup_url = settings.UUID_LOOKUP_URL
    except AttributeError:
      uuid_lookup_url = None

    try:
      owner_lookup_url = settings.OWNER_LOOKUP_URL
    except __HOLE__:
      owner_lookup_url = None

    values = {
        'uuid_lookup_url': uuid_lookup_url,
        'owner_lookup_url': owner_lookup_url,
        'client_site_enabled': settings.CLIENT_SITE_ENABLED,
        'computer': computer,
        'applesus_installs': applesus_installs,
        'installs': installs,
        'client_log_files': client_log_files,
        'msu_log': msu_log,
        'install_problems': install_problems,
        'preflight_exits': exits,
        'tags': tags,
        'tags_list': tags_list,
        'host_report': True,
        'limit': SINGLE_HOST_DATA_FETCH_LIMIT,
        'is_support_user': auth.IsSupportUser(),
        'is_security_user': auth.IsSecurityUser(),
        'is_physical_security_user': auth.IsPhysicalSecurityUser(),
        'self_report': self_report
    }

    if popup:
      self.Render('host_popup.html', values)
    else:
      self.Render('host.html', values)
dataset/ETHPy150Open google/simian/src/simian/mac/admin/host.py/Host._DisplayHost