Sorts the keys in a context.

@param ctx the context to sort.

@return the sorted context.
195198
function(ctx)
{
   // sort keys
   var rval = {};
   var keys = Object.keys(ctx).sort();
   for(var k in keys)
   {
      var key = keys[k];
      rval[key] = ctx[key];
   }
   return rval;
}
138971
public DTMIterator sortNodes(
          XPathContext xctxt, Vector keys, DTMIterator sourceNodes)
            throws TransformerException
  {

    NodeSorter sorter = new NodeSorter(xctxt);
    sourceNodes.setShouldCacheNodes(true);
    sourceNodes.runTo(-1);
    xctxt.pushContextNodeList(sourceNodes);

    try
    {
      sorter.sort(sourceNodes, keys, xctxt);
      sourceNodes.setCurrentPos(0);
    }
    finally
    {
      xctxt.popContextNodeList();
    }

    return sourceNodes;
  }
148708
public int color(Context ctx) {
        if (mColorInt == 0 && mColorRes != -1) {
            mColorInt = ContextCompat.getColor(ctx, mColorRes);
        }
        return mColorInt;
    }
1368743
public final K getKey(int index) {
    if (index < 0 || index >= this.size) {
      return null;
    }
    @SuppressWarnings("unchecked")
    K result = (K) this.data[index << 1];
    return result;
  }
375520
private void listObjects(WebContext ctx, Bucket bucket) {
        int maxKeys = ctx.get("max-keys").asInt(1000);
        String marker = ctx.get("marker").asString();
        String prefix = ctx.get("prefix").asString();

        Response response = ctx.respondWith();
        response.setHeader(HTTP_HEADER_NAME_CONTENT_TYPE, CONTENT_TYPE_XML);

        bucket.outputObjects(response.xml(), maxKeys, marker, prefix);
    }
357894
public void returnOutputContext(OutputContext ctx) {
        List<ByteBuffer> remaining = ctx.releaseRemaining();
        if (pending == null) {
            pending = remaining;
        } else {
            List<ByteBuffer> tmp = pending;
            pending = remaining;
            pending.addAll(tmp);
        }
    }
938059
public static void prepareContext(GenericApplicationContext ctx)
  {
    final String configFileName = "annis-service.properties";
    
    MutablePropertySources sources = ctx.getEnvironment().getPropertySources();
    try
    {
      File fBase = new File(Utils.getAnnisFile(
        "conf/" + configFileName ).getAbsolutePath());
      if(fBase.canRead() && fBase.isFile())
      {
        sources.addFirst(new ResourcePropertySource("file:" + fBase.getCanonicalPath()));
      }
      
      String globalConfig = System.getenv("ANNIS_CFG");
      if(globalConfig == null)
      {
        globalConfig = "/etc/annis";
      }
      File fGlobal = new File(globalConfig + "/" + configFileName);
      if(fGlobal.canRead() && fGlobal.isFile())
      {
        sources.addFirst(new ResourcePropertySource("file:" + fBase.getCanonicalPath()));
      }
      
      String userConfig = System.getProperty("user.home") + "/.annis";
      File fUser = new File(userConfig + "/" + configFileName);
      if(fUser.canRead() && fUser.isFile())
      {
        sources.addFirst(new ResourcePropertySource("file:" + fUser.getCanonicalPath()));
      }
      
    }
    catch (IOException ex)
    {
      log.error("Could not load configuration", ex);
    }
  }
472151
public ZooActionBuilder withApplicationContext(ApplicationContext ctx) {
        this.applicationContext = ctx;

        if (applicationContext.containsBean("zookeeperClient")) {
            action.setZookeeperClient(applicationContext.getBean("zookeeperClient", ZooClient.class));
        }

        if (applicationContext.containsBean("zookeeperCommandResultMapper")) {
            action.setJsonMapper(applicationContext.getBean("zookeeperCommandResultMapper", ObjectMapper.class));
        }

        return this;
    }
341722
protected function initializeSorting(ContextInterface $context)
    {
        if (null !== $activeSort = $context->getActiveSort()) {
            $columnName = $activeSort->getColumnName();
            if ($this->table->hasColumn($columnName)) {
                $this->table->getColumn($columnName)->applySort($this, $activeSort);
            }
        }
    }
110814
function(ctx) {
		var event = ctx.originalEvent;
		if( event.which === $.ui.keyCode.ESCAPE) {
			this._local._cancelDrag();
		}
		return this._super(ctx);
	}
385384
public static <K extends Comparable< ? super K>,V extends Comparable< ? super V>> List<Entry<K,V>>
            sortKeyValuePairByValue(Map<K,V> map) {
        List<Map.Entry<K,V>> entries = new ArrayList<Map.Entry<K,V>>(map.entrySet());
        Collections.sort(entries, new Comparator<Map.Entry<K,V>>() {
            @Override
            public int compare(Entry<K,V> o1, Entry<K,V> o2) {
                if (!o1.getValue().equals(o2.getValue())) {
                    return (o1.getValue()).compareTo(o2.getValue());
                }
                return o1.getKey().compareTo(o2.getKey());
            }
        } );
        return entries;
    }
1331414
@Override
    public void setContext(Context context) {
        super.setContext(context);

        fsInfo = FSInfo.instance(context);

        symbolFileEnabled = !options.isSet("ignore.symbol.file");

        String sf = options.get("sortFiles");
        if (sf != null) {
            sortFiles = (sf.equals("reverse") ? SortFiles.REVERSE : SortFiles.FORWARD);
        }
    }
829464
public void rsort ()
    {
        sort(new Comparator<T>() {
            public int compare (T o1, T o2) {
                return _comp.compare(o2, o1);
            }
        });
    }
1204497
public void initContext(Context ctx)
	{
		// 模板静态文本部分
		ctx.staticTextArray = staticTextArray;
		// 模板各种缓存存放地

		// 临时标量所在空间
		ctx.tempVarStartIndex = tempVarStartIndex;
		// 分配变量空间,最后一个为模板的返回值
		ctx.vars = new Object[varIndexSize + 1];
		ctx.vars[varIndexSize] = Context.NOT_EXIST_OBJECT;

		// 将全局变量放到数组
		putGlobaToArray(ctx);

	}
23881
public java.util.List<String> getContextKeyNames() {
        if (contextKeyNames == null) {
            contextKeyNames = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return contextKeyNames;
    }
650202
public static int getBytesToken(ParsingContext ctx) {
        String input = ctx.getInput().substring(ctx.getLocation());
        int tokenOffset = 0;
        int i = 0;
        char[] inputChars = input.toCharArray();
        for (; i < input.length(); i += 1) {
            char c = inputChars[i];
            if (c == ' ') {
                continue;
            }
            if (c != BYTES_TOKEN_CHARS[tokenOffset]) {
                return -1;
            } else {
                tokenOffset += 1;
                if (tokenOffset == BYTES_TOKEN_CHARS.length) {
                    // Found the token.
                    return i;
                }
            }
        }
        return -1;
    }
606166
function (context) {
            if (context) {
                if (this.contextBuilder) {
                    context = this.contextBuilder(context);
                }
                if (!context.scopeOrder) {
                    context.scopeOrder = this._defaults.scopeOrder;
                }
                return context;
            }
            return { scopeOrder: this._defaults.scopeOrder };
        }