Initializes a linter with the specified configuration.

 @param config [Hash] configuration for this linter
 Runs the linter against the given Haml document.

 @param document [HamlLint::Document]
357536
def run(document)
      @document = document
      @lints = []
      visit(document.tree)
      @lints
    rescue Parser::SyntaxError => e
      location = e.diagnostic.location
      @lints <<
        HamlLint::Lint.new(
          HamlLint::Linter::Syntax.new(config),
          document.file,
          location.line,
          e.to_s,
          :error
        )
    end
1195472
protected function _initialize(AnConfig $config)
    {
        if ($config->repository) {
            $config->append(array(
                'identifier' => $config->repository->getDescription()->getInheritanceColumnValue()->getIdentifier(),
                'node_type' => (string) $config->repository->getDescription()->getInheritanceColumnValue(),
                'commentable' => $config->repository->isCommentable(),
                'ownable' => $config->repository->isOwnable(),
                'hashtagable' => $config->repository->isHashtagable(),
                'geolocatable' => $config->repository->isGeolocatable()
            ));
        }

        parent::_initialize($config);
    }
534225
@Override
  public void init(PlayerConfig config) throws InitializationFailedException {
    super.init(config);
    solrUrl = config.get(SOLR_URL_KEY);
    if (solrUrl == null || "".equals(solrUrl.trim())) {
      throw new IllegalArgumentException(this.getClass().getName() + " expects configuration property " + SOLR_URL_KEY);
    }
  }
493024
private function init($config = array())
    {
        $this->getCore()->open($this->getFilename(), $config);
        if ($this->currentSheet !== null) {
            $this->getCore()->setSheet($this->currentSheet);
        }
    }
1146670
public void initImpl()
    throws ConfigException
  {
    if (_handler != null) {
    }
    else if (_pathHandler != null) {
    }
    else {
      setPath(Paths.get("."));
    }

    /*
    if (_formatter instanceof ELFormatter) {
      ((ELFormatter)_formatter).init();
    }
    */

    if (_formatter != null) {
    }
    else if (_handler != null && _handler.getFormatter() != null) {
    }
    else {
      _formatter = new PatternFormatter(PatternFormatter.DEFAULT_PATTERN);
    }
    
    if (_pathHandler != null) {
      _pathHandler.init();

      _handler = _pathHandler;
    }
    
    if (_handler == null) {
      throw new ConfigException(L.l("<log-handler> requires a configured log handler"));
    }
    
    // env/02s9
    if (_level != null) {
      _handler.setLevel(_level);
    }

    /* JDK defaults to Level.ALL
    if (_level != null)
      _handler.setLevel(_level);
    else
      _handler.setLevel(Level.INFO);
    */

    if (_formatter != null) {
      _handler.setFormatter(_formatter);
    }

    if (_filter != null) {
      _handler.setFilter(_filter);
    }
    
    if (_names.size() == 0) {
      _names.add("");
    }

    for (String name : _names) {
      Logger logger = Logger.getLogger(name);

      if (! (logger instanceof EnvironmentLogger)) {
        if (_handler instanceof AutoCloseable) {
          EnvLoader.addCloseListener((AutoCloseable) _handler);
        }
      }

      logger.addHandler(_handler);
    }
  }
684247
public function handle(Document $document, array $config)
    {
        $content = $document->getContent();

        $pattern = '/<!---([\w\W]*?)-->/';
        if (preg_match($pattern, $content, $matches) === 1) {
        // not really required when using html doc tags. But in case it's frontmatter, it should be removed
            $content    = preg_replace($pattern, '', $content);
            $attributes = array_replace_recursive($document->getAttributes(), Yaml::parse($matches[1]));

            $document->setAttributes($attributes);
        }

        $document->setContent($content);
    }
632382
public static synchronized void initialize(GerritWorkersConfig config) {
        if (instance == null) {
            instance = new GerritSendCommandQueue();
        }
        getInstance().startQueue(config);
    }
