Starting point for the demonstration application.
183467
public static void showChart(
      String name, String xAxis, String yAxis1, XYDataset dataset1, String yAxis2,
      XYDataset dataset2
  ) {
    final JFreeChart chart = createChart(name, xAxis, yAxis1, dataset1, yAxis2, dataset2);
    final ChartPanel chartPanel = createPanel(chart);

    final ApplicationFrame app = new ApplicationFrame(name);

    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    app.setContentPane(chartPanel);
    app.pack();

    RefineryUtilities.centerFrameOnScreen(app);

    app.setVisible(true);
  }
233460
def main():
    
    e = mod_env.Internet('VAIS - Load testing',  'Simulation of several websites')
    e.create(800)
    print(e)
    
    #Create some users to browse the web and load test website
    print(npc.web_users.params)
744236
def main():
    """"""
    init_logging()

    LOG.info("Starting imaging-pipeline")

    # Read parameters
    PARFILE = 'parameters.json'
    if len(sys.argv) > 1:
       PARFILE = sys.argv[1]
    LOG.info("JSON parameter file = %s", PARFILE)
    try: 	
       with open(PARFILE, "r") as par_file:
             jspar = json.load(par_file)       
    except AssertionError as error:
       LOG.critical('ERROR %s', error)
       return

    # We will use dask
    arlexecute.set_client(get_dask_Client())
    arlexecute.run(init_logging)

    # Import visibility list from HDF5 file
    vis_list = import_blockvisibility_from_hdf5(
        '%s/%s' % (RESULTS_DIR, jspar["files"]["vis_list"]))

    # Now read the BlockVisibilities constructed using a model drawn from GLEAM
    predicted_vislist = import_blockvisibility_from_hdf5(
        '%s/%s' % (RESULTS_DIR, jspar["files"]["predicted_vis_list"]))
    corrupted_vislist = import_blockvisibility_from_hdf5(
        '%s/%s' % (RESULTS_DIR, jspar["files"]["corrupted_vis_list"]))

# Reproduce parameters from the visibility data
    ntimes = vis_list[0].nvis

    phasecentre = vis_list[0].phasecentre
    print(phasecentre)
    polframe = vis_list[0].polarisation_frame.type
    LOG.info("Polarisation Frame of vis_list: %s", polframe)

    wprojection_planes = jspar["advice"]["wprojection_planes"]
    guard_band_image   = jspar["advice"]["guard_band_image"]
    delA               = jspar["advice"]["delA"]
    advice_low = advise_wide_field(vis_list[0], guard_band_image=guard_band_image,
                                   delA=delA,
                                   wprojection_planes=wprojection_planes)
    advice_high = advise_wide_field(vis_list[-1], guard_band_image=guard_band_image,
                                    delA=delA,
                                    wprojection_planes=wprojection_planes)

    vis_slices = advice_low['vis_slices']
    npixel = advice_high['npixels2']
    cellsize = min(advice_low['cellsize'], advice_high['cellsize'])
    
# Recovering frequencies
    fstart = vis_list[0].frequency
    fend = vis_list[-1].frequency
    num_freq_win = len(vis_list)
    frequency = numpy.linspace(fstart, fend, num_freq_win)

