text:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class Team58Robot extends IterativeRobot {

    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    public void robotInit() {
        Driverstation.autoSelectorInit();
        Motors.init();
    }

    public void autonomousInit() {
        Autonomous.startTime();
    }
    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() {
         Autonomous.doAuto();
    }

    /**
     * @override
     */
    public void teleopInit() {
        Motors.shotTime.stop();
        Motors.shotTime.reset();
        Motors.shotTime.start();
    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
        Motors.Drive();  //Comment this line to disable driving
        Motors.Paddle();  //Comment this line to disable shooting
        Motors.Collector();  //Comment this line to disable collecting
       Motors.collectorToggle();
        //Motors.runTrickShot(); //trick shot
     SmartDashboard.putBoolean("Collector Running", Motors.collectorDashboard);
    }

    /**
     * This function is called periodically during test mode
     */
    public void testPeriodic() {

    }

    public void disabledInit() {

    }

}


text:
#ifndef FIRO_QT_SIGMAPAGE_H
#define FIRO_QT_SIGMAPAGE_H

#include "addresstablemodel.h"
#include "clientmodel.h"
#include "platformstyle.h"
#include "sendcoinsentry.h"
#include "coincontroldialog.h"
#include <sigmacoincontroldialog.h>

#include <QWidget>

namespace Ui {
    class SigmaDialog;
    class BlankSigmaDialog;
}

class BlankSigmaDialog : public QDialog
{
    Q_OBJECT

public:
    BlankSigmaDialog();
    ~BlankSigmaDialog();

private:
    Ui::BlankSigmaDialog *ui;
};

class SigmaDialog : public QDialog
{
    Q_OBJECT

public:
    SigmaDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
    ~SigmaDialog();

    void setClientModel(ClientModel *model);
    void setWalletModel(WalletModel *model);

    /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907).
     */
    QWidget *setupTabChain(QWidget *prev);

public Q_SLOTS:
    void clear();
    void accept();
    void reject();
    SendCoinsEntry* addEntry();
    void coinControlFeatureChanged(bool);
    void updateTabsAndLabels();
    void coinControlUpdateLabels();
    void coinControlClipboardQuantity();
    void coinControlClipboardAmount();
    void coinControlClipboardFee();
    void coinControlClipboardAfterFee();
    void coinControlClipboardBytes();
    void coinControlClipboardPriority();
    void coinControlClipboardLowOutput();
    void coinControlClipboardChange();
    void coinControlButtonClicked();
    void coinControlChangeChecked(int);
    void coinControlChangeEdited(const QString &);
    void tabSelected();

private:
    Ui::SigmaDialog *ui;
    ClientModel *clientModel;
    WalletModel *walletModel;
    bool isNewRecipientAllowed;
    const PlatformStyle *platformStyle;

    void processSpendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg = QString());

private Q_SLOTS:
    void numBlocksChanged(int count, const QDateTime& blockDate, double nVerificationProgress, bool header);
    void on_mintButton_clicked();
    void on_sendButton_clicked();
    void removeEntry(SendCoinsEntry* entry);
    void updateAvailableToMintBalance(const CAmount& balance);
    void updateMintableBalance();
    void updateCoins(const std::vector<CMintMeta>& spendable, const std::vector<CMintMeta>& pending);

Q_SIGNALS:
    // Fired when a message should be reported to the user
    void message(const QString &title, const QString &message, unsigned int style);
};

#endif // FIRO_QT_SIGMAPAGE_H

redpajama_set_name: RedPajamaGithub


text:
import builtins
import keyword
import re
import time

from idlelib.config import idleConf
from idlelib.delegator import Delegator

DEBUG = False

def any(name, alternates):
    "Return a named group pattern matching list of alternates."
    return "(?P<%s>" % name + "|".join(alternates) + ")"

def make_pat():
    kw = r"\b" + any("KEYWORD", keyword.kwlist) + r"\b"
    builtinlist = [str(name) for name in dir(builtins)
                                        if not name.startswith('_') and \
                                        name not in keyword.kwlist]
    builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
    comment = any("COMMENT", [r"#[^\n]*"])
    stringprefix = r"(?i:r|u|f|fr|rf|b|br|rb)?"
    sqstring = stringprefix + r"'[^'\\\n]*(\\.[^'\\\n]*)*'?"
    dqstring = stringprefix + r'"[^"\\\n]*(\\.[^"\\\n]*)*"?'
    sq3string = stringprefix + r"'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
    dq3string = stringprefix + r'"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
    string = any("STRING", [sq3string, dq3string, sqstring, dqstring])
    return kw + "|" + builtin + "|" + comment + "|" + string +\
           "|" + any("SYNC", [r"\n"])

prog = re.compile(make_pat(), re.S)
idprog = re.compile(r"\s+(\w+)", re.S)

def color_config(text):
    """Set color options of Text widget.

    If ColorDelegator is used, this should be called first.
    """
    # Called from htest, TextFrame, Editor, and Turtledemo.
    # Not automatic because ColorDelegator does not know 'text'.
    theme = idleConf.CurrentTheme()
    normal_colors = idleConf.GetHighlight(theme, 'normal')
    cursor_color = idleConf.GetHighlight(theme, 'cursor')['foreground']
    select_colors = idleConf.GetHighlight(theme, 'hilite')
    text.config(
        foreground=normal_colors['foreground'],
        background=normal_colors['background'],
        insertbackground=cursor_color,
        selectforeground=select_colors['foreground'],
        selectbackground=select_colors['background'],
        inactiveselectbackground=select_colors['background'],  # new in 8.5
    )

