/* =================== /* Convenience Methods /* ===================
3911
function forwardGeocode(address, callback) {
    var geocoder = new window.google.maps.Geocoder();
    var payload = {address: address};
    geocoder.geocode(payload, callback);
  }
469199
function () {
        var that = this,
            fullQuery = that.extendedCurrentValue(),
            currentValue = that.el.val(),
            resolver = $.Deferred();

        resolver
            .done(function (suggestion) {
                that.selectSuggestion(suggestion, 0, currentValue, { hasBeenEnriched: true });
                that.el.trigger('suggestions-fixdata', suggestion);
            })
            .fail(function () {
                that.selection = null;
                that.el.trigger('suggestions-fixdata');
            });

        if (that.isQueryRequestable(fullQuery)) {
            that.currentValue = fullQuery;
            that.getSuggestions(fullQuery, { count: 1, from_bound: null, to_bound: null })
                .done(function (suggestions) {
                    // data fetched
                    var suggestion = suggestions[0];
                    if (suggestion) {
                        resolver.resolve(suggestion);
                    } else {
                        resolver.reject();
                    }
                })
                .fail(function () {
                    // no data fetched
                    resolver.reject();
                });
        } else {
            resolver.reject();
        }
    }
454777
function () {
                    if (this.$initialized) {
                        return;
                    }

                    var $ = this.$,
                        bindingCreator = this.$bindingCreator,
                        bindingAttributes = this.$bindingAttributes,
                        bindingDefinitions,
                        bindingAttribute,
                        value,
                        key;

                    // FIXME: resolve dependencies between bindings and loop in the correct order
                    // e.g. view="{{product.view}}" needs product

                    // Resolve bindings and events
                    for (key in bindingAttributes) {
                        if (bindingAttributes.hasOwnProperty(key)) {
                            bindingAttribute = bindingAttributes[key];
                            if (bindingAttribute) {
                                value = bindingAttribute.value;
                                bindingDefinitions = bindingAttribute.bindingDefinitions;
                                $[key] = bindingCreator.evaluate(value, this, key, bindingDefinitions);
                            } else {
                                value = $[key];
                                bindingDefinitions = null;
                            }
                        }
                    }

                    if (this.$errorAttribute && this.$bindings[this.$errorAttribute]) {
                        var b = this.$bindings[this.$errorAttribute][0], errorBinding;
                        if (b.$.path.length > 1) {
                            var path = b.$.path.slice(), attrKey = path.pop().name;
                            path = path.concat(bindingCreator.parsePath("errors()." + attrKey));

                            errorBinding = bindingCreator.create({
                                type: 'oneWay',
                                path: path
                            }, this, "$error");
                            if (errorBinding) {
                                $['$error'] = errorBinding.getValue();
                            }
                        }
                    }

                    this._initializeBindingsBeforeComplete();

                    this._initializationComplete();
                }
486793
function handleResource( $tpl, &$resourceData, $method, &$extraParameters )
    {
        $path = $resourceData['template-name'];

        $matchKeys = $this->Keys;
        if ( isset( $GLOBALS['eZDesignKeys'] ) )
        {
            $matchKeys = array_merge( $matchKeys, $GLOBALS['eZDesignKeys'] );
            unset( $GLOBALS['eZDesignKeys'] );
            $this->Keys = $matchKeys;
        }
        if ( is_array( $extraParameters ) and
             isset( $extraParameters['ezdesign:keys'] ) )
        {
            $this->mergeKeys( $matchKeys, $extraParameters['ezdesign:keys'] );
        }
        $this->KeyStack[] = $this->Keys;
        $this->Keys = $matchKeys;

        eZDebug::accumulatorStart( 'override_cache', 'Override', 'Cache load' );

        if( !isset( $GLOBALS['eZOverrideTemplateCacheMap'] ) )
        {
            $overrideCacheFile = $this->createOverrideCache();

            if ( $overrideCacheFile )
            {
                include_once( $overrideCacheFile );
            }
        }

        if ( isset( $GLOBALS['eZOverrideTemplateCacheMap'] ) )
        {
            if( isset( $GLOBALS['eZOverrideTemplateCacheMap'][md5( '/' . $path )] ) )
            {
                $cacheMap = $GLOBALS['eZOverrideTemplateCacheMap'][md5( '/' . $path )];
                if ( !is_string( $cacheMap ) and trim( $cacheMap['code'] ) )
                {
                    eval( "\$matchFile = " . $cacheMap['code'] . ";" );
                }
                else
                {
                    $matchFile = $cacheMap;
                }
                $match['file'] = $matchFile;
            }
        }
        else
        {
            $template = "/" . $path;
            $matchFileArray = eZTemplateDesignResource::overrideArray( $this->OverrideSiteAccess );

            $matchFile = $matchFileArray[$template];

            if ( isset( $matchFile['custom_match'] ) )
            {
                $matchFound = false;
                foreach ( $matchFile['custom_match'] as $customMatch )
                {
                    $matchOverride = true;
                    if ( count( $customMatch['conditions'] ) > 0 )
                    {
                        foreach ( array_keys( $customMatch['conditions'] ) as $conditionKey )
                        {
                            // Create special substring match for subtree override
                            if ( $conditionKey == 'url_alias' )
                            {
                                if ( strpos( $matchKeys['url_alias'], $customMatch['conditions'][$conditionKey] ) === 0 )
                                {
                                }
                                else
                                {
                                    $matchOverride = false;
                                }
                            }
                            else if ( isset( $matchKeys[$conditionKey] ) and
                                      isset( $customMatch['conditions'][$conditionKey] ) )
                            {
                                if ( is_array( $matchKeys[$conditionKey] ) )
                                {
                                    if ( !in_array( $customMatch['conditions'][$conditionKey], $matchKeys[$conditionKey] ) )
                                    {
                                        $matchOverride = false;
                                    }
                                }
                                else if ( $matchKeys[$conditionKey] != $customMatch['conditions'][$conditionKey] )
                                {
                                    $matchOverride = false;
                                }
                            }
                            else
                            {
                                $matchOverride = false;
                            }
                        }
                        if ( $matchOverride == true )
                        {
                            $match['file'] = $customMatch['match_file'];
                            $matchFound = true;
                            break;
                        }
                        else
                        {
                        }
                    }
                    else
                    {
                        // Default match without conditions
                        $match['file'] = $customMatch['match_file'];
                        $matchFound = true;
                    }
                }
                if ( !$matchFound )
                    $match['file'] = $matchFile['base_dir'] . $matchFile['template'];
            }
            else
            {
                $match['file'] = $matchFile['base_dir'] . $matchFile['template'];
            }
        }
        eZDebug::accumulatorStop( 'override_cache' );
        if ( isset( $match ) )
        {
            $file = $match["file"];

            $matchedKeys = array();
            $usedKeys = array();
            foreach ( $matchKeys as $matchKeyName => $matchKeyValue )
            {
                $usedKeys[$matchKeyName] = $matchKeyValue;
            }
            $extraParameters['ezdesign:used_keys'] = $usedKeys;
            $extraParameters['ezdesign:matched_keys'] = $matchedKeys;
            $tpl->setVariable( 'used', $usedKeys, 'DesignKeys' );
            $tpl->setVariable( 'matched', $matchedKeys, 'DesignKeys' );
            $resourceData['template-filename'] = $file;
            $result = eZTemplateFileResource::handleResourceData( $tpl, $this, $resourceData, $method, $extraParameters );
        }
        else
        {
            $result = false;
        }
        $this->Keys = array_pop( $this->KeyStack );
        return $result;
    }
568828
void appendGoogRequiresTo(StringBuilder sb) {
    for (GoogRequire require : googRequires.values()) {
      // TODO(lukes): we need some namespace management here... though really we need namespace
      // management with all declarations... The problem is that a require could introduce a name
      // alias that conflicts with a symbol defined elsewhere in the file.
      require.writeTo(sb);
    }
  }
575141
function init() {
    if (tokens) {
      return;
    }
    if (fromString) {
      tokens = cbml.parse(contentString);
    }
    else {
      tokens = cbml.parse(fs.readFileSync(filename));
    }
    /*<debug>
    console.log(JSON.stringify(tokens, null, '  '));
    //</debug>*/
  }