# Recovering bandwidths
    channel_bandwidth = numpy.array(num_freq_win * [vis_list[1].frequency - vis_list[0].frequency])
    
    # Get the LSM. This is currently blank.
    model_list = [
        arlexecute.execute(create_image_from_visibility)(
            vis_list[f],
            npixel=npixel,
            frequency=[frequency[f]],
            channel_bandwidth=[channel_bandwidth[f]],
            cellsize=cellsize,
            phasecentre=phasecentre,
            polarisation_frame=PolarisationFrame(polframe))
        for f, freq in enumerate(frequency)
    ]
    # future_predicted_vislist = arlexecute.scatter(predicted_vislist)

    # Create and execute graphs to make the dirty image and PSF
    # LOG.info('About to run invert to get dirty image')
    # dirty_list = invert_component(future_predicted_vislist, model_list,
    #                               context='wstack',
    #                               vis_slices=vis_slices, dopsf=False)
    # dirty_list = arlexecute.compute(dirty_list, sync=True)

    # LOG.info('About to run invert to get PSF')
    # psf_list = invert_component(future_predicted_vislist, model_list,
    #                             context='wstack',
    #                             vis_slices=vis_slices, dopsf=True)
    # psf_list = arlexecute.compute(psf_list, sync=True)

    # Now deconvolve using msclean
    # LOG.info('About to run deconvolve')
    # deconvolve_list, _ = deconvolve_component(
    #     dirty_list, psf_list,
    #     model_imagelist=model_list,
    #     deconvolve_facets=8,
    #     deconvolve_overlap=16,
    #     deconvolve_taper='tukey',
    #     scales=[0, 3, 10],
    #     algorithm='msclean',
    #     niter=1000,
    #     fractional_threshold=0.1,
    #     threshold=0.1,
    #     gain=0.1,
    #     psf_support=64)
    # deconvolved = arlexecute.compute(deconvolve_list, sync=True)

    LOG.info('About to run continuum imaging')
    continuum_imaging_list = continuum_imaging_arlexecute(
        predicted_vislist,
        model_imagelist		= model_list,
        context			= jspar["processing"]["continuum_imaging"]["context"] , #'wstack',
        vis_slices		= vis_slices,
        scales			= jspar["processing"]["continuum_imaging"]["scales"],             #[0, 3, 10],
        algorithm		= jspar["processing"]["continuum_imaging"]["algorithm"],          #'mmclean',
        nmoment			= jspar["processing"]["continuum_imaging"]["nmoment"],            #3,
        niter			= jspar["processing"]["continuum_imaging"]["niter"],		  #1000,
        fractional_threshold	= jspar["processing"]["continuum_imaging"]["fractional_threshold"], #0.1,
        threshold		= jspar["processing"]["continuum_imaging"]["threshold"], 	  #0.1,
        nmajor			= jspar["processing"]["continuum_imaging"]["nmajor"], 		  #5,
        gain			= jspar["processing"]["continuum_imaging"]["gain"],               #0.25,
        deconvolve_facets	= jspar["processing"]["continuum_imaging"]["deconvolve_facets"],  #8,
        deconvolve_overlap	= jspar["processing"]["continuum_imaging"]["deconvolve_overlap"], #16,
        deconvolve_taper	= jspar["processing"]["continuum_imaging"]["deconvolve_taper"],   #'tukey',
        psf_support		= jspar["processing"]["continuum_imaging"]["psf_support"] )        #64)
    result = arlexecute.compute(continuum_imaging_list, sync=True)
    deconvolved = result[0][0]
    residual = result[1][0]
    restored = result[2][0]

    print(qa_image(deconvolved, context='Clean image - no selfcal'))
    print(qa_image(restored, context='Restored clean image - no selfcal'))
    export_image_to_fits(restored,
                         '%s/%s' % (RESULTS_DIR, jspar["files"]["continuum_imaging_restored"]))

    print(qa_image(residual[0], context='Residual clean image - no selfcal'))
    export_image_to_fits(residual[0],
                         '%s/%s' % (RESULTS_DIR, jspar["files"]["continuum_imaging_residual"]))

    controls = create_calibration_controls()

    controls['T']['first_selfcal'] = jspar["processing"]["controls"]["T"]["first_selfcal"]
    controls['G']['first_selfcal'] = jspar["processing"]["controls"]["G"]["first_selfcal"]
    controls['B']['first_selfcal'] = jspar["processing"]["controls"]["B"]["first_selfcal"]

    controls['T']['timescale'] = jspar["processing"]["controls"]["T"]["timescale"]
    controls['G']['timescale'] = jspar["processing"]["controls"]["G"]["timescale"]
    controls['B']['timescale'] = jspar["processing"]["controls"]["B"]["timescale"]

    PP.pprint(controls)

    future_corrupted_vislist = arlexecute.scatter(corrupted_vislist)
    ical_list = ical_arlexecute(future_corrupted_vislist,
        model_imagelist		= model_list,
        context			= jspar["processing"]["ical"]["context"] , 		#'wstack',
        calibration_context	= jspar["processing"]["ical"]["calibration_context"] , 	#'TG',
        controls		= controls,
        vis_slices		= ntimes,
        scales			= jspar["processing"]["ical"]["scales"],             	#[0, 3, 10],
        timeslice		= jspar["processing"]["ical"]["timeslice"],          	#'auto',
        algorithm		= jspar["processing"]["ical"]["algorithm"],          	#'mmclean',
        nmoment			= jspar["processing"]["ical"]["nmoment"],            	#3,
        niter			= jspar["processing"]["ical"]["niter"],		  	#1000,
        fractional_threshold	= jspar["processing"]["ical"]["fractional_threshold"], 	#0.1,
        threshold		= jspar["processing"]["ical"]["threshold"], 	  	#0.1,
        nmajor			= jspar["processing"]["ical"]["nmajor"], 		#5,
        gain			= jspar["processing"]["ical"]["gain"],               	#0.25,
        deconvolve_facets	= jspar["processing"]["ical"]["deconvolve_facets"],  	#8,
        deconvolve_overlap	= jspar["processing"]["ical"]["deconvolve_overlap"], 	#16,
        deconvolve_taper	= jspar["processing"]["ical"]["deconvolve_taper"],   	#'tukey',
        global_solution		= jspar["processing"]["ical"]["global_solution"],    	#False,
        do_selfcal		= jspar["processing"]["ical"]["do_selfcal"],         	#True,
        psf_support		= jspar["processing"]["ical"]["psf_support"])         	#64


    LOG.info('About to run ical')
    result = arlexecute.compute(ical_list, sync=True)
    deconvolved = result[0][0]
    residual = result[1][0]
    restored = result[2][0]

    print(qa_image(deconvolved, context='Clean image'))
    print(qa_image(restored, context='Restored clean image'))
    export_image_to_fits(restored, '%s/%s' % (RESULTS_DIR, jspar["files"]["ical_restored"]))

    print(qa_image(residual[0], context='Residual clean image'))
    export_image_to_fits(residual[0], '%s/%s' % (RESULTS_DIR, jspar["files"]["ical_residual"]))

    arlexecute.close()
