/* ------------------------------ Sandbox ------------------------------ Sandbox methods
512443
function toFunction(s) {
  var result = (function() {
    try {
      return Script.runInNewContext('eval(' + s + ')')
    }
    catch (e) {
      return e.name + ': ' + e.message
    }
  }())
  return result
}
210779
protected function compile($text, $sandbox=false){

        // disable php in sandbox mode
        if ($sandbox) {
            $text = str_replace( array("<?","?>"), array("&lt;?","?&gt;"), $text);
        }

        foreach ($this->compilers as $compiler) {
            $method = "compile_{$compiler}";
            $text   = $this->{$method}($text);
        }

        if($sandbox) {

            $lines = explode("\n", $text);

            foreach ($lines as $ln => &$line) {
                if($errors = $this->check_security($line)) {
                    return 'illegal call(s): '.implode(", ", $errors)." - on line ".$ln.($this->srcinfo ? ' ('.$this->srcinfo.') ':'');
                }
            }
        }

        if($errors = $this->check_syntax($text)) {

            if($this->srcinfo) $errors[] = '('.$this->srcinfo.')';

            return implode("\n", $errors);
        }

        return $text;
    }
744085
private static void doBox(CodeBuilder adapter, SoyRuntimeType type) {
    if (type.isKnownSanitizedContent()) {
      FieldRef.enumReference(
              ContentKind.valueOf(((SanitizedType) type.soyType()).getContentKind().name()))
          .accessStaticUnchecked(adapter);
      MethodRef.ORDAIN_AS_SAFE.invokeUnchecked(adapter);
    } else if (type.isKnownString()) {
      MethodRef.STRING_DATA_FOR_VALUE.invokeUnchecked(adapter);
    } else if (type.isKnownListOrUnionOfLists()) {
      MethodRef.LIST_IMPL_FOR_PROVIDER_LIST.invokeUnchecked(adapter);
    } else if (type.isKnownLegacyObjectMapOrUnionOfMaps()) {
      FieldRef.enumReference(RuntimeMapTypeTracker.Type.LEGACY_OBJECT_MAP_OR_RECORD)
          .putUnchecked(adapter);
      MethodRef.DICT_IMPL_FOR_PROVIDER_MAP.invokeUnchecked(adapter);
    } else if (type.isKnownMapOrUnionOfMaps()) {
      MethodRef.MAP_IMPL_FOR_PROVIDER_MAP.invokeUnchecked(adapter);
    } else if (type.isKnownProtoOrUnionOfProtos()) {
      MethodRef.SOY_PROTO_VALUE_CREATE.invokeUnchecked(adapter);
    } else {
      throw new IllegalStateException("Can't box soy expression of type " + type);
    }
  }
218225
function() {
        this.io = µBlock.CompiledLineIO;
        this.blockId = undefined;
        this.block = undefined;
        this.stringifier = this.io.serialize;
        this.blocks = new Map();
        this.properties = new Map();
    }
106098
public function handle(Container $app, Sandbox $sandbox)
    {
        if ($sandbox->isLaravel()) {
            $kernel = $app->make(Kernel::class);

            $closure = function () use ($app) {
                $this->app = $app;
            };

            $resetKernel = $closure->bindTo($kernel, $kernel);
            $resetKernel();
        }

        return $app;
    }
992228
private Object executeMethod(final Method method, final ServletContextImpl context, final Object[] params)
            throws PrivilegedActionException, IllegalAccessException, InvocationTargetException {

        if (SecurityUtil.isPackageProtectionEnabled()) {
            return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                public Object run() throws IllegalAccessException, InvocationTargetException {
                    return method.invoke(context, params);
                }
            });
        } else {
            return method.invoke(context, params);
        }
    }
1123812
function(src) {
		var doc = document;
		this.contentLocation = new gui.URL(doc, src);
		this.xguest = (function(secured) {
			if (secured) {
				return "*";
			} else if (gui.URL.external(src, doc)) {
				var url = new gui.URL(doc, src);
				return url.protocol + "//" + url.host;
			}
			return null;
		}(this._sandboxed()));
	}
829915
function createSandbox() {
  // collect registered language extensions
  var sandbox = {};
  sandbox.extensions = [];
  // mock prettify.js API
  sandbox.window = {};
  sandbox.window.PR = sandbox.PR = {
    registerLangHandler: function (handler, exts) {
      sandbox.extensions = sandbox.extensions.concat(exts);
    },
    createSimpleLexer: function (sPatterns, fPatterns) {
      return function (job) {};
    },
    sourceDecorator: function (options) {
      return function (job) {};
    },
    prettyPrintOne: function (src, lang, ln) {
      return src;
    },
    prettyPrint: function (done, root) {},
    PR_ATTRIB_NAME: 'atn',
    PR_ATTRIB_VALUE: 'atv',
    PR_COMMENT: 'com',
    PR_DECLARATION: 'dec',
    PR_KEYWORD: 'kwd',
    PR_LITERAL: 'lit',
    PR_NOCODE: 'nocode',
    PR_PLAIN: 'pln',
    PR_PUNCTUATION: 'pun',
    PR_SOURCE: 'src',
    PR_STRING: 'str',
    PR_TAG: 'tag',
    PR_TYPE: 'typ'
  };
  return sandbox;
}
642394
function () {

/*Line 119 - 'AtomListBox.js' */                this.setClass();

/*Line 121 - 'AtomListBox.js' */                baseType.init.call(this);
/*Line 122 - 'AtomListBox.js' */                var self = this;