1173853
function persistentStateProvider(publicAPI, model) {
  if (!model.persistentStateImpl) {
    if (localStorageAvailable()) {
      model.persistentStateImpl = {
        getState: (key) => {
          const strVal = window.localStorage[key];
          if (strVal === undefined) {
            return null;
          }
          return JSON.parse(strVal);
        },
        setState: (key, value) => {
          window.localStorage.setItem(key, JSON.stringify(value));
        },
      };
    } else {
      model.persistentStateImpl = {
        state: {},
        getState: (key) => model.persistentStateImpl.state[key],
        setState: (key, value) => {
          model.persistentStateImpl.state[key] = value;
        },
      };
    }
  }

  // Provide this method an object that implements getState(key) and setState(key, value)
  publicAPI.setImplementation = (impl) => {
    model.persistentStateImpl = impl;
  };

  publicAPI.getPersistentState = (key) =>
    model.persistentStateImpl.getState(key);

  publicAPI.setPersistentState = (key, value) => {
    model.persistentStateImpl.setState(key, value);
  };
}
900665
function _doJumpToDef() {
        var request = null,
            result = new $.Deferred(),
            jumpToDefProvider = null,
            editor = EditorManager.getActiveEditor();

        if (editor) {
            // Find a suitable provider, if any
            var language = editor.getLanguageForSelection(),
                enabledProviders = _providerRegistrationHandler.getProvidersForLanguageId(language.getId());


            enabledProviders.some(function (item, index) {
                if (item.provider.canJumpToDef(editor)) {
                    jumpToDefProvider = item.provider;
                    return true;
                }
            });

            if (jumpToDefProvider) {
                request = jumpToDefProvider.doJumpToDef(editor);

                if (request) {
                    request.done(function () {
                        result.resolve();
                    }).fail(function () {
                        result.reject();
                    });
                } else {
                    result.reject();
                }
            } else {
                result.reject();
            }
        } else {
            result.reject();
        }

        return result.promise();
    }
