Create all window and wsymm strategies
322384
def _generate_window_strategies():
  
  for wnd_dict in window._content_generation_table:
    names = wnd_dict["names"]
    sname = wnd_dict["sname"] = names[0]
    wnd_dict.setdefault("params_def", "")
    for sdict in [window, wsymm]:
      docs_dict = window._doc_kwargs(symm = sdict is wsymm, **wnd_dict)
      decorators = [format_docstring(**docs_dict), sdict.strategy(*names)]
      ns = dict(pi=pi, sin=sin, cos=cos, xrange=xrange, __name__=__name__)
      exec(sdict._code_template.format(**wnd_dict), ns, ns)
      reduce(lambda func, dec: dec(func), decorators, ns[sname])
      if not wnd_dict.get("distinct", True):
        wsymm[sname] = window[sname]
        break
    wsymm[sname].periodic = window[sname].periodic = window[sname]
    wsymm[sname].symm = window[sname].symm = wsymm[sname]
1093201
function setupWindow(win, conn) {
  win.on('inputChar', function (c, i) {
    if (i === nc.keys.ESC) {
      var items = {};
      for (var i=0; i<connections.length; i++) {
        items[connections[i].client.opt.server] = connections[i].wins.status;
        for (var j=0,chans=Object.keys(connections[i].wins.channels); j<chans.length; j++)
          items['  ' + chans[j]] = connections[i].wins.channels[chans[j]];
        for (var j=0,queries=Object.keys(connections[i].wins.queries); j<queries.length; j++)
          items['  Q:' + queries[j]] = connections[i].wins.queries[queries[j]];
      }
      widgets.ListBox(items,
        {
          title: 'Windows',
          height: Math.min(Object.keys(items).length+2, nc.lines-2),
          style: {
            colors: {
              bg: 'blue',
              fg: 'white'
            }
          }
        }, function(window) {
          if (window)
            window.top();
          nc.redraw();
      });
    } else if (i === nc.keys.BACKSPACE && win.curx > 0) {
      win.inbuffer = win.inbuffer.substring(0, win.curx - 1) + win.inbuffer.substring(win.curx);
      win.delch(win.height-1, win.curx - 1);
      win.refresh();
    } else if (i === nc.keys.DEL) {
      win.inbuffer = win.inbuffer.substring(0, win.curx) + win.inbuffer.substring(win.curx + 1);
      win.delch(win.height-1, win.curx);
      win.refresh();
    } else if (i === nc.keys.LEFT && win.curx > 0) {
      win.cursor(win.height-1, win.curx-1);
      win.refresh();
    } else if (i === nc.keys.RIGHT && win.curx < win.inbuffer.length) {
      win.cursor(win.height-1, win.curx+1);
      win.refresh();
    } else if (i === nc.keys.END) {
      win.cursor(win.height-1, win.inbuffer.length);
      win.refresh();
    } else if (i === nc.keys.HOME) {
      win.cursor(win.height-1, 0);
      win.refresh();
	  } else if (i === nc.keys.NEWLINE) {
	    if (win.inbuffer.length) {
	      if (win.inbuffer[0] === '/') {
  	      var cmd = win.inbuffer.substring(1).split(' ', 1).join('').trim(),
  	          args = win.inbuffer.substring(win.inbuffer.indexOf(cmd)+cmd.length+1).trim();
	        switch (cmd.toLowerCase()) {
            case 'j':
	          case 'join':
              if (args.length) {
                if (args[0] !== '#' && args[0] !== '&'
                    && args[0] !== '+' && args[0] !== '!')
                  args = "#" + args;
                if (args.length > 1 && !conn.wins.channels[args])
                  conn.client.join(args);
              }
	          break;
            case 'part':
              var name = getWinName(win, conn);
              if (name[0] === '#' || name[0] === '&'
                  || name[0] === '+' || name[0] === '!') {
                conn.client.part(name);
                delete conn.wins.channels[name];
              }
            break;
	          case 'msg':
	            var who = args.substring(0, args.indexOf(' ')),
	                message = args.substring(args.indexOf(' ')+1);
	            if (!who.length || !message.length)
	              appendLine(win, 'Invalid arguments');
	            else {
	              conn.client.say(who, message);
	              appendLine(win, '* ->' + who + ': ' + message);
	            }
	          break;
	          case 'me':
	            if (win !== conn.wins.status) {
	              if (args.length) {
                  var key = getWinName(win, conn);
	                conn.client.say(key, CTCP_DELIM + 'ACTION ' + args + CTCP_DELIM);
  	              appendLine(win, '* ' + conn.client.nick + ' ' + args, COLOR_ACTION);
  	            }
	            } else
	              appendLine(win, 'That command is only valid on channel and query windows');
	          break;
            case 'whois':
              if (args.length) {
                conn.client.send('WHOIS', args, false);
              }
            break;
            case 'nick':
              if (args.length) {
                var newnick = args.split(' ', 1).join('');
                if (newnick) {
                  conn.client.prevnick = conn.client.nick;
                  conn.client.send("NICK", newnick);
                  conn.client.nick = newnick;
                }
              }
            break;
            case 'away':
              conn.client.send('AWAY', (args.length ? args : 'I am away'));
              appendLine(conn.wins.status, '* You have been marked as being away', nc.attrs.BOLD);
            break;
            case 'back':
              conn.client.send('AWAY');
              appendLine(conn.wins.status, '* You are no longer marked as being away', nc.attrs.BOLD);
            break;
            case 'exit':
	          case 'quit':
	            if (args.length)
  	            conn.client.disconnect(args);
  	          else
  	            conn.client.disconnect();
	            cleanup();
	          break;
	          case 'close':
	            if (win === conn.wins.status)
	              conn.client.disconnect();
	            else {
                var key = getWinName(win, conn);
                if (key[0] === '#' || key[0] === '&'
                    || key[0] === '+' || key[0] === '!') {
                  conn.client.part(key);
                  delete conn.wins.channels[key];
                } else
                  delete conn.wins.queries[key];
	            }
              win.close();
              nc.redraw();
              if (nc.numwins === 1)
                cleanup();
              return;
	          break;
	          case 'query':
	            var to = args.split(' ', 1).join('');
              if (!conn.wins.queries[to.toLowerCase()]) {
                var query = new nc.Window(nc.lines, nc.cols);
                setupWindow(query, conn);
                updateHeader(query, 'Query: ' + to, {pos: 'center'});
                conn.wins.queries[to.toLowerCase()] = query;
              }
	          break;
            case 'connect':
            break;
            case 'server':
            break;
            case 'whowas':
            break;
            case 'who':
            break;
            case 'info':
            break;
            case 'banlist':
            break;
            case 'notice':
            break;
            case 'invite':
            break;
            case 'ctcp':
            break;
	          default:
  	          appendLine(win, 'Unknown command: ' + cmd);
	        }
	      } else if (win.inbuffer.length && win !== conn.wins.status) {
          var key = getWinName(win, conn);
	        conn.client.say(key, win.inbuffer);
	        appendLine(win, '<' + conn.client.nick + '> ' + win.inbuffer);
	      }
	      win.inbuffer = "";
	      win.cursor(win.height-1, 0);
	      win.clrtoeol();
	      win.refresh();
	    }
	  } else if (i >= 32 && i <= 126 && win.curx < win.width-1) {
	    win.inbuffer = win.inbuffer.slice(0, win.curx) + c + win.inbuffer.slice(win.curx);

	    if (win.curx < win.inbuffer.length) {
	      win.insch(i);
	      win.cursor(win.height - 1, win.curx + 1);
	    } else {
	      win.addch(i);
	    }
	    
	    win.refresh();
	  }
  });
  win.scrollok(true);
  win.hline(win.height-2, 0, win.width);
  win.setscrreg(1, win.height-3); // Leave one line at the top for the header
  win.cursor(win.height-1, 0);
  win.refresh();
  win.inbuffer = "";
}
414005
private Window createWindow(String subtitle) {
		Window w = new Window();
		w.setWidth(windowWidth);
		w.setHeight(windowHeight);
		w.setTitle(I18nProvider.getAttribute().getAttributeWindowTitle(subtitle));
		w.setCanDragReposition(true);
		w.setCanDragResize(true);
		w.setAutoCenter(true);
		w.setKeepInParentRect(true);
		return w;
	}