528505
private void constructExample() {
		add(new WHeading(HeadingLevel.H2, "Examples showing TabSet Type property."));
		add(new WHeading(HeadingLevel.H3, "Tabs at the top"));
		WTabSet tabset0 = new SampleWTabset();
		add(tabset0);

		add(new WHeading(HeadingLevel.H3, "Tabs at the top with explicit TYPE"));
		/* Explicitly setting TYPE_TOP is superfluous */
		WTabSet tabset1 = new SampleWTabset(WTabSet.TYPE_TOP);
		add(tabset1);

		add(new WHeading(HeadingLevel.H3, "Tabs on the LEFT"));
		WTabSet tabset1a = new SampleWTabset(WTabSet.TYPE_LEFT);
		add(tabset1a);

		add(new WHeading(HeadingLevel.H3, "Tabs on the RIGHT"));
		WTabSet tabset1b = new SampleWTabset(WTabSet.TYPE_RIGHT);
		add(tabset1b);

		add(new WHeading(HeadingLevel.H3, "ACCORDION tabs"));
		WTabSet tabset1c = new SampleWTabset(TabSetType.ACCORDION);
		add(tabset1c);

		add(new WHorizontalRule());

		/* Content height */
		add(new WHeading(HeadingLevel.H2, "Examples showing content height property."));
		add(new WHeading(HeadingLevel.H3, "Tall content."));
		WTabSet htabset1 = new SampleWTabset();
		htabset1.setContentHeight(TALL_CONTENT);
		add(htabset1);

		WTabSet htabset1a = new SampleWTabset(WTabSet.TYPE_LEFT);
		htabset1a.setContentHeight(TALL_CONTENT);
		add(htabset1a);

		WTabSet htabset1b = new SampleWTabset(WTabSet.TYPE_RIGHT);
		htabset1b.setContentHeight(TALL_CONTENT);
		add(htabset1b);

		WTabSet htabset1c = new SampleWTabset(TabSetType.ACCORDION);
		htabset1c.setContentHeight(TALL_CONTENT);
		add(htabset1c);

		add(new WHeading(HeadingLevel.H3, "Short content."));
		WTabSet htabset1d = new SampleWTabset();
		htabset1d.setContentHeight(SHORT_CONTENT);
		add(htabset1d);

		WTabSet htabset1e = new SampleWTabset(WTabSet.TYPE_LEFT);
		htabset1e.setContentHeight(SHORT_CONTENT);
		add(htabset1e);

		WTabSet htabset1f = new SampleWTabset(WTabSet.TYPE_RIGHT);
		htabset1f.setContentHeight(SHORT_CONTENT);
		add(htabset1f);

		WTabSet htabset1g = new SampleWTabset(TabSetType.ACCORDION);
		htabset1g.setContentHeight(SHORT_CONTENT);
		add(htabset1g);

		add(new WHorizontalRule());
		add(new WHeading(HeadingLevel.H2, "Examples showing disabled property."));

		/* NOTE: WTabSet does not currently implement SubordinateTarget therefore one cannot create a subordinate
		 * control to disable/enable a WTabSet.
		 */
		WTabSet disabledTabset = new SampleWTabset();
		disabledTabset.setDisabled(true);
		add(disabledTabset);


		add(new WHeading(HeadingLevel.H2, "Examples showing accordion's single property."));
		WTabSet singleOpenAccordionabset = new SampleWTabset(WTabSet.TYPE_ACCORDION);
		singleOpenAccordionabset.setSingle(true);
		add(singleOpenAccordionabset);

		add(new WHorizontalRule());

		/* NOTE: no example of the hidden property because WTabSet is not a subordinate target. This is inconsistent
		 * with the schema. */
		add(new WHeading(HeadingLevel.H2, "Setting the initially active tab"));
		add(new WHeading(HeadingLevel.H3,
				"Server side with tabs on the left, with second tab initially active."));
		WTabSet tabset3 = new WTabSet(WTabSet.TYPE_LEFT);
		tabset3.setContentHeight("10em");
		tabset3.addTab(new WText("Some content should go in here."), "First tab",
				WTabSet.TAB_MODE_SERVER, 'i');

		WPanel largeContent2 = new WPanel();
		largeContent2.setLayout(new FlowLayout(Alignment.VERTICAL));
		largeContent2.add(new WText(LONG_TEXT));
		largeContent2.add(new WText(LONG_TEXT));
		largeContent2.add(new WText(LONG_TEXT));
		tabset3.addTab(largeContent2, "Second tab which is much longer", WTabSet.TAB_MODE_SERVER,
				'e');

		WImage image = new WImage("/image/success.png", "success");
		image.setCacheKey("eg-image-tab");
		WDecoratedLabel tabLabel = new WDecoratedLabel(image, new WText("Third tab"), null);

		tabset3.addTab(new WText("The tab button for this tab has an image!"), tabLabel,
				WTabSet.TAB_MODE_SERVER, 'h');

		// Set 2nd tab active
		tabset3.setActiveIndex(1);
		add(tabset3);

		add(new WHeading(HeadingLevel.H3,
				"Client side with tabs on the right and the third tab initially active."));
		WText thirdContent = new WText("Some more content should go into here.");
		WTabSet tabset4 = new WTabSet(WTabSet.TYPE_RIGHT);
		tabset4.setContentHeight("10em");
		tabset4.addTab(new WText("Some content should go into here."), "First tab",
				WTabSet.TAB_MODE_CLIENT);
		tabset4.addTab(new WText(LONG_TEXT), "Second tab which is longer", WTabSet.TAB_MODE_CLIENT);
		tabset4.addTab(thirdContent, "Third tab", WTabSet.TAB_MODE_CLIENT);

		// Set 3rd tab active
		tabset4.setActiveTab(thirdContent);
		add(tabset4);

		add(new WHeading(HeadingLevel.H3, "Client side with showing lots of tabs."));
		add(new ExplanatoryText(
				"This will effectively show what happens when tabs need to wrap. You should do everything possible to avoid this situation."));
		WTabSet tabset5 = new WTabSet();
		tabset5.addTab(new WText("Tab 1."), "First tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 2."), "Second tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 3."), "Third tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 4."), "Fourth tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 5."), "Fifth tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 6."), "Sixth tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 7."), "Seventh tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 8."), "Eighth tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 9."), "Nineth tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 10."), "Tenth tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 11."), "Eleventh tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 12."), "Twelfth tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 13."), "Thirteenth tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 14."), "Fourteenth tab", WTabSet.TAB_MODE_CLIENT);
		tabset5.addTab(new WText("Tab 15."), "Fifteenth tab", WTabSet.TAB_MODE_CLIENT);
		add(tabset5);

		add(new WHorizontalRule());

		add(new WHeading(HeadingLevel.H2, "Using WSubordinateControl"));
		WTabSet targetTabset = new SampleWTabset();
		add(targetTabset);

		WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
		add(layout);
		final WCheckBox disabledControllerCb = new WCheckBox();
		final WCheckBox hiddenControllerCb = new WCheckBox();
		layout.addField("disable tabset", disabledControllerCb);
		layout.addField("hide tabset", hiddenControllerCb);


		// Build & add the subordinate
		SubordinateBuilder builder = new SubordinateBuilder();
		builder.condition().equals(hiddenControllerCb, String.valueOf(true));
		builder.whenTrue().hide(targetTabset);
		builder.whenFalse().show(targetTabset);
		add(builder.build());

		builder = new SubordinateBuilder();
		builder.condition().equals(disabledControllerCb, String.valueOf(true));
		builder.whenTrue().disable(targetTabset);
		builder.whenFalse().enable(targetTabset);
		add(builder.build());

	}
