text:
ace.define("ace/ext/chromevox",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) {
var cvoxAce = {};
cvoxAce.SpeechProperty;
cvoxAce.Cursor;
cvoxAce.Token;
cvoxAce.Annotation;
var CONSTANT_PROP = {
  'rate': 0.8,
  'pitch': 0.4,
  'volume': 0.9
};
var DEFAULT_PROP = {
  'rate': 1,
  'pitch': 0.5,
  'volume': 0.9
};
var ENTITY_PROP = {
  'rate': 0.8,
  'pitch': 0.8,
  'volume': 0.9
};
var KEYWORD_PROP = {
  'rate': 0.8,
  'pitch': 0.3,
  'volume': 0.9
};
var STORAGE_PROP = {
  'rate': 0.8,
  'pitch': 0.7,
  'volume': 0.9
};
var VARIABLE_PROP = {
  'rate': 0.8,
  'pitch': 0.8,
  'volume': 0.9
};
var DELETED_PROP = {
  'punctuationEcho': 'none',
  'relativePitch': -0.6
};
var ERROR_EARCON = 'ALERT_NONMODAL';
var MODE_SWITCH_EARCON = 'ALERT_MODAL';
var NO_MATCH_EARCON = 'INVALID_KEYPRESS';
var INSERT_MODE_STATE = 'insertMode';
var COMMAND_MODE_STATE = 'start';

var REPLACE_LIST = [
  {
    substr: ';',
    newSubstr: ' semicolon '
  },
  {
    substr: ':',
    newSubstr: ' colon '
  }
];
var Command = {
  SPEAK_ANNOT: 'annots',
  SPEAK_ALL_ANNOTS: 'all_annots',
  TOGGLE_LOCATION: 'toggle_location',
  SPEAK_MODE: 'mode',
  SPEAK_ROW_COL: 'row_col',
  TOGGLE_DISPLACEMENT: 'toggle_displacement',
  FOCUS_TEXT: 'focus_text'
};
var KEY_PREFIX = 'CONTROL + SHIFT ';
cvoxAce.editor = null;
var lastCursor = null;
var annotTable = {};
var shouldSpeakRowLocation = false;
var shouldSpeakDisplacement = false;
var changed = false;
var vimState = null;
var keyCodeToShortcutMap = {};
var cmdToShortcutMap = {};
var getKeyShortcutString = function(keyCode) {
  return KEY_PREFIX + String.fromCharCode(keyCode);
};
var isVimMode = function() {
  var keyboardHandler = cvoxAce.editor.keyBinding.getKeyboardHandler();
  return keyboardHandler.$id === 'ace/keyboard/vim';
};
var getCurrentToken = function(cursor) {
  return cvoxAce.editor.getSession().getTokenAt(cursor.row, cursor.column + 1);
};
var getCurrentLine = function(cursor) {
  return cvoxAce.editor.getSession().getLine(cursor.row);
};
var onRowChange = function(currCursor) {
  if (annotTable[currCursor.row]) {
    cvox.Api.playEarcon(ERROR_EARCON);
  }
  if (shouldSpeakRowLocation) {
    cvox.Api.stop();
    speakChar(currCursor);
    speakTokenQueue(getCurrentToken(currCursor));
    speakLine(currCursor.row, 1);
  } else {
    speakLine(currCursor.row, 0);
  }
};
var isWord = function(cursor) {
  var line = getCurrentLine(cursor);
  var lineSuffix = line.substr(cursor.column - 1);
  if (cursor.column === 0) {
    lineSuffix = ' ' + line;
  }
  var firstWordRegExp = /^\W(\w+)/;
  var words = firstWordRegExp.exec(lineSuffix);
  return words !== null;
};
var rules = {
  'constant': {
    prop: CONSTANT_PROP
  },
  'entity': {
    prop: ENTITY_PROP
  },
  'keyword': {
    prop: KEYWORD_PROP
  },
  'storage': {
    prop: STORAGE_PROP
  },
  'variable': {
    prop: VARIABLE_PROP
  },
  'meta': {
    prop: DEFAULT_PROP,
    replace: [
      {
        substr: '</',
        newSubstr: ' closing tag '
      },
      {
        substr: '/>',
        newSubstr: ' close tag '
      },
      {
        substr: '<',
        newSubstr: ' tag start '
      },
      {
        substr: '>',
        newSubstr: ' tag end '
      }
    ]
  }
};
var DEFAULT_RULE = {
  prop: DEFAULT_RULE
};
var expand = function(value, replaceRules) {
  var newValue = value;
  for (var i = 0; i < replaceRules.length; i++) {
    var replaceRule = replaceRules[i];
    var regexp = new RegExp(replaceRule.substr, 'g');
    newValue = newValue.replace(regexp, replaceRule.newSubstr);
  }
  return newValue;
};
var mergeTokens = function(tokens, start, end) {
  var newToken = {};
  newToken.value = '';
  newToken.type = tokens[start].type;
  for (var j = start; j < end; j++) {
    newToken.value += tokens[j].value;
  }
  return newToken;
};
var mergeLikeTokens = function(tokens) {
  if (tokens.length <= 1) {
    return tokens;
  }
  var newTokens = [];
  var lastLikeIndex = 0;
  for (var i = 1; i < tokens.length; i++) {
    var lastLikeToken = tokens[lastLikeIndex];
    var currToken = tokens[i];
    if (getTokenRule(lastLikeToken) !== getTokenRule(currToken)) {
      newTokens.push(mergeTokens(tokens, lastLikeIndex, i));
      lastLikeIndex = i;
    }
  }
  newTokens.push(mergeTokens(tokens, lastLikeIndex, tokens.length));
  return newTokens;
};
var isRowWhiteSpace = function(row) {
  var line = cvoxAce.editor.getSession().getLine(row);
  var whiteSpaceRegexp = /^\s*$/;
  return whiteSpaceRegexp.exec(line) !== null;
};
var speakLine = function(row, queue) {
  var tokens = cvoxAce.editor.getSession().getTokens(row);
  if (tokens.length === 0 || isRowWhiteSpace(row)) {
    cvox.Api.playEarcon('EDITABLE_TEXT');
    return;
  }
  tokens = mergeLikeTokens(tokens);
  var firstToken = tokens[0];
  tokens = tokens.filter(function(token) {
    return token !== firstToken;
  });
  speakToken_(firstToken, queue);
  tokens.forEach(speakTokenQueue);
};
var speakTokenFlush = function(token) {
  speakToken_(token, 0);
};
var speakTokenQueue = function(token) {
  speakToken_(token, 1);
};
var getTokenRule = function(token) {
  if (!token || !token.type) {
    return;
  }
  var split = token.type.split('.');
  if (split.length === 0) {
    return;
  }
  var type = split[0];
  var rule = rules[type];
  if (!rule) {
    return DEFAULT_RULE;
  }
  return rule;
};
var speakToken_ = function(token, queue) {
  var rule = getTokenRule(token);
  var value = expand(token.value, REPLACE_LIST);
  if (rule.replace) {
    value = expand(value, rule.replace);
  }
  cvox.Api.speak(value, queue, rule.prop);
};
var speakChar = function(cursor) {
  var line = getCurrentLine(cursor);
  cvox.Api.speak(line[cursor.column], 1);
};
var speakDisplacement = function(lastCursor, currCursor) {
  var line = getCurrentLine(currCursor);
  var displace = line.substring(lastCursor.column, currCursor.column);
  displace = displace.replace(/ /g, ' space ');
  cvox.Api.speak(displace);
};
var speakCharOrWordOrLine = function(lastCursor, currCursor) {
  if (Math.abs(lastCursor.column - currCursor.column) !== 1) {
    var currLineLength = getCurrentLine(currCursor).length;
    if (currCursor.column === 0 || currCursor.column === currLineLength) {
      speakLine(currCursor.row, 0);
      return;
    }
    if (isWord(currCursor)) {
      cvox.Api.stop();
      speakTokenQueue(getCurrentToken(currCursor));
      return;
    }
  }
  speakChar(currCursor);
};
var onColumnChange = function(lastCursor, currCursor) {
  if (!cvoxAce.editor.selection.isEmpty()) {
    speakDisplacement(lastCursor, currCursor);
    cvox.Api.speak('selected', 1);
  }
  else if (shouldSpeakDisplacement) {
    speakDisplacement(lastCursor, currCursor);
  } else {
    speakCharOrWordOrLine(lastCursor, currCursor);
  }
};
var onCursorChange = function(evt) {
  if (changed) {
    changed = false;
    return;
  }
  var currCursor = cvoxAce.editor.selection.getCursor();
  if (currCursor.row !== lastCursor.row) {
    onRowChange(currCursor);
  } else {
    onColumnChange(lastCursor, currCursor);
  }
  lastCursor = currCursor;
};
var onSelectionChange = function(evt) {
  if (cvoxAce.editor.selection.isEmpty()) {
    cvox.Api.speak('unselected');
  }
};
var onChange = function(delta) {
  switch (delta.action) {
  case 'remove':
    cvox.Api.speak(delta.text, 0, DELETED_PROP);
    changed = true;
    break;
  case 'insert':
    cvox.Api.speak(delta.text, 0);
    changed = true;
    break;
  }
};
var isNewAnnotation = function(annot) {
  var row = annot.row;
  var col = annot.column;
  return !annotTable[row] || !annotTable[row][col];
};
var populateAnnotations = function(annotations) {
  annotTable = {};
  for (var i = 0; i < annotations.length; i++) {
    var annotation = annotations[i];
    var row = annotation.row;
    var col = annotation.column;
    if (!annotTable[row]) {
      annotTable[row] = {};
    }
    annotTable[row][col] = annotation;
  }
};
var onAnnotationChange = function(evt) {
  var annotations = cvoxAce.editor.getSession().getAnnotations();
  var newAnnotations = annotations.filter(isNewAnnotation);
  if (newAnnotations.length > 0) {
    cvox.Api.playEarcon(ERROR_EARCON);
  }
  populateAnnotations(annotations);
};
var speakAnnot = function(annot) {
  var annotText = annot.type + ' ' + annot.text + ' on ' +
      rowColToString(annot.row, annot.column);
  annotText = annotText.replace(';', 'semicolon');
  cvox.Api.speak(annotText, 1);
};
var speakAnnotsByRow = function(row) {
  var annots = annotTable[row];
  for (var col in annots) {
    speakAnnot(annots[col]);
  }
};
var rowColToString = function(row, col) {
  return 'row ' + (row + 1) + ' column ' + (col + 1);
};
var speakCurrRowAndCol = function() {
  cvox.Api.speak(rowColToString(lastCursor.row, lastCursor.column));
};
var speakAllAnnots = function() {
  for (var row in annotTable) {
    speakAnnotsByRow(row);
  }
};
var speakMode = function() {
  if (!isVimMode()) {
    return;
  }
  switch (cvoxAce.editor.keyBinding.$data.state) {
  case INSERT_MODE_STATE:
    cvox.Api.speak('Insert mode');
    break;
  case COMMAND_MODE_STATE:
    cvox.Api.speak('Command mode');
    break;
  }
};
var toggleSpeakRowLocation = function() {
  shouldSpeakRowLocation = !shouldSpeakRowLocation;
  if (shouldSpeakRowLocation) {
    cvox.Api.speak('Speak location on row change enabled.');
  } else {
    cvox.Api.speak('Speak location on row change disabled.');
  }
};
var toggleSpeakDisplacement = function() {
  shouldSpeakDisplacement = !shouldSpeakDisplacement;
  if (shouldSpeakDisplacement) {
    cvox.Api.speak('Speak displacement on column changes.');
  } else {
    cvox.Api.speak('Speak current character or word on column changes.');
  }
};
var onKeyDown = function(evt) {
  if (evt.ctrlKey && evt.shiftKey) {
    var shortcut = keyCodeToShortcutMap[evt.keyCode];
    if (shortcut) {
      shortcut.func();
    }
  }
};
var onChangeStatus = function(evt, editor) {
  if (!isVimMode()) {
    return;
  }
  var state = editor.keyBinding.$data.state;
  if (state === vimState) {
    return;
  }
  switch (state) {
  case INSERT_MODE_STATE:
    cvox.Api.playEarcon(MODE_SWITCH_EARCON);
    cvox.Api.setKeyEcho(true);
    break;
  case COMMAND_MODE_STATE:
    cvox.Api.playEarcon(MODE_SWITCH_EARCON);
    cvox.Api.setKeyEcho(false);
    break;
  }
  vimState = state;
};
var contextMenuHandler = function(evt) {
  var cmd = evt.detail['customCommand'];
  var shortcut = cmdToShortcutMap[cmd];
  if (shortcut) {
    shortcut.func();
    cvoxAce.editor.focus();
  }
};
var initContextMenu = function() {
  var ACTIONS = SHORTCUTS.map(function(shortcut) {
    return {
      desc: shortcut.desc + getKeyShortcutString(shortcut.keyCode),
      cmd: shortcut.cmd
    };
  });
  var body = document.querySelector('body');
  body.setAttribute('contextMenuActions', JSON.stringify(ACTIONS));
  body.addEventListener('ATCustomEvent', contextMenuHandler, true);
};
var onFindSearchbox = function(evt) {
  if (evt.match) {
    speakLine(lastCursor.row, 0);
  } else {
    cvox.Api.playEarcon(NO_MATCH_EARCON);
  }
};
var focus = function() {
  cvoxAce.editor.focus();
};
var SHORTCUTS = [
  {
    keyCode: 49,
    func: function() {
      speakAnnotsByRow(lastCursor.row);
    },
    cmd: Command.SPEAK_ANNOT,
    desc: 'Speak annotations on line'
  },
  {
    keyCode: 50,
    func: speakAllAnnots,
    cmd: Command.SPEAK_ALL_ANNOTS,
    desc: 'Speak all annotations'
  },
  {
    keyCode: 51,
    func: speakMode,
    cmd: Command.SPEAK_MODE,
    desc: 'Speak Vim mode'
  },
  {
    keyCode: 52,
    func: toggleSpeakRowLocation,
    cmd: Command.TOGGLE_LOCATION,
    desc: 'Toggle speak row location'
  },
  {
    keyCode: 53,
    func: speakCurrRowAndCol,
    cmd: Command.SPEAK_ROW_COL,
    desc: 'Speak row and column'
  },
  {
    keyCode: 54,
    func: toggleSpeakDisplacement,
    cmd: Command.TOGGLE_DISPLACEMENT,
    desc: 'Toggle speak displacement'
  },
  {
    keyCode: 55,
    func: focus,
    cmd: Command.FOCUS_TEXT,
    desc: 'Focus text'
  }
];
var onFocus = function(_, editor) {
  cvoxAce.editor = editor;
  editor.getSession().selection.on('changeCursor', onCursorChange);
  editor.getSession().selection.on('changeSelection', onSelectionChange);
  editor.getSession().on('change', onChange);
  editor.getSession().on('changeAnnotation', onAnnotationChange);
  editor.on('changeStatus', onChangeStatus);
  editor.on('findSearchBox', onFindSearchbox);
  editor.container.addEventListener('keydown', onKeyDown);

  lastCursor = editor.selection.getCursor();
};
var init = function(editor) {
  onFocus(null, editor);
  SHORTCUTS.forEach(function(shortcut) {
    keyCodeToShortcutMap[shortcut.keyCode] = shortcut;
    cmdToShortcutMap[shortcut.cmd] = shortcut;
  });

  editor.on('focus', onFocus);
  if (isVimMode()) {
    cvox.Api.setKeyEcho(false);
  }
  initContextMenu();
};
function cvoxApiExists() {
  return (typeof(cvox) !== 'undefined') && cvox && cvox.Api;
}
var tries = 0;
var MAX_TRIES = 15;
function watchForCvoxLoad(editor) {
  if (cvoxApiExists()) {
    init(editor);
  } else {
    tries++;
    if (tries >= MAX_TRIES) {
      return;
    }
    window.setTimeout(watchForCvoxLoad, 500, editor);
  }
}

var Editor = require('../editor').Editor;
require('../config').defineOptions(Editor.prototype, 'editor', {
  enableChromevoxEnhancements: {
    set: function(val) {
      if (val) {
        watchForCvoxLoad(this);
      }
    },
    value: true // turn it on by default or check for window.cvox
  }
});

});
                (function() {
                    ace.require(["ace/ext/chromevox"], function() {});
                })();