class ColorDelegator(Delegator):
    """Delegator for syntax highlighting (text coloring).

    Instance variables:
        delegate: Delegator below this one in the stack, meaning the
                one this one delegates to.

        Used to track state:
        after_id: Identifier for scheduled after event, which is a
                timer for colorizing the text.
        allow_colorizing: Boolean toggle for applying colorizing.
        colorizing: Boolean flag when colorizing is in process.
        stop_colorizing: Boolean flag to end an active colorizing
                process.
    """

    def __init__(self):
        Delegator.__init__(self)
        self.init_state()
        self.prog = prog
        self.idprog = idprog
        self.LoadTagDefs()

    def init_state(self):
        "Initialize variables that track colorizing state."
        self.after_id = None
        self.allow_colorizing = True
        self.stop_colorizing = False
        self.colorizing = False

    def setdelegate(self, delegate):
        """Set the delegate for this instance.

        A delegate is an instance of a Delegator class and each
        delegate points to the next delegator in the stack.  This
        allows multiple delegators to be chained together for a
        widget.  The bottom delegate for a colorizer is a Text
        widget.

        If there is a delegate, also start the colorizing process.
        """
        if self.delegate is not None:
            self.unbind("<<toggle-auto-coloring>>")
        Delegator.setdelegate(self, delegate)
        if delegate is not None:
            self.config_colors()
            self.bind("<<toggle-auto-coloring>>", self.toggle_colorize_event)
            self.notify_range("1.0", "end")
        else:
            # No delegate - stop any colorizing.
            self.stop_colorizing = True
            self.allow_colorizing = False

    def config_colors(self):
        "Configure text widget tags with colors from tagdefs."
        for tag, cnf in self.tagdefs.items():
            self.tag_configure(tag, **cnf)
        self.tag_raise('sel')

    def LoadTagDefs(self):
        "Create dictionary of tag names to text colors."
        theme = idleConf.CurrentTheme()
        self.tagdefs = {
            "COMMENT": idleConf.GetHighlight(theme, "comment"),
            "KEYWORD": idleConf.GetHighlight(theme, "keyword"),
            "BUILTIN": idleConf.GetHighlight(theme, "builtin"),
            "STRING": idleConf.GetHighlight(theme, "string"),
            "DEFINITION": idleConf.GetHighlight(theme, "definition"),
            "SYNC": {'background':None,'foreground':None},
            "TODO": {'background':None,'foreground':None},
            "ERROR": idleConf.GetHighlight(theme, "error"),
            # The following is used by ReplaceDialog:
            "hit": idleConf.GetHighlight(theme, "hit"),
            }

        if DEBUG: print('tagdefs',self.tagdefs)

    def insert(self, index, chars, tags=None):
        "Insert chars into widget at index and mark for colorizing."
        index = self.index(index)
        self.delegate.insert(index, chars, tags)
        self.notify_range(index, index + "+%dc" % len(chars))

    def delete(self, index1, index2=None):
        "Delete chars between indexes and mark for colorizing."
        index1 = self.index(index1)
        self.delegate.delete(index1, index2)
        self.notify_range(index1)

    def notify_range(self, index1, index2=None):
        "Mark text changes for processing and restart colorizing, if active."
        self.tag_add("TODO", index1, index2)
        if self.after_id:
            if DEBUG: print("colorizing already scheduled")
            return
        if self.colorizing:
            self.stop_colorizing = True
            if DEBUG: print("stop colorizing")
        if self.allow_colorizing:
            if DEBUG: print("schedule colorizing")
            self.after_id = self.after(1, self.recolorize)
        return

    def close(self):
        if self.after_id:
            after_id = self.after_id
            self.after_id = None
            if DEBUG: print("cancel scheduled recolorizer")
            self.after_cancel(after_id)
        self.allow_colorizing = False
        self.stop_colorizing = True

    def toggle_colorize_event(self, event=None):
        """Toggle colorizing on and off.

        When toggling off, if colorizing is scheduled or is in
        process, it will be cancelled and/or stopped.

        When toggling on, colorizing will be scheduled.
        """
        if self.after_id:
            after_id = self.after_id
            self.after_id = None
            if DEBUG: print("cancel scheduled recolorizer")
            self.after_cancel(after_id)
        if self.allow_colorizing and self.colorizing:
            if DEBUG: print("stop colorizing")
            self.stop_colorizing = True
        self.allow_colorizing = not self.allow_colorizing
        if self.allow_colorizing and not self.colorizing:
            self.after_id = self.after(1, self.recolorize)
        if DEBUG:
            print("auto colorizing turned",\
                  self.allow_colorizing and "on" or "off")
        return "break"

    def recolorize(self):
        """Timer event (every 1ms) to colorize text.

        Colorizing is only attempted when the text widget exists,
        when colorizing is toggled on, and when the colorizing
        process is not already running.

        After colorizing is complete, some cleanup is done to
        make sure that all the text has been colorized.
        """
        self.after_id = None
        if not self.delegate:
            if DEBUG: print("no delegate")
            return
        if not self.allow_colorizing:
            if DEBUG: print("auto colorizing is off")
            return
        if self.colorizing:
            if DEBUG: print("already colorizing")
            return
        try:
            self.stop_colorizing = False
            self.colorizing = True
            if DEBUG: print("colorizing...")
            t0 = time.perf_counter()
            self.recolorize_main()
            t1 = time.perf_counter()
            if DEBUG: print("%.3f seconds" % (t1-t0))
        finally:
            self.colorizing = False
        if self.allow_colorizing and self.tag_nextrange("TODO", "1.0"):
            if DEBUG: print("reschedule colorizing")
            self.after_id = self.after(1, self.recolorize)

    def recolorize_main(self):
        "Evaluate text and apply colorizing tags."
        next = "1.0"
        while True:
            item = self.tag_nextrange("TODO", next)
            if not item:
                break
            head, tail = item
            self.tag_remove("SYNC", head, tail)
            item = self.tag_prevrange("SYNC", head)
            if item:
                head = item[1]
            else:
                head = "1.0"

            chars = ""
            next = head
            lines_to_get = 1
            ok = False
            while not ok:
                mark = next
                next = self.index(mark + "+%d lines linestart" %
                                         lines_to_get)
                lines_to_get = min(lines_to_get * 2, 100)
                ok = "SYNC" in self.tag_names(next + "-1c")
                line = self.get(mark, next)
                ##print head, "get", mark, next, "->", repr(line)
                if not line:
                    return
                for tag in self.tagdefs:
                    self.tag_remove(tag, mark, next)
                chars = chars + line
                m = self.prog.search(chars)
                while m:
                    for key, value in m.groupdict().items():
                        if value:
                            a, b = m.span(key)
                            self.tag_add(key,
                                         head + "+%dc" % a,
                                         head + "+%dc" % b)
                            if value in ("def", "class"):
                                m1 = self.idprog.match(chars, b)
                                if m1:
                                    a, b = m1.span(1)
                                    self.tag_add("DEFINITION",
                                                 head + "+%dc" % a,
                                                 head + "+%dc" % b)
                    m = self.prog.search(chars, m.end())
                if "SYNC" in self.tag_names(next + "-1c"):
                    head = next
                    chars = ""
                else:
                    ok = False
                if not ok:
                    # We're in an inconsistent state, and the call to
                    # update may tell us to stop.  It may also change
                    # the correct value for "next" (since this is a
                    # line.col string, not a true mark).  So leave a
                    # crumb telling the next invocation to resume here
                    # in case update tells us to leave.
                    self.tag_add("TODO", next)
                self.update()
                if self.stop_colorizing:
                    if DEBUG: print("colorizing stopped")
                    return

    def removecolors(self):
        "Remove all colorizing tags."
        for tag in self.tagdefs:
            self.tag_remove(tag, "1.0", "end")

def _color_delegator(parent):  # htest #
    from tkinter import Toplevel, Text
    from idlelib.percolator import Percolator

    top = Toplevel(parent)
    top.title("Test ColorDelegator")
    x, y = map(int, parent.geometry().split('+')[1:])
    top.geometry("700x250+%d+%d" % (x + 20, y + 175))
    source = (
        "if True: int ('1') # keyword, builtin, string, comment\n"
        "elif False: print(0)\n"
        "else: float(None)\n"
        "if iF + If + IF: 'keyword matching must respect case'\n"
        "if'': x or''  # valid string-keyword no-space combinations\n"
        "async def f(): await g()\n"
        "# All valid prefixes for unicode and byte strings should be colored.\n"
        "'x', '''x''', \"x\", \"\"\"x\"\"\"\n"
        "r'x', u'x', R'x', U'x', f'x', F'x'\n"
        "fr'x', Fr'x', fR'x', FR'x', rf'x', rF'x', Rf'x', RF'x'\n"
        "b'x',B'x', br'x',Br'x',bR'x',BR'x', rb'x', rB'x',Rb'x',RB'x'\n"
        "# Invalid combinations of legal characters should be half colored.\n"
        "ur'x', ru'x', uf'x', fu'x', UR'x', ufr'x', rfu'x', xf'x', fx'x'\n"
        )
    text = Text(top, background="white")
    text.pack(expand=1, fill="both")
    text.insert("insert", source)
    text.focus_set()

    color_config(text)
    p = Percolator(text)
    d = ColorDelegator()
    p.insertfilter(d)

if __name__ == "__main__":
    from unittest import main
    main('idlelib.idle_test.test_colorizer', verbosity=2, exit=False)

    from idlelib.idle_test.htest import run
    run(_color_delegator)


text:
def gen():
    yield 10