834164
def setup_menu_actions(self):
        """"""
        self.recent_notebook_menu.clear()
        self.recent_notebooks_actions = []
        if self.recent_notebooks:
            for notebook in self.recent_notebooks:
                name = notebook
                action = \
                    create_action(self,
                                  name,
                                  icon=ima.icon('filenew'),
                                  triggered=lambda v,
                                  path=notebook:
                                      self.create_new_client(filename=path))
                self.recent_notebooks_actions.append(action)
            self.recent_notebooks_actions += \
                [None, self.clear_recent_notebooks_action]
        else:
            self.recent_notebooks_actions = \
                [self.clear_recent_notebooks_action]
        add_actions(self.recent_notebook_menu, self.recent_notebooks_actions)
        self.update_notebook_actions()
458660
def _create_controls(self, can_kill):
        
        DEBUG_MSG("_create_controls()", 1, self)
        # Need the following line as Windows toolbars default to 15x16

        self.SetToolBitmapSize(wx.Size(16,16))
        self.AddSimpleTool(_NTB_X_PAN_LEFT, _load_bitmap('stock_left.xpm'),
                           'Left', 'Scroll left')
        self.AddSimpleTool(_NTB_X_PAN_RIGHT, _load_bitmap('stock_right.xpm'),
                           'Right', 'Scroll right')
        self.AddSimpleTool(_NTB_X_ZOOMIN, _load_bitmap('stock_zoom-in.xpm'),
                           'Zoom in', 'Increase X axis magnification')
        self.AddSimpleTool(_NTB_X_ZOOMOUT, _load_bitmap('stock_zoom-out.xpm'),
                           'Zoom out', 'Decrease X axis magnification')
        self.AddSeparator()
        self.AddSimpleTool(_NTB_Y_PAN_UP,_load_bitmap('stock_up.xpm'),
                           'Up', 'Scroll up')
        self.AddSimpleTool(_NTB_Y_PAN_DOWN, _load_bitmap('stock_down.xpm'),
                           'Down', 'Scroll down')
        self.AddSimpleTool(_NTB_Y_ZOOMIN, _load_bitmap('stock_zoom-in.xpm'),
                           'Zoom in', 'Increase Y axis magnification')
        self.AddSimpleTool(_NTB_Y_ZOOMOUT, _load_bitmap('stock_zoom-out.xpm'),
                           'Zoom out', 'Decrease Y axis magnification')
        self.AddSeparator()
        self.AddSimpleTool(_NTB_SAVE, _load_bitmap('stock_save_as.xpm'),
                           'Save', 'Save plot contents as images')
        self.AddSeparator()

        bind(self, wx.EVT_TOOL, self._onLeftScroll, id=_NTB_X_PAN_LEFT)
        bind(self, wx.EVT_TOOL, self._onRightScroll, id=_NTB_X_PAN_RIGHT)
        bind(self, wx.EVT_TOOL, self._onXZoomIn, id=_NTB_X_ZOOMIN)
        bind(self, wx.EVT_TOOL, self._onXZoomOut, id=_NTB_X_ZOOMOUT)
        bind(self, wx.EVT_TOOL, self._onUpScroll, id=_NTB_Y_PAN_UP)
        bind(self, wx.EVT_TOOL, self._onDownScroll, id=_NTB_Y_PAN_DOWN)
        bind(self, wx.EVT_TOOL, self._onYZoomIn, id=_NTB_Y_ZOOMIN)
        bind(self, wx.EVT_TOOL, self._onYZoomOut, id=_NTB_Y_ZOOMOUT)
        bind(self, wx.EVT_TOOL, self._onSave, id=_NTB_SAVE)
        bind(self, wx.EVT_TOOL_ENTER, self._onEnterTool, id=self.GetId())
        if can_kill:
            bind(self, wx.EVT_TOOL, self._onClose, id=_NTB_CLOSE)
        bind(self, wx.EVT_MOUSEWHEEL, self._onMouseWheel)