165371
def main():
    ''''''
    args = docopt(__doc__, version=__version__)

    if 'bam_coverage' in args:
        bam_coverage(args['<reference>'],
                     args['<alignments>'],
                     int(args['<minmatch>']),
                     min_mapq=int(args['--mapq']),
                     min_len=float(args['--minlen']))
63841
def main(args, prog_name):
  """"""
  # get options and arguments
  ui = getUI(prog_name, args)

  if ui.optionIsSet("test"):
    # just run unit tests
    unittest.main(argv=[sys.argv[0]])
  elif ui.optionIsSet("help"):
    # just show help
    ui.usage()
  else:
    verbose = (ui.optionIsSet("verbose") is True) or DEFAULT_VERBOSITY

    # get output handle
    out_fh = sys.stdout
    if ui.optionIsSet("output"):
      out_fh = open(ui.getValue("output"), "w")

    # get window size...
    window_size = DEFAULT_WINDOW_SIZE
    if ui.optionIsSet("window"):
      window_size = ui.getValue("window")

    # get the window anchoring location
    windowCentre = DEFAULT_WINDOW_CENTRE
    if ui.optionIsSet("centre"):
      windowCentre = ui.getValue("centre")
      if windowCentre not in WINDOW_CENTRE_OPTIONS:
        sys.stderr.write("un-recognised window anchor position: " +
                         str(windowCentre) + "\n")
        sys.exit(1)

    args = ui.getAllArguments()
    assert(len(args) == 3 or len(args) == 4)
    region_fn = ui.getArgument(0)
    ga_path = ui.getArgument(1)
    index_fn = None
    if len(args) == 3:
      spec = ui.getArgument(2)
    else:
      index_fn = ui.getArgument(2)
      spec = ui.getArgument(3)

    extensions = (ui.getValue("extensions").strip().split(",") if
                  ui.optionIsSet("extensions") else None)
    index_extensions = (ui.getValue("index-extensions").strip().split(",") if
                        ui.optionIsSet("index-extensions") else None)
    fail_no_index = ui.optionIsSet("fail-no-index")
    mi_seqs = (MissingSequenceHandler[ui.getValue("missing")]
               if ui.optionIsSet("missing")
               else MissingSequenceHandler.TREAT_AS_ALL_GAPS)
    species = ([x.strip() for x in ui.getValue("species").split(",")] if
               ui.optionIsSet("species") else None)

    # build the genome alignment
    alig = (load_just_in_time_genome_alignment(ga_path, spec, extensions,
                                               index_extensions, fail_no_index,
                                               verbose)
            if os.path.isdir(ga_path)
            else build_genome_alignment_from_file(ga_path, spec, index_fn,
                                                  verbose))

    # get the profile and write it to the output stream
    profile = processBED(open(region_fn), alig, window_size, CENTRE,
                         mi_seqs, species, verbose)
    out_fh.write("\n\n" + ", ".join(str(x) for x in profile) + "\n")