text:
import sys
import gtk
from Borg import Borg
from NDImplementationDecorator import NDImplementationDecorator

class ComponentNodeDialog:
  def __init__(self,objt,builder):
    self.window = builder.get_object("ComponentNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    componentName = objt.name()
    self.decorator.updateTextCtrl("componentNameCtrl",componentName)
    self.decorator.updateMLTextCtrl("componentDescriptionCtrl",objt.description())

    cifs  = []
    for cif in objt.interfaces():
      cifs.append([cif[0],cif[1]])
    self.decorator.updateListCtrl("componentInterfacesCtrl",['Name','Type'],gtk.ListStore(str,str),cifs)

    cStructure = []
    for csRow  in objt.structure():
      cStructure.append([csRow[0],csRow[1],csRow[2],csRow[3],csRow[4],csRow[5],csRow[6],csRow[7],csRow[8],csRow[9]])
    self.decorator.updateListCtrl("componentStructureCtrl",['Head Asset','Type','Nav','Nry','Role','Tail Role','Tail Nry','Tail Nav','Tail Type','Tail Asset'],gtk.ListStore(str,str,str,str,str,str,str,str,str,str),cStructure)

    reqs  = []
    for req in objt.requirements():
      reqs.append([req])
    self.decorator.updateListCtrl("componentRequirementsCtrl",['Name'],gtk.ListStore(str),reqs)

    self.window.resize(350,300)

  def on_componentOkButton_clicked(self,callback_data):
    self.window.destroy()

  def show(self):
    self.window.show()

redpajama_set_name: RedPajamaGithub


text:
package main

import (
	"fmt"

	"github.com/kataras/iris"

	"github.com/kataras/iris/websocket"
)

/* Native messages no need to import the iris-ws.js to the ./templates.client.html
Use of: OnMessage and EmitMessage.

NOTICE: IF YOU HAVE RAN THE PREVIOUS EXAMPLES YOU HAVE TO CLEAR YOUR BROWSER's CACHE
BECAUSE chat.js is different than the CACHED. OTHERWISE YOU WILL GET Ws is undefined from the browser's console, because it will use the cached.
*/

type clientPage struct {
	Title string
	Host  string
}

func main() {
	app := iris.New()

	app.RegisterView(iris.HTML("./templates", ".html")) // select the html engine to serve templates

	ws := websocket.New(websocket.Config{
	// to enable binary messages (useful for protobuf):
	// BinaryMessages: true,
	})

	// register the server on an endpoint.
	// see the inline javascript code i the websockets.html, this endpoint is used to connect to the server.
	app.Get("/my_endpoint", ws.Handler())

	app.StaticWeb("/js", "./static/js") // serve our custom javascript code

	app.Get("/", func(ctx iris.Context) {
		ctx.ViewData("", clientPage{"Client Page", "localhost:8080"})
		ctx.View("client.html")
	})

	ws.OnConnection(func(c websocket.Connection) {

		c.OnMessage(func(data []byte) {
			message := string(data)
			c.To(websocket.Broadcast).EmitMessage([]byte("Message from: " + c.ID() + "-> " + message)) // broadcast to all clients except this
			c.EmitMessage([]byte("Me: " + message))                                                    // writes to itself
		})

		c.OnDisconnect(func() {
			fmt.Printf("\nConnection with ID: %s has been disconnected!", c.ID())
		})

	})

	app.Run(iris.Addr(":8080"))

}


text:
/*
 * Project:Easy Web Framework
 * Description:
 * EasyFK stands for Easy Web Framework.It's an open source product for E-Business / E-Commerce.It
 * was launched by a chinese Hezhiping(QQ:110476592) in 2015.The goal of EasyFK is to  provide a
 * foundation and starting point for reliable, secure , simple-to-use ,cost-effective ,scalable
 * and suitable-for-Chinese E-Business / E-Commerce solutions. With EasyFK, you can get started
 * right away without the huge deployment and maintenance costs of E-Business / E-Commerce systems.
 * Of course, you can customize it or use it as a framework to implement your most challenging business needs.
 * EasyFk is licensed under the Apache License Version 2.0.  You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Author:hezhiping   Email:110476592@qq.com
 */
package cn.gorun8.easyfk.base.location;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;

import javolution.util.FastMap;

import cn.gorun8.easyfk.base.util.UtilProperties;
import cn.gorun8.easyfk.base.util.UtilValidate;

/**
 * A special location resolver that uses Strings like URLs, but with more options
 *
 */

public class FlexibleLocation {

    protected static Map<String, LocationResolver> locationResolvers = FastMap.newInstance();

    protected static Map<String, String> defaultResolvers = FastMap.newInstance();

    protected static String standardUrlResolverName = StandardUrlLocationResolver.class.getName();
    protected static String classpathResolverName = ClasspathLocationResolver.class.getName();
    protected static String easyfkHomeResolverName = EasyFKHomeLocationResolver.class.getName();
    protected static String componentResolverName = ComponentLocationResolver.class.getName();

    static {
        defaultResolvers.put("http", standardUrlResolverName);
        defaultResolvers.put("https", standardUrlResolverName);
        defaultResolvers.put("ftp", standardUrlResolverName);
        defaultResolvers.put("jar", standardUrlResolverName);
        defaultResolvers.put("file", standardUrlResolverName);

        defaultResolvers.put("classpath", classpathResolverName);
        defaultResolvers.put("easyfkhome", easyfkHomeResolverName);
        defaultResolvers.put("component", componentResolverName);
    }

    /**
     * Resolves the gives location into a URL object for use in various ways.
     *
     * The general format of the location is like a URL: {locationType}://location/path/file.ext
     *
     * Supports standard locationTypes like http, https, ftp, jar, & file
     * Supports a classpath location type for when desired to be used like any other URL
     * Supports EasyFK specific location types like easyfkhome and component
     * Supports additional locationTypes specified in the locationresolvers.properties file
     *
     * @param location The location String to parse and create a URL from
     * @return URL object corresponding to the location String passed in
     * @throws MalformedURLException
     */
    public static URL resolveLocation(String location) throws MalformedURLException {
        return resolveLocation(location, null);
    }

    public static URL resolveLocation(String location, ClassLoader loader) throws MalformedURLException {
        if (UtilValidate.isEmpty(location)) {
            return null;
        }
        String locationType = getLocationType(location);

        LocationResolver resolver = locationResolvers.get(locationType);
        if (resolver == null) {
            synchronized (FlexibleLocation.class) {
                resolver = locationResolvers.get(locationType);
                if (resolver == null) {
                    String locationResolverName = UtilProperties.getPropertyValue("locationresolvers", locationType);
                    if (UtilValidate.isEmpty(locationResolverName)) {
                        // try one of the defaults
                        locationResolverName = defaultResolvers.get(locationType);
                    }

                    if (UtilValidate.isEmpty(locationResolverName)) {
                        // still nothing, give up
                        throw new MalformedURLException("Could not find a LocationResolver class name for the location type: " + locationType);
                    }

                    // now create a new instance of the class...
                    try {
                        Class<?> lClass = null;

                        try {
                            ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
                            lClass = classLoader.loadClass(locationResolverName);
                        } catch (ClassNotFoundException e) {
                            throw new MalformedURLException("Error loading Location Resolver class \"" + locationResolverName + "\": " + e.toString());
                        }

                        try {
                            resolver = (LocationResolver) lClass.newInstance();
                        } catch (IllegalAccessException e) {
                            throw new MalformedURLException("Error loading Location Resolver class \"" + locationResolverName + "\": " + e.toString());
                        } catch (InstantiationException e) {
                            throw new MalformedURLException("Error loading Location Resolver class \"" + locationResolverName + "\": " + e.toString());
                        }
                    } catch (SecurityException e) {
                        throw new MalformedURLException("Error loading Location Resolver class \"" + locationResolverName + "\": " + e.toString());
                    }

                    if (resolver != null) {
                        locationResolvers.put(locationType, resolver);
                    }
                }
            }
        }

        if (resolver != null) {
            if (loader != null && resolver instanceof ClasspathLocationResolver) {
                ClasspathLocationResolver cplResolver = (ClasspathLocationResolver) resolver;
                return cplResolver.resolveLocation(location, loader);
            } else {
                return resolver.resolveLocation(location);
            }
        } else {
            throw new MalformedURLException("Could not find a LocationResolver for the location type: " + locationType);
        }
    }

    /**
     * Find the location type descriptor for the passed location String;
     *   generally is all text before the first ":" character.
     *   If no type descriptor is found, defaults to "classpath".
     */
    public static String getLocationType(String location) {
        if (UtilValidate.isEmpty(location)) {
            return null;
        }

        int colonIndex = location.indexOf(":");
        if (colonIndex > 0) {
            return location.substring(0, colonIndex);
        } else {
            return "classpath";
        }
    }

    public static String stripLocationType(String location) {
        if (UtilValidate.isEmpty(location)) {
            return "";
        }

        StringBuilder strippedSoFar = new StringBuilder(location);

        // first take care of the colon and everything before it
        int colonIndex = strippedSoFar.indexOf(":");
        if (colonIndex == 0) {
            strippedSoFar.deleteCharAt(0);
        } else if (colonIndex > 0) {
            strippedSoFar.delete(0, colonIndex + 1);
        }

        // now remove any extra forward slashes, ie as long as the first two are forward slashes remove the first one
        while (strippedSoFar.charAt(0) == '/' && strippedSoFar.charAt(1) == '/') {
            strippedSoFar.deleteCharAt(0);
        }

        return strippedSoFar.toString();
    }
}


text:
package org.dcm4cheri.data;

import org.dcm4che.data.Dataset;
import org.dcm4che.data.DcmDecodeParam;
import org.dcm4che.data.DcmElement;
import org.dcm4che.data.DcmHandler;
import org.dcm4che.data.FileFormat;
import org.dcm4che.data.SpecificCharacterSet;

import org.dcm4che.dict.Tags;
import org.dcm4che.dict.VRs;

import java.io.File;
import java.io.InputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.NoSuchElementException;
import javax.imageio.stream.ImageInputStream;

import org.xml.sax.helpers.DefaultHandler;

/**
 *
 * @author  gunter.zeilinger@tiani.com
 * @version 1.0.0
 */
abstract class FilterDataset extends BaseDatasetImpl implements Dataset {

    protected final BaseDatasetImpl backend;

    /** Creates a new instance of DatasetView */
    public FilterDataset(Dataset backend) {
        this.backend = (BaseDatasetImpl)backend;
    }

    protected abstract boolean filter(int tag, int vr);

    public boolean contains(int tag) {
        return get(tag) != null;
    }

    public int vm(int tag) {
        DcmElement el = get(tag);
        return el != null ? el.vm(backend.getSpecificCharacterSet()) : -1;
    }

    public int size() {
        int count = 0;
        DcmElement el;
        for (Iterator iter = backend.iterator(); iter.hasNext();) {
            el = (DcmElement) iter.next();
            if (filter(el.tag(), el.vr())) {
                ++count;
            }
        }
        return count;
    }

    public DcmElement get(int tag) {
        DcmElement el = backend.get(tag);
        return el != null && filter(el.tag(), el.vr()) ? el : null;
    }

    public Iterator iterator() {
        final Iterator backendIter = backend.iterator();
        return new Iterator() {
            private DcmElement next = findNext();
            private DcmElement findNext() {
                DcmElement el;
                while (backendIter.hasNext()) {
                    el = (DcmElement)backendIter.next();
                    if (filter(el.tag(), el.tag())) {
                        return el;
                    }
                }
                return null;
            }

            public boolean hasNext() {
                return next != null;
            }

            public Object next() {
                if (next == null) {
                    throw new NoSuchElementException();
                }
                DcmElement retval = next;
                next = findNext();
                return retval;
            }

            public void remove() {
                throw new UnsupportedOperationException();
            }
        };
    }

    public boolean isEmpty() {
        return size() == 0;
    }

    public SpecificCharacterSet getSpecificCharacterSet() {
        return backend.getSpecificCharacterSet();
    }

    public Dataset getParent() {
        return backend.getParent();
    }

    public void setPrivateCreatorID(String privateCreatorID) {
        backend.setPrivateCreatorID(privateCreatorID);
    }

    public String getPrivateCreatorID() {
        return backend.getPrivateCreatorID();
    }

    public long getItemOffset() {
        return backend.getItemOffset();
    }

    public DcmHandler getDcmHandler() {
        throw new UnsupportedOperationException();
    }

    public DefaultHandler getSAXHandler() {
        throw new UnsupportedOperationException();
    }

    protected DcmElement put(DcmElement el) {
       if (!filter(el.tag(), el.vr())) {
          throw new IllegalArgumentException(
            "" + el + " does not fit in this sub DataSet");
       }
       return backend.put(el);
    }

    public DcmElement remove(int tag) {
        DcmElement el = backend.get(tag);
        return (el != null && filter(tag, el.vr())) ? backend.remove(tag) : null;
    }

    public void clear() {
      ArrayList toRemove = new ArrayList();
      for (Iterator iter = backend.iterator(); iter.hasNext();) {
         DcmElement el = (DcmElement)iter.next();
         if (filter(el.tag(), el.vr())) {
            toRemove.add(el);
         }
      }
      for (int i = 0, n = toRemove.size(); i < n; ++i) {
         backend.remove(((DcmElement)toRemove.get(i)).tag());
      }
    }

    public Dataset setItemOffset(long itemOffset) {
        throw new UnsupportedOperationException();
    }

    public void readDataset(InputStream in, DcmDecodeParam param, int stopTag)
            throws IOException {
        throw new UnsupportedOperationException();
    }

    public void readFile(InputStream in, FileFormat format, int stopTag)
            throws IOException {
        throw new UnsupportedOperationException();
    }

    public void readFile(ImageInputStream iin, FileFormat format, int stopTag)
            throws IOException {
        throw new UnsupportedOperationException();
    }

    public void readFile(File f, FileFormat format, int stopTag)
	    	throws IOException {
        throw new UnsupportedOperationException();
	}

    public DcmElement putXX(int tag, int vr) {
        if (!filter(tag, vr)) {
            throw new IllegalArgumentException(
              "Tag " + Tags.toString(tag) + ", VR " + VRs.toString(vr) + " does not fit in this sub DataSet");
        }
        return backend.putXX(tag, vr);
    }

    static final class Selection extends FilterDataset {
        private final Dataset filter;
        Selection(Dataset backend, Dataset filter) {
            super(backend);
            this.filter = filter;
        }

        protected  boolean filter(int tag, int vr) {
            return filter == null || filter.contains(tag);
        }

        public DcmElement get(int tag) {
            if (filter == null) {
                return backend.get(tag);
            }
            DcmElement filterEl = filter.get(tag);
            if (filterEl == null) {
                return null;
            }

            DcmElement el = backend.get(tag);
            if (!(el instanceof SQElement)) {
                return el;
            }
            if (!(filterEl instanceof SQElement)) {
                log.warn("VR mismatch - dataset:" + el
                        + ", filter:" + filterEl);
                return el;
            }
            Dataset item = filterEl.getItem();
            if (item == null || item.isEmpty()) {
                return el;
            }
            return new FilterSQElement((SQElement)el, item);
        }
    }

    static final class ExcludePrivate extends FilterDataset {
        ExcludePrivate(Dataset backend) {
            super(backend);
        }

        protected  boolean filter(int tag, int vr) {
            return !Tags.isPrivate(tag);
        }

        public DcmElement get(int tag) {
            if (Tags.isPrivate(tag)) return null;
            DcmElement el = backend.get(tag);
            if (!(el instanceof SQElement)) {
                return el;
            }
            return new ExcludePrivateSQElement((SQElement)el);
        }
    }

    static final class Segment extends FilterDataset {
        private long fromTag;
        private long toTag;
        Segment(Dataset backend, int fromTag, int toTag) {
            super(backend);
            this.fromTag = fromTag & 0xFFFFFFFFL;
            this.toTag = toTag & 0xFFFFFFFFL;
            if (this.fromTag > this.toTag) {
               throw new IllegalArgumentException(
                  "fromTag:" + Tags.toString(fromTag)
                  + " greater toTag:" + Tags.toString(toTag));
            }
        }

        public int size() {
            int count = 0;
            long ltag;
            for (Iterator iter = backend.iterator(); iter.hasNext();) {
                ltag = ((DcmElement)iter.next()).tag() & 0xFFFFFFFFL;
                if (ltag < fromTag) continue;
                if (ltag >= toTag) break;
                ++count;
            }
            return count;
        }

        protected boolean filter(int tag, int vr) {
            long ltag = tag & 0xFFFFFFFFL;
            return ltag >= fromTag && ltag < toTag;
        }
    }

    static final int[] EMPTY_INT = {};

    static final class TagFilter extends FilterDataset {
        private final int[] tags;
        private final int[] vrs;
		private final boolean exclude;
		private final boolean excludePrivate;
        TagFilter(Dataset backend, int[] tags, int[] vrs, boolean exclude,
                boolean excludePrivate) {
            super(backend);
            this.tags = tags == null ? EMPTY_INT : (int[]) tags.clone();
            this.exclude = exclude;
            this.excludePrivate = excludePrivate;
            this.vrs = vrs == null ? EMPTY_INT : (int[]) vrs.clone();
            Arrays.sort(this.tags);
        }

        protected boolean filter(int tag, int vr) {
            return !(excludePrivate && Tags.isPrivate(tag))
            	&& (containsVR(vr) || (Arrays.binarySearch(tags, tag)) >= 0) ?
                        !exclude : exclude;
        }

        private boolean containsVR(int vr) {
            for (int i = 0; i < vrs.length; i++) {
                if (vrs[i] == vr) {
                    return true;
                }
            }
            return false;
        }

    }

}


text:
@interface BMViewController ()

@end

@implementation BMViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"menu-icon"]
                                                                              style:UIBarButtonItemStylePlain
                                                                             target:self.navigationController
                                                                             action:@selector(toggleMenu)];
}