1203399
@Override
    public Object visitSelpart(CSSParser.SelpartContext ctx) {
        logEnter("selpart");
        String ident;
        if (ctx.HASH() != null) {
            ident = extractIdUnescaped(ctx.HASH().getText());
            if (ident != null) {
                selector_stack.peek().s.add(rf.createID(ident));
            } else {
                combined_selector_stack.peek().invalid = true;
            }

        } else if (ctx.CLASSKEYWORD() != null) {
            selector_stack.peek().s.add(rf.createClass(extractTextUnescaped(ctx.CLASSKEYWORD().getText())));
        } else if (ctx.attribute() != null) {
            Selector.ElementAttribute ea = visitAttribute(ctx.attribute());
            selector_stack.peek().s.add(ea);

        } else if (ctx.pseudo() != null) {
            Selector.SelectorPart p = visitPseudo(ctx.pseudo());
            if (p != null) {
                if (p instanceof PseudoElement && selector_stack.peek().s.getPseudoElementType() != null) {
                    log.warn("Invalid selector with multiple pseudo-elements");
                    combined_selector_stack.peek().invalid = true;
                }
                else
                    selector_stack.peek().s.add(p);
            } else {
                combined_selector_stack.peek().invalid = true;
            }

        } else {
            combined_selector_stack.peek().invalid = true;
        }
        logLeave("selpart");
        //returns null
        return null;
    }
786835
function FirebaseStorage($firebaseUtils, $q) {

    /**
     * This inner constructor `Storage` allows for exporting of private methods
     * like _assertStorageRef, _isStorageRef, _convertTask, and _unwrapStorageSnapshot.
     */
    var Storage = function Storage(storageRef) {
      _assertStorageRef(storageRef);
      return {
        $put: function $put(file, metadata) {
          var task = storageRef.put(file, metadata);
          return _convertTask(task, $firebaseUtils);
        },
        $putString: function $putString(data, format, metadata) {
          var task = storageRef.putString(data, format, metadata);
          return _convertTask(task, $firebaseUtils);
        },
        $getDownloadURL: function $getDownloadURL() {
          return $q.when(storageRef.getDownloadURL());
        },
        $delete: function $delete() {
          return $q.when(storageRef.delete());
        },
        $getMetadata: function $getMetadata() {
          return $q.when(storageRef.getMetadata());
        },
        $updateMetadata: function $updateMetadata(object) {
          return $q.when(storageRef.updateMetadata(object));
        },
        $toString: function $toString() {
          return storageRef.toString();
        }
      };
    };

    Storage.utils = {
      _unwrapStorageSnapshot: _unwrapStorageSnapshot,
      _isStorageRef: _isStorageRef,
      _assertStorageRef: _assertStorageRef
    };

    return Storage;
  }