/*Line 124 - 'AtomListBox.js' */                var e = this._element;
/*Line 125 - 'AtomListBox.js' */                if (/select/i.test(e.tagName)) {
/*Line 126 - 'AtomListBox.js' */                    this.set_allowSelectFirst(true);
/*Line 127 - 'AtomListBox.js' */                    this.bindEvent(e, 'change', function () {
/*Line 128 - 'AtomListBox.js' */                        AtomBinder.setValue(self, 'selectedIndex', e.selectedIndex);
/*Line 129 - 'AtomListBox.js' */                    });
/*Line 130 - 'AtomListBox.js' */                }



/*Line 134 - 'AtomListBox.js' */                this.selectCommand = function () {
/*Line 135 - 'AtomListBox.js' */                    self.onSelectItem.apply(self, arguments);
/*Line 136 - 'AtomListBox.js' */                };
/*Line 137 - 'AtomListBox.js' */                this.selectAllCommand = function () {
/*Line 138 - 'AtomListBox.js' */                    self.set_selectAll(true);
/*Line 139 - 'AtomListBox.js' */                };
/*Line 140 - 'AtomListBox.js' */                this.clearSelectionCommand = function () {
/*Line 141 - 'AtomListBox.js' */                    self.set_selectedIndex(-1);
/*Line 142 - 'AtomListBox.js' */                };
/*Line 143 - 'AtomListBox.js' */            }
279543
public static void main(String[] args) throws Exception
    {
        String pathToOnyxDB = System.getProperty("user.home")
                + File.separatorChar + ".onyxdb"
                + File.separatorChar + "sandbox"
                + File.separatorChar +"remote-db.oxd";

        DatabaseServer server1 = new DatabaseServer(pathToOnyxDB);
        server1.setPort(8081);
        server1.setCredentials("onyx-remote", "SavingDataIsFun!");

        server1.start();
        System.out.println("Server Started");
        server1.join(); //joins the database thread with the application thread
        
    }
1093945
function(code, url, done) {
  var vm = require('vm')
  var sandbox = {}
  var expose = [
    'application',
    'setTimeout',
    'setInterval',
    'clearTimeout',
    'clearInterval'
  ]

  for (var i = 0; i < expose.length; i++) {
    sandbox[expose[i]] = global[expose[i]]
  }

  code = '"use strict";\n' + code
  try {
    vm.runInNewContext(code, vm.createContext(sandbox), url)
    done()
  } catch (e) {
    done(e)
  }
}
480680
def automatic_sandbox_install():
    

    sandbox_user = __generate_new_sandbox_user()

    return ApiContext(
        ApiEnvironmentType.SANDBOX,
        sandbox_user.api_key,
        socket.gethostname()
    )
678309
@Override
    public void postConstruct(Object instance, Object creationMetaData) throws InjectionProviderException
    {
        // TODO the servlet spec is not clear about searching in superclass??
        Class clazz = instance.getClass();
        Method[] methods = getDeclaredMethods(clazz);
        if (methods == null)
        {
            methods = clazz.getDeclaredMethods();
            Map<Class,Method[]> declaredMethodBeansMap = getDeclaredMethodBeansMap();
            synchronized(declaredMethodBeansMap)
            {
                declaredMethodBeansMap.put(clazz, methods);
            }
        }
        Method postConstruct = null;
        for (int i = 0; i < methods.length; i++)
        {
            Method method = methods[i];
            if (method.isAnnotationPresent(PostConstruct.class))
            {
                // a method that does not take any arguments
                // the method must not be static
                // must not throw any checked expections
                // the return value must be void
                // the method may be public, protected, package private or private

                if ((postConstruct != null)
                        || (method.getParameterTypes().length != 0)
                        || (Modifier.isStatic(method.getModifiers()))
                        || (method.getExceptionTypes().length > 0)
                        || (!method.getReturnType().getName().equals("void")))
                {
                    throw new IllegalArgumentException("Invalid PostConstruct annotation");
                }
                postConstruct = method;
            }
        }
        try
        {
            invokeAnnotatedMethod(postConstruct, instance);
        }
        catch (IllegalAccessException ex)
        {
            throw new InjectionProviderException(ex);
        }
        catch (InvocationTargetException ex)
        {
            throw new InjectionProviderException(ex);
        }
    }
73147
private function createAttribute($name, $value, $derivation, $optional, array $anchors)
    {
        return new SandboxAttribute($name, $value, $derivation, $optional, $anchors);
    }
301721
public function handle(Container $app, Sandbox $sandbox)
    {
        if (isset($app['session'])) {
            $session = $app->make('session');
            $session->flush();
            $session->regenerate();
        }

        return $app;
    }
856003
public static void main(String argv[]) throws Exception {
    DnsMonitorSecurityManager.setTheManager();
    AvatarZKShell shell = null;

    shell = new AvatarZKShell();
    int res;
    try {
      res = ToolRunner.run(shell, argv);
    } finally {
      shell.close();
    }
    System.exit(res);
  }
364399
protected function sandbox(&$locate, UrlGenerator $url, array $options = [])
    {
        $sandbox = (isset($options['sandbox']) && $options['sandbox'] == false) ? null : $url->getRequest()->query('sandbox');
        if (!is_null($sandbox)) {
            $separator = (parse_url($locate, PHP_URL_QUERY) == NULL) ? '?' : '&';
            $locate    .= $separator . 'sandbox=' . $sandbox;
        }
        return $locate;
    }