1152023
def initialize_document(self, doc):
        ''' 

        '''
        for h in self._handlers:
            # TODO (havocp) we need to check the 'failed' flag on each handler
            # and build a composite error display. In develop mode, we want to
            # somehow get these errors to the client.
            h.modify_document(doc)
            if h.failed:
                log.error("Error running application handler %r: %s %s ", h, h.error, h.error_detail)

        if settings.perform_document_validation():
            doc.validate()
686018
public static synchronized void init(HpelTraceServiceConfig config) {
        if (config == null)
            throw new NullPointerException("LogProviderConfig must not be null");

        loggingConfig.compareAndSet(null, config);
    }
185759
function initClientRendered(widgetDefs, document) {
    // Ensure that event handlers to handle delegating events are
    // always attached before initializing any widgets
    eventDelegation.init();

    document = document || window.document;
    for (var i=0,len=widgetDefs.length; i<len; i++) {
        var widgetDef = widgetDefs[i];

        if (widgetDef.children.length) {
            initClientRendered(widgetDef.children, document);
        }

        var widget = initWidget(
            widgetDef.type,
            widgetDef.id,
            widgetDef.config,
            widgetDef.state,
            widgetDef.scope,
            widgetDef.domEvents,
            widgetDef.customEvents,
            widgetDef.extend,
            widgetDef.bodyElId,
            widgetDef.existingWidget,
            null,
            document);

        widgetDef.widget = widget;
    }
}
1031185
function init(elem, id, opts) {
	var obj, posOptions, attr, config, title,

	// Setup element references
	docBody = $(document.body),

	// Use document body instead of document element if needed
	newTarget = elem[0] === document ? docBody : elem,

	// Grab metadata from element if plugin is present
	metadata = elem.metadata ? elem.metadata(opts.metadata) : NULL,

	// If metadata type if HTML5, grab 'name' from the object instead, or use the regular data object otherwise
	metadata5 = opts.metadata.type === 'html5' && metadata ? metadata[opts.metadata.name] : NULL,

	// Grab data from metadata.name (or data-qtipopts as fallback) using .data() method,
	html5 = elem.data(opts.metadata.name || 'qtipopts');

	// If we don't get an object returned attempt to parse it manualyl without parseJSON
	/* eslint-disable no-empty */
	try { html5 = typeof html5 === 'string' ? $.parseJSON(html5) : html5; }
	catch(e) {}
	/* eslint-enable no-empty */

	// Merge in and sanitize metadata
	config = $.extend(TRUE, {}, QTIP.defaults, opts,
		typeof html5 === 'object' ? sanitizeOptions(html5) : NULL,
		sanitizeOptions(metadata5 || metadata));

	// Re-grab our positioning options now we've merged our metadata and set id to passed value
	posOptions = config.position;
	config.id = id;

	// Setup missing content if none is detected
	if('boolean' === typeof config.content.text) {
		attr = elem.attr(config.content.attr);

		// Grab from supplied attribute if available
		if(config.content.attr !== FALSE && attr) { config.content.text = attr; }

		// No valid content was found, abort render
		else { return FALSE; }
	}

	// Setup target options
	if(!posOptions.container.length) { posOptions.container = docBody; }
	if(posOptions.target === FALSE) { posOptions.target = newTarget; }
	if(config.show.target === FALSE) { config.show.target = newTarget; }
	if(config.show.solo === TRUE) { config.show.solo = posOptions.container.closest('body'); }
	if(config.hide.target === FALSE) { config.hide.target = newTarget; }
	if(config.position.viewport === TRUE) { config.position.viewport = posOptions.container; }

	// Ensure we only use a single container
	posOptions.container = posOptions.container.eq(0);

	// Convert position corner values into x and y strings
	posOptions.at = new CORNER(posOptions.at, TRUE);
	posOptions.my = new CORNER(posOptions.my);

	// Destroy previous tooltip if overwrite is enabled, or skip element if not
	if(elem.data(NAMESPACE)) {
		if(config.overwrite) {
			elem.qtip('destroy', true);
		}
		else if(config.overwrite === FALSE) {
			return FALSE;
		}
	}

	// Add has-qtip attribute
	elem.attr(ATTR_HAS, id);

	// Remove title attribute and store it if present
	if(config.suppress && (title = elem.attr('title'))) {
		// Final attr call fixes event delegation and IE default tooltip showing problem
		elem.removeAttr('title').attr(oldtitle, title).attr('title', '');
	}

	// Initialize the tooltip and add API reference
	obj = new QTip(elem, config, id, !!attr);
	elem.data(NAMESPACE, obj);

	return obj;
}
1312007
private final void init() {
        InputStream in = null;

        try {
            URL url =
                this.getClass()
                    .getClassLoader()
                    .getResource("padawan.conf.xml");

            if (url != null) {
                URLConnection conn = url.openConnection();
                in = conn.getInputStream();

                long newModified = conn.getLastModified();

                if ((lastModified != newModified) && (newModified != 0)) {
                    lastModified = newModified;
                    Document xmlDoc =
                        CDocumentBuilderFactory.newParser()
                                               .newDocumentBuilder()
                                               .parse(in);
                    parseDocument(xmlDoc);
                }
            }
        } catch (Exception ignore) {
            ignore.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (Exception e) {
            }
        }
    }