619769
def real_main(release_url=None,
              tests_json_path=None,
              upload_build_id=None,
              upload_release_name=None):
    """"""
    coordinator = workers.get_coordinator()
    fetch_worker.register(coordinator)
    coordinator.start()

    data = open(FLAGS.tests_json_path).read()
    tests = load_tests(data)

    item = DiffMyImages(
        release_url,
        tests,
        upload_build_id,
        upload_release_name,
        heartbeat=workers.PrintWorkflow)
    item.root = True

    coordinator.input_queue.put(item)
    coordinator.wait_one()
    coordinator.stop()
    coordinator.join()
1224538
def main():
  '''  '''
  arguments = docopt(__doc__, version=__version__)

  if arguments['ls'] or arguments['list']:
    _get_licences()
  elif arguments['--tldr'] and arguments['<NAME>']:
    get_license_summary(arguments['<NAME>'].lower())
  elif arguments['--export'] and arguments['<NAME>']:
    save_license(arguments['<NAME>'].lower())
  elif arguments['<NAME>']:
    print(_get_license_description(arguments['<NAME>'].lower()))
  else:
    print(__doc__)
197008
def main(**kwargs):
    """"""
    options = ApplicationOptions(**kwargs)
    Event.configure(is_logging_enabled=options.event_logging)
    application = Application(options)
    application.run(options.definition)