413244
function launch(wmsCatalogItem, bbox) {
  // // At the moment just grab the screen extent
  // // Calculate view extent in degrees
  // const bbox = wmsCatalogItem.terria.currentViewer.getCurrentExtent();

  bbox.west = CesiumMath.toDegrees(bbox.west);
  bbox.south = CesiumMath.toDegrees(bbox.south);
  bbox.east = CesiumMath.toDegrees(bbox.east);
  bbox.north = CesiumMath.toDegrees(bbox.north);

  const query = {
    service: "WCS",
    request: "GetCoverage",
    version: "1.0.0",
    format: "GeoTIFF",
    crs: "EPSG:4326",
    width: 1024,
    height: Math.round((1024 * bbox.height) / bbox.width),
    coverage: wmsCatalogItem.linkedWcsCoverage,
    bbox: `${bbox.west},${bbox.south},${bbox.east},${bbox.north}`
  };

  if (defined(wmsCatalogItem.discreteTime)) {
    query.time = wmsCatalogItem.discreteTime.toISOString();
  }

  const style = getStyle(wmsCatalogItem);
  if (defined(style)) {
    query.styles = style;
  }

  var uri = new URI(wmsCatalogItem.linkedWcsUrl).query(query);

  var url = proxyCatalogItemUrl(wmsCatalogItem, uri.toString(), "1d");

  var now = new Date();
  var timestamp = sprintf(
    "%04d-%02d-%02dT%02d:%02d:%02d",
    now.getFullYear(),
    now.getMonth() + 1,
    now.getDate(),
    now.getHours(),
    now.getMinutes(),
    now.getSeconds()
  );

  const asyncResult = new ResultPendingCatalogItem(wmsCatalogItem.terria);
  asyncResult.name = wmsCatalogItem.name + " " + timestamp;
  asyncResult.description =
    "This is the result of exporting data from " +
    wmsCatalogItem.name +
    " service at " +
    timestamp +
    " with the input parameters below.";

  const parametersForInfo = [
    { name: "Bounding box", value: query.bbox },
    { name: "Format", value: query.format }
  ];
  const inputsSection =
    '<table class="cesium-infoBox-defaultTable">' +
    parametersForInfo.reduce(function(previousValue, parameter) {
      return (
        previousValue +
        "<tr>" +
        '<td style="vertical-align: middle">' +
        parameter.name +
        "</td>" +
        "<td>" +
        parameter.value +
        "</td>" +
        "</tr>"
      );
    }, "") +
    "</table>";

  asyncResult.info.push({
    name: "Inputs",
    content: inputsSection
  });

  const promise = loadBlob(url)
    .then(blob => {
      if (blob.type.indexOf("xml") !== -1) {
        // Geoserver errors -_-
        wmsCatalogItem.terria.error.raiseEvent(
          new TerriaError({
            sender: wmsCatalogItem,
            title: "Data export failed",
            message: "The Web Coverage Service failed"
          })
        );
        // Could fetch error details from XML to show to user
        asyncResult.isEnabled = false;
        return;
      }

      FileSaver.saveAs(blob, `${wmsCatalogItem.name} clip.tiff`);

      asyncResult.isEnabled = false;
    })
    .otherwise(error => {
      wmsCatalogItem.terria.error.raiseEvent(
        new TerriaError({
          sender: wmsCatalogItem,
          title: "Data export failed",
          message: `The Web Coverage Service failed: ${error}`
        })
      );
      asyncResult.isEnabled = false;
    });

  asyncResult.loadPromise = promise;
  asyncResult.isEnabled = true;
}
1036191
def generate(env):
    """"""
    SCons.Tool.createStaticLibBuilder(env)
    SCons.Tool.createSharedLibBuilder(env)
    SCons.Tool.createProgBuilder(env)

    env['AR'] = 'mwld'
    env['ARCOM'] = '$AR $ARFLAGS -library -o $TARGET $SOURCES'

    env['LIBDIRPREFIX'] = '-L'
    env['LIBDIRSUFFIX'] = ''
    env['LIBLINKPREFIX'] = '-l'
    env['LIBLINKSUFFIX'] = '.lib'

    env['LINK'] = 'mwld'
    env['LINKCOM'] = '$LINK $LINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'

    env['SHLINK'] = '$LINK'
    env['SHLINKFLAGS'] = '$LINKFLAGS'
    env['SHLINKCOM']   = shlib_action
    env['SHLIBEMITTER']= shlib_emitter
    env['LDMODULEEMITTER']= shlib_emitter