1237651
def record_lint(node, message)
      @lints << HamlLint::Lint.new(self, @document.file, node.line, message,
                                   config.fetch('severity', :warning).to_sym)
    end
229015
function (config) {
    config = config || {};
    Appender.call(this, config);

    /**
     * Log file name, initialized from the configuration. Folders up to the
     * file must exist beforehand.
     */
    this.fileName = config.fileName;

    /**
     * Append log events to the end of the file when true, clear the file
     * before writing the first log event otherwise.
     */
    this.appendToFile = (typeof config.append !== 'undefined') ?
      !!config.append :
      true;

    /**
     * True to log strings instead of objects
     */
    this.appendStrings = (typeof config.appendStrings !== 'undefined') ?
      config.appendStrings :
      true;

    /**
     * The file stream, initialized by the "start" function
     */
    this.stream = null;
  }
1144069
@SuppressWarnings("unchecked")
    public void init(ServletConfig config) throws ServletException
    {
        super.init(config);
        // Move init params to my properties
        Enumeration<String> paramNames = this.getInitParameterNames();
        while (paramNames.hasMoreElements())
        {
            String paramName = paramNames.nextElement();
            this.setProperty(paramName, this.getInitParameter(paramName));
        }
        if (Boolean.TRUE.toString().equalsIgnoreCase(this.getInitParameter(LOG_PARAM)))
            logger = Logger.getLogger(PROPERTY_PREFIX);
    }
380956
def setdocument(self, doc):
        
        assert isinstance(doc, Document)

        if not self.doc:
            self.doc = doc
            if self.id:
                if self.id in doc:
                    raise DuplicateIDError(self.id)
                else:
                    self.doc.index[id] = self

        for e in self: #recursive for all children
            if isinstance(e,AbstractElement): e.setdocument(doc)
918091
protected void createDocument() throws ParserConfigurationException
    {
        DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = builderFactory.newDocumentBuilder();
        DocumentType doctype = builder.getDOMImplementation().createDocumentType("html", "-//W3C//DTD XHTML 1.1//EN", "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd");
        doc = builder.getDOMImplementation().createDocument("http://www.w3.org/1999/xhtml", "html", doctype);
        
        head = doc.createElement("head");
        Element meta = doc.createElement("meta");
        meta.setAttribute("http-equiv", "content-type");
        meta.setAttribute("content", "text/html;charset=utf-8");
        head.appendChild(meta);
        title = doc.createElement("title");
        title.setTextContent("PDF Document");
        head.appendChild(title);
        globalStyle = doc.createElement("style");
        globalStyle.setAttribute("type", "text/css");
        //globalStyle.setTextContent(createGlobalStyle());
        head.appendChild(globalStyle);
        
        body = doc.createElement("body");
        
        Element root = doc.getDocumentElement();
        root.appendChild(head);
        root.appendChild(body);
    }