@end


text:
from azure.identity import DefaultAzureCredential
from azure.mgmt.synapse import SynapseManagementClient

"""
# PREREQUISITES
    pip install azure-identity
    pip install azure-mgmt-synapse
# USAGE
    python sql_pool_vulnerability_assessment_rule_baseline_get.py

    Before run the sample, please set the values of the client ID, tenant ID and client secret
    of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
    AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
    https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""

def main():
    client = SynapseManagementClient(
        credential=DefaultAzureCredential(),
        subscription_id="00000000-1111-2222-3333-444444444444",
    )

    response = client.sql_pool_vulnerability_assessment_rule_baselines.get(
        resource_group_name="vulnerabilityaseessmenttest-4711",
        workspace_name="vulnerabilityaseessmenttest-6411",
        sql_pool_name="testdb",
        vulnerability_assessment_name="default",
        rule_id="VA1001",
        baseline_name="master",
    )
    print(response)

# x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/SqlPoolVulnerabilityAssessmentRuleBaselineGet.json
if __name__ == "__main__":
    main()


text:
@interface RxConfigWizardViewController : NSViewController <FlightControllerDelegate>

@property (weak) FlightController *flightController;

@property (assign) IBOutlet NSTextField *label;
@property (assign) IBOutlet TransmitterView *transmitterView;

@property (assign) IBOutlet NSButton *throttleReverse;
@property (assign) IBOutlet NSButton *yawReverse;
@property (assign) IBOutlet NSButton *pitchReverse;
@property (assign) IBOutlet NSButton *rollReverse;

- (IBAction)nextClicked:(id)sender;
- (IBAction)prevClicked:(id)sender;

- (IBAction)throttleReverseClicked:(id)sender;
- (IBAction)yawReverseClicked:(id)sender;
- (IBAction)pitchReverseClicked:(id)sender;
- (IBAction)rollReverseClicked:(id)sender;

@end


text:
from django.conf.urls import patterns, url
from time_logger.views import ViewsLog, ViewLogDetail, SlowQueriesLog, BinLog

urlpatterns = patterns('',
   url(r'^views_log/$', ViewsLog.as_view()),
   url(r'^views_log/(?P<pk>.+)/$', ViewLogDetail.as_view()),
   url(r'^slow_queries_log/$', SlowQueriesLog.as_view()),
   url(r'^bin_log/$', BinLog.as_view()),
)


text:
/**
 *     This code was auto-generated by a Codezu.
 *
 *     Changes to this file may cause incorrect behavior and will be lost if
 *     the code is regenerated.
 */
package com.mozu.api.contracts.commerceruntime.products;

import java.util.List;
import java.util.HashMap;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.joda.time.DateTime;
import java.io.IOException;
import java.lang.ClassNotFoundException;
import com.mozu.api.contracts.commerceruntime.products.ProductPropertyValue;

/**
 *	Details of a property attribute defined for a product.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class ProductProperty implements Serializable
{
	// Default Serial Version UID
	private static final long serialVersionUID = 1L;

	protected  String attributeFQN;

	public String getAttributeFQN() {
		return this.attributeFQN;
	}

	public void setAttributeFQN(String attributeFQN) {
		this.attributeFQN = attributeFQN;
	}

	protected  String dataType;

	public String getDataType() {
		return this.dataType;
	}

	public void setDataType(String dataType) {
		this.dataType = dataType;
	}

	protected  Boolean isMultiValue;

	public Boolean getIsMultiValue() {
		return this.isMultiValue;
	}

	public void setIsMultiValue(Boolean isMultiValue) {
		this.isMultiValue = isMultiValue;
	}

	protected  String name;

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	protected List<ProductPropertyValue> values;
	public List<ProductPropertyValue> getValues() {
		return this.values;
	}
	public void setValues(List<ProductPropertyValue> values) {
		this.values = values;
	}

}


text:
Template.adminJournalConfig.onCreated(function () {
  if (Jrnl.session.get('selectedEntryId')) {
    this.subscribe('journal_entry', Jrnl.session.get('selectedEntryId'));
  }
});

Template.adminJournalConfig.onRendered(function () {
  refreshPreview();
});

Template.adminJournalConfig.helpers({

  collection: function () {
    return Jrnl.collections.JournalEntries;
  },

  selectedEntry: function () {
    var selectedEntryId = Jrnl.session.get('selectedEntryId'), entry;
    if (selectedEntryId) {
      entry = Jrnl.collections.JournalEntries.findOne({ _id: selectedEntryId });
    }
    return entry;
  },

  formType: function () {
    var formType = 'insert';
    if (Jrnl.session.get('selectedEntryId')) {
      formType = 'update';
    }
    return formType;
  },

  previewTitle: function () {
    if (Jrnl.session.get('previewTitle')) {
      return Jrnl.session.get('previewTitle');
    }
  },

  previewContent: function () {
    if (Jrnl.session.get('previewContent')) {
      return Jrnl.session.get('previewContent');
    }
  }

});

Template.adminJournalConfig.events({

  'keyup input': function (e) {
    var title = $(e.currentTarget).val();
    Jrnl.session.set('previewTitle', title);
  },

  'keyup textarea': function (e) {
    var content = $(e.currentTarget).val();
    Jrnl.session.set('previewContent', content);
  }

});

var refreshPreview = function () {
  Jrnl.session.set('previewTitle', $('input').val());
  Jrnl.session.set('previewContent', $('textarea').val());
};


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using CoreXml.Test.XLinq;
using Microsoft.Test.ModuleCore;

namespace XLinqTests
{
    public abstract class XNodeRemove : XLinqTestCase
    {
        #region Fields

        private EventsHelper _eHelper;

        private bool _runWithEvents;

        #endregion

        #region Public Methods and Operators

        public void NodeWithNoParent()
        {
            _runWithEvents = (bool)Params[0];
            XNode[] nodes = { new XElement("a"), new XElement("b", new XAttribute("id", "a0")), new XElement("c", new XAttribute("id", "a0"), new XElement("cc")), new XComment("comm"), new XProcessingInstruction("PI", ""), new XText(""), new XText("  "), new XText("normal"), new XCData("cdata"), new XDocument(), new XDocument(new XDeclaration("1.0", "UTF8", "true"), new XElement("c", new XAttribute("id", "a0"), new XElement("cc"))) };

            foreach (XNode n in nodes)
            {
                try
                {
                    if (_runWithEvents)
                    {
                        _eHelper = new EventsHelper(n);
                    }
                    n.Remove();
                    if (_runWithEvents)
                    {
                        _eHelper.Verify(XObjectChange.Remove, n);
                    }
                    TestLog.Compare(false, "Exception expected [" + n.NodeType + "] " + n);
                }
                catch (InvalidOperationException)
                {
                }
            }
        }

        public void OnDocument()
        {
            _runWithEvents = (bool)Params[0];
            var itemCount = (int)Variation.Params[0];
            var addDecl = (bool)Variation.Params[1];

            object[] data = { new XDocumentType("root", null, null, null), new XElement("A"), new XElement("B", new XElement("x"), "string", new XAttribute("at", "home")), new XProcessingInstruction("PI1", ""), new XProcessingInstruction("PI2", ""), new XText(" "), new XText(" "), new XText(" "), new XComment("comment1"), new XComment("comment2") };

            foreach (var nodes in data.NonRecursiveVariations(itemCount))
            {
                if (nodes.Count(x => x is XElement) > 1 || nodes.CheckDTDAfterElement())
                {
                    continue; // double root elem check and dtd after elem check
                }

                int length = (new XDocument(nodes)).Nodes().Count();
                for (int i = 0; i < length; i++)
                {
                    XDocument doc = addDecl ? new XDocument(new XDeclaration("1.0", "UTF8", "true"), nodes) : new XDocument(nodes);
                    XNode o = doc.Nodes().ElementAt(i);

                    if (_runWithEvents)
                    {
                        _eHelper = new EventsHelper(doc);
                    }

                    DoRemoveTest(doc, i);

                    if (_runWithEvents)
                    {
                        _eHelper.Verify(XObjectChange.Remove, o);
                    }
                }
            }
        }

        public void OnElement()
        {
            _runWithEvents = (bool)Params[0];
            var useParentElement = (bool)Variation.Params[0];
            var useDocument = (bool)Variation.Params[1];
            var itemCount = (int)Variation.Params[2];

            object[] data = { new XElement("A"), new XElement("B", new XElement("X")), new XProcessingInstruction("PI1", ""), new XProcessingInstruction("PI2", ""), new XAttribute("id", "a0"), new XText("text"), new XText(""), new XText("text2"), new XCData("cdata1"), new XCData("cdata2"), null, "string1", "string2", new XComment("comment1"), new XComment("comment2") };

            foreach (var nodes in data.NonRecursiveVariations(itemCount))
            {
                int length = (new XElement("dummy", nodes)).Nodes().Count();
                for (int i = 0; i < length; i++)
                {
                    var elem = new XElement("X", nodes);
                    XElement parent = null;
                    if (useParentElement)
                    {
                        parent = new XElement("Parent", new XAttribute("id", "x07"), "text", elem, "text2");
                    }
                    if (useDocument)
                    {
                        var doc = new XDocument(useParentElement ? parent : elem);
                    }

                    var elemCopy = new XElement(elem);
                    XNode o = elem.Nodes().ElementAt(i);
                    if (_runWithEvents)
                    {
                        _eHelper = new EventsHelper(elem);
                    }
                    DoRemoveTest(elem, i);
                    if (_runWithEvents)
                    {
                        _eHelper.Verify(XObjectChange.Remove, o);
                    }
                }
            }
        }

        public void RemoveNodesFromMixedContent()
        {
            int count = 0;
            _runWithEvents = (bool)Params[0];
            XElement a = XElement.Parse(@"t1t2");
            if (_runWithEvents)
            {
                _eHelper = new EventsHelper(a);
                count = a.Nodes().Skip(1).Count();
            }
            a.Nodes().Skip(1).Remove();
            if (_runWithEvents)
            {
                _eHelper.Verify(XObjectChange.Remove, count);
            }
            TestLog.Compare(a.Nodes().Count(), 1, "Wrong node count ...");
            TestLog.Compare(a.FirstNode is XText, "text node");
            TestLog.Compare((a.FirstNode as XText).Value, "t1", "text node value");
        }

        public void UsagePattern1()
        {
            _runWithEvents = (bool)Params[0];
            var e = new XElement("root", new XElement("b", new XAttribute("id", "a0")), new XElement("c", new XAttribute("id", "a0"), new XElement("cc")), new XComment("comm"), new XProcessingInstruction("PI", ""), new XText(""), new XElement("a"), new XText("  "), new XText("normal"), new XCData("cdata"));

            // Need to do snapshot -> otherwise will stop on the first node when Removed.
            if (_runWithEvents)
            {
                _eHelper = new EventsHelper(e);
            }

            foreach (XNode n in e.Nodes().ToList())
            {
                n.Remove();
                if (_runWithEvents)
                {
                    _eHelper.Verify(XObjectChange.Remove, n);
                }
            }

            TestLog.Compare(e.Nodes().IsEmpty(), "nodes Removed");
        }

        #endregion

        #region Methods

        private void DoRemoveTest(XContainer elem, int position)
        {
            List<ExpectedValue> expectedData = elem.Nodes().Take(position).Concat(elem.Nodes().Skip(position + 1)).Select(n => new ExpectedValue(!(n is XText), n)).ProcessNodes().ToList();

            XNode toRemove = elem.Nodes().ElementAt(position);
            toRemove.Remove();

            TestLog.Compare(toRemove.Parent == null, "Parent of Removed");
            TestLog.Compare(toRemove.Document == null, "Document of Removed");
            TestLog.Compare(toRemove.NextNode == null, "NextNode");
            TestLog.Compare(toRemove.PreviousNode == null, "PreviousNode");
            if (toRemove is XContainer)
            {
                foreach (XNode child in (toRemove as XContainer).Nodes())
                {
                    TestLog.Compare(child.Document == null, "Document of child of Removed");
                    TestLog.Compare(child.Parent == toRemove, "Parent of child of Removed should be set");
                }
            }
            // try Remove Removed node
            try
            {
                toRemove.Remove();
                TestLog.Compare(false, "Exception expected [" + toRemove.NodeType + "] " + toRemove);
            }
            catch (InvalidOperationException)
            {
            }

            TestLog.Compare(expectedData.EqualAll(elem.Nodes(), XNode.EqualityComparer), "The rest of the tree - Nodes()");
        }
        #endregion
    }
}


text:
package jadx.gui.ui.filedialog;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import javax.swing.JFileChooser;

import org.jetbrains.annotations.Nullable;

import jadx.gui.settings.JadxProject;
import jadx.gui.ui.MainWindow;
import jadx.gui.utils.NLS;

public class FileDialogWrapper {

	private final MainWindow mainWindow;

	private boolean isOpen;
	private String title;
	private List<String> fileExtList;
	private int selectionMode = JFileChooser.FILES_AND_DIRECTORIES;
	private @Nullable Path currentDir;
	private @Nullable Path selectedFile;

	public FileDialogWrapper(MainWindow mainWindow, FileOpenMode mode) {
		this.mainWindow = mainWindow;
		initForMode(mode);
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setFileExtList(List<String> fileExtList) {
		this.fileExtList = fileExtList;
	}

	public void setSelectionMode(int selectionMode) {
		this.selectionMode = selectionMode;
	}

	public void setSelectedFile(Path path) {
		this.selectedFile = path;
	}

	public void setCurrentDir(Path currentDir) {
		this.currentDir = currentDir;
	}

	public List<Path> show() {
		if (mainWindow.getSettings().isUseAlternativeFileDialog()) {
			return new CustomFileDialog(this).showDialog();
		} else {
			return new CustomFileChooser(this).showDialog();
		}
	}

	private void initForMode(FileOpenMode mode) {
		switch (mode) {
			case OPEN:
			case OPEN_PROJECT:
			case ADD:
				if (mode == FileOpenMode.OPEN_PROJECT) {
					fileExtList = Collections.singletonList(JadxProject.PROJECT_EXTENSION);
					title = NLS.str("file.open_title");
				} else {
					fileExtList = new ArrayList<>(Arrays.asList("apk", "dex", "jar", "class", "smali", "zip", "xapk", "aar", "arsc"));
					if (mode == FileOpenMode.OPEN) {
						fileExtList.addAll(Arrays.asList(JadxProject.PROJECT_EXTENSION, "aab"));
						title = NLS.str("file.open_title");
					} else {
						title = NLS.str("file.add_files_action");
					}
				}
				selectionMode = JFileChooser.FILES_AND_DIRECTORIES;
				currentDir = mainWindow.getSettings().getLastOpenFilePath();
				isOpen = true;
				break;

			case SAVE_PROJECT:
				title = NLS.str("file.save_project");
				fileExtList = Collections.singletonList(JadxProject.PROJECT_EXTENSION);
				selectionMode = JFileChooser.FILES_ONLY;
				currentDir = mainWindow.getSettings().getLastSaveFilePath();
				isOpen = false;
				break;

			case EXPORT:
				title = NLS.str("file.save_all_msg");
				fileExtList = Collections.emptyList();
				selectionMode = JFileChooser.DIRECTORIES_ONLY;
				currentDir = mainWindow.getSettings().getLastSaveFilePath();
				isOpen = false;
				break;

			case CUSTOM_SAVE:
				isOpen = false;
				currentDir = mainWindow.getSettings().getLastSaveFilePath();
				break;

			case CUSTOM_OPEN:
				isOpen = true;
				currentDir = mainWindow.getSettings().getLastOpenFilePath();
				break;
		}
	}

	public Path getCurrentDir() {
		return currentDir;
	}

	public MainWindow getMainWindow() {
		return mainWindow;
	}

	public boolean isOpen() {
		return isOpen;
	}

	public String getTitle() {
		return title;
	}

	public List<String> getFileExtList() {
		return fileExtList;
	}

	public int getSelectionMode() {
		return selectionMode;
	}

	public Path getSelectedFile() {
		return selectedFile;
	}
}


text:
<?php

namespace Aztech\Phinject\Tests;

use Aztech\Phinject\ContainerFactory;
use Prophecy\Argument;

class ContainerFactoryTest extends \PHPUnit_Framework_TestCase
{

    private $baseDir;

    protected function setUp()
    {
        $this->baseDir = __DIR__ . '/../res/config-factory-test-files';
    }

    public function testCreateFromJson()
    {
        $file = $this->baseDir . '/config.json';

        $container = ContainerFactory::createFromJson($file);

        $this->assertInstanceOf('\Aztech\Phinject\Container', $container);
    }

    public function testCreateFromPhp()
    {
        $file = $this->baseDir . '/config.php';

        $container = ContainerFactory::createFromPhp($file);

        $this->assertInstanceOf('\Aztech\Phinject\Container', $container);
    }

    public function testOverridenServiceBuilderFactoryIsUsedByFactory()
    {
        $serviceBuilder = $this->prophesize('Aztech\Phinject\ServiceBuilder');

        $serviceBuilderFactory = $this->prophesize('\Aztech\Phinject\ServiceBuilderFactory');
        $serviceBuilderFactory
            ->build(Argument::any())
            ->willReturn($serviceBuilder->reveal())
            ->shouldBeCalled();

        ContainerFactory::setServiceBuilderFactory($serviceBuilderFactory->reveal());
        ContainerFactory::createFromInlineYaml('');
        ContainerFactory::setServiceBuilderFactory(null);
    }

    /**
     * @expectedException \InvalidArgumentException
     */
    public function testCreateWithInvalidConfigThrowsException()
    {
        $config = new \stdClass();

        ContainerFactory::create($config);
    }

    public function testTemplatedConfigsAreHandled()
    {
        $configSrc = <<<YML
templates:
    template:
        class: \stdClass
        properties:
            test: "{{word}}"

apply-templates:
    TemplatedObject:
        template: template
        apply:
            word: 'Hello world'
YML;

        $container = ContainerFactory::createFromInlineYaml($configSrc, [ 'templates' => true ]);
        $object = $container->get('TemplatedObject');

        $this->assertEquals('Hello world', $object->test);
    }

    /**
     * @expectedException \InvalidArgumentException
     */
    public function testMissingFileThrowsException()
    {
        $file = __DIR__ . '/noconfigfileshouldbehere.yml';

        ContainerFactory::create($file);
    }

    public function testUsingDeferredGeneratesLazyProxies()
    {
        $config = <<<YML
classes:
    deferred:
        class: \Aztech\Phinject\Tests\RefCountingClass
        lazy: true
        properties:
            test: 'hello'
YML;

        $this->assertEquals(0, RefCountingClass::getInstanceCount(), 'Count should be 0 initially.');

        $container = ContainerFactory::createFromInlineYaml($config, [ 'deferred' => true ]);
        $object = $container->get('deferred');

        $this->assertEquals(0, RefCountingClass::getInstanceCount(), 'Count should be 0 after lazy activation.');

        $this->assertEquals('hello', $object->test);
        $this->assertEquals(1, RefCountingClass::getInstanceCount());
    }
}

class RefCountingClass
{
    public static $counter = 0;

    public static function getInstanceCount()
    {
        return self::$counter;
    }

    public $test;

    public function __construct()
    {
        self::$counter++;
    }

    public function getTest()
    {
        return $this->test;
    }
}


text:
/**
 * This class automatically wires up your Ionic Framework project
 * to the Native Page Transitions plugin.
 *
 *
 * We scan the code on deviceready for any animation tags.
 * We expect a direction as well: animation="slide-left-right"
 * Slide default: left, Flip default: right.
 *
 * If you specify a default transitions, we will use that as the default as expected:
 * <body animation="slide-left-right">
 *
 * Prevent anchors (<a> tags) or back buttons from being auto-enhanced by adding:
 * animation-native="false" to the tag: <ion-nav-back-button animation-native="false">
 *
 * (untested feature:) To add a delay for ios or android, add:
 * animation-native-androiddelay="200" to the tag (200 ms for android in this case)
 *
 * TODO: add attributes for things like duration and slowdownfactor
 *
 *
 ************************************************************************************
 * PRO TIP: specify details in the $ionicPlatform.ready function of app.js:
 *
 *   window.plugins.nativepagetransitions.globalOptions.duration = 350;
 *   window.plugins.nativepagetransitions.globalOptions.slowdownfactor = 8;
 *   // window.plugins.nativepagetransitions.globalOptions.fixedPixelsTop = 64;
 *   window.plugins.nativepagetransitions.globalOptions.fixedPixelsBottom = 48;
 *
 */

(function () {

  "use strict";

  var transitionStack = [];
  var defaultTransition = null;

  // poor mans autowiring trigger.. we need dominserted stuff for enhancing dynamic links
  ionic.on("click", function (event) {
    // timeout because the dom needs to update before the buttons can be enhanced
    setTimeout(function () {
      window.NativePageTransitionsIonicAdapter.apply();
    }, 400);
  });

  var NativePageTransitionsIonicAdapter = function () {
    window.NativePageTransitionsIonicAdapter = this;
  };

  NativePageTransitionsIonicAdapter.prototype = {

    enhanceBackbuttons: function (from) {
      var backbuttons = document.querySelectorAll('button.back-button');
      for (var j = 0; j < backbuttons.length; j++) {
        var backbutton = backbuttons[j];
        if (backbutton.getAttribute("animation-native") !== "false") {
          var transition = transitionStack.pop() || "slide:right"; // default, when stack is empty
          var direction = transition.substring(transition.indexOf(":") + 1);
          if (transition.indexOf("flip") > -1) {
            backbutton.setAttribute("onclick", 'event.preventDefault ? event.preventDefault() : event.returnValue = false;');
            backbutton.setAttribute("ontouchend", 'event.preventDefault ? event.preventDefault() : event.returnValue = false; setTimeout(function(){window.kendo.mobile.application.pane.navigate("#:back")},20); window.NativePageTransitionsIonicAdapter.flip(\'' + direction + '\', \'' + from + '\', \'' + 100 + '\', \'' + 100 + '\')');
          } else {
            backbutton.setAttribute("onclick", 'event.stopPropagation(); event.preventDefault ? event.preventDefault() : event.returnValue = false;');
            backbutton.setAttribute("ontouchend", 'event.preventDefault ? event.preventDefault() : event.returnValue = false; window.NativePageTransitionsIonicAdapter.slide(\'' + direction + '\', \'' + from + '\', \'140\', \'140\')');
          }
        }
      }
    },

    apply: function () {
      if (defaultTransition == null) {
        defaultTransition = document.body.getAttribute("animation");
        if (defaultTransition == null) {
          defaultTransition = "none";
        }
      }

      var transAnchors;
      if (defaultTransition == "none") {
        // if there is no default, we only need to enhance the specific tags
        transAnchors = document.querySelectorAll("a[animation]");
      } else {
        // if there is a default, enhance all tags (except backbuttons and data-rel's (like modalview)), and honor the specific overrides if they exist
        transAnchors = document.querySelectorAll('a[href]:not([data-rel])');
        // add an animation attribute to all anchors without one, so the processing below is uniform
        for (var t = 0; t < transAnchors.length; t++) {
          var theAnchor = transAnchors[t];
          // exclude and links with window.open
          var lowerhref = theAnchor.getAttribute('href').toLowerCase();
          if (lowerhref.indexOf("window.open") == -1 && lowerhref.indexOf("url.loadurl") == -1) {
            if (!theAnchor.hasAttribute("animation")) {
              theAnchor.setAttribute("animation", defaultTransition);
            }
          }
        }
      }
      for (var i = 0; i < transAnchors.length; i++) {
        var transAnchor = transAnchors[i];
        if (transAnchor.getAttribute("animation-native") !== "false") {
          var transition = transAnchor.getAttribute("animation");
          if (transition != null && transition != "none") {
            var href = transAnchor.getAttribute("href");

            var androiddelay = transAnchor.getAttribute("animation-native-androiddelay");
            if (androiddelay == null) {
              androiddelay = 100;
            }
            var iosdelay = transAnchor.getAttribute("animation-native-iosdelay");
            if (iosdelay == null) {
              iosdelay = 100;
            }

            if (transition.indexOf("slide") > -1) {
              this._addSlideEvent(transAnchor, transition, href, androiddelay, iosdelay);
            } else if (transition.indexOf("flip") > -1) {
              this._addFlipEvent(transAnchor, transition, href, androiddelay, iosdelay);
            } else {
              // unsupported transition for now, so leave it be
              continue;
            }
            // removing these will prevent these element to be processed again in this lifecycle
            transAnchor.removeAttribute("animation");
            if (href != null) {
              transAnchor.removeAttribute("href");
            }
          }
        }
      }
    },

    _addSlideEvent: function (transAnchor, transition, href, androiddelay, iosdelay) {
      var direction = "left";
      if (transition.indexOf("slide-right") > -1) {
        direction = "right";
      } else if (transition.indexOf("slide-up") > -1) {
        direction = "up";
      } else if (transition.indexOf("slide-down") > -1) {
        direction = "down";
      }
      transAnchor.setAttribute("onclick", 'window.NativePageTransitionsIonicAdapter.slide(\'' + direction + '\', \'' + href + '\', \'' + androiddelay + '\', \'' + iosdelay + '\')');
    },

    _addFlipEvent: function (transAnchor, transition, href, androiddelay, iosdelay) {
      var direction = "left";
      if (transition.indexOf("flip-right") > -1) {
        direction = "right";
      } else if (transition.indexOf("flip-up") > -1) {
        direction = "up";
      } else if (transition.indexOf("flip-down") > -1) {
        direction = "down";
      }
      transAnchor.setAttribute("onclick", 'window.NativePageTransitionsIonicAdapter.flip(\'' + direction + '\', \'' + href + '\', \'' + androiddelay + '\', \'' + iosdelay + '\')');
    },

    getOppositeDirection: function (direction) {
      if (direction == "right") {
        return "left";
      } else if (direction == "up") {
        return "down";
      } else if (direction == "down") {
        return "up";
      } else {
        return "right";
      }
    },

    slide: function (direction, href, androiddelay, iosdelay) {
      event.preventDefault ? event.preventDefault() : event.returnValue = false;
      transitionStack.push("slide:" + this.getOppositeDirection(direction));
      window.plugins.nativepagetransitions.slide({
            'direction': direction,
            'androiddelay': androiddelay,
            'iosdelay': iosdelay,
//            'winphonedelay': winphonedelay,
            'href': href
          },
          function () {
            console.log('slide transition finished');
          },
          function (errmsg) {
            console.log('slide transition failed: ' + errmsg);
          });
    },

    flip: function (direction, href, androiddelay, iosdelay) {
      event.preventDefault ? event.preventDefault() : event.returnValue = false;
      transitionStack.push("flip:" + this.getOppositeDirection(direction));
      window.plugins.nativepagetransitions.flip({
            'direction': direction,
            'androiddelay': androiddelay,
            'iosdelay': iosdelay,
//            'winphonedelay': winphonedelay,
            'href': href
          },
          function () {
            console.log('flip transition finished');
          },
          function (errmsg) {
            console.log('flip transition failed: ' + errmsg);
          });
    }
  };

  var adapter = new NativePageTransitionsIonicAdapter();

  // wait for cordova (and its plugins) to be ready
  document.addEventListener(
      "deviceready",
      function () {
        if (window.ionic && window.plugins && window.plugins.nativepagetransitions) {
          adapter.apply();
          adapter.enhanceBackbuttons();

          window.ionic.on("hashchange", function (event) {
            // timeout because the dom needs to update before the buttons can be enhanced
            var from = event.oldURL.substring(event.oldURL.indexOf("#"));
            setTimeout(function () {
              window.NativePageTransitionsIonicAdapter.enhanceBackbuttons(from);
            }, 100);
          });

        } else {
          console.log("window.plugins.nativepagetransitions is not available, so no native transitions will be applied");
        }
      },
      false);
})();


text:
/*
 *    {type:'auto',mapping:'name',formatter:function|name,format:'yyyy-dd-mm',defaults:1,child:[modelConfig], enum:'',enumReverse:false}
 */
var PurgeClass = (function() {
    var parseChannels,

        Model = function(modelConfig) {
            this._parsers = {};
            if (ng.isFunction(modelConfig)) {
                this._parsers = modelConfig;
            } else {
                for (var i in modelConfig) {
                    this._parsers[i] = ng.isFunction(modelConfig[i]) ? modelConfig[i] : _cfgToParser(modelConfig[i]);
                }
            }
        };

    Model.prototype = {
        parse: function(data) {
            var result;
            if (ng.isArray(data)) {
                result = [];
                for (var i = 0; i < data.length; i++) {
                    result.push(this.$$parse(data[i]));
                }
            } else {
                result = this.$$parse(data);
            }
            return result;
        },
        $$parse: function(item) {
            var result = {};
            if (ng.isFunction(this._parsers)) {
                result = this._parsers(item);
            } else {
                for (var i in this._parsers) {
                    result[i] = this._parsers[i](item);
                }
            }
            return result;
        }
    };

    Model.setChannels = _setChannels;

    return Model;

    function _setChannels(channels) {
        parseChannels = channels;
    }

    function _isEmpty(obj) {
        var hasOwnProperty = Object.prototype.hasOwnProperty,
            toString = Object.prototype.toString;

        if (obj == null) return true;
        if (obj + '' === 'undefined') return true;
        if (hasOwnProperty.call(obj, 'length') && (toString.call(obj) === '[object Array]' || toString.call(obj) === '[object String]' || hasOwnProperty.call(obj, 'callee'))) {
            return obj.length === 0;
        }
        return Object.keys(obj).length === 0;
    }

    function _getPropertyByPath(data, path) {
        var result = null;
        if (!ng.isString(path) || _isEmpty(path)) {
            return data;
        } else if (!ng.isObject(data)) {
            return data;
        } else {
            path = path.split('.');
            result = data;
            for (var i = 0; i < path.length; i++) {
                if (ng.isObject(result) && result.hasOwnProperty(path[i])) {
                    result = result[path[i]];
                } else {
                    return undefined;
                }
            }
            return result;
        }
    }

    function _cfgToParser(config) {
        var parser = null;

        // 获取mapping值
        parser = function(data) {
            return _getPropertyByPath(data, config.mapping);
        };

        // 经过解析管道,包装转换函数
        ng.forEach(parseChannels, function(node) {
            parser = node(parser, config);
        });

        return parser;
    }
})();