1173310
def _(pymux, variables):
    "  "
    w = pymux.arrangement.get_previous_active_window()

    if w:
        pymux.arrangement.set_active_window(w)
799421
def _create_select_window_handler(self, window):
        "  "
        def handler(mouse_event):
            if mouse_event.event_type == MouseEventType.MOUSE_DOWN:
                self.pymux.arrangement.set_active_window(window)
                self.pymux.invalidate()
            else:
                return NotImplemented  # Event not handled here.
        return handler
567691
def create_actions(MAIN):
    """"""
    actions = MAIN.action  # actions was already taken

    """ ------ OPEN SETTINGS ------ """
    actions['open_settings'] = QAction(QIcon(ICON['settings']), 'Settings',
                                       MAIN)
    actions['open_settings'].triggered.connect(MAIN.show_settings)

    """ ------ CLOSE WINDOW ------ """
    actions['close_wndw'] = QAction(QIcon(ICON['quit']), 'Quit', MAIN)
    actions['close_wndw'].triggered.connect(MAIN.close)

    """ ------ ABOUT ------ """
    actions['about'] = QAction('About WONAMBI', MAIN)
    actions['about'].triggered.connect(MAIN.about)

    actions['aboutqt'] = QAction('About Qt', MAIN)
    actions['aboutqt'].triggered.connect(lambda: QMessageBox.aboutQt(MAIN))