async def run():
    {i async for i in <warning descr="Expected type 'collections.AsyncIterable', got 'Generator[int, Any, None]' instead">gen()</warning>}
    [i async for i in <warning descr="Expected type 'collections.AsyncIterable', got 'Generator[int, Any, None]' instead">gen()</warning>]
    {i: i ** 2 async for i in <warning descr="Expected type 'collections.AsyncIterable', got 'Generator[int, Any, None]' instead">gen()</warning>}
    (i ** 2 async for i in <warning descr="Expected type 'collections.AsyncIterable', got 'Generator[int, Any, None]' instead">gen()</warning>)
    list(i async for i in <warning descr="Expected type 'collections.AsyncIterable', got 'Generator[int, Any, None]' instead">gen()</warning>)

    dataset = {data async for line in <warning descr="Expected type 'collections.AsyncIterable', got 'Generator[int, Any, None]' instead">gen()</warning>
                    async for data in <warning descr="Expected type 'collections.AsyncIterable', got 'Generator[int, Any, None]' instead">gen()</warning>
                    if check(data)}


text:
<?php /* form injected via AJAX */

/* debug
var_dump($template_name);
var_dump($table_name);
var_dump($action);
var_dump($id);
//*/

if ($action == 'update') {

	include_once CFG . 'database.php';
	include_once LIB . 'db.php';

	$object_db = $db->query("SELECT * FROM `$table_name` WHERE `_id`={$id}");
	$object = $object_db->fetchObject();
	/* debug
	var_dump($object);
	//*/
}

?>

<form method=POST action="<?=ROOT?>backoffice/<?=$table_name?>">

	<fieldset>

			Nome
			<input id=name name=name type=text required value="<?=isset($object->name) ? $object->name : ''?>" maxlength=100>

			<input name=submit type=submit value=Invio>

	</fieldset>

	<input type=hidden name=action value=<?=$action?>>
	<input type=hidden name=id value=<?=$id?>>

</form>


text:
Ti=Waiver of Jury Trial

sec=<span style="text-transform:uppercase">Each party, knowingly, voluntarily, and intentionally, waives its right to trial by jury in any proceeding arising out of or relating to {_this_Agreement} or any {_Contemplated_Transaction}, whether sounding in contract, tort, or otherwise. </span>

=[Z/ol/Base]


text:
from django.shortcuts import render

from pyvdp.paai.fundstransferattinq.cardattributes import fundstransferinquiry, FundsTransferInquiryModel

from demo.forms.paai.fundstransferattinq.cardattributes.fundstransferinquiry import FundsTransferInquiryPostForm

def funds_transfer_inquiry(request):
    if request.method == 'POST':
        form = FundsTransferInquiryPostForm(request.POST)
        if form.is_valid():
            pan = form.cleaned_data['pan']

            ftid_kwargs = {
                'systemsTraceAuditNumber': 123456,
                'primaryAccountNumber': pan,
            }

            data = FundsTransferInquiryModel(**ftid_kwargs)

            result = fundstransferinquiry.send(data=data)

            return render(request, template_name='success.html', context={'result': result})
    else:
        form_post = FundsTransferInquiryPostForm()
        return render(request,
                      template_name='paai/fundstransferattinq/cardattributes/fundstransferinquiry.html',
                      context={'form_post': form_post})


text:
#ifndef BUFFERREQUESTERTEST_H
#define BUFFERREQUESTERTEST_H

#include "RegressionTest.h"
#include "BufferRequester/BufferRequesterListener.h"

class BufferRequester;

namespace WFAPI {
class MapLibNetworkContext;
}

class BufferRequesterTest : public RegressionTest,
                            public BufferRequesterListener {
public:
   BufferRequesterTest(Nav2Session& session, const char* name);
   virtual ~BufferRequesterTest();

   virtual void startTest();

   virtual void requestReceived(const MC2SimpleString& descr,
                                BitBuffer* dataBuffer,
                                OriginType origin);

   virtual void setArgImpl(const std::string& str);
private:
   BufferRequester* m_requester;
   WFAPI::MapLibNetworkContext* m_netContext;
   std::string m_reqString;
   bool m_expectsValidResult;
   int m_count;
};

#endif /* BUFFERREQUESTERTEST_H */


text:
(
    function () {
        var isDebugging = false;

        window.addEventListener("message", function(msg){
            if (!!msg.data.log){
                console.log(msg.data.log);
            }
        }, true);

        function onCopyClicked(tab) {

            if (!isAgmSite(tab.url) && !isOctaneSite(tab.url)) {
                console.log("Nothing to copy, the URL does not look like either Octane or AGM site, URL: " + tab.url);
                if (!isDebugging){
                    return;
                }
            }

            chrome.tabs.sendMessage(tab.id, { action: "copy" }, function (response) {
                if (response && response.data) {
                    copyText(response.data);
                }
            });
        }

        // show page action for tabs that matches the condition.
        chrome.tabs.onUpdated.addListener(function (tabid, changeInfo, tab) {
            if (!isAgmSite(tab.url) && !isOctaneSite(tab.url)) {
                chrome.pageAction.hide(tabid);
                if (!isDebugging)
                {
                    return;
                }
            }

            chrome.pageAction.show(tabid);

            chrome.pageAction.onClicked.removeListener(onCopyClicked);
            chrome.pageAction.onClicked.addListener(onCopyClicked);
        });

        function copyText(text) {
            var input = document.createElement('textarea');
            document.body.appendChild(input);
            input.value = text;
            input.focus();
            input.select();
            document.execCommand('Copy');
            input.remove();
        };
    })();


text:
package io.encoded.seriala

trait SerialReader[T] {

  def read(): T

  def close()

}


text:
import { warn } from '../util/index'
import { parsePath, setPath } from './path'
import Cache from '../cache'

const expressionCache = new Cache(1000)

const allowedKeywords =
  'Math,Date,this,true,false,null,undefined,Infinity,NaN,' +
  'isNaN,isFinite,decodeURI,decodeURIComponent,encodeURI,' +
  'encodeURIComponent,parseInt,parseFloat'
const allowedKeywordsRE =
  new RegExp('^(' + allowedKeywords.replace(/,/g, '\\b|') + '\\b)')

// keywords that don't make sense inside expressions
const improperKeywords =
  'break,case,class,catch,const,continue,debugger,default,' +
  'delete,do,else,export,extends,finally,for,function,if,' +
  'import,in,instanceof,let,return,super,switch,throw,try,' +
  'var,while,with,yield,enum,await,implements,package,' +
  'protected,static,interface,private,public'
const improperKeywordsRE =
  new RegExp('^(' + improperKeywords.replace(/,/g, '\\b|') + '\\b)')