964557
def view(self, request, application, label, roles, actions):
        
        if application.content_type.model == 'applicant':
            if not application.applicant.email_verified:
                application.applicant.email_verified = True
                application.applicant.save()
        for action in actions:
            if action in request.POST:
                return action
        link, is_secret = base.get_email_link(application)
        return render(
            template_name='kgapplications/project_aed_introduction.html',
            context={
                'actions': actions,
                'application': application, 'roles': roles,
                'link': link, 'is_secret': is_secret,
            },
            request=request)
981913
def _create_application(self):
        
        # Create Application.
        application = Application(
            input=self.input,
            output=self.output,
            editing_mode=EditingMode.VI,
            layout=self.editor_layout.layout,
            key_bindings=self.key_bindings,
#            get_title=lambda: get_terminal_title(self),
            style=DynamicStyle(lambda: self.current_style),
            paste_mode=Condition(lambda: self.paste_mode),
#            ignore_case=Condition(lambda: self.ignore_case),  # TODO
            include_default_pygments_style=False,
            mouse_support=Condition(lambda: self.enable_mouse_support),
            full_screen=True,
            enable_page_navigation_bindings=True)

        # Handle command line previews.
        # (e.g. when typing ':colorscheme blue', it should already show the
        # preview before pressing enter.)
        def preview(_):
            if self.application.layout.has_focus(self.command_buffer):
                self.previewer.preview(self.command_buffer.text)
        self.command_buffer.on_text_changed += preview

        return application
846112
private void constructExample() {
		add(new WHeading(HeadingLevel.H3, "ACCORDION tabs"));
		WTabSet tabset1c = new SampleWTabset(TabSetType.ACCORDION);
		add(tabset1c);


		/* Content height */
		add(new WHeading(HeadingLevel.H2, "Examples showing content height property."));
		add(new WHeading(HeadingLevel.H3, "Tall content."));

		WTabSet htabset1c = new SampleWTabset(TabSetType.ACCORDION);
		htabset1c.setContentHeight(TALL_CONTENT);
		add(htabset1c);

		add(new WHeading(HeadingLevel.H3, "Short content."));

		WTabSet htabset1g = new SampleWTabset(TabSetType.ACCORDION);
		htabset1g.setContentHeight(SHORT_CONTENT);
		add(htabset1g);


		add(new WHeading(HeadingLevel.H2, "Examples showing accordion's single property."));
		WTabSet singleOpenAccordionabset = new SampleWTabset(WTabSet.TYPE_ACCORDION);
		singleOpenAccordionabset.setSingle(true);
		add(singleOpenAccordionabset);


		add(new WHeading(HeadingLevel.H2, "Using WSubordinateControl"));
		WTabSet targetTabset = new SampleWTabset(TabSetType.ACCORDION);
		add(targetTabset);

		WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
		add(layout);
		final WCheckBox disabledControllerCb = new WCheckBox();
		final WCheckBox hiddenControllerCb = new WCheckBox();
		layout.addField("disable tabset", disabledControllerCb);
		layout.addField("hide tabset", hiddenControllerCb);


		// Build & add the subordinate
		SubordinateBuilder builder = new SubordinateBuilder();
		builder.condition().equals(hiddenControllerCb, String.valueOf(true));
		builder.whenTrue().hide(targetTabset);
		builder.whenFalse().show(targetTabset);
		add(builder.build());

		builder = new SubordinateBuilder();
		builder.condition().equals(disabledControllerCb, String.valueOf(true));
		builder.whenTrue().disable(targetTabset);
		builder.whenFalse().enable(targetTabset);
		add(builder.build());

	}
