def DrawWindow(self):
    """Draws the user interface."""
    self.nameserver_form = StringVar()
    self.status = StringVar()
    self.query_count = IntVar()
    self.data_source = StringVar()
    self.health_performance = StringVar()
    self.location = StringVar()
    self.use_global = IntVar()
    self.use_regional = IntVar()
    self.use_censor_checks = IntVar()
    self.share_results = IntVar()

    self.master.title('namebench')
    outer_frame = Frame(self.master)
    outer_frame.grid(row=0, padx=16, pady=16)
    inner_frame = Frame(outer_frame, relief=GROOVE, bd=2, padx=12, pady=12)
    inner_frame.grid(row=0, columnspan=2)
    status = Label(outer_frame, text='...', textvariable=self.status)
    status.grid(row=15, sticky=W, column=0)

    if sys.platform[:3] == 'win':
      seperator_width = 490
    else:
      seperator_width = 585

    bold_font = tkFont.Font(font=status['font'])
    bold_font['weight'] = 'bold'

    ns_label = Label(inner_frame, text='Nameservers')
    ns_label.grid(row=0, columnspan=2, sticky=W)
    ns_label['font'] = bold_font

    nameservers = Entry(inner_frame, bg='white',
                        textvariable=self.nameserver_form,
                        width=80)
    nameservers.grid(row=1, columnspan=2, sticky=W, padx=4, pady=2)
    self.nameserver_form.set(', '.join(nameserver_list.InternalNameServers()))

    global_button = Checkbutton(inner_frame,
                                text='Include global DNS providers (Google Public DNS, OpenDNS, UltraDNS, etc.)',
                                variable=self.use_global)
    global_button.grid(row=2, columnspan=2, sticky=W)
    global_button.toggle()

    regional_button = Checkbutton(inner_frame,
                                  text='Include best available regional DNS services',
                                  variable=self.use_regional)
    regional_button.grid(row=3, columnspan=2, sticky=W)
    regional_button.toggle()

    separator = Frame(inner_frame, height=2, width=seperator_width, bd=1, relief=SUNKEN)
    separator.grid(row=4, padx=5, pady=5, columnspan=2)

    ds_label = Label(inner_frame, text='Options')
    ds_label.grid(row=5, column=0, sticky=W)
    ds_label['font'] = bold_font

    censorship_button = Checkbutton(inner_frame, text='Include censorship checks',
                                    variable=self.use_censor_checks)
    censorship_button.grid(row=6, columnspan=2, sticky=W)

    share_button = Checkbutton(inner_frame,
                               text='Upload and share your anonymized results (help speed up the internet!)',
                               variable=self.share_results)

    # Old versions of Tk do not support two-dimensional padding.
    try:
      share_button.grid(row=7, columnspan=2, sticky=W, pady=[0,10])
    except TclError:
      share_button.grid(row=7, columnspan=2, sticky=W)

    loc_label = Label(inner_frame, text='Your location')
    loc_label.grid(row=10, column=0, sticky=W)
    loc_label['font'] = bold_font

    run_count_label = Label(inner_frame, text='Health Check Performance')
    run_count_label.grid(row=10, column=1, sticky=W)
    run_count_label['font'] = bold_font

    self.DiscoverLocation()
    self.LoadDataSources()
    source_titles = self.data_src.ListSourceTitles()
    left_dropdown_width = max([len(x) for x in source_titles]) - 3

    location_choices = [self.country, '(Other)']
    location = OptionMenu(inner_frame, self.location, *location_choices)
    location.configure(width=left_dropdown_width)
    location.grid(row=11, column=0, sticky=W)
    self.location.set(location_choices[0])

    mode_choices = ['Fast', 'Slow (unstable network)']
    right_dropdown_width = max([len(x) for x in mode_choices]) - 3
    health_performance = OptionMenu(inner_frame, self.health_performance, *mode_choices)
    health_performance.configure(width=right_dropdown_width)
    health_performance.grid(row=11, column=1, sticky=W)
    self.health_performance.set(mode_choices[0])

    ds_label = Label(inner_frame, text='Query Data Source')
    ds_label.grid(row=12, column=0, sticky=W)
    ds_label['font'] = bold_font

    numqueries_label = Label(inner_frame, text='Number of queries')
    numqueries_label.grid(row=12, column=1, sticky=W)
    numqueries_label['font'] = bold_font

    data_source = OptionMenu(inner_frame, self.data_source, *source_titles)
    data_source.configure(width=left_dropdown_width)
    data_source.grid(row=13, column=0, sticky=W)
    self.data_source.set(source_titles[0])

    query_count = Entry(inner_frame, bg='white', textvariable=self.query_count)
    query_count.grid(row=13, column=1, sticky=W, padx=4)
    query_count.configure(width=right_dropdown_width + 6)
    self.query_count.set(self.options.query_count)

    self.button = Button(outer_frame, command=self.StartJob)
    self.button.grid(row=15, sticky=E, column=1, pady=4, padx=1)
    self.UpdateRunState(running=True)
    self.UpdateRunState(running=False)
    self.UpdateStatus('namebench %s is ready!' % self.version)
dataset/ETHPy150Open catap/namebench/libnamebench/tk.py/MainWindow.DrawWindow/original