const wsRE = /\s/g
const newlineRE = /\n/g
const saveRE = /[\{,]\s*[\w\$_]+\s*:|('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`)|new |typeof |void /g
const restoreRE = /"(\d+)"/g
const pathTestRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/
const identRE = /[^\w$\.](?:[A-Za-z_$][\w$]*)/g
const booleanLiteralRE = /^(?:true|false)$/

/**
 * Save / Rewrite / Restore
 *
 * When rewriting paths found in an expression, it is
 * possible for the same letter sequences to be found in
 * strings and Object literal property keys. Therefore we
 * remove and store these parts in a temporary array, and
 * restore them after the path rewrite.
 */

var saved = []

/**
 * Save replacer
 *
 * The save regex can match two possible cases:
 * 1. An opening object literal
 * 2. A string
 * If matched as a plain string, we need to escape its
 * newlines, since the string needs to be preserved when
 * generating the function body.
 *
 * @param {String} str
 * @param {String} isString - str if matched as a string
 * @return {String} - placeholder with index
 */

function save (str, isString) {
  var i = saved.length
  saved[i] = isString
    ? str.replace(newlineRE, '\\n')
    : str
  return '"' + i + '"'
}

/**
 * Path rewrite replacer
 *
 * @param {String} raw
 * @return {String}
 */

function rewrite (raw) {
  var c = raw.charAt(0)
  var path = raw.slice(1)
  if (allowedKeywordsRE.test(path)) {
    return raw
  } else {
    path = path.indexOf('"') > -1
      ? path.replace(restoreRE, restore)
      : path
    return c + 'scope.' + path
  }
}

/**
 * Restore replacer
 *
 * @param {String} str
 * @param {String} i - matched save index
 * @return {String}
 */

function restore (str, i) {
  return saved[i]
}

/**
 * Rewrite an expression, prefixing all path accessors with
 * `scope.` and generate getter/setter functions.
 *
 * @param {String} exp
 * @return {Function}
 */

function compileGetter (exp) {
  if (improperKeywordsRE.test(exp)) {
    process.env.NODE_ENV !== 'production' && warn(
      'Avoid using reserved keywords in expression: ' + exp
    )
  }
  // reset state
  saved.length = 0
  // save strings and object literal keys
  var body = exp
    .replace(saveRE, save)
    .replace(wsRE, '')
  // rewrite all paths
  // pad 1 space here becaue the regex matches 1 extra char
  body = (' ' + body)
    .replace(identRE, rewrite)
    .replace(restoreRE, restore)
  return makeGetterFn(body)
}

/**
 * Build a getter function. Requires eval.
 *
 * We isolate the try/catch so it doesn't affect the
 * optimization of the parse function when it is not called.
 *
 * @param {String} body
 * @return {Function|undefined}
 */

function makeGetterFn (body) {
  try {
    /* eslint-disable no-new-func */
    return new Function('scope', 'return ' + body + ';')
    /* eslint-enable no-new-func */
  } catch (e) {
    process.env.NODE_ENV !== 'production' && warn(
      'Invalid expression. ' +
      'Generated function body: ' + body
    )
  }
}

/**
 * Compile a setter function for the expression.
 *
 * @param {String} exp
 * @return {Function|undefined}
 */

function compileSetter (exp) {
  var path = parsePath(exp)
  if (path) {
    return function (scope, val) {
      setPath(scope, path, val)
    }
  } else {
    process.env.NODE_ENV !== 'production' && warn(
      'Invalid setter expression: ' + exp
    )
  }
}

/**
 * Parse an expression into re-written getter/setters.
 *
 * @param {String} exp
 * @param {Boolean} needSet
 * @return {Function}
 */

export function parseExpression (exp, needSet) {
  exp = exp.trim()
  // try cache
  var hit = expressionCache.get(exp)
  if (hit) {
    if (needSet && !hit.set) {
      hit.set = compileSetter(hit.exp)
    }
    return hit
  }
  var res = { exp: exp }
  res.get = isSimplePath(exp) && exp.indexOf('[') < 0
    // optimized super simple getter
    ? makeGetterFn('scope.' + exp)
    // dynamic getter
    : compileGetter(exp)
  if (needSet) {
    res.set = compileSetter(exp)
  }
  expressionCache.put(exp, res)
  return res
}

/**
 * Check if an expression is a simple path.
 *
 * @param {String} exp
 * @return {Boolean}
 */

export function isSimplePath (exp) {
  return pathTestRE.test(exp) &&
    // don't treat true/false as paths
    !booleanLiteralRE.test(exp) &&
    // Math constants e.g. Math.PI, Math.E etc.
    exp.slice(0, 5) !== 'Math.'
}


text:
package org.terasology.network;

import org.terasology.naming.NameVersion;
import org.terasology.world.internal.WorldInfo;

import java.util.List;
import java.util.Map;

/**
 * TODO Type description
 *
 * @author Martin Steiger
 */
public interface ServerInfoMessage {

    /**
     * @return
     */
    String getGameName();

    List<WorldInfo> getWorldInfoList();

    /**
     * @return
     */
    List<String> getRegisterBlockFamilyList();

    /**
     * @return
     */
    Map<Integer, String> getBlockIds();

    Map<Short, String> getBiomeIds();

    /**
     * @return
     */
    long getTime();

    /**
     * @return
     */
    List<NameVersion> getModuleList();

    /**
     * @return the block height that is used to compute (water) reflections
     */
    float getReflectionHeight();

}


text:
package com.tkmtwo.interpolate;

import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.collect.ImmutableMap;
import java.util.Map;

/**
 *
 * @param <T> any Object.  The toString() method is called during token replacement.
 */
public class MappingInterpolatorCallback<T>
  extends AbstractInterpolatorCallback {

  /** internal map of token/values. */
  private Map<String, T> map;

  /**
   * Creates a new interpolator with an empty map.
   *
   */
  public MappingInterpolatorCallback() {
    map = ImmutableMap.of();
  }

  /**
   * Creates a new interpolator callback using the
   * supplied mappings.
   *
   * @param m a map from which to copy entries
   */
  public MappingInterpolatorCallback(Map<String, T> m) {
    map = ImmutableMap.copyOf(checkNotNull(m));
  }

  /**
   * Creates a new interpolator callback using the
   * supplied mappings in the supplied prefix.
   *
   * @param tokenPrefix
   * @param m a map from which to copy entries
   */
  public MappingInterpolatorCallback(String tokenPrefix,
                                     Map<String, T> m) {
    setTokenPrefix(tokenPrefix);
    map = ImmutableMap.copyOf(checkNotNull(m));
  }

  /**
   * Creates a new interpolator callback using the
   * supplied mapping.
   *
   *
   * @param k1 a String key
   * @param v1 an Object value
   */
  public MappingInterpolatorCallback(String k1, T v1) {
    map = ImmutableMap.of(k1, v1);
  }
  /**
   * Creates a new interpolator callback using the
   * supplied mappings in the supplied prefix.
   *
   * @param tokenPrefix - prefix for this callback
   * @param k1 a String key
   * @param v1 an Object value
   */
  public MappingInterpolatorCallback(String tokenPrefix,
                                     String k1, T v1) {
    setTokenPrefix(tokenPrefix);
    map = ImmutableMap.of(k1, v1);
  }

  /**
   * Creates a new interpolator callback using the
   * supplied mappings.
   *
   * @param k1 a String key
   * @param v1 an Object value
   * @param k2 a String key
   * @param v2 an Object value
   */
  public MappingInterpolatorCallback(String k1, T v1,
                                     String k2, T v2) {
    map = ImmutableMap.of(k1, v1,
                          k2, v2);
  }
  /**
   * Creates a new interpolator callback using the
   * supplied mappings in the supplied prefix.
   *
   * @param tokenPrefix - prefix for this callback
   * @param k1 a String key
   * @param v1 an Object value
   * @param k2 a String key
   * @param v2 an Object value
   */
  public MappingInterpolatorCallback(String tokenPrefix,
                                     String k1, T v1,
                                     String k2, T v2) {
    setTokenPrefix(tokenPrefix);
    map = ImmutableMap.of(k1, v1,
                          k2, v2);
  }

  /**
   * Creates a new interpolator callback using the
   * supplied mappings.
   *
   * @param k1 a String key
   * @param v1 an Object value
   * @param k2 a String key
   * @param v2 an Object value
   * @param k3 a String key
   * @param v3 an Object value
   */
  public MappingInterpolatorCallback(String k1, T v1,
                                     String k2, T v2,
                                     String k3, T v3) {
    map = ImmutableMap.of(k1, v1,
                          k2, v2,
                          k3, v3);
  }
  /**
   * Creates a new interpolator callback using the
   * supplied mappings in the supplied prefix.
   *
   * @param tokenPrefix - prefix for this callback
   * @param k1 a String key
   * @param v1 an Object value
   * @param k2 a String key
   * @param v2 an Object value
   * @param k3 a String key
   * @param v3 an Object value
   */
  public MappingInterpolatorCallback(String tokenPrefix,
                                     String k1, T v1,
                                     String k2, T v2,
                                     String k3, T v3) {
    setTokenPrefix(tokenPrefix);
    map = ImmutableMap.of(k1, v1,
                          k2, v2,
                          k3, v3);
  }

  /**
   * Creates a new interpolator callback using the
   * supplied mappings.
   *
   * @param k1 a String key
   * @param v1 an Object value
   * @param k2 a String key
   * @param v2 an Object value
   * @param k3 a String key
   * @param v3 an Object value
   * @param k4 a String key
   * @param v4 an Object value
   */
  public MappingInterpolatorCallback(String k1, T v1,
                                     String k2, T v2,
                                     String k3, T v3,
                                     String k4, T v4) {
    map = ImmutableMap.of(k1, v1,
                          k2, v2,
                          k3, v3,
                          k4, v4);
  }

  /**
   * Creates a new interpolator callback using the
   * supplied mappings in the supplied prefix.
   *
   * @param tokenPrefix - prefix for this callback
   * @param k1 a String key
   * @param v1 an Object value
   * @param k2 a String key
   * @param v2 an Object value
   * @param k3 a String key
   * @param v3 an Object value
   * @param k4 a String key
   * @param v4 an Object value
   */
  public MappingInterpolatorCallback(String tokenPrefix,
                                     String k1, T v1,
                                     String k2, T v2,
                                     String k3, T v3,
                                     String k4, T v4) {
    setTokenPrefix(tokenPrefix);
    map = ImmutableMap.of(k1, v1,
                          k2, v2,
                          k3, v3,
                          k4, v4);
  }

  /**
   * Creates a new interpolator callback using the
   * supplied mappings.
   *
   * @param k1 a String key
   * @param v1 an Object value
   * @param k2 a String key
   * @param v2 an Object value
   * @param k3 a String key
   * @param v3 an Object value
   * @param k4 a String key
   * @param v4 an Object value
   * @param k5 a String key
   * @param v5 an Object value
   */
  public MappingInterpolatorCallback(String k1, T v1,
                                     String k2, T v2,
                                     String k3, T v3,
                                     String k4, T v4,
                                     String k5, T v5) {
    map = ImmutableMap.of(k1, v1,
                          k2, v2,
                          k3, v3,
                          k4, v4,
                          k5, v5);
  }

  /**
   * Creates a new interpolator callback using the
   * supplied mappings in the supplied prefix.
   *
   * @param tokenPrefix - prefix for this callback
   * @param k1 a String key
   * @param v1 an Object value
   * @param k2 a String key
   * @param v2 an Object value
   * @param k3 a String key
   * @param v3 an Object value
   * @param k4 a String key
   * @param v4 an Object value
   * @param k5 a String key
   * @param v5 an Object value
   */
  public MappingInterpolatorCallback(String tokenPrefix,
                                     String k1, T v1,
                                     String k2, T v2,
                                     String k3, T v3,
                                     String k4, T v4,
                                     String k5, T v5) {
    setTokenPrefix(tokenPrefix);
    map = ImmutableMap.of(k1, v1,
                          k2, v2,
                          k3, v3,
                          k4, v4,
                          k5, v5);
  }

  /**
   * Copies an addition entry into the map.
   *
   *
   * @param k a String key
   * @param v an Object value
   */
  public void put(String k, T v) {
    map = new ImmutableMap.Builder<String, T>()
      .putAll(map)
      .put(k, v)
      .build();
  }

  /**
   * Copies addition entries into the map.
   *
   *
   * @param m - another map.  All entries are copied in.
   */
  public void putAll(Map<String, T> m) {
    map = new ImmutableMap.Builder<String, T>()
      .putAll(map)
      .putAll(m)
      .build();
  }

  /**
   * @see AbstractInterpolatorCallback#replaceInternal(String, int, CharSequence, CharSequence)
   */
  @Override
  protected String replaceInternal(String token,
                                   int tokenNumber,
                                   CharSequence tokenStart,
                                   CharSequence tokenStop) {
    logger.trace("Searching map for '{}' relplacement...", token);
    if (map.containsKey(token)) {
      //String s = map.get(token).toString();
      String s = formatValue(map.get(token));
      logger.trace("Value found is '{}'", s);
      return s;
    }
    logger.trace("Value not found.");
    return null;
  }

  protected String formatValue(T value) {
    return value.toString();
  }

}


text:
package o;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.List;
import javax.net.ssl.SSLSocket;

final class Ꭲ$ˊ extends Ꭲ
{
  private final Method ˊ;
  private final Method ˋ;
  private final Class<?> ˎ;
  private final Class<?> ˏ;

  public Ꭲ$ˊ(Method paramMethod1, Method paramMethod2, Class<?> paramClass1, Class<?> paramClass2)
  {
    this.ˋ = paramMethod1;
    this.ˊ = paramMethod2;
    this.ˎ = paramClass1;
    this.ˏ = paramClass2;
  }

  public final void ˊ(SSLSocket paramSSLSocket, List<ٲ> paramList)
  {
    try
    {
      ArrayList localArrayList = new ArrayList(paramList.size());
      int i = 0;
      int j = paramList.size();
      while (i < j)
      {
        localArrayList.add(((ٲ)paramList.get(i)).ˏ.ˊ());
        i++;
      }
      ClassLoader localClassLoader = Ꭲ.class.getClassLoader();
      Class[] arrayOfClass = new Class[2];
      arrayOfClass[0] = this.ˎ;
      arrayOfClass[1] = this.ˏ;
      Object localObject = Proxy.newProxyInstance(localClassLoader, arrayOfClass, new Ꭲ.If(localArrayList));
      this.ˋ.invoke(null, new Object[] { paramSSLSocket, localObject });
      return;
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      throw new AssertionError(localInvocationTargetException);
    }
    catch (IllegalAccessException localIllegalAccessException)
    {
      throw new AssertionError(localIllegalAccessException);
    }
  }

  // ERROR //
  public final ἲ ˋ(SSLSocket paramSSLSocket)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 20	o/Ꭲ$ˊ:ˊ	Ljava/lang/reflect/Method;
    //   4: aconst_null
    //   5: iconst_1
    //   6: anewarray 77	java/lang/Object
    //   9: dup
    //   10: iconst_0
    //   11: aload_1
    //   12: aastore
    //   13: invokevirtual 83	java/lang/reflect/Method:invoke	(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    //   16: invokestatic 93	java/lang/reflect/Proxy:getInvocationHandler	(Ljava/lang/Object;)Ljava/lang/reflect/InvocationHandler;
    //   19: checkcast 66	o/Ꭲ$If
    //   22: astore_2
    //   23: aload_2
    //   24: getfield 96	o/Ꭲ$If:ˊ	Z
    //   27: ifne +25 -> 52
    //   30: aload_2
    //   31: getfield 99	o/Ꭲ$If:ˋ	Ljava/lang/String;
    //   34: ifnonnull +18 -> 52
    //   37: ldc 101
    //   39: invokestatic 107	java/util/logging/Logger:getLogger	(Ljava/lang/String;)Ljava/util/logging/Logger;
    //   42: getstatic 113	java/util/logging/Level:INFO	Ljava/util/logging/Level;
    //   45: ldc 115
    //   47: invokevirtual 119	java/util/logging/Logger:log	(Ljava/util/logging/Level;Ljava/lang/String;)V
    //   50: aconst_null
    //   51: areturn
    //   52: aload_2
    //   53: getfield 96	o/Ꭲ$If:ˊ	Z
    //   56: ifeq +5 -> 61
    //   59: aconst_null
    //   60: areturn
    //   61: aload_2
    //   62: getfield 99	o/Ꭲ$If:ˋ	Ljava/lang/String;
    //   65: invokestatic 122	o/ἲ:ˊ	(Ljava/lang/String;)Lo/ἲ;
    //   68: astore_3
    //   69: aload_3
    //   70: areturn
    //   71: new 85	java/lang/AssertionError
    //   74: dup
    //   75: invokespecial 123	java/lang/AssertionError:<init>	()V
    //   78: athrow
    //   79: new 85	java/lang/AssertionError
    //   82: dup
    //   83: invokespecial 123	java/lang/AssertionError:<init>	()V
    //   86: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   0	50	71	java/lang/reflect/InvocationTargetException
    //   52	59	71	java/lang/reflect/InvocationTargetException
    //   61	69	71	java/lang/reflect/InvocationTargetException
    //   0	50	79	java/lang/IllegalAccessException
    //   52	59	79	java/lang/IllegalAccessException
    //   61	69	79	java/lang/IllegalAccessException
  }
}

/* Location:           /Users/vikas/Documents/Mhacks_Real_app/classes-dex2jar.jar
 * Qualified Name:     o.Ꭲ.ˊ
 * JD-Core Version:    0.6.2
 */


text:
package org.jetbrains.plugins.groovy.lang.completion;

import com.intellij.codeInsight.completion.*;
import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.openapi.util.EmptyRunnable;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.patterns.ElementPattern;
import com.intellij.patterns.PlatformPatterns;
import com.intellij.psi.*;
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
import com.intellij.psi.codeStyle.SuggestedNameInfo;
import com.intellij.psi.codeStyle.VariableKind;
import com.intellij.psi.impl.light.LightElement;
import com.intellij.psi.util.InheritanceUtil;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.Consumer;
import com.intellij.util.ProcessingContext;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.groovy.GroovyBundle;
import org.jetbrains.plugins.groovy.lang.psi.GrReferenceElement;
import org.jetbrains.plugins.groovy.lang.psi.GroovyFile;
import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory;
import org.jetbrains.plugins.groovy.lang.psi.api.GroovyResolveResult;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrCatchClause;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrField;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariableDeclaration;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrReferenceExpression;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrAccessorMethod;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrGdkMethod;
import org.jetbrains.plugins.groovy.lang.psi.api.toplevel.imports.GrImportStatement;
import org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement;
import org.jetbrains.plugins.groovy.lang.psi.api.types.GrTypeParameter;
import org.jetbrains.plugins.groovy.lang.psi.api.types.GrTypeParameterList;
import org.jetbrains.plugins.groovy.lang.psi.util.GroovyPropertyUtils;
import org.jetbrains.plugins.groovy.lang.psi.util.PsiUtil;
import org.jetbrains.plugins.groovy.refactoring.DefaultGroovyVariableNameValidator;
import org.jetbrains.plugins.groovy.refactoring.GroovyNameSuggestionUtil;
import org.jetbrains.plugins.groovy.refactoring.inline.InlineMethodConflictSolver;

import java.util.List;
import java.util.Map;
import java.util.Set;

import static org.jetbrains.plugins.groovy.lang.completion.GroovyCompletionUtil.canResolveToPackage;

public class GrMainCompletionProvider extends CompletionProvider<CompletionParameters> {
  public static final ElementPattern<PsiElement> AFTER_AT = PlatformPatterns.psiElement().afterLeaf("@");
  public static final ElementPattern<PsiElement> IN_CATCH_TYPE = PlatformPatterns
    .psiElement().afterLeaf(PlatformPatterns.psiElement().withText("(").withParent(GrCatchClause.class));

  private static void addUnfinishedMethodTypeParameters(@NotNull PsiElement position, @NotNull CompletionResultSet result) {
    final GrTypeParameterList candidate = findTypeParameterListCandidate(position);

    if (candidate != null) {
      for (GrTypeParameter p : candidate.getTypeParameters()) {
        result.addElement(new JavaPsiClassReferenceElement(p));
      }
    }
  }

  private static void suggestVariableNames(PsiElement context, CompletionResultSet result) {
    final PsiElement parent = context.getParent();
    if (GroovyCompletionUtil.isWildcardCompletion(context)) return;
    if (parent instanceof GrVariable) {
      final GrVariable variable = (GrVariable) parent;
      if (context.equals(variable.getNameIdentifierGroovy())) {
        final PsiType type = variable.getTypeGroovy();
        if (type != null) {
          final JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(context.getProject());
          VariableKind kind = variable instanceof GrParameter ? VariableKind.PARAMETER :
              variable instanceof GrField ? VariableKind.FIELD : VariableKind.LOCAL_VARIABLE;
          SuggestedNameInfo suggestedNameInfo = codeStyleManager.suggestVariableName(kind, null, null, type);
          String[] names = suggestedNameInfo.names;
          if (names.length > 0) {
            String name = names[0];
            String newName = InlineMethodConflictSolver.suggestNewName(name, null, parent);
            if (!name.equals(newName)) {
              result.addElement(LookupElementBuilder.create(newName));
              return;
            }
          }
          for (String name : names) {
            result.addElement(LookupElementBuilder.create(name));
          }
        }

        GrExpression initializer = variable.getInitializerGroovy();
        if (initializer != null) {
          for (String name : GroovyNameSuggestionUtil.suggestVariableNames(initializer, new DefaultGroovyVariableNameValidator(variable),
                                                                           variable.hasModifierProperty(PsiModifier.STATIC))) {
            result.addElement(LookupElementBuilder.create(name));
          }
        }
      }
    }
  }

  @Nullable
  private static GrReferenceElement findGroovyReference(@NotNull PsiElement position) {
    final PsiElement parent = position.getParent();
    if (parent instanceof GrReferenceElement) {
      return (GrReferenceElement)parent;
    }
    if (couldContainReference(position)) {
      return GroovyPsiElementFactory.getInstance(position.getProject()).createReferenceElementFromText("Foo", position);
    }
    return null;
  }

  private static boolean couldContainReference(PsiElement position) {
    return IN_CATCH_TYPE.accepts(position) ||
           AFTER_AT.accepts(position) ||
           GroovyCompletionUtil.isFirstElementAfterPossibleModifiersInVariableDeclaration(position, true) ||
           GroovyCompletionUtil.isTupleVarNameWithoutTypeDeclared(position);
  }

  @Nullable
  private static GrTypeParameterList findTypeParameterListCandidate(@NotNull PsiElement position) {
    final PsiElement parent = position.getParent();
    if (parent instanceof GrVariable) {
      final PsiElement pparent = parent.getParent();
      if (pparent instanceof GrVariableDeclaration) {
        PsiElement candidate = PsiUtil.skipWhitespacesAndComments(parent.getPrevSibling(), false);
        if (candidate instanceof GrTypeParameterList) {
          return (GrTypeParameterList)candidate;
        }
      }
    }
    return null;
  }

  public static boolean isClassNamePossible(PsiElement position) {
    PsiElement parent = position.getParent();
    if (parent instanceof GrReferenceElement) {
      return ((GrReferenceElement)parent).getQualifier() == null;
    }
    return couldContainReference(position);
  }

  private static void addAllClasses(CompletionParameters parameters, final CompletionResultSet result, final JavaCompletionSession session) {
    addAllClasses(parameters, result::addElement, session, result.getPrefixMatcher());
  }

  public static void addAllClasses(CompletionParameters parameters,
                                   final Consumer<LookupElement> consumer,
                                   final JavaCompletionSession inheritors, final PrefixMatcher matcher) {
    final PsiElement position = parameters.getPosition();
    final boolean afterNew = JavaClassNameCompletionContributor.AFTER_NEW.accepts(position);
    AllClassesGetter.processJavaClasses(parameters, matcher, parameters.getInvocationCount() <= 1, psiClass -> {
      for (JavaPsiClassReferenceElement element : JavaClassNameCompletionContributor
        .createClassLookupItems(psiClass, afterNew, new GroovyClassNameInsertHandler(),
                                psiClass1 -> !inheritors.alreadyProcessed(psiClass1))) {
        consumer.consume(element);
      }
    });
  }

  @NotNull
  static Runnable completeReference(final CompletionParameters parameters,
                                    final GrReferenceElement reference,
                                    final JavaCompletionSession inheritorsHolder,
                                    final PrefixMatcher matcher,
                                    final Consumer<LookupElement> _consumer) {
    final Consumer<LookupElement> consumer = new Consumer<LookupElement>() {
      final Set<LookupElement> added = ContainerUtil.newHashSet();
      @Override
      public void consume(LookupElement element) {
        if (added.add(element)) {
          _consumer.consume(element);
        }
      }
    };

    final Map<PsiModifierListOwner, LookupElement> staticMembers = ContainerUtil.newHashMap();
    final PsiElement qualifier = reference.getQualifier();
    final PsiType qualifierType = GroovyCompletionUtil.getQualifierType(qualifier);

    if (reference instanceof GrReferenceExpression && (qualifier instanceof GrExpression || qualifier == null)) {
      for (String string : CompleteReferencesWithSameQualifier.getVariantsWithSameQualifier((GrReferenceExpression)reference, matcher, (GrExpression)qualifier)) {
        consumer.consume(LookupElementBuilder.create(string).withItemTextUnderlined(true));
      }
      if (parameters.getInvocationCount() < 2 && qualifier != null && qualifierType == null && !canResolveToPackage(qualifier)) {
        if (parameters.getInvocationCount() == 1) {
          showInfo();
        }
        return EmptyRunnable.INSTANCE;
      }
    }

    final List<LookupElement> zeroPriority = ContainerUtil.newArrayList();

    PsiClass qualifierClass = com.intellij.psi.util.PsiUtil.resolveClassInClassTypeOnly(qualifierType);
    final boolean honorExcludes = qualifierClass == null || !JavaCompletionUtil.isInExcludedPackage(qualifierClass, false);

    GroovyCompletionUtil.processVariants(reference, matcher, parameters, lookupElement -> {
      Object object = lookupElement.getObject();
      if (object instanceof GroovyResolveResult) {
        object = ((GroovyResolveResult)object).getElement();
      }

      if (isLightElementDeclaredDuringCompletion(object)) {
        return;
      }

      if (!(lookupElement instanceof LookupElementBuilder) && inheritorsHolder.alreadyProcessed(lookupElement)) {
        return;
      }

      if (honorExcludes && object instanceof PsiMember && JavaCompletionUtil.isInExcludedPackage((PsiMember)object, true)) {
        return;
      }

      if (!(object instanceof PsiClass)) {
        int priority = assignPriority(lookupElement, qualifierType);
        lookupElement = JavaCompletionUtil.highlightIfNeeded(qualifierType,
                                                             PrioritizedLookupElement.withPriority(lookupElement, priority), object, reference);
      }

      if ((object instanceof PsiMethod || object instanceof PsiField) &&
          ((PsiModifierListOwner)object).hasModifierProperty(PsiModifier.STATIC)) {
        if (lookupElement.getLookupString().equals(((PsiMember)object).getName())) {
          staticMembers.put(CompletionUtil.getOriginalOrSelf((PsiModifierListOwner)object), lookupElement);
        }
      }

      PrioritizedLookupElement prio = lookupElement.as(PrioritizedLookupElement.CLASS_CONDITION_KEY);
      if (prio == null || prio.getPriority() == 0) {
        zeroPriority.add(lookupElement);
      } else {
        consumer.consume(lookupElement);
      }
    });

    for (LookupElement element : zeroPriority) {
      consumer.consume(element);
    }

    if (qualifier == null) {
      return addStaticMembers(parameters, matcher, staticMembers, consumer);
    }
    return EmptyRunnable.INSTANCE;
  }

  private static boolean isLightElementDeclaredDuringCompletion(Object object) {
    if (!(object instanceof LightElement && object instanceof PsiNamedElement)) return false;
    final String name = ((PsiNamedElement)object).getName();
    if (name == null) return false;

    return name.contains(CompletionInitializationContext.DUMMY_IDENTIFIER_TRIMMED.trim()) ||
           name.contains(GrDummyIdentifierProvider.DUMMY_IDENTIFIER_DECAPITALIZED.trim());
  }

  private static Runnable addStaticMembers(CompletionParameters parameters,
                                       final PrefixMatcher matcher,
                                       final Map<PsiModifierListOwner, LookupElement> staticMembers, final Consumer<LookupElement> consumer) {
    final StaticMemberProcessor processor = completeStaticMembers(parameters);
    processor.processMembersOfRegisteredClasses(matcher, (member, psiClass) -> {
      if (member instanceof GrAccessorMethod) {
        member = ((GrAccessorMethod)member).getProperty();
      }
      member = CompletionUtil.getOriginalOrSelf(member);
      if (staticMembers.containsKey(member)) {
        return;
      }
      final String name = member.getName();
      if (name == null || !matcher.prefixMatches(name)) {
        staticMembers.remove(member);
        return;
      }
      JavaGlobalMemberLookupElement element = createGlobalMemberElement(member, psiClass, true);
      staticMembers.put(member, element);
      consumer.consume(element);
    });
    if (parameters.getInvocationCount() >= 2 && StringUtil.isNotEmpty(matcher.getPrefix())) {
      return () -> processor.processStaticMethodsGlobally(matcher, element -> {
        PsiMember member = (PsiMember)element.getObject();
        if (member instanceof GrAccessorMethod) {
          member = ((GrAccessorMethod)member).getProperty();
        }
        member = CompletionUtil.getOriginalOrSelf(member);
        if (staticMembers.containsKey(member)) {
          return;
        }
        staticMembers.put(member, element);
        consumer.consume(element);
      });
    }
    return EmptyRunnable.INSTANCE;
  }

  private static void showInfo() {
    CompletionService.getCompletionService()
      .setAdvertisementText(GroovyBundle.message("invoke.completion.second.time.to.show.skipped.methods"));
  }

  private static boolean checkForIterator(PsiMethod method) {
    if (!"next".equals(method.getName())) return false;

    final PsiClass containingClass = method.getContainingClass();
    if (containingClass == null) return false;
    final PsiClass iterator = JavaPsiFacade.getInstance(method.getProject()).findClass(CommonClassNames.JAVA_UTIL_ITERATOR,
                                                                                method.getResolveScope());
    return InheritanceUtil.isInheritorOrSelf(containingClass, iterator, true);
  }

  private static int assignPriority(LookupElement lookupElement, PsiType qualifierType) {
    Object object = lookupElement.getObject();
    PsiSubstitutor substitutor = null;
    GroovyResolveResult resolveResult = null;
    if (object instanceof GroovyResolveResult) {
      resolveResult = (GroovyResolveResult)object;
      substitutor = resolveResult.getSubstitutor();
      object = ((GroovyResolveResult)object).getElement();
    }

    // default groovy methods
    if (object instanceof GrGdkMethod &&
        GroovyCompletionUtil.skipDefGroovyMethod((GrGdkMethod)object, substitutor, qualifierType)) {
      return -1;
    }

    // operator methods
    if (object instanceof PsiMethod &&
        PsiUtil.OPERATOR_METHOD_NAMES.contains(((PsiMethod)object).getName()) && !checkForIterator((PsiMethod)object)) {
      return -3;
    }

    // accessors if there is no get, set, is prefix
    if (object instanceof PsiMethod && GroovyPropertyUtils.isSimplePropertyAccessor((PsiMethod)object)) {
      return -1;
    }

    // inaccessible elements
    if (resolveResult != null && !resolveResult.isAccessible()) {
      return -2;
    }
    return 0;
  }

  static StaticMemberProcessor completeStaticMembers(CompletionParameters parameters) {
    final PsiElement position = parameters.getPosition();
    final PsiElement originalPosition = parameters.getOriginalPosition();
    final StaticMemberProcessor processor = new StaticMemberProcessor(position) {
      @NotNull
      @Override
      protected LookupElement createLookupElement(@NotNull PsiMember member, @NotNull PsiClass containingClass, boolean shouldImport) {
        shouldImport |= originalPosition != null && PsiTreeUtil.isAncestor(containingClass, originalPosition, false);
        return createGlobalMemberElement(member, containingClass, shouldImport);
      }

      @Override
      protected LookupElement createLookupElement(@NotNull List<PsiMethod> overloads,
                                                  @NotNull PsiClass containingClass,
                                                  boolean shouldImport) {
        shouldImport |= originalPosition != null && PsiTreeUtil.isAncestor(containingClass, originalPosition, false);
        return new JavaGlobalMemberLookupElement(overloads, containingClass, QualifiedMethodInsertHandler.INSTANCE, StaticImportInsertHandler.INSTANCE, shouldImport);
      }

      @Override
      protected boolean isAccessible(PsiMember member) {
        boolean result = super.isAccessible(member);

        if (!result && member instanceof GrField) {
          GrAccessorMethod[] getters = ((GrField)member).getGetters();
          return getters.length > 0 && super.isAccessible(getters[0]);
        }

        return result;
      }
    };
    final PsiFile file = position.getContainingFile();
    if (file instanceof GroovyFile) {
      for (GrImportStatement statement : ((GroovyFile)file).getImportStatements()) {
        if (statement.isStatic()) {
          GrCodeReferenceElement importReference = statement.getImportReference();
          if (importReference != null) {
            if (!statement.isOnDemand()) {
              importReference = importReference.getQualifier();
            }
            if (importReference != null) {
              final PsiElement target = importReference.resolve();
              if (target instanceof PsiClass) {
                processor.importMembersOf((PsiClass)target);
              }
            }
          }
        }
      }
    }
    return processor;
  }

  static JavaGlobalMemberLookupElement createGlobalMemberElement(PsiMember member, PsiClass containingClass, boolean shouldImport) {
    return new JavaGlobalMemberLookupElement(member, containingClass, QualifiedMethodInsertHandler.INSTANCE, StaticImportInsertHandler.INSTANCE, shouldImport);
  }

  public static void register(CompletionContributor contributor) {
    contributor.extend(CompletionType.BASIC, PlatformPatterns.psiElement(PsiElement.class), new GrMainCompletionProvider());
  }

  @Override
  protected void addCompletions(@NotNull CompletionParameters parameters,
                                ProcessingContext context,
                                @NotNull final CompletionResultSet result) {
    GroovyCompletionData.addGroovyDocKeywords(parameters, result);

    PsiElement position = parameters.getPosition();
    if (PlatformPatterns.psiElement().inside(false, PlatformPatterns.psiElement(PsiComment.class)).accepts(position)) {
      return;
    }

    GroovyCompletionData.addGroovyKeywords(parameters, result);

    addUnfinishedMethodTypeParameters(position, result);

    suggestVariableNames(position, result);

    GrReferenceElement reference = findGroovyReference(position);
    if (reference == null) {
      if (parameters.getInvocationCount() >= 2) {
        result.stopHere();
        addAllClasses(parameters, result.withPrefixMatcher(CompletionUtil.findJavaIdentifierPrefix(parameters)), new JavaCompletionSession(result));
      }
      return;
    }

    if (reference.getParent() instanceof GrImportStatement && reference.getQualifier() != null) {
      result.addElement(LookupElementBuilder.create("*"));
    }

    JavaCompletionSession inheritors = new JavaCompletionSession(result);
    if (GroovySmartCompletionContributor.AFTER_NEW.accepts(position)) {
      GroovySmartCompletionContributor.generateInheritorVariants(parameters, result.getPrefixMatcher(), inheritors::addClassItem);
    }

    Runnable addSlowVariants =
      completeReference(parameters, reference, inheritors, result.getPrefixMatcher(), lookupElement -> result.addElement(lookupElement));

    if (reference.getQualifier() == null) {
      if (!GroovySmartCompletionContributor.AFTER_NEW.accepts(position)) {
        GroovySmartCompletionContributor.addExpectedClassMembers(parameters, result);
      }

      if (isClassNamePossible(position) && JavaCompletionContributor.mayStartClassName(result)) {
        result.stopHere();
        if (parameters.getInvocationCount() >= 2) {
          addAllClasses(parameters, result, inheritors);
        } else {
          JavaCompletionContributor.advertiseSecondCompletion(position.getProject(), result);
        }
      }
    }

    addSlowVariants.run();
  }
}


text:
<?php

if(!defined('KYLAKSIZOV'))
exit("Stop! Forbidden");

?>

Мои приложения

Описание раздела например что оно делает, зачем нужно и т.д.

		<a href="<?=HOME?>admin/?component=applications&inc=search" class="btn btn-primary btn-xs-block f_r m_t_15"> Добавить

	        <button type="button" class="c_0 btn btn-xs btn-default"></button>
	        <button type="button" class="btn btn-xs btn-default"></button>
	        <button type="button" class="btn btn-xs btn-default"></button>

<?php
###################################################
#	Воборка каталога с приложениями и их настроек
$dir_applications = scandir(ADMIN_APPLICATIONS);

$skip = array('.', '..');

foreach($dir_applications as $dir) {
    if(!in_array($dir, $skip) && is_dir(ADMIN_APPLICATIONS . $dir)){
    	$config_app = "";
        try{
        	$config_app = parse_ini_file(ADMIN_APPLICATIONS . $dir . "/" . "config.ini", true); // обработка конфигурационного файла с секциями
        	if($config_app !== FALSE){

        		if(isset($config_app["info"]["picture"]) && $config_app["info"]["picture"] !== "")
        			$picture = HOME . "admin/applications/" . $dir . "/" . $config_app["info"]["picture"];
        		else
        			$picture = HOME . "admin/systems/template/img/no-apps.jpg";

				//FunctionSystems::Pre($config_app["info"]["name"]);
				echo '

						'.$config_app["info"]["name"].' '.$config_app["info"]["version"].'

'.$config_app["info"]["description"].'

							<button type="button" class="btn btn-xs btn-primary">Действие</button>
							<button type="button" class="btn btn-xs btn-primary dropdown-toggle" data-toggle="dropdown">

								Меню с переключением
							</button>

Действие

Другое действие

Что-то иное

Отдельная ссылка

						<input type="checkbox" class="form-control f_r">

';
			} else{
				throw New Exception('Не могу найти конфигурацию приложения '.$dir.' по адресу: ' . ADMIN_APPLICATIONS . $dir . '/config.ini');
			}
        } catch(Exception $e){
            FunctionSystems::Error($e -> getMessage());
        }
    }
}

#	Воборка каталога с приложениями и их настроек END
###################################################
?>


text:
action('document components')

describe('generate doc files for each of the components')

cli(function(program, dispatch) {
  program
    .command('document:components')
    .option('--include <pattern>', 'a glob pattern to use')
    .action(dispatch(this.api.runner))
})

execute( function(params, context = {}) {
  let exists = require('fs').existsSync
  let project = context.project
  let pick = require('lodash/pick')
  let targets = project.scripts.groupBy('categoryFolder')

  targets.components.forEach(target => {
     console.log(target.id)
  })

  targets.layouts.forEach(target => {
     console.log(target.id)
  })

  console.log(Object.keys(global))
})


text:
public class HelloWord {

	public static void main(String[] args)
	{
		System.out.println("Hello Word");
		System.out.print("Also hello from Ronny :)");
	}

}