304993
function(sel) {
  var cap, param;

  if (typeof sel !== 'string') {
    if (sel.length > 1) {
      var func = []
        , i = 0
        , l = sel.length;

      for (; i < l; i++) {
        func.push(parse(sel[i]));
      }

      l = func.length;
      return function(el) {
        for (i = 0; i < l; i++) {
          if (!func[i](el)) return;
        }
        return true;
      };
    }
    // optimization: shortcut
    return sel[0] === '*' 
      ? selectors['*'] 
      : selectors.type(sel[0]);
  }

  switch (sel[0]) {
    case '.': return selectors.attr('class', '~=', sel.substring(1));
    case '#': return selectors.attr('id', '=', sel.substring(1));
    case '[': cap = /^\[([\w-]+)(?:([^\w]?=)([^\]]+))?\]/.exec(sel);
              return selectors.attr(cap[1], cap[2] || '-', unquote(cap[3]));
    case ':': cap = /^(:[\w-]+)\(([^)]+)\)/.exec(sel);
              if (cap) sel = cap[1], param = unquote(cap[2]);
              return param ? selectors[sel](param) : selectors[sel];
    case '*': return selectors['*'];
    default:  return selectors.type(sel);
  }
}
933596
function( value, element, param ) {
			if ( this.optional(element) ) {
				return "dependency-mismatch";
			}

			var previous = this.previousValue(element),
				validator, data;

			if (!this.settings.messages[element.name] ) {
				this.settings.messages[element.name] = {};
			}
			previous.originalMessage = this.settings.messages[element.name].remote;
			this.settings.messages[element.name].remote = previous.message;

			param = typeof param === "string" && { url: param } || param;

			if ( previous.old === value ) {
				return previous.valid;
			}

			previous.old = value;
			validator = this;
			this.startRequest(element);
			data = {};
			data[element.name] = value;
			$.ajax($.extend(true, {
				url: param,
				mode: "abort",
				port: "validate" + element.name,
				dataType: "json",
				data: data,
				context: validator.currentForm,
				success: function( response ) {
					var valid = response === true || response === "true",
						errors, message, submitted;

					validator.settings.messages[element.name].remote = previous.originalMessage;
					if ( valid ) {
						submitted = validator.formSubmitted;
						validator.prepareElement(element);
						validator.formSubmitted = submitted;
						validator.successList.push(element);
						delete validator.invalid[element.name];
						validator.showErrors();
					} else {
						errors = {};
						message = response || validator.defaultMessage( element, "remote" );
						errors[element.name] = previous.message = $.isFunction(message) ? message(value) : message;
						validator.invalid[element.name] = true;
						validator.showErrors(errors);
					}
					previous.valid = valid;
					validator.stopRequest(element, valid);
				}
			}, param));
			return "pending";
		}
1197331
function () {

        var args = _A(arguments, 0, 3);
        if (!args.length) {
            throw new Error('Parameters required!');
        }

        var opts = isObject(args.slice(-1)[0]) ? args.pop() : {};

        switch (args.length) {
            case 2:
                opts.data = opts.data || args[1];
            case 1:
                opts.dom = opts.dom || args[0];
        }

        if (!opts.dom) {
            throw new Error('Container can not be empty!');
        }
        else if (!isDom(opts.dom)) {
            throw new Error('Container must be a HTMLElement instance!');
        }

        if (!opts.data || !opts.data.length) {
            throw new Error('Data must be an array and must have more than one element!');
        }

        /**
         * Options
         * @private
         */
        this._opts = opts;

        opts = null, args = null;

        this._setting();

        this.fire('initialize');

        this._renderWrapper();
        this._initPlugins();
        this._bindHandler();

        this.fire('initialized');

        // Autoplay mode
        this._autoPlay();
    }
954885
function(method, sId) {
            sId = sId || method;
            sId = this.options.prefix+"."+sId;
            return this.addMethod(method, {
                fallback: function(args, options, method) {
                    return Storage.get(sId+"."+method);
                },
                after: function(args, results, options, method) {
                    Storage.set(sId+"."+method, results);
                }
            });
        }
476262
function(object) {
        if (object === null || object === void 0)
            return object;

        return Object.getPrototypeOf(Object(object)).constructor;
    }
1136098
function showInterfaceJava(intf, html) {
    html.push("<div class='show-Java'><h3>Java</h3><pre>")

    intf.methods.forEach(function(method){
        showInterfaceJavaMethod(intf, method, html)
    })

    html.push("</pre></div>")
}
258663
@Override
    public Method resolveFunction(String prefix, String localName) {
        Function f = this.functions.get(prefix + ":" + localName);
        if (f == null) {
            return null;
        }
        return f.getMethod();
    }