1043186
def __combine_windows(w1, w2):
    
    res = []
    for s1, s2 in zip(w1, w2):
        res.append(slice(min(s1.start, s2.start), max(s1.stop, s2.stop)))
    return tuple(res)
1352747
def create_shortcuts(self):
        """"""
        inspect = config_shortcut(self._control.inspect_current_object,
                                  context='Console',
                                  name='Inspect current object', parent=self)
        clear_console = config_shortcut(self.clear_console, context='Console',
                                        name='Clear shell', parent=self)
        restart_kernel = config_shortcut(self.ipyclient.restart_kernel,
                                         context='ipython_console',
                                         name='Restart kernel', parent=self)
        new_tab = config_shortcut(lambda: self.new_client.emit(),
                                  context='ipython_console', name='new tab',
                                  parent=self)
        reset_namespace = config_shortcut(lambda: self._reset_namespace(),
                                          context='ipython_console',
                                          name='reset namespace', parent=self)
        array_inline = config_shortcut(self._control.enter_array_inline,
                                       context='array_builder',
                                       name='enter array inline', parent=self)
        array_table = config_shortcut(self._control.enter_array_table,
                                      context='array_builder',
                                      name='enter array table', parent=self)
        clear_line = config_shortcut(self.ipyclient.clear_line,
                                     context='console', name='clear line',
                                     parent=self)

        return [inspect, clear_console, restart_kernel, new_tab,
                reset_namespace, array_inline, array_table, clear_line]
159336
def create_window(self, command=None, start_directory=None, name=None):
        
        assert command is None or isinstance(command, six.text_type)
        assert start_directory is None or isinstance(start_directory, six.text_type)

        pane = self._create_pane(None, command, start_directory=start_directory)

        self.arrangement.create_window(pane, name=name)
        pane.focus()
        self.invalidate()
1123086
def generate(env):
    """"""
    for t in SCons.Tool.tool_list(env['PLATFORM'], env):
        SCons.Tool.Tool(t)(env)
329812
function(win, options) {
            var vals = packValueMask('ConfigureWindow', options);
            var format = 'CxSLSxx' + vals[0];
            var args = [12, vals[2].length + 3, win, vals[1]];
            args = args.concat(vals[2]);
            return [format, args];
        }
822014
function createWindow() {
        // Create the browser window.

        // Get full path of the file getting opened
        const target = splitArgs(argv);
        if (target === '' && opts.defaultPath) {
            // Invalid, empty target, let's just create a window from default
            wm.createWindow(opts.defaultPath);
            return;
        }
        const targetPath = pathlib.resolve(process.cwd(), target);

        if (opts.changeDirectory === true) {
            // If we need to change into the relevant directory, do it now
            const dir = pathlib.dirname(targetPath);
            if (fs.existsSync(dir)) {
                process.chdir(dir);
            }
        } else if (String.isString(opts.changeDirectory)) {
            process.chdir(opts.changeDirectory);
        }
        wm.createWindow(targetPath);
    }
651289
def process!
      windows = @termfile[:windows]
      default = windows.delete('default')
      execute_window(default, :default => true) unless default[:tabs].empty?
      windows.each_pair { |_, cont| execute_window(cont) }
    end