1305682
private static void createAndShowGUI() {

    // Create and set up the window.
    JFrame frame = new JFrame("XChart Style Demo");
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    XChartStyleDemo demo = new XChartStyleDemo();

    // Add content to the window.
    frame.add(demo.styleSplitPane);

    // Display the window.
    frame.pack();
    frame.setVisible(true);
  }
882047
def main():
    """"""
    args = parse_arguments()
    pid = args.pid
    title = get_programme_title(pid)
    broadcast_date = get_broadcast_date(pid)
    listing = extract_listing(pid)
    filename = get_output_filename(args)
    tracklisting = generate_output(listing, title, broadcast_date)
    output_to_file(filename, tracklisting, args.action)
    print("Done!")
1263409
def demo(quiet, shell, speed, prompt, commentecho):
    """"""
    run(
        DEMO,
        shell=shell,
        speed=speed,
        test_mode=TESTING,
        prompt_template=prompt,
        quiet=quiet,
        commentecho=commentecho,
    )
611653
private void registerSamples() {
		SamplePanelRegistry.registerFactory(CATEGORY_WMS, new ShowcaseSampleDefinition() {

			public SamplePanel create() {
				return new WmsLayerPanel();
			}

			public String getTitle() {
				return MESSAGES.wmsLayerTitle();
			}

			public String getShortDescription() {
				return MESSAGES.wmsLayerShort();
			}

			public String getDescription() {
				return MESSAGES.wmsLayerDescription();
			}

			public String getCategory() {
				return CATEGORY_WMS;
			}

			@Override
			public String getKey() {
				return "basicwmslayer";
			}
		});
		SamplePanelRegistry.registerFactory(CATEGORY_WMS, new ShowcaseSampleDefinition() {

			public SamplePanel create() {
				return new CapabilitiesPanel();
			}

			public String getTitle() {
				return MESSAGES.capabilitiesTitle();
			}

			public String getShortDescription() {
				return MESSAGES.capabilitiesShort();
			}

			public String getDescription() {
				return MESSAGES.capabilitiesDescription();
			}

			public String getCategory() {
				return CATEGORY_WMS;
			}

			@Override
			public String getKey() {
				return "wmsgetcapabilities";
			}
		});
		SamplePanelRegistry.registerFactory(CATEGORY_WMS, new ShowcaseSampleDefinition() {

			public SamplePanel create() {
				return new WmsFeatureInfoPanel();
			}

			public String getTitle() {
				return MESSAGES.wmsGetFeatureInfoTitle();
			}

			public String getShortDescription() {
				return MESSAGES.wmsGetFeatureInfoShort();
			}

			public String getDescription() {
				return MESSAGES.wmsGetFeatureInfoDescription();
			}

			public String getCategory() {
				return CATEGORY_WMS;
			}

			@Override
			public String getKey() {
				return "wmsgetfeatureinfo";
			}
		});
		SamplePanelRegistry.registerFactory(CATEGORY_WMS, new ShowcaseSampleDefinition() {

			public SamplePanel create() {
				return new SelectStylePanel();
			}

			public String getTitle() {
				return MESSAGES.selectStyleTitle();
			}

			public String getShortDescription() {
				return MESSAGES.selectStyleShort();
			}

			public String getDescription() {
				return MESSAGES.selectStyleDescription();
			}

			public String getCategory() {
				return CATEGORY_WMS;
			}

			@Override
			public String getKey() {
				return "selectstyle";
			}
		});
		SamplePanelRegistry.registerFactory(CATEGORY_WMS, new ShowcaseSampleDefinition() {

			public SamplePanel create() {
				return new WmsLayerLegendPanel();
			}

			public String getTitle() {
				return MESSAGES.wmsLayerLegendTitle();
			}

			public String getShortDescription() {
				return MESSAGES.wmsLayerLegendShort();
			}

			public String getDescription() {
				return MESSAGES.wmsLayerLegendDescription();
			}

			public String getCategory() {
				return CATEGORY_WMS;
			}

			@Override
			public String getKey() {
				return "wmslayerlegend";
			}
		});
	}
233442
def show(config):
    """"""
    with open(config, 'r'):
        main.show(yaml.